From c1c7d3a1dbcc2fd2108acba60e9b33ba23a09bbb Mon Sep 17 00:00:00 2001 From: Lyla Fischer Date: Wed, 26 Sep 2012 16:13:16 -0400 Subject: [PATCH] added basic problem types --- .../templates/problem/circuitschematic.yaml | 131 ++++++++++++++++++ .../templates/problem/customgrader.yaml | 33 +++++ .../templates/problem/forumularesponse.yaml | 40 ++++++ .../templates/problem/imageresponse.yaml | 26 ++++ .../templates/problem/multiplechoice.yaml | 27 ++++ .../templates/problem/numericalresponse.yaml | 28 ++++ .../templates/problem/optionresponse.yaml | 19 +++ .../templates/problem/string_response.yaml | 41 ++++++ 8 files changed, 345 insertions(+) create mode 100644 common/lib/xmodule/xmodule/templates/problem/circuitschematic.yaml create mode 100644 common/lib/xmodule/xmodule/templates/problem/customgrader.yaml create mode 100644 common/lib/xmodule/xmodule/templates/problem/forumularesponse.yaml create mode 100644 common/lib/xmodule/xmodule/templates/problem/imageresponse.yaml create mode 100644 common/lib/xmodule/xmodule/templates/problem/multiplechoice.yaml create mode 100644 common/lib/xmodule/xmodule/templates/problem/numericalresponse.yaml create mode 100644 common/lib/xmodule/xmodule/templates/problem/optionresponse.yaml create mode 100644 common/lib/xmodule/xmodule/templates/problem/string_response.yaml diff --git a/common/lib/xmodule/xmodule/templates/problem/circuitschematic.yaml b/common/lib/xmodule/xmodule/templates/problem/circuitschematic.yaml new file mode 100644 index 0000000000..b07c114e67 --- /dev/null +++ b/common/lib/xmodule/xmodule/templates/problem/circuitschematic.yaml @@ -0,0 +1,131 @@ +--- +metadata: + display_name: Circuit Schematic +data: | + + + + + Your goal for this lab is to design a circuit that implements a + + 3-input logic gate that implements \(Z = \lnot{(C(A+B))}\) where the + \(\lnot\) symbol stands for logical negation. This function is + enumerated in the following truth table: + +
+      C B A | Z
+      =========
+      0 0 0 | 1
+      0 0 1 | 1
+      0 1 0 | 1
+      0 1 1 | 1
+      1 0 0 | 1
+      1 0 1 | 0
+      1 1 0 | 0
+      1 1 1 | 0
+      
+ + The schematic diagram below includes the resistive pullup for the logic + gate and some voltage sources that serve as the power supply and + generators for the signals that will be the inputs to the gate. + The voltage sources generate the three input signals (A, B and C), timed so that all + possible combinations of the inputs will be generated over a \(4\mu s\) + interval. + +

Please add the appropriate pulldown network of mosfet + switches connected to node Z to implement the truth table above, with + \(R_{ON}\) of the mosfets chosen so that \(V_{ol}\) of the logic gate is less than + \(0.25V\) for any combination of inputs. In the schematic tool, the mosfet + model has \(V_{th} = 0.5V\), so \(V_{ol} \lt 0.25V\) + will ensure that when the output of the logic gate is 0, if it is used + as the input to some other logic gate, the mosfet to which + it connects will be off. + +

On page 305 of the text we + see from Equation (6) that \(R_{ON} = R_n \frac{L}{W}\). In the + schematic tool, the mosfet model has \(R_n \approx 26.5k\Omega\) when + using a \(3V\) power supply. To adjust \(R_{ON}\), double click the + mosfet and select an appropriate value for the W/L parameter. For + example, setting a mosfet's W/L to 10 would result in \(R_{ON} = + 2.65k\Omega\). + +

Note that the "Plot offset" property of the scope probes + on the A, B and C signals has been set so that the plots will not + overlap, making it easier to see what's happening. + +

