-
Notifications
You must be signed in to change notification settings - Fork 0
/
survey.html
142 lines (127 loc) · 5.41 KB
/
survey.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<title>Storm</title>
<link rel="stylesheet" href="stylesheets/styles.css">
<link rel="stylesheet" href="stylesheets/github-dark.css">
<link rel="stylesheet" href="stylesheets/custom.css">
<script src='https://cdn.firebase.com/js/client/2.2.1/firebase.js'></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="javascripts/main.js"></script>
<script src="javascripts/util.js"></script>
<script src="javascripts/clock.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
</head>
<body>
<div class="container">
<div id="topbar">
<span id="goal"></span>
</div>
<div id="sidebar">
<div id="clock">--:--</div>
<div id="definition" class="stage">1) Definition</div>
<div id="ideation" class="stage">2) Ideation</div>
<div id="discussion" class="stage">3) Discussion</div>
<div id="election" class="stage">4) Election</div>
<div id="decision" class="stage">5) Decision</div>
</div>
<div id="main" class="scrollable">
<div id="section-title" class="section-title">Survey</div>
<div id="overview">
Storm is an experimental tool and we need feedback! Please take 60 seconds to tell us what you thought.
</div>
<br>
<form id="survey" onsubmit="return submitToFirebase(event)">
<div class="survey-spacing">
<span class="survey-title">Question 1</span>
How satisfied are you with the group's decision?
<div class='vote-boxes survey'>
<label>dissatisfied</label>
<label><input type='radio' name='one' value='1'>1</label>
<label><input type='radio' name='one' value='2'>2</label>
<label><input type='radio' name='one' value='3'>3</label>
<label><input type='radio' name='one' value='4'>4</label>
<label><input type='radio' name='one' value='5'>5</label>
<label>satisfied</label>
</div>
</div>
<div class="survey-spacing">
<span class="survey-title">Question 2</span>
How satisfied are you with the time allotted?
<div class='vote-boxes survey'>
<label>not enough time</label>
<label><input type='radio' name='two' value='1'>1</label>
<label><input type='radio' name='two' value='2'>2</label>
<label><input type='radio' name='two' value='3'>3</label>
<label><input type='radio' name='two' value='4'>4</label>
<label><input type='radio' name='two' value='5'>5</label>
<label>too much time</label>
</div>
</div>
<div class="survey-spacing">
<span class="survey-title">Question 3</span>
How comfortable were you anonymously proposing and critiquing ideas?
<div class='vote-boxes survey'>
<label>uncomfortable</label>
<label><input type='radio' name='three' value='1'>1</label>
<label><input type='radio' name='three' value='2'>2</label>
<label><input type='radio' name='three' value='3'>3</label>
<label><input type='radio' name='three' value='4'>4</label>
<label><input type='radio' name='three' value='5'>5</label>
<label>comfortable</label>
</div>
</div>
<div>
<span class="survey-title">Question 4</span>
Please share any additional comments.<br>
<textarea id="comments" class="survey-textarea" rows="5" cols="70"></textarea>
</div>
<br><br>
<input type="submit" class="button" id="submit-button">
</form>
<script>
function submitToFirebase() {
var one = $('input[name=one]:checked', '#survey').val();
var two = $('input[name=two]:checked', '#survey').val();
var three = $('input[name=three]:checked', '#survey').val();
var comments = $("#comments").val();
var key = getFirebaseKey();
var ref = new Firebase(getSurveyUrl(key));
// submit ideas to the database
ref.transaction(function(currentData) {
if (currentData === null)
currentData = [];
currentData.push({
question_one: one,
question_two: two,
question_three: three,
additional_comments: comments
});
return currentData;
},
onSubmitToFirebaseComplete);
return false;
}
function onSubmitToFirebaseComplete(error, committed, snapshot) {
if (error || !committed) {
alert("Sorry, an error occurred");
}
else {
$("#survey").hide();
$("#overview").hide();
$("#section-title").html("Thank You!");
}
}
</script>
</div>
</div>
<div class="wrapper">
</div>
<!--[if !IE]><script>fixScale(document);</script><![endif]-->
</body>
</html>