Skip to content

Commit 422e9b3

Browse files
committed
Moved all the rst files under regular dictionaries folder & removed _hidden ones for testing
1 parent b2d99ff commit 422e9b3

10 files changed

Lines changed: 51 additions & 48 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/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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Practice
3232
introLink.addEventListener("click", function(event) {
3333
event.preventDefault(); // Stop immediate navigation
3434
35-
console.log("User clicked the Introduction link. Saving first...");
35+
console.log("User clicked the posttest link. Saving first...");
3636
3737
// Trigger Save clicks, then navigate
3838
triggerSaveClicks(() => {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Practice
3232
introLink.addEventListener("click", function(event) {
3333
event.preventDefault(); // Stop immediate navigation
3434
35-
console.log("User clicked the Introduction link. Saving first...");
35+
console.log("User clicked the posttest link. Saving first...");
3636
3737
// Trigger Save clicks, then navigate
3838
triggerSaveClicks(() => {
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: 39 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@
6464
Finish the function ``get_vegetarian_menu(menu_items):`` below:
6565
- It takes a list of tuples ``menu_items`` as input, each tuple contains ``(name, category, price, is_vegetarian)``.
6666
- It returns a new nested dictionary that only contains the items from ``menu_items`` where ``is_vegetarian`` is ``True``.
67-
- The outer dictionary keys are ``category`` such as "Soup", "Pizza", "Pasta", "Salad".
68-
- The inner dictionary keys are ``name`` and values are ``price`` for each vegetarian item of that ``category``.
67+
- The outer dictionary keys are ``category`` such as "Soup", "Pizza", "Pasta", "Salad".
68+
- The inner dictionary keys are ``name`` and values are ``price`` for each vegetarian item of that ``category``.
6969
-----
7070
def get_vegetarian_menu(menu_items):
7171
=====
@@ -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
@@ -92,8 +93,8 @@
9293
Finish the function ``get_vegetarian_menu(menu_items):`` below:
9394
- It takes a list of tuples ``menu_items`` as input, each tuple contains ``(name, category, price, is_vegetarian)``.
9495
- It returns a new nested dictionary that only contains the items from ``menu_items`` where ``is_vegetarian`` is ``True``.
95-
- The outer dictionary keys are ``category`` such as "Soup", "Pizza", "Pasta", "Salad".
96-
- The inner dictionary keys are ``name`` and values are ``price`` for each vegetarian item of that ``category``.
96+
- The outer dictionary keys are ``category`` such as "Soup", "Pizza", "Pasta", "Salad".
97+
- The inner dictionary keys are ``name`` and values are ``price`` for each vegetarian item of that ``category``.
9798
-----
9899
def get_order_totals(orders):
99100
=====
@@ -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.
File renamed without changes.

0 commit comments

Comments
 (0)