Please do not change the voltages of the voltage sources or the + resistance of the pullup resistor. + + + + +
+ +
+ + # for a schematic response, submission[i] is the json representation + # of the diagram and analysis results for the i-th schematic tag + + def get_tran(json,signal): + for element in json: + if element[0] == 'transient': + return element[1].get(signal,[]) + return [] + + def get_value(at,output): + for (t,v) in output: + if at == t: return v + return None + + output = get_tran(submission[0],'Z') + okay = True + + # output should be 1, 1, 1, 1, 1, 0, 0, 0 + if get_value(0.0000004,output) < 2.7: okay = False; + if get_value(0.0000009,output) < 2.7: okay = False; + if get_value(0.0000014,output) < 2.7: okay = False; + if get_value(0.0000019,output) < 2.7: okay = False; + if get_value(0.0000024,output) < 2.7: okay = False; + if get_value(0.0000029,output) > 0.25: okay = False; + if get_value(0.0000034,output) > 0.25: okay = False; + if get_value(0.0000039,output) > 0.25: okay = False; + + correct = ['correct' if okay else 'incorrect'] + + +
+ + + + When your circuit is ready for testing, run a \(4\mu s\) transient + simulation to verify correct functionality and appropriate \(V_{ol}\) + when the output of the gate is logic 0. To submit, please click + CHECK. The checker will be verifying the voltage of the + output node at several different times, so you'll earn a checkmark + only after you've performed the transient simulation so that + the checker will have a waveform to check! + +

Hint: you'll only need 3 mosfet switches to implement the gate. + +

When the gate is correctly implemented, the plot produced by the transient + analysis should like similar to the following figure. + +
+ +
Figure 1. Example plot output +
+ +

Food for thought: You'll notice there are little spikes, + sometimes called glitches, in the output waveform (see the + bottom cyan-colored waveform in Figure 1). These only occur when the + A and B inputs are changing simultaneously and the C input is high. + Can you explain why? Think about what is happening in the pulldown + circuitry at the time the glitches occur. + + + +
+children: [] diff --git a/common/lib/xmodule/xmodule/templates/problem/customgrader.yaml b/common/lib/xmodule/xmodule/templates/problem/customgrader.yaml new file mode 100644 index 0000000000..837f0669b7 --- /dev/null +++ b/common/lib/xmodule/xmodule/templates/problem/customgrader.yaml @@ -0,0 +1,33 @@ +--- +metadata: + display_name: Custom Grader +data: | + + +

Example: Custom Response Problem

+ +

+ A custom response problem accepts one or more lines of text input from the + student, and evaluates the inputs for correctness based on evaluation using a + python script embedded within the problem. +

+ + + + + Enter two integers which sum to 10:
+ +
+ +
+
+ +
+
+children: [] diff --git a/common/lib/xmodule/xmodule/templates/problem/forumularesponse.yaml b/common/lib/xmodule/xmodule/templates/problem/forumularesponse.yaml new file mode 100644 index 0000000000..d4df020419 --- /dev/null +++ b/common/lib/xmodule/xmodule/templates/problem/forumularesponse.yaml @@ -0,0 +1,40 @@ +--- +metadata: + display_name: Formula Repsonse +data: | + + +

Example: Formula Response Problem

+ +

+ A formula response problem accepts a line of text input from the + student, and evaluates the input for correctness based on numerical sampling of + the symbolic formula which is given. +

+ +

+ The answer is correct if it is within a specified numerical tolerance + of the expected answer. +

+ +

This kind of response checking can handle symbolic expressions, but places an extra burden + on the problem author to specify the allowed variables in the expression, and the + numerical ranges over which the variables must be sampled to test for correctness.

