-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
172 lines (170 loc) · 10.4 KB
/
index.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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<!DOCTYPE HTML>
<html lang="en" ng-app='quiz'>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Quickly Quiz</title>
<!-- Third party APIs-->
<script src="js/jquery-1.8.2.js" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery-ui-1.9.1.custom.js" type="text/javascript" charset="utf-8"></script>
<script src="js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/angular.js" type="text/javascript" charset="utf-8"></script>
<!-- Quickly Quiz Scripts -->
<script src="js/quiz.js" type="text/javascript" charset="utf-8"></script>
<script src="js/service.js" type="text/javascript" charset="utf-8"></script>
<script src="js/controllers.js" type="text/javascript" charset="utf-8"></script>
<script src="js/directives.js" type="text/javascript" charset="utf-8"></script>
<!-- Style sheets -->
<link rel="stylesheet" href="css/bootstrap.css" type="text/css" media="all" charset="utf-8">
<link rel="stylesheet" href="css/quiz.css" type="text/css" media="all" charset="utf-8">
<link rel="stylesheet" href="css/printfriendly.css" type="text/css" media="print" charset="utf-8">
</head>
<body>
<h2 id="title">Quickly Quiz!</h2>
<div class="container-fluid" ng-controller="QuizControl">
<div class="row-fluid">
<div class="span3 hide-on-print">
<!-- editor sidebar-->
<div class="well">
<form ng-submit="" ng-controller="QuestionEditorControl" action="">
<fieldset>
<legend>Add a Question</legend>
<input focus-on-start type="text" ng-model="text" ng-enter="moveFocusTo('#addChoice')" />
<ol>
<li ng-repeat="choice in choices">
{{choice}} <i class="icon-remove" ng-click="removeChoice($index);"></i>
</li>
<li style="list-style-type: none;">
<input id="addChoice" type="text" ng-model="newChoice" ng-enter="addChoice()" />
</li>
</ol>
<button type="button" class="btn btn-block btn-primary" ng-click="addQuestion()">
Add this question
</button>
</fieldset>
</form>
</div>
<div class="well">
<form action="">
<fieldset>
<legend>Shuffle</legend>
<span class="help-block">Shuffle the order of the choices to your questions</span>
<button type="button" ng-click="quiz.shuffleChoices()" class="btn btn-block btn-primary">
Shuffle all of the choices
</button>
</fieldset>
</form>
</div>
<div class="well">
<form action="">
<fieldset>
<legend>Format</legend>
<label>Bullets for questions.</label>
<div class="btn-group" data-toggle="buttons-radio">
<button ng-repeat="(style_name, bulleter) in defaults.bullet_styles"
class="btn"
ng-bind-html-unsafe="bulleter(0)"
ng-click="quiz.style().questions.bullet_style = style_name"
ng-class="(quiz.style().questions.bullet_style == style_name) && 'active' || ''">
</button>
</div>
<label>Bullets for choices.</label>
<div class="btn-group" data-toggle="buttons-radio">
<button ng-repeat="(style_name, bulleter) in defaults.bullet_styles"
class="btn"
ng-bind-html-unsafe="bulleter(0)"
ng-click="quiz.style().choices.bullet_style = style_name"
ng-class="(quiz.style().choices.bullet_style == style_name) && 'active' || ''">
</button>
</div>
<label>Quiz Font</label>
<div class="btn-group">
<button class="btn" style="font-family: {{quiz.font()}};">
{{quiz.style().font}}
</button>
<button class="btn dropdown-toggle" data-toggle="dropdown">
<span class="caret"></span>
</button>
<ul class="dropdown-menu">
<li ng-repeat="(name, family) in defaults.fonts">
<a ng-click="quiz.style().font=name" style="font-family: {{family}};">
{{name}}
</a>
</li>
</ul>
</div>
<label>Question Order</label>
<div class="btn-group" data-toggle="buttons-radio">
<button ng-repeat="(name, order) in defaults.orderings"
class="btn"
ng-click="quiz.style().questions.ordering=name"
ng-class="(quiz.style().questions.ordering == name) && 'active' || ''">
{{name}}
</button>
</div>
</fieldset>
</form>
</div>
</div>
<div class="span9">
<!-- Quiz content-->
<div id="quiz" class="well" style="font-family: {{quiz.font()}};">
<div id="name">Name: </div>
<div contentEditable="true" ng-model='quiz.data().directions'>{{quiz.data().directions}}</div>
<ul class="questions" fixed-heights='quiz.questions()'>
<li
class="question"
ng-repeat="question in quiz.questions() | reorder: quiz.ordering.data"
ng-mouseenter="showQuestionEditor=true"
ng-mouseleave="showQuestionEditor=false">
<div>
{{quiz.question_bullet(quiz.ordering.index($index))}}
<span contentEditable="true" ng-model='question.text'>{{question.text}}</span>
<span ng-show="showQuestionEditor">
<i class="icon-remove" ng-click="quiz.removeQuestion(question)"></i>
<i class="icon-random" ng-click="question.choices.shuffle()"></i>
<i
ng-hide="$first"
class="icon-arrow-up"
ng-click="quiz.questions().swap($index, $index - 1)"></i>
<i
ng-hide="$last"
class="icon-arrow-down"
ng-click="quiz.questions().swap($index, $index + 1)"></i>
</span>
</div>
<div class="choices">
<div
class="choice"
ng-repeat="choice in question.choices"
ng-mouseenter="showChoiceEditor=true"
ng-mouseleave="showChoiceEditor=false">
<span >
{{quiz.choice_bullet($index)}}
<span contentEditable="true" ng-model="question.choices[$index]">
{{choice}}
</span>
</span>
<span ng-show="showChoiceEditor">
<i class="icon-remove" ng-click="quiz.removeChoice(question, $index)"></i>
<i
ng-hide="$first"
class="icon-arrow-up"
ng-click="question.choices.swap($index, $index - 1)"></i>
<i
ng-hide="$last"
class="icon-arrow-down"
ng-click="question.choices.swap($index, $index + 1)"></i>
<i class="icon-plus" ng-click="question.choices.splice($index + 1, 0, '')"></i>
</span>
</div>
</div>
</li>
</ul>
<!-- Needed for the list to space correctly -->
<br class="clear" />
</div>
</div>
</div>
</div>
</body>
</html>