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

Commit c0a840f

Browse files
committed
Merge pull request #21 from RunestoneInteractive/master
Updating master
2 parents 1528542 + f968ad4 commit c0a840f

File tree

21 files changed

+678
-460
lines changed

21 files changed

+678
-460
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ So, you would like to help out with developing the Runestone Components. What d
7979
2. Setup your environment on your development machine
8080

8181
1. Make a virtual environment for testing and working I recommend pyvenv-3.4 as it is baked in to Python 3.4 and higher.
82-
2. Rather than following the instructions above for installing runestone simply run ``pip install .`` from the top level runestone directory. This will install all of the required prerequisites and setup the runestone install as a link to the development directory.
82+
2. Rather than following the instructions above for installing runestone simply run ``pip install -e .`` from the top level runestone directory. This will install all of the required prerequisites and setup the runestone install as a link to the development directory.
8383

8484
3. When you have some changes to share, make a Pull Request.
8585

runestone/activecode/activecode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ def run(self):
196196
if 'timelimit' not in self.options:
197197
self.options['timelimit'] = 'data-timelimit=25000'
198198
else:
199-
self.options['timelimit'] = 'data-timelimit=%d' % self.options['timelimit']
199+
self.options['timelimit'] = 'data-timelimit=%s' % self.options['timelimit']
200200

201201
if 'autorun' not in self.options:
202202
self.options['autorun'] = ''

runestone/activecode/js/activecode.js

Lines changed: 92 additions & 20 deletions
Large diffs are not rendered by default.

runestone/activecode/js/skulpt-stdlib.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

runestone/activecode/js/skulpt.min.js

Lines changed: 530 additions & 377 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

runestone/assess/fitb.py

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,6 @@ def __init__(self,content):
116116
def visit_blank_node(self,node):
117117
res = ""
118118

119-
120119
res = node.template_blank_start % node.blank_options
121120

122121
self.body.append(res)
@@ -126,7 +125,7 @@ def depart_blank_node(self,node):
126125
fbl = []
127126
res = ""
128127
feedCounter = 0
129-
128+
print self.body[-2:]
130129

131130
for k in sorted(node.blank_options.keys()):
132131
if 'feedback' in k:
@@ -177,7 +176,8 @@ def run(self):
177176
178177
Question text
179178
...
180-
"""
179+
"""
180+
181181
self.options['divid'] = self.arguments[0]
182182
if self.content:
183183
if 'iscode' in self.options:
@@ -187,23 +187,26 @@ def run(self):
187187
else:
188188
self.options['bodytext'] = '\n'
189189

190+
if 'correct' not in self.options:
191+
raise ValueError("missing correct value in %s"%self.options['divid'])
192+
190193
TEMPLATE_BLANK_START = '''
191-
<span data-blank>%(bodytext)s<span data-answer id="%(divid)s_answer">%(correct)s</span>
194+
<span data-blank>
192195
'''
193196
TEMPLATE_BLANK_OPTION = '''
194-
<span data-feedback="regex" id="%(divid)s_%(feedLabel)s">%(feedExp)s</span>
195-
<span data-feedback="text" for="%(divid)s_%(feedLabel)s">%(feedText)s</span>
197+
<span data-feedback="regex" style="display: none" id="%(divid)s_%(feedLabel)s">%(feedExp)s</span>
198+
<span data-feedback="text" style="display: none" for="%(divid)s_%(feedLabel)s">%(feedText)s</span>
196199
'''
197200
TEMPLATE_BLANK_END = '''
201+
<span data-answer style="display: none" id="%(divid)s_answer">%(correct)s</span>
198202
</span>
199203
'''
200204

201-
202-
203205
blankNode = BlankNode(self.options)
204206
blankNode.template_blank_start = TEMPLATE_BLANK_START
205207
blankNode.template_blank_option = TEMPLATE_BLANK_OPTION
206208
blankNode.template_option_end = TEMPLATE_BLANK_END
207209

210+
self.state.nested_parse(self.content, self.content_offset, blankNode)
208211

209212
return [blankNode]