+ + + + +
+ Give an equation for the relativistic energy of an object with mass m. Explicitly indicate multiplication with a * symbol.
+
+ + +
E = +
+ +
+
+children: [] diff --git a/common/lib/xmodule/xmodule/templates/problem/imageresponse.yaml b/common/lib/xmodule/xmodule/templates/problem/imageresponse.yaml new file mode 100644 index 0000000000..8ca93d29dd --- /dev/null +++ b/common/lib/xmodule/xmodule/templates/problem/imageresponse.yaml @@ -0,0 +1,26 @@ +--- +metadata: + display_name: Image Response +data: | + + +

Example: Image Response Problem

+ +

+ When teaching conventionally, a common check for understanding is to ask the student to point + at something which satisfies a set of contraints. This use case is captured in the imageresponse. + An image response problem presents an image for the student. Input is + given by the location of mouse clicks on the image. Correctness of input can only be evaluated based on expected dimensions of a rectangle. + +

+ + + Click on the cow in this image: + + + + +
+
+ +children: [] diff --git a/common/lib/xmodule/xmodule/templates/problem/multiplechoice.yaml b/common/lib/xmodule/xmodule/templates/problem/multiplechoice.yaml new file mode 100644 index 0000000000..9d6d9dc5fc --- /dev/null +++ b/common/lib/xmodule/xmodule/templates/problem/multiplechoice.yaml @@ -0,0 +1,27 @@ +--- +metadata: + display_name: Multiple Choice +data: | + + +

Example: Multiple Choice Response Problem

+ +

+ A multiple choice response problem presents radio buttons for student + input. One or more of the choice may be correct.--> Correctness of + input is evaluated based on expected answers specified within each + "choice" stanza. +

+ +

Select the correct choice. Grass is:

+ + + Red + Green + Yellow + Blue + + +
+
+children: [] diff --git a/common/lib/xmodule/xmodule/templates/problem/numericalresponse.yaml b/common/lib/xmodule/xmodule/templates/problem/numericalresponse.yaml new file mode 100644 index 0000000000..8edc3f61ba --- /dev/null +++ b/common/lib/xmodule/xmodule/templates/problem/numericalresponse.yaml @@ -0,0 +1,28 @@ +--- +metadata: + display_name: Numerical Response +data: | + + +

Example: Numerical Response Problem

+ +

+ A numerical response problem accepts a line of text input from the + student, and evaluates the input for correctness based on its + numerical value. +

+ +

+ The answer is correct if it is within a specified numerical tolerance + of the expected answer. +

+ +

Enter the numerical value of Pi: + + + + +

+
+
+children: [] diff --git a/common/lib/xmodule/xmodule/templates/problem/optionresponse.yaml b/common/lib/xmodule/xmodule/templates/problem/optionresponse.yaml new file mode 100644 index 0000000000..95e19e369c --- /dev/null +++ b/common/lib/xmodule/xmodule/templates/problem/optionresponse.yaml @@ -0,0 +1,19 @@ +--- +metadata: + display_name: Option Response +data: | + + +

Example: Option Response Problem

+

+ An option response problem presents option boxes for students to select from. Correctness of input is evaluated based + on which option is defined as correct in the optioninput statement. +

+

Select the correct options:

+ +

The location of the sky is:

+

The location of the earth is:

+
+
+
+children: [] diff --git a/common/lib/xmodule/xmodule/templates/problem/string_response.yaml b/common/lib/xmodule/xmodule/templates/problem/string_response.yaml new file mode 100644 index 0000000000..28b89cf613 --- /dev/null +++ b/common/lib/xmodule/xmodule/templates/problem/string_response.yaml @@ -0,0 +1,41 @@ +--- +metadata: + display_name: String Response +data: | + + +

Example: String Response Problem

+

+ + A string response problem accepts a line of text input from the + student, and evaluates the input for correctness based on an expected + answer within each input box. + + The answer is correct if it is the expected answer. +

+
+ + +

Which US state has Lansing as its capital?    

+ + + + + + + + + The state capital of Wisconsin is Madison. + + + The state capital of Minnesota is St. Paul. + + + The state you are looking for is also known as the 'Great Lakes State' + + + +
+ +
+children: []