Skip to content

Commit d1dc6be

Browse files
authored
Merge pull request barbarer#175 from xinyinghou/master
Moved all the rst files under regular dictionaries folder & removed _hidden ones for testing
2 parents a824ea3 + d5bf5a8 commit d1dc6be

11 files changed

Lines changed: 114 additions & 197 deletions

File tree

_sources/_hidden/mooc_nested_dict/index.rst

Lines changed: 0 additions & 12 deletions
This file was deleted.

_sources/_hidden/mooc_nested_dict/nested-wt.rst

Lines changed: 0 additions & 112 deletions
This file was deleted.

_sources/_hidden/mooc_nested_dict/intro.rst renamed to _sources/dictionaries/mc_intro.rst

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -108,35 +108,17 @@ See the video below for an example.
108108
:align: center
109109

110110
Finish writing the code for the following problem.
111+
.. writecode:: intro-sample-write-code-double-mooc_nested
112+
:numbered: left
113+
:adaptive:
114+
:practice: T
111115

112-
.. activecode:: intro-sample-write-code-triple-mooc_nested
113-
:practice: T
114-
:autograde: unittest
115-
116-
Write a function called ``triple(num)`` that takes a number ``num`` and
117-
returns the number times 3. For example, ``triple(2)`` should return 6 and
118-
``triple(-1)`` should return -3. Look below the code to check for any
119-
compiler errors or the results
120-
from the test cases. Be sure to ``return`` the result.
121-
~~~~
122-
def triple(num):
123-
# write code here
124-
125-
print(triple(2))
126-
print(triple(-1))
127-
128-
====
129-
from unittest.gui import TestCaseGui
130-
class myTests(TestCaseGui):
131-
132-
def testOne(self):
133-
self.assertEqual(triple(2),6,"triple(2)")
134-
self.assertEqual(triple(3),9,"triple(3)")
135-
self.assertEqual(triple(-1),-3,"triple(-1)")
136-
self.assertEqual(triple(0),0,"triple(0)")
137-
self.assertEqual(triple(11),33,"triple(11)")
138-
139-
myTests().main()
116+
Write a function called ``double(num)`` that takes a number ``num`` and
117+
returns the number times 3. For example, ``double(3)`` should return 6 and ``double(-4)`` should return -8.
118+
-----
119+
def double(num):
120+
# Your code here
121+
pass
140122

141123

142124
Solving Write Code Problems with an Adaptive Mixed-up Puzzle as Scaffolding

_sources/_hidden/mooc_nested_dict/nested-nt.rst renamed to _sources/dictionaries/mc_nested-nt.rst

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,6 @@
11
Practice
22
=============
33

