|
1 | 1 | <?xml version="1.0"?> |
2 | 2 | <section xml:id="writing-exercises_multiple-choice-questions"> |
3 | 3 | <title>Multiple Choice Questions</title> |
4 | | - <p>Another common question type is the multiple choice question.</p> |
5 | | - <program language="rst"> |
6 | | - <input> |
7 | | -.. mchoice:: uniqueid |
8 | | - :multiple_answers: boolean [optional] |
9 | | - :random: boolean [optional] |
10 | | - :answer_a: possible answer -- what follows _ is label |
11 | | - :answer_b: possible answer |
12 | | - :answer_c: possible answer |
13 | | - :answer_d: possible answer |
14 | | - :answer_e: possible answer |
15 | | - :correct: letter of correct answer or list of correct answer letters (in case of multiple answe |
16 | | - rs) |
17 | | - :feedback_a: displayed if a is picked |
18 | | - :feedback_b: displayed if b is picked |
19 | | - :feedback_c: displayed if c is picked |
20 | | - :feedback_d: displayed if d is picked |
21 | | - :feedback_e: displayed if e is picked |
22 | | - |
23 | | - Question text ... |
24 | | -</input> |
25 | | - </program> |
26 | | - <p>Here is an example from a Data Structures class:</p> |
27 | | - <exercise label="stack_2"> |
| 4 | + <p>A common question type is the multiple choice question like below.</p> |
| 5 | + |
| 6 | + <exercise label="java_mcq_2"> |
28 | 7 | <statement> |
29 | | - <p>3-1-1: Given the following sequence of stack operations, what is the top item on the stack when the sequence is complete?</p> |
30 | | - <program language="python"> |
31 | | - <input> |
32 | | -m = Stack() |
33 | | -m.push('x') |
34 | | -m.push('y') |
35 | | -m.push('z') |
36 | | -while not m.isEmpty(): |
37 | | - m.pop() |
38 | | - m.pop() |
39 | | -</input> |
| 8 | + <p>What does the following code print?</p> |
| 9 | + <program language="java"> |
| 10 | + <code> |
| 11 | +System.out.println(2 + 3 * 5 - 1); |
| 12 | + </code> |
40 | 13 | </program> |
41 | 14 | </statement> |
| 15 | + |
42 | 16 | <choices> |
43 | 17 | <choice> |
44 | 18 | <statement> |
45 | | - <p>'x'</p> |
| 19 | + <p>24</p> |
46 | 20 | </statement> |
| 21 | + |
47 | 22 | <feedback> |
48 | | - <p>You may want to check out the docs for isEmpty</p> |
| 23 | + <p> |
| 24 | + This would be true if it was System.out.println(((2 + 3) * 5) - 1), |
| 25 | + but without the parentheses the multiplication is done first. |
| 26 | + </p> |
49 | 27 | </feedback> |
50 | 28 | </choice> |
| 29 | + |
51 | 30 | <choice> |
52 | 31 | <statement> |
53 | | - <p>the stack is empty</p> |
| 32 | + <p>14</p> |
54 | 33 | </statement> |
| 34 | + |
55 | 35 | <feedback> |
56 | | - <p>There is an odd number of things on the stack but each time through the loop 2 things are popped.</p> |
| 36 | + <p> |
| 37 | + This would be true if it was System.out.println(2 + (3 * (5 - 1))), |
| 38 | + but without the parentheses the multiplication is done first and the |
| 39 | + addition and subtraction are handled from left to right. |
| 40 | + </p> |
57 | 41 | </feedback> |
58 | 42 | </choice> |
59 | | - <choice correct="yes"> |
| 43 | + |
| 44 | + <choice> |
60 | 45 | <statement> |
61 | | - <p>an error will occur</p> |
| 46 | + <p>This will give a compile time error.</p> |
62 | 47 | </statement> |
| 48 | + |
63 | 49 | <feedback> |
64 | | - <p>Good Job.</p> |
| 50 | + <p> |
| 51 | + This will compile and run. Try it in DrJava. Look up operator |
| 52 | + precedence in Java. |
| 53 | + </p> |
65 | 54 | </feedback> |
66 | 55 | </choice> |
67 | | - <choice> |
| 56 | + |
| 57 | + <choice correct="yes"> |
68 | 58 | <statement> |
69 | | - <p>'z'</p> |
| 59 | + <p>16</p> |
70 | 60 | </statement> |
| 61 | + |
71 | 62 | <feedback> |
72 | | - <p>You may want to check out the docs for isEmpty</p> |
| 63 | + <p> |
| 64 | + Correct! Remember PEMDAS. The multiplication is done first (3 * 5 = 15) and then the addition (2 + 15 = 17) and finally the subtraction (17 - 1 = 16). |
| 65 | + </p> |
73 | 66 | </feedback> |
74 | 67 | </choice> |
75 | 68 | </choices> |
76 | 69 | </exercise> |
77 | | - <p>The source code is here:</p> |
78 | | - <program language="rst"> |
79 | | - <input> |
80 | | -.. mchoice:: stack_2 |
81 | | - :answer_a: 'x' |
82 | | - :answer_b: the stack is empty |
83 | | - :answer_c: an error will occur |
84 | | - :answer_d: 'z' |
85 | | - :correct: c |
86 | | - :feedback_a: You may want to check out the docs for isEmpty |
87 | | - :feedback_b: There is an odd number of things on the stack but each time through the loop 2 things are popped. |
88 | | - :feedback_c: Good Job. |
89 | | - :feedback_d: You may want to check out the docs for isEmpty |
90 | | - |
91 | | - Given the following sequence of stack operations, what is the top item on the stack when the sequence is complete? |
92 | | - |
93 | | - .. code-block:: python |
94 | | - |
95 | | - m = Stack() |
96 | | - m.push('x') |
97 | | - m.push('y') |
98 | | - m.push('z') |
99 | | - while not m.isEmpty(): |
100 | | - m.pop() |
101 | | - m.pop() |
102 | | -</input> |
103 | | - </program> |
| 70 | + <p>To create multiple choice questions, start or go to any assignment in the Instructor Dashboard "Assignment Builder". In the Exercises section of the assignment, click on "Add Exercise" and select "+ Create New Exercise" and then select "Multiple Choice".</p> |
| 71 | + <figure align="center" xml:id="mcq_fig"> |
| 72 | + <caption>Choose Multiple Choice Exercise</caption> |
| 73 | + <image source="Figures/exerciseMultipleChoice.png" width="100%" alt="Choose Multiple Choice Question"/> |
| 74 | + </figure> |
| 75 | + <p>Enter the question. Type in / and press enter to see the menu to format the text and add in images, tables, code blocks, etc. You can also just use Markdown syntax directly (<url href="https://www.markdownguide.org/cheat-sheet/">Markdown Cheat Sheet</url>) and put code in between backticks (`) for inline code or triple backticks (```) for code blocks.</p> |
| 76 | +<figure align="center" xml:id="mcq_edit_fig"> |
| 77 | + <caption>Create a Multiple Choice Question</caption> |
| 78 | + <image source="Figures/createMCQ.png" width="100%" alt="Create a Multiple Choice Question"/> |
| 79 | + </figure> |
| 80 | + <p>Click on Next or 2 to move to the Options tab and enter the multiple choice options. Click on Add Option to add more options. Click on the checkmark next to "Correct" to mark a correct option. You can mark more than one answer as correct. You can also add feedback for each choice that will be shown to the student after they answer the question. Do / and enter to see the format menu or use markdown for each option.</p> |
| 81 | + <figure align="center" xml:id="mcq_options_fig"> |
| 82 | + <caption>Enter Multiple Choice Options</caption> |
| 83 | + <image source="Figures/mcqOptions.png" width="100%" alt="Enter Multiple Choice Options"/> |
| 84 | + </figure> |
| 85 | + <p>Click on Next or 3 to move to the Settings tab. Here you can set the chapter and section where you want the exercise stored in the assignment builder (where it will show when browsing chapters in the assignment builder), the author, the topic, the number of points for the question, and add tags to help you find the question later. If you change the name of the exercise, make sure it is unique! Some authors put their author names in the exercise name too to make them easier to find. You can also choose to make the exercise private or contribute it to the question bank for other teachers to use. Please make experimental questions private. </p> |
| 86 | + <figure align="center" xml:id="mcq_settings_fig"> |
| 87 | + <caption>Set Multiple Choice Question Settings</caption> |
| 88 | + <image source="Figures/mcqSettings.png" width="100%" alt="Set Multiple Choice Question Settings"/> |
| 89 | + </figure> |
| 90 | + <p>Make sure that you Preview the exercise in step 4 and test it before saving it. Although there is no way to delete an exercise once it is saved, you can always edit it later to fix mistakes, make it private, or flag it for the volunteers to fix or delete.</p> |
104 | 91 | </section> |
0 commit comments