.. raw:: latex
\newpage %
==========================
APPENDIX E: Problem Types
==========================
Option Response
===============
The Option Response input type allows the student to choose from a collection of
answer options, presented as a drop-down list.
Option Response is structurally similar to Multiple Choice. Some conceptual
differences between the two include the following.
* The Multiple Choice radio button format makes it easier for students to read very long response options.
* The Option Response drop-down input format makes it more likely for students to think of an answer and then search for it, rather than relying purely on recognition to answer the question. The Multiple Choice format is more explicit and visual. This makes it a more appropriate choice for presenting tricky or complicated answer options which are intended to get the student to pause and think.
Sample Problem:
.. image:: ../Images/image287.png
:width: 600
**Problem Code:**
.. code-block:: xml
Option Response is most similar to __________.
1
Explanation
Like Option Response, Multiple Choice also allows students to select
from a variety of pre-written responses.
**Template**
.. code-block:: xml
options="('A','B')"
correct="A"/>
**XML Attribute Information**
.. image:: ../Images/option_response1.png
.. image:: ../Images/optionresponse2.png
.. raw:: latex
\newpage %
Multiple Choice
===============
The Multiple Choice input type allows the student to select at most one choice
from a collection of answer choices, presented as a list of radio buttons.
A Multiple Choice problem can have more than one correct answer, depending on
how many choices are marked as correct in the underlying XML. If all choices are
marked as incorrect, there is no correct response.
Multiple Choice is structurally similar to Option Response. Some conceptual
differences between the two include the following.
• The Multiple Choice radio button format makes it easier for students to read very long response options.
• The Option Response drop-down input format makes it more likely for students to think of an answer and then search for it, rather than relying purely on recognition to answer the question.
• The Multiple Choice format is more explicit and visual. This makes it a more appropriate choice for presenting tricky or complicated answer options which areintended to get the student to pause and think.
Sample Problem:
.. image:: ../Images/image289.png
:width: 600
**Problem Code:**
.. code-block:: xml
Example Problem
How many correct responses can a Multiple Choice question have?
Only one
Only zero or one
Zero or more
Only one or more
Nobody knows
Somebody might know :)
Explanation
It depends on how many choices are marked as correct in the underlying XML.
Note that if all choices are marked as incorrect, there is no
correct response.
**Template**
.. code-block:: xml
A
B
**XML Attribute Information**
.. image:: ../Images/multipleresponse.png
.. image:: ../Images/multipleresponse2.png
.. image:: ../Images/multipleresponse3.png
.. raw:: latex
\newpage %
Checkbox
========
The Checkbox input type allows the student to select zero or more choices from a
collection of answer choices, presented as a list of checkboxes.
Remark: Questions with one Checkbox input type have exactly one correct
response. All the choices marked as correct="true" have to be selected for the
submitted answer (i.e. the response) to be considered correct.
In particular, the response of no boxes checked off could be the single correct
response, and a Checkbox question, unlike a Multiple Choice question, cannot
have zero correct responses.
Sample Problem:
.. image:: ../Images/image290.png
:width: 600
**Problem Code:**
.. code-block:: xml
How many correct responses can a Checkbox question have?
Zero
One
Two or more
Nobody knows
Somebody might know :)
**Template**
.. code-block:: xml
Zero
One
.. raw:: latex
\newpage %
String Response
===============
The String Response input type provides an input box in which the student can
enter a line of text, which is then checked against a specified expected answer.
A String Response input does not provide any answer suggestions, so it can be a
good way to get the students to engage with the material more deeply in a
sequence and look up, figure out, or remember the correct answer themselves.
Note that a student's answer in a String Response is marked as correct if it
matches every character of the expected answer. This can be a problem with
international spelling, dates, or anything where the format of the answer is not
clear.
Sample Problem:
.. image:: ../Images/image291.png
:width: 600
**Problem Code:**
.. code-block:: xml
Example Problem
What is the name of this unit? (What response type is this?)
Explanation
The name of this unit is "String Response," written without the punctuation.
Arbitrary capitalization is accepted.
**Template**
.. code-block:: xml
**XML Attribute Information**
.. image:: ../Images/stringresponse.png
.. image:: ../Images/stringresponse2.png
.. raw:: latex
\newpage %
Numerical Response
==================
The Numerical Response input type accepts a line of text input from the student
and evaluates the input for correctness based on its numerical value. The input
is allowed to be a number or a mathematical expression in a fixed syntax.
The answer is correct if it is within a specified numerical tolerance of the
expected answer.
The expected answer can be specified explicitly or precomputed by a Python
script.
Accepted input types include ```` and ````.
However, the math display on ```` uses a different parser
and has different capabilities than the response type--this may lead to student
confusion. For this reason, we strongly urge using ````
only, and the examples below show its use.
Sample Problem:
.. image:: ../Images/image292.png
:width: 600
**Problem Code**:
.. code-block:: xml
Example Problem
What base is the decimal numeral system in?
What is the value of the standard gravity constant g, measured in m/s2? Give your answer to at least two decimal places.
What is the distance in the plane between the points (pi, 0) and (0, e)? You can type math.
Explanation
The decimal numerical system is base ten.
The standard gravity constant is defined to be precisely 9.80665 m/s2.
This is 9.80 to two decimal places. Entering 9.8 also works.
By the distance formula, the distance between two points in the plane is
the square root of the sum of the squares of the differences of each coordinate.
Even though an exact numerical value is checked in this case, the
easiest way to enter this answer is to type
sqrt(pi^2+e^2) into the editor.
Other answers like sqrt((pi-0)^2+(0-e)^2) also work.
**Templates**
Exact values
.. code-block:: xml
Answers with decimal precision
.. code-block:: xml
Answers with percentage precision
.. code-block:: xml
Answers with scripts
.. code-block:: xml
**XML Attribute Information**
E =
Let x be a variable, and let n be an arbitrary constant. What is the derivative of xn?
Explanation
Use standard arithmetic operation symbols and indicate multiplication explicitly.
Use the symbol ^ to raise to a power.
Use parentheses to specify order of operations.
XML Attribute Information
This question consists of two parts.
First, enter two integers which sum to 10.
Now enter two (finite) decimals which sum to 20.
Explanation
For the first part, any two numbers of the form n
and 10-n, where n is any integer, will work.
One possible answer would be the pair 0 and 10.
For the second part, any pair x and 20-x will work, where x is any real number with a finite decimal representation. Both inputs have to be entered either in standard decimal notation or in scientific exponential notation. One possible answer would be the pair 0.5 and 19.5. Another way to write this would be 5e-1 and 1.95e1.
**Templates**
*With displayed suggested correct answers*
.. code-block:: xml
Enter two real numbers which sum to 20:
**Templates**
*With NO suggested correct answers*
.. code-block:: xml
Enter two real numbers which sum to 20:
.. raw:: latex
\newpage %
Chemical Equation Response
==========================
The Chemical Equation Response input type is a special type of Custom Response
that allows the student to enter chemical equations as answers.
Sample Problem:
.. image:: ../Images/image296.png
:width: 600
**Problem Code**:
.. code-block:: xml
Example Problem
Some problems may ask for a particular chemical equation. Practice by writing out the following reaction in the box below.
\( \text{H}_2\text{SO}_4 \longrightarrow \text{ H}^+ + \text{ HSO}_4^-\)
if chemcalc.chemical_equations_equal(submission[0], 'H2SO4 -> H^+ + HSO4^-'):
correct = ['correct']
else:
correct = ['incorrect']
Some tips:
- Only real element symbols are permitted.
- Subscripts are entered with plain text.
- Superscripts are indicated with a caret (^).
- The reaction arrow (\(\longrightarrow\)) is indicated with "->".
So, you can enter "H2SO4 -> H^+ + HSO4^-".
.. raw:: latex
\newpage %
Schematic Response
==================
The Schematic Response input type provides an interactive grid on which the
student can construct a schematic answer, such as a circuit.
Sample Problem:
.. image:: ../Images/image297.png
:width: 600
.. image:: ../Images/image298.png
:width: 600
.. image:: ../Images/image299.png
:width: 600
**Problem Code**:
.. code-block:: xml
Make a voltage divider that splits the provided voltage evenly.
dc_value = "dc analysis not found"
for response in submission[0]:
if response[0] == 'dc':
for node in response[1:]:
dc_value = node['output']
if dc_value == .5:
correct = ['correct']
else:
correct = ['incorrect']
Make a high pass filter.
ac_values = None
for response in submission[0]:
if response[0] == 'ac':
for node in response[1:]:
ac_values = node['NodeA']
print "the ac analysis value:", ac_values
if ac_values == None:
correct = ['incorrect']
elif ac_values[0][1] < ac_values[1][1]:
correct = ['correct']
else:
correct = ['incorrect']
Explanation
A voltage divider that evenly divides the input voltage can be formed with two identically valued resistors, with the sampled voltage taken in between the two.

A simple high-pass filter without any further constaints can be formed by simply putting a resister in series with a capacitor. The actual values of the components do not really matter in order to meet the constraints of the problem.