4-
.. raw:: html
5-
6-
<script>
7-
8-
function triggerSaveClicks(callback) {
9-
console.log("Triggering all Save and Save & Run clicks...");
10-
11-
let saveButtons = document.querySelectorAll('button');
12-
let saveCount = 0;
13-
14-
saveButtons.forEach(button => {
15-
if (button.innerText.includes('Save') || button.innerText.includes('Save & Run')) {
16-
console.log(`Clicking button: ${button.innerText}`);
17-
button.click(); // Simulate button click
18-
saveCount++;
19-
}
20-
});
21-
22-
// Ensure logging is complete before proceeding
23-
setTimeout(() => {
24-
console.log(`Triggered ${saveCount} Save clicks. Proceeding...`);
25-
if (callback) callback();
26-
}, 1000); // Wait 1 second for logging to process
27-
28-
29-
document.addEventListener("DOMContentLoaded", function() {
30-
let introLink = document.getElementById('posttest'); // Change ID if needed
31-
if (introLink) {
32-
introLink.addEventListener("click", function(event) {
33-
event.preventDefault(); // Stop immediate navigation
34-
35-
console.log("User clicked the Introduction link. Saving first...");
36-
37-
// Trigger Save clicks, then navigate
38-
triggerSaveClicks(() => {
39-
window.location.href = introLink.href; // Navigate after saving
40-
});
41-
});
42-
}
43-
});
44-
45-
</script>
46-
474
.. activecode:: w1-mooc_nested
485
:autograde: unittest
496
:nocodelens:
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
Practice
2+
=============
3+
4+
5+
.. selectquestion:: t1-mooc_nested
6+
:fromid: w1-mooc_nested, p1-mooc_nested
7+
:toggle: lock
8+
9+
10+
.. selectquestion:: t2-mooc_nested
11+
:fromid: w2-mooc_nested, p2-mooc_nested
12+
:toggle: lock
13+
14+
15+
.. selectquestion:: t3-mooc_nested
16+
:fromid: w3-mooc_nested, p3-mooc_nested
17+
:toggle: lock
18+
19+
20+
.. selectquestion:: t4-mooc_nested
21+
:fromid: w4-mooc_nested, p4-mooc_nested
22+
:toggle: lock
23+
24+
25+
Post-Survey
26+
=============
27+
28+
.. poll:: satisfication_mooc-nested
29+
:option_1: Very low satisfaction
30+
:option_2: Low satisfaction
31+
:option_3: Neither low or high satisfaction
32+
:option_4: High satisfaction
33+
:option_5: Very high satisfaction
34+
:results: instructor
35+
36+
From 1 (Very low satisfaction) to 5 (Very high satisfaction), rate your level of <b>satisfaction with the help provided</b> (this refers to the mixed-up puzzle in the toggle bar).
37+
38+
.. shortanswer:: satisfication_explain_mooc-nested
39+
40+
Please explain the reason for your satisfication choice in the box.
41+
42+
43+
.. shortanswer:: end_explain_mooc-nested
44+
45+
Please skip this question if you used the "Mixed-up puzzle in the toggle bar" at least once.
46+
47+
If you did not use the help at all when solving the practice problems, please explain why.
48+
49+
50+
51+
52+
What to do next
53+
=================
54+
55+
.. raw:: html
56+
57+
<p>Click on the following link to take the posttest: <b><a id="posttest"> <font size="+1">Posttest</font></a></b></p>
58+
59+
.. raw:: html
60+
61+
<script type="text/javascript" >
62+
63+
window.onload = function() {
64+
65+
a = document.getElementById("posttest")
66+
a.href = "posttest.html"
67+
};
68+
69+
</script>
File renamed without changes.
File renamed without changes.
File renamed without changes.

_sources/_hidden/mooc_nested_dict/puzzle_bank.rst renamed to _sources/dictionaries/mc_puzzle_bank.rst

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,13 @@
7777
=====
7878
if category not in menu:
7979
=====
80-
menu[category] = {}
80+
menu[category] = {}
8181
=====
8282
menu[category][name] = price
8383
=====
8484
return menu
8585

86+
8687

8788
.. parsonsprob:: p4-mooc_nested
8889
:numbered: left
@@ -118,6 +119,7 @@
118119
return order_totals
119120

120121

122+
121123
.. parsonsprob:: intro-sample-puzzle-mooc_nested
122124
:numbered: left
123125
:adaptive:
@@ -129,4 +131,35 @@
129131
-----
130132
def triple(num):
131133
=====
132-
return num * 3
134+
return num * 3
135+
136+
137+
138+
.. activecode:: intro-sample-write-code-triple-mooc_nested
139+
:practice: T
140+
:autograde: unittest
141+
142+
Write a function called ``triple(num)`` that takes a number ``num`` and
143+
returns the number times 3. For example, ``triple(2)`` should return 6 and
144+
``triple(-1)`` should return -3. Look below the code to check for any
145+
compiler errors or the results
146+
from the test cases. Be sure to ``return`` the result.
147+
~~~~
148+
def triple(num):
149+
# write code here
150+
151+
print(triple(2))
152+
print(triple(-1))
153+
154+
====
155+
from unittest.gui import TestCaseGui
156+
class myTests(TestCaseGui):
157+
158+
def testOne(self):
159+
self.assertEqual(triple(2),6,"triple(2)")
160+
self.assertEqual(triple(3),9,"triple(3)")
161+
self.assertEqual(triple(-1),-3,"triple(-1)")
162+
self.assertEqual(triple(0),0,"triple(0)")
163+
self.assertEqual(triple(11),33,"triple(11)")
164+
165+
myTests().main()
File renamed without changes.

0 commit comments

Comments
 (0)