Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit e68a2a4

Browse files
committed
Merge pull request #37 from riknos314/newtimedPR
Updated timed to have new functionality that Barbara Ericson requested
2 parents 193af8a + 16a1a40 commit e68a2a4

File tree

13 files changed

+1656
-1489
lines changed

13 files changed

+1656
-1489
lines changed

runestone/assess/.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
*.woff2
2+
*.woff
3+
*.ttf
4+
*.eot
5+
*.svg
6+
7+
node_modules/
8+
bower_components/

runestone/assess/README.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ Each 2 <code>li</code> answer/feedback pair represents a possible answer to the
2828
<li><code>id</code> must be unique in the document</li>
2929
<li><code>data-multipleanswers</code> REQUIRED Attribute. Possible values are true and false. Determines whether the question can take one or more answers on submission (radio vs checkbox).</li>
3030
<li><code>data-random</code> Randomizes the order that the possible answers are displayed on the page</li>
31-
<li><code>data-timed</code> Required if this MC question is inside of a timed assessment, will break things if not.</li>
3231
<br />
3332
<p>Attributes of the question tags</p>
3433
<br />
@@ -58,7 +57,7 @@ Each regex,text <code>span</code> pair represents a point of feedback for incorr
5857

5958
Multiple blanks can also be put into the same FITB question as shown here.
6059

61-
<p data-component="fillintheblank" data-casei="false" data-timed id="fill1412" >
60+
<p data-component="fillintheblank" data-casei="false" id="fill1412" >
6261

6362
<span data-blank>Give me a string that has an 'e' in it. Now.<span data-answer id="blank2_answer">e</span>
6463
<span data-feedback="regex" id="feedback1">f</span>
@@ -91,14 +90,13 @@ Multiple blanks can also be put into the same FITB question as shown here.
9190
<ul>
9291
<li><code>data-casei</code> Determines if the answer is case insensitive</li>
9392
<li><code>id</code> Must be unique in the document</li>
94-
<li><code>timed</code> Required for a FITB component inside of a timed assessment</li>
9593

9694
</ul>
9795

9896
<h2>Timed</h2>
9997

10098
<ul data-component="timedAssessment" data-time id="timed_1">
101-
<ul data-component="multiplechoice" data-multipleanswers="true" data-timed data-random id="question_1">
99+
<ul data-component="multiplechoice" data-multipleanswers="true" data-random id="question_1">
102100
The Question can go right here.
103101
<li data-component="answer" id="123" >Answer One</li>
104102
<li data-component="feedback" for="123">Feedback for One</li>
@@ -110,7 +108,7 @@ Multiple blanks can also be put into the same FITB question as shown here.
110108
<li data-component="feedback" for="789">Feedback for Three</li>
111109
</ul>
112110

113-
<ul data-component="multiplechoice" data-timed id="question_2">
111+
<ul data-component="multiplechoice" id="question_2">
114112
The Question can go right here.
115113
<li data-component="answer" id="123" >Answer One</li>
116114
<li data-component="feedback" for="123">Feedback for One</li>
@@ -122,7 +120,7 @@ Multiple blanks can also be put into the same FITB question as shown here.
122120
<li data-component="feedback" for="789">Feedback for Three</li>
123121
</ul>
124122

125-
<p data-component="fillintheblank" data-casei="false" data-timed id="fill1412" >
123+
<p data-component="fillintheblank" data-casei="false" id="fill1412" >
126124

127125
<span data-blank>Give me a string that has an 'e' in it. Now.<span data-answer id="blank2_answer">e</span>
128126

runestone/assess/assess.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,12 @@ def setup(app):
3636
app.add_directive('timed', TimedDirective)
3737

3838
app.add_stylesheet('fitb.css')
39-
app.add_javascript('assess.js')
39+
#app.add_javascript('assess.js')
40+
app.add_javascript('mchoice.js')
41+
app.add_javascript('timedmc.js')
42+
app.add_javascript('fitb.js')
43+
app.add_javascript('timedfitb.js')
44+
app.add_javascript('timed.js')
4045

4146
app.add_node(TimedNode, html=(visit_timed_node, depart_timed_node))
4247
app.add_node(MChoiceNode, html=(visit_mc_node, depart_mc_node))

runestone/assess/css/fitb.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.selectwidthauto {
2+
width:auto !important;
3+
display: inline-block !important;
4+
margin: 5px;
5+
}
6+
7+
input.input-validation-error {
8+
border: 1px solid #e80c4d;
9+
}

runestone/assess/fitb.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,6 @@ def visit_fitb_node(self,node):
4444
node.fitb_options['casei'] = 'true'
4545
else:
4646
node.fitb_options['casei'] = 'false'
47-
if 'timed' in node.fitb_options:
48-
node.fitb_options['timed'] = 'data-timed'
49-
else:
50-
node.fitb_options['timed'] = ''
5147
res = node.template_start % node.fitb_options
5248

5349
self.body.append(res)
@@ -66,7 +62,6 @@ class FillInTheBlank(Directive):
6662
final_argument_whitespace = True
6763
has_content = True
6864
option_spec = {'blankid':directives.unchanged,
69-
'timed':directives.flag,
7065
'iscode':directives.flag,
7166
'casei':directives.flag # case insensitive matching
7267
}
@@ -78,13 +73,12 @@ def run(self):
7873
:return:
7974
.. fillintheblank:: qname
8075
:iscode: boolean
81-
:timed: Flag that indicated this is part of a timed block
8276
:casei: Case insensitive boolean
8377
...
8478
"""
8579

8680
TEMPLATE_START = '''
87-
<p data-component="fillintheblank" data-casei="%(casei)s" id="%(divid)s" %(timed)s>
81+
<p data-component="fillintheblank" data-casei="%(casei)s" id="%(divid)s">
8882
'''
8983

9084
TEMPLATE_END = '''

0 commit comments

Comments
 (0)