You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 7, 2023. It is now read-only.
Copy file name to clipboardExpand all lines: runestone/common/project_template/_sources/overview.rst
+83-71Lines changed: 83 additions & 71 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,6 +66,12 @@ environment for learning a programming language like Python since you can experi
66
66
67
67
Take a look at the activecode interpreter in action. If we take a simple Python program and make it active, you will see that it can be executed directly by pressing the *run* button. Try pressing the *run* button below.
68
68
69
+
.. datafile:: df1
70
+
71
+
def main():
72
+
print("Hello world")
73
+
return 45
74
+
69
75
.. activecode:: codeexample1
70
76
:coach:
71
77
@@ -183,48 +189,44 @@ Finally, it is also possible to embed simple questions into the text. These
183
189
questions provide a way for the students to check themselves as they go along. The questions also provide feedback so that you can
184
190
understand why an answer may or may not be correct.
185
191
186
-
**Check your understanding**
187
-
188
-
.. mchoicemf:: question1_1
189
-
:answer_a: Python
190
-
:answer_b: Java
191
-
:answer_c: C
192
-
:answer_d: ML
193
-
:correct: a
194
-
:feedback_a: Yes, Python is a great language to learn, whether you are a beginner or an experienced programmer.
195
-
:feedback_b: Java is a good object oriented language but it has some details that make it hard for the beginner.
196
-
:feedback_c: C is an imperative programming language that has been around for a long time, but it is not the one that we use.
197
-
:feedback_d: No, ML is a functional programming language. You can use Python to write functional programs as well.
198
192
199
-
What programming language does this site help you to learn?
193
+
.. mchoice:: 1524142112
194
+
:correct: b
195
+
:answer_a: Peanuts
196
+
:answer_b: Cashews
197
+
:feedback_a: They're ok, but cashews are better.
198
+
:feedback_b: Good job.
200
199
200
+
Peanuts or cashews?
201
201
202
202
This next type of question allows more than one correct answer to be required. The feedback will tell you whether you have the
203
203
correct number as well as the feedback for each.
204
204
205
205
206
-
.. mchoicema:: question1_2
207
-
:answer_a: red
208
-
:answer_b: yellow
209
-
:answer_c: black
210
-
:answer_d: green
211
-
:correct: a,b,d
212
-
:feedback_a: Red is a definitely on of the colors.
213
-
:feedback_b: Yes, yellow is correct.
214
-
:feedback_c: Remember the acronym...ROY G BIV. B stands for blue.
215
-
:feedback_d: Yes, green is one of the colors.
216
-
217
-
Which colors might be found in a rainbow? (choose all that are correct)
206
+
.. mchoice:: 152414d
207
+
:multiple_answers:
208
+
:correct: a, c
209
+
:random:
210
+
:answer_a: Hi
211
+
:answer_b: Bye
212
+
:answer_c: Aloha
213
+
:feedback_a: Feedback for Hi
214
+
:feedback_b: Feedback for Bye
215
+
:feedback_c: Feedback for Aloha
218
216
217
+
Here is the question...
219
218
220
219
Another type of question allows you as the instructor to ask for a value. You can test for the value using Pythons regular expressions. For example:
221
220
222
-
.. fillintheblank:: baseconvert1
223
-
:correct:\\b31\\b
224
-
:blankid: baseconvert1_ans1
225
221
226
-
What is value of 25 expressed as an octal number (base 8) :textfield:`baseconvert1_ans1::mini`
222
+
.. fillintheblank:: fill1412
227
223
224
+
.. blank:: blank21
225
+
:correct:\\bblue\\b
226
+
:feedback1: ("\\bred\\b", "You are an awful person.")
227
+
:feedback2: (".*", "(Hint: Sail Norse)")
228
+
229
+
What is the best color?
228
230
229
231
And finally here is a way of giving your students some simple programming problems where the code is already there for them but not indented or in the correct order. Use drag-and-drop to get everthing right.
230
232
@@ -285,48 +287,58 @@ Please note that you can currently only have one timed exam per html page.
285
287
286
288
It currently needs at least 4 directives to function: starttimer, revealquestions, timedmchoicemf, and finishtimer. You can have as many timedmchoicemf as you want. The time is specified in minutes using the :duration option in starttimer.
287
289
288
-
.. starttimer:: Start
289
-
:duration: 38
290
-
291
-
.. revealquestions:: timed_Test
292
-
:showtitle: Timed Exam Paused or Not Started
293
-
:hidetitle: Currently Taking Timed Exam
294
-
295
-
.. timedmchoicemf:: te_1
296
-
:answer_a: The value you are searching for is the first element in the array.
297
-
:answer_b: The value you are searching for is the last element in the array
298
-
:answer_c: The value you are searching for is in the middle of the array.
299
-
:answer_d: The value you are searching for is not in the array
300
-
:answer_e: Sequential Search can never be faster than Binary Search.
301
-
:correct: a
302
-
:feedback_a: Only when the search value is the first item in the array, and thus the first value encountered in sequential search, will sequential be faster than binary.
303
-
:feedback_b: In this case a sequential search will have to check every element before finding the correct one, whereas a binary search will not.
304
-
:feedback_c: Results will differ depending on the exact location of the element, but Binary Search will still find the element faster while Sequential will have to check more elements.
305
-
:feedback_d: If the search value is not in the array, a sequential search will have to check every item in the array before failing, a binary search will be faster.
306
-
:feedback_e: When the search value is the first element, Sequential will always be faster, as it will only need to check one element.
307
-
308
-
Under which of these conditions will a sequential search be faster than a binary search?
309
-
310
-
.. timedmchoicemf:: te_2
311
-
:answer_a: (c || d)
312
-
:answer_b: (c && d)
313
-
:answer_c: (!c) || (!d)
314
-
:answer_d: !(c && d)
315
-
:answer_e: (!c) && (!d)
316
-
:correct: e
317
-
:feedback_a: NOTing an OR expression does not result in the same values ORed.
318
-
:feedback_b: You do negate the OR to AND, but you also need to negate the values of d and d.
319
-
:feedback_c: This would be equivalent to (!(c && d)) using De Morgans laws.
320
-
:feedback_d: This would be equivalent to (!c || !d)
321
-
:feedback_e: NOTing (negating) an OR expression is the same as the AND of the individual values NOTed (negated). See De Morgans laws.
322
-
323
-
Which of the following expressions is equivalent to the following?
324
-
325
-
.. code-block:: java
326
-
327
-
!(c || d)
328
-
329
-
.. finishtimer:: Finish
290
+
.. timed:: timed1
291
+
:timelimit: 10
292
+
293
+
.. mchoice:: 1524142112
294
+
:timed:
295
+
:correct: a
296
+
:answer_a: Red pill
297
+
:answer_b: Blue pill
298
+
:feedback_a: Time to see how far the rabbit hole goes.
299
+
:feedback_b: Wrong answer.
300
+
301
+
Choose the red pill or the blue pill...
302
+
303
+
304
+
305
+
.. mchoice:: 152414d
306
+
:timed:
307
+
:multiple_answers:
308
+
:correct: a, c
309
+
:answer_a: Answer a
310
+
:answer_b: Answer b
311
+
:answer_c: Answer c
312
+
:feedback_a: Feedback for a
313
+
:feedback_b: Feedback for b
314
+
:feedback_c: Feedback for c
315
+
316
+
Here is the question...
317
+
318
+
.. fillintheblank:: fill1412
319
+
:timed:
320
+
321
+
.. blank:: blank21
322
+
:correct:\\b31\\b
323
+
:feedback1: ("\\b25\\b", "NOOOOOOOOO NOT 25")
324
+
:feedback2: (".*", "You don't know your octal numbers...")
325
+
326
+
What is the octal of 25? Don't say 25.
327
+
328
+
.. blank:: blank123
329
+
:correct: 12
330
+
:feedback1: (".*", "There's no 12 in that string!")
0 commit comments