-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathsample.html
234 lines (222 loc) · 7.71 KB
/
sample.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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Quiz</title>
<link href='http://fonts.googleapis.com/css?family=Josefin+Sans|Alike' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="quiz.css" type="text/css" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
tex2jax: {
inlineMath: [ ['$','$'], ["\\(","\\)"] ],
processEscapes: true
}
});
</script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML.js"></script>
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.2/styles/default.min.css">
<script src="http://cdnjs.cloudflare.com/ajax/libs/highlight.js/8.2/highlight.min.js"></script>
<script>hljs.initHighlightingOnLoad();</script>
<script type="text/javascript">
$(document).ready(function(){
//close all the content divs on page load
$('.response').hide();
// toggle slide
$('.selection').click(function(){
// by calling sibling, we can use same div for all demos
$(this).siblings('.response').slideToggle('fast');
});
$('button').click(function(event){
var $target = $(event.target);
var $checkboxes = $target.parent('.mcq').find('input');
for (var i = 0; i < $checkboxes.length; i++) {
var $checkbox = $checkboxes.eq(i);
a = $checkbox;
if ($checkbox[0].checked && $checkbox.nextAll('.response').hasClass('right')) {
$checkbox.nextAll('.correct-checkbox').show();
} else if ($checkbox[0].checked &&
$checkbox.nextAll('.response').hasClass('wrong')) {
$checkbox.nextAll('.incorrect-checkbox').show();
} else if (!$checkbox[0].checked &&
$checkbox.nextAll('.response').hasClass('right')) {
$checkbox.nextAll('.incorrect-checkbox').show();
} else {
$checkbox.nextAll('.correct-checkbox').show();
}
}
$target.parent('.mcq').find('.response').slideToggle('fast');
if ($target.text() == 'Submit') {
$target.text('Hide');
} else {
$checkboxes.nextAll('.incorrect-checkbox').hide();
$checkboxes.nextAll('.correct-checkbox').hide();
$target.text('Submit');
}
});
});
</script>
</head>
<body>
$\newcommand{\ones}{\mathbf 1}$
<div>
<h1>Sample Quiz Title</h1>
<fieldset>
<legend>Problem Group 1 Title</legend>
<div class="intro">This is the statement for problem group one.
You can add a link to websites like this: <a href="http://www.google.com">http://www.google.com</a>.
You can add images like this:
<div><img src="http://upload.wikimedia.org/wikipedia/commons/9/9b/Carl_Friedrich_Gauss.jpg"></div>
The image source can either be a local path, or some web URL. Images can be embedded
anywhere: within problem groups, problems or options.
It also supports syntax highlighting like this:
<pre><code class="java">int a = 2;
int b = 3;
System.out.println(a + b);
</pre></code>
Quizgen supports LaTeX:
\[
a = \begin{pmatrix} 1 \\ 3 \\ 2 \end{pmatrix} , \quad
b = \begin{pmatrix} 2 \\ 6 \\ 4 \end{pmatrix} , \quad
c = \begin{pmatrix} 1 \\ 3 \\ 0 \end{pmatrix} .
\]
A blank line marks the end of this problem group introduction text and the
beginning of the first problem.</div>
<hr/>
<div>
<div class="description">
This is the first problem in the problem group with some LaTeX: $a_3$.</div>
<ol type="a">
<li class="choice">
<div class="selection">This is an option. </div>
<div class="response wrong">
<span class="wrong">Incorrect. </span>
You can add an explanation for an option after the double colon to explain why it is correct/incorrect.
</div>
</li>
<li class="choice">
<div class="selection">This is another option. Observe that explanations are optional.</div>
<div class="response wrong">
<span class="wrong">Incorrect. </span>
</div>
</li>
<li class="choice">
<div class="selection">This option is the correct option since it is marked with an equal to sign.</div>
<div class="response right">
<span class="right">Correct! </span>
</div>
</li>
</ol>
</div>
<hr/>
<div>
<div class="description">
Again, a blank line marks the end of the options. Here's another problem in
this problem group with more inline latex $c$ and $d$.
Quizgen supports displayed equations as well:
\[
x=Zy + a - c.
\]</div>
<ol type="a">
<li class="choice">
<div class="selection">Yes.</div>
<div class="response wrong">
<span class="wrong">Incorrect. </span>
</div>
</li>
<li class="choice">
<div class="selection">No.</div>
<div class="response right">
<span class="right">Correct! </span>
</div>
</li>
</ol>
</div>
<hr/>
<div>
<div class="description">
You can also have problems with multiple correct responses.
Students will be asked to select all that apply, and then submit their
responses.</div>
<div class="mcq">
<label>
<input type="checkbox"/>
<span class="multiple-selection">Option 1. </span>
<span class="correct-checkbox">✓</span>
<span class="incorrect-checkbox">✗</span>
<div class="response right">This option is correct. This is an explanation.</div>
</label>
<label>
<input type="checkbox"/>
<span class="multiple-selection">Option 2.</span>
<span class="correct-checkbox">✓</span>
<span class="incorrect-checkbox">✗</span>
<div class="response wrong">This option is incorrect. </div>
</label>
<label>
<input type="checkbox"/>
<span class="multiple-selection">Option 3.</span>
<span class="correct-checkbox">✓</span>
<span class="incorrect-checkbox">✗</span>
<div class="response wrong">This option is incorrect. </div>
</label>
<label>
<input type="checkbox"/>
<span class="multiple-selection">Option 4.</span>
<span class="correct-checkbox">✓</span>
<span class="incorrect-checkbox">✗</span>
<div class="response right">This option is correct. </div>
</label>
<button>Submit</button>
</div>
</div>
</fieldset>
<br/>
<fieldset>
<div>
<div class="description">
This problem group has no title and has no introduction. When the text following the start of a new problem group is immediately followed by the options, it is inferred to be a problem.</div>
<ol type="a">
<li class="choice">
<div class="selection">Yes I understand. </div>
<div class="response right">
<span class="right">Correct! </span>
Great! Here's some latex $\|a + b + c\|.$
</div>
</li>
<li class="choice">
<div class="selection">No. </div>
<div class="response wrong">
<span class="wrong">Incorrect. </span>
Please email me and I'll try to help!
</div>
</li>
</ol>
</div>
<hr/>
<div>
<div class="description">
This is another problem in this problem group.</div>
<ol type="a">
<li class="choice">
<div class="selection">This is a great tutorial!</div>
<div class="response wrong">
<span class="wrong">Incorrect. </span>
</div>
</li>
<li class="choice">
<div class="selection">This tutorial can be improved. I'm going to email you with suggestions so you can do a better job.</div>
<div class="response right">
<span class="right">Correct! </span>
</div>
</li>
</ol>
</div>
</fieldset>
<br/>
</div>
<footer>
Page generated using <a href="https://github.com/karanveerm/quizgen">Quizgen</a>
</footer>
</body>
</html>