Skip to content

Commit a058eb5

Browse files
authored
Merge pull request barbarer#179 from xinyinghou/master
Resolved issues identified during pilot testing
2 parents 36af527 + 05de03c commit a058eb5

8 files changed

Lines changed: 16 additions & 21 deletions

File tree

.DS_Store

0 Bytes
Binary file not shown.

_sources/.DS_Store

0 Bytes
Binary file not shown.

_sources/_hidden/mc_nested-nt.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Practice
7878
+------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------+
7979

8080
~~~~
81-
def get_average_score(dict_category_item, lst_quantity):
81+
def get_average_score(student_information):
8282

8383

8484

@@ -102,6 +102,7 @@ Practice
102102

103103

104104

105+
105106
.. activecode:: w3-mooc_nested
106107
:autograde: unittest
107108
:nocodelens:

_sources/_hidden/mc_post_survey.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Thank you!
22
===========
33

4-
That's it! You have completed the practice problems and the post-survey. Your feedback is valuable to us, and we appreciate your time and effort in participating in this study.
4+
That's it! You have completed the practice problems and the post-survey (if applicable). Your feedback is valuable to us, and we appreciate your time and effort in participating in this study.
55

66
We hope you found the practice problems helpful in improving your understanding of nested dictionaries in Python.
77

_sources/_hidden/mc_posttest.rst

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ Please answer the following questions.
7676
7777
7878
.. activecode:: posttest-2-mooc_nested
79-
:language: python3
8079
:autograde: unittest
8180
:nocodelens:
8281
@@ -117,23 +116,21 @@ Please answer the following questions.
117116
118117
119118
====
120-
from unittest.gui import TestCaseGui
121-
122-
class myTests(TestCaseGui):
123119
124-
def testOne(self):
125-
126-
self.assertEqual(happy_hour_specials([("Classic", "Burger", True, 12), ("Veggie", "Burger", True, 14), ("Fish", "Burger", True, 16), ("Cheese", "Pizza", False, 20)]), {"Burger": {"Classic": 12, "Veggie": 14}})
127-
self.assertEqual(happy_hour_specials([("Mango", "Smoothie", True, 8), ("Green", "Smoothie", True, 12), ("Chocolate", "Milkshake", False, 15), ("Vanilla", "Milkshake", False, 18)]), {"Smoothie": {"Mango": 8, "Green": 12}})
128-
self.assertEqual(happy_hour_specials([("Spaghetti", "Pasta", True, 10), ("Alfredo", "Pasta", True, 12), ("Bolognese", "Pasta", False, 14), ("Seafood", "Pasta", True, 18)]), {"Pasta": {"Spaghetti": 10, "Alfredo": 12}})
129-
self.assertEqual(happy_hour_specials([("Margherita", "Pizza", True, 15), ("Pepperoni", "Pizza", False, 22), ("Hawaiian", "Pizza", True, 10), ("Caesar", "Salad", True, 10)]), {"Pizza": {"Margherita": 15, "Hawaiian": 10}, "Salad": {"Caesar": 10}})
120+
from unittest.gui import TestCaseGui
121+
122+
class myTests(TestCaseGui):
123+
def testOne(self):
124+
self.assertEqual(happy_hour_specials([("Classic", "Burger", True, 12), ("Veggie", "Burger", True, 14), ("Fish", "Burger", True, 16), ("Cheese", "Pizza", False, 20)]), {"Burger": {"Classic": 12, "Veggie": 14}})
125+
self.assertEqual(happy_hour_specials([("Mango", "Smoothie", True, 8), ("Green", "Smoothie", True, 12), ("Chocolate", "Milkshake", False, 15), ("Vanilla", "Milkshake", False, 18)]), {"Smoothie": {"Mango": 8, "Green": 12}})
126+
self.assertEqual(happy_hour_specials([("Spaghetti", "Pasta", True, 10), ("Alfredo", "Pasta", True, 12), ("Bolognese", "Pasta", False, 14), ("Seafood", "Pasta", True, 18)]), {"Pasta": {"Spaghetti": 10, "Alfredo": 12}})
127+
self.assertEqual(happy_hour_specials([("Margherita", "Pizza", True, 15), ("Pepperoni", "Pizza", False, 22), ("Hawaiian", "Pizza", True, 10), ("Caesar", "Salad", True, 10)]), {"Pizza": {"Margherita": 15, "Hawaiian": 10}, "Salad": {"Caesar": 10}})
130128
131-
myTests().main()
129+
myTests().main()
132130
133131
134132
135133
.. activecode:: posttest-3-mooc_nested
136-
:language: python3
137134
:autograde: unittest
138135
:nocodelens:
139136

_sources/_hidden/mc_puzzle_bank.rst

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,8 @@
9090
:adaptive:
9191
:practice: T
9292

93-
Finish the function ``get_vegetarian_menu(menu_items):`` below:
94-
- It takes a list of tuples ``menu_items`` as input, each tuple contains ``(name, category, price, is_vegetarian)``.
95-
- It returns a new nested dictionary that only contains the items from ``menu_items`` where ``is_vegetarian`` is ``True``.
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``.
93+
Finish the function ``get_order_totals()``, that takes a list of tuples and returns a nested dictionary with the same information. Each tuple includes 3 values; the first is the person's name, the second is item name, and the third is the quantity.
94+
- Note that there may be more than one tuple for the same person and item - your dictionary should total all the quantities for the same person and item.
9895
-----
9996
def get_order_totals(orders):
10097
=====

_sources/_hidden/mc_start.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,9 @@ What to do next
7474
reviewLink.href = "#"; // Prevent default navigation for now
7575
7676
reviewLink.onclick = function(event) {
77-
const consent = document.getElementById('consent');
77+
const consent_sent = document.getElementById('consent_sent');
7878
79-
if (!consent) {
79+
if (!consent_sent) {
8080
alert('Please check the consent form before moving to the next.');
8181
event.preventDefault();
8282
return false;

_sources/turtles/.DS_Store

2 KB
Binary file not shown.

0 commit comments

Comments
 (0)