runestone/common/js/runestonebase.js

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -4,47 +4,17 @@ function RunestoneBase () { // Basic parent stuff
44

55
RunestoneBase.prototype.logBookEvent = function (eventInfo) {
66
eventInfo.course = eBookConfig.course;
7-
if (eBookConfig.logLevel > 0) {
7+
if (eBookConfig.useRunestoneServices && eBookConfig.logLevel > 0) {
88
jQuery.get(eBookConfig.ajaxURL + 'hsblog', eventInfo); // Log the run event
99
}
1010
console.log("logging event " + eventInfo);
1111
};
1212

13-
RunestoneBase.prototype.logRunEvent = function (info) {
13+
RunestoneBase.prototype.logRunEvent = function (eventInfo) {
1414
eventInfo.course = eBookConfig.course;
15-
if (eBookConfig.logLevel > 0) {
15+
if (eBookConfig.useRunestoneServices && eBookConfig.logLevel > 0) {
1616
jQuery.post(eBookConfig.ajaxURL + 'runlog', eventInfo); // Log the run event
1717
}
1818
console.log("running " + eventInfo);
1919
};
2020

21-
22-
23-
if (![].includes) {
24-
Array.prototype.includes = function(searchElement /*, fromIndex*/ ) {
25-
'use strict';
26-
var O = Object(this);
27-
var len = parseInt(O.length) || 0;
28-
if (len === 0) {
29-
return false;
30-
}
31-
var n = parseInt(arguments[1]) || 0;
32-
var k;
33-
if (n >= 0) {
34-
k = n;
35-
} else {
36-
k = len + n;
37-
if (k < 0) {k = 0;}
38-
}
39-
var currentElement;
40-
while (k < len) {
41-
currentElement = O[k];
42-
if (searchElement === currentElement ||
43-
(searchElement !== searchElement && currentElement !== currentElement)) {
44-
return true;
45-
}
46-
k++;
47-
}
48-
return false;
49-
};
50-
}

runestone/common/project_template/_sources/overview.rst

Lines changed: 37 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -289,12 +289,12 @@ next line executed.
289289
Timed Exam Questions
290290
---------------------
291291

292-
You can add a timed exam of multiple-choice/fill-in-the-blank questions that the user can only take once. All the feedback will be shown after the time is up or after the user has clicked the "Submit Answers" button at the end of the timed exam. To start the timed exam click on the "Start" button. This will also start the countdown of the time remaining. You can pause the timer by clicking on the "Pause" button and start it again by clicking on the "Resume" button. When you pause the timed exam the questions will be hidden. There is also a clock icon that will display the time remaining when the reader hovers over it.
292+
You can add a timed exam of multiple-choice/fill-in-the-blank/clickable-area/drag-n-drop questions that the user can only take once. All the feedback will be shown after the time is up or after the user has clicked the "Submit Answers" button at the end of the timed exam. To start the timed exam click on the "Start" button. This will also start the countdown of the time remaining. You can pause the timer by clicking on the "Pause" button and start it again by clicking on the "Resume" button. When you pause the timed exam the questions will be hidden. There is also a clock icon that will display the time remaining when the reader hovers over it.
293293

294294
Please note that you can currently only have one timed exam per html page.
295295

296296
All you need is the timed directive--you can specify the time limit (in minutes), and there are options for no feedback, no results, and no time limit (in which case it will keep track of the amount of time taken to complete the exam).
297-
A timed exam can hold any number of multiple choice or fill in the blank questions.
297+
A timed exam can hold any number of multiple choice, fill in the blank, clickable area, and dragndrop components.
298298

299299
.. timed:: timed1
300300
:timelimit: 10
@@ -314,20 +314,28 @@ A timed exam can hold any number of multiple choice or fill in the blank questio
314314

315315
Under which of these conditions will a sequential search be faster than a binary search?
316316

317-
.. mchoice:: questiontimed2
318-
:random:
319-
:multiple_answers:
320-
:correct: a,b,d
321-
:answer_a: Red
322-
:answer_b: Blue
323-
:answer_c: Brown
324-
:answer_d: Indigo
325-
:feedback_a: Yes, red is definitely one of the colors.
326-
:feedback_b: Blue is correct!
327-
:feedback_c: Remember ROY G BIV!
328-
:feedback_d: Yes, indigo is also in the rainbow!
329-
330-
Which of these are colors of the rainbow?
317+
.. clickablearea:: clicktimed1
318+
:question: Click on the correct cells.
319+
:feedback: Remember, the operator '=' is used for assignment.
320+
:table:
321+
:correct: 1,1;1,4;2,3;2,4
322+
:incorrect: 2,1;2,2;3,0
323+
324+
+------------------------+------------+----------+----------+
325+
| correct | N-A | N-A | correct |
326+
+========================+============+==========+==========+
327+
| Incorrect | incorrect | correct | correct |
328+
+------------------------+------------+----------+----------+
329+
| This row is incorrect | ... | ... | ... |
330+
+------------------------+------------+----------+----------+
331+
332+
.. dragndrop:: dnd2
333+
:feedback: This is feedback.
334+
:match_1: Drag to Answer A|||Answer A
335+
:match_2: Drag me Answer B|||Answer B
336+
:match_3: Drag to Answer C|||Answer C
337+
338+
This is a drag n drop question.
331339

332340
.. fillintheblank:: fill1412
333341

@@ -430,6 +438,7 @@ will be evaluated once they click the 'Check Me' button.
430438

431439
.. clickablearea:: click1
432440
:question: Click on all assignment statements.
441+
:iscode:
433442
:feedback: Remember, the operator '=' is used for assignment.
434443

435444
:click-incorrect:def main()::endclick:
@@ -610,8 +619,13 @@ connect it to the print block. Now click the run button and you should see 10 p
610619
in the gray output area.
611620

612621

613-
Other Languages - LiveCode
614-
--------------------------
622+
Other Languages in ActiveCode
623+
-----------------------------
624+
625+
Activecode now supports Java, C++ and C through a backend server, not in the browser. You can
626+
use them by specifying the language to be `java`, `cpp` or `c` In addition it supports either Python3 or Python2
627+
outside of the browser using `python3` or `python2` as the language. You are limited to non-graphical
628+
programs in any of these options.
615629

616630
.. activecode:: lc1
617631
:language: java
@@ -637,6 +651,11 @@ Other Languages - LiveCode
637651

638652
}
639653

654+
655+
Audio Tours
656+
-----------
657+
658+
640659
.. activecode:: ch03_4
641660
:nocanvas:
642661
:tour_1: "Overall Tour"; 1-2: Example04_Tour01_Line01; 2: Example04_Tour01_Line02; 1: Example04_Tour01_Line03;
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)