@@ -219,7 +219,7 @@ Python script that you create and embed in the problem. These problems
...
@@ -219,7 +219,7 @@ Python script that you create and embed in the problem. These problems
can be any type. Numerical input and text input problems are the most
can be any type. Numerical input and text input problems are the most
popular write-your-own-grader.
popular write-your-own-grader.
.. image:: Images/WriteYourOwnGraderExample.gif
.. image:: Images/CustomPythonExample.png
:alt: Image of a write your own grader problem
:alt: Image of a write your own grader problem
Create a Write-Your-Own-Grader Problem
Create a Write-Your-Own-Grader Problem
...
@@ -295,22 +295,53 @@ To create a image mapped input problem:
...
@@ -295,22 +295,53 @@ To create a image mapped input problem:
Math Expression Input
Math Expression Input
---------------------
---------------------
In math expression input problems, students enter text that represents
In math expression input problems, students enter text that represents a mathematical expression into a field, and the LMS changes that text to a symbolic expression that appears below that field.
a mathematical expression, and Studio changes that text to a symbolic
expression that appears below the field where the student is typing.
Unlike numerical input problems, which only allow integers and a few
select constants, math expression problems can include more complicated
symbolic expressions.
When you create a math expression input problem for your students in
.. image:: Images/MathExpressionInputExample.gif
Studio, you'll use `MathJax <http://www.mathjax.org>`_ to change your
:alt: Image of math expression input problem
plain text into "beautiful math." For more information about how to use
MathJax in Studio, see :ref:`MathJax in Studio`.
Unlike numerical input problems, which only allow integers and a few select constants, math expression problems can include unknown variables and more complicated symbolic expressions. The grader uses a numerical sampling to determine whether the student's response matches the instructor-provided math expression, to a specified numerical tolerance. The instructor must specify the allowed variables in the expression as well as the range of values for each variable.
.. warning:: Math expression input problems cannot currently include negative numbers raised to fractional powers, such as (-1)^(1/2). Math expression input problems can include complex numbers raised to fractional powers, or positive non-complex numbers raised to fractional powers.
.. warning:: Math expression input problems cannot currently include negative numbers raised to fractional powers, such as (-1)^(1/2). Math expression input problems can include complex numbers raised to fractional powers, or positive non-complex numbers raised to fractional powers.
.. image:: Images/MathExpressionInputExample.gif
When you create a math expression input problem in Studio, you'll use `MathJax <http://www.mathjax.org>`_ to change your plain text into "beautiful math." For more information about how to use MathJax in Studio, see :ref:`MathJax in Studio`.
:alt: Image of math expression input problem
The LMS automatically converts the following Greek letter names into the corresponding Greek characters when a student types them in the answer field:
.. list-table::
:widths: 20 20 20 20
:header-rows: 0
* - alpha
- beta
- gamma
- delta
* - epsilon
- varepsilon
- zeta
- eta
* - theta
- vartheta
- iota
- kappa
* - lambda
- mu
- nu
- xi
* - pi
- rho
- sigma
- tau
* - upsilon
- phi
- varphi
- chi
* - psi
- omega
-
-
note:: ``epsilon`` is the lunate version, whereas ``varepsilon`` looks like a backward 3.
This appendix provides information about the XML for most problem and tool types in Studio:
===============
The Option Response input type allows the student to choose from a collection of
:ref:`Checkbox`
answer options, presented as a drop-down list.
:ref:`Chemical Equation Response`
:ref:`Custom Response`
:ref:`Formula Response`
:ref:`Image Response`
:ref:`Multiple Choice`
:ref:`Numerical Response`
:ref:`Option Response`
:ref:`Schematic Response`
:ref:`String Response`
Option Response is structurally similar to Multiple Choice. Some conceptual
.. _Checkbox:
differences between the two include the following.
* The Multiple Choice radio button format makes it easier for students to read very long response options.
Choice Response (Checkbox)
---------------------------
* 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.
**To designate an answer as correct, add correct="true"**
**Available in Simple Editor**
Sample Problem:
Sample Problem:
.. image:: ../Images/image287.png
.. image:: ../Images/CheckboxExample.gif
:width: 600
:alt: Image of a checkbox problem
:alt: Image of an option response problem
**Problem Code:**
**Sample Problem XML**
.. code-block:: xml
.. code-block:: xml
<problem>
<problem>
<startouttext/>
<p>Learning about the benefits of preventative healthcare can be particularly difficult. Check all of the reasons below why this may be the case.</p>
<p>Option Response is most similar to __________.</p>
<choiceresponse>
<checkboxgroup>
<optionresponse>
<choice correct="true"><text>A large amount of time passes between undertaking a preventative measure and seeing the result.</text></choice>
<optioninput
<choice correct="false"><text>Non-immunized people will always fall sick.</text></choice>
options="('Multiple Choice','String Response',
<choice correct="true"><text>If others are immunized, fewer people will fall sick regardless of a particular individual's choice to get immunized or not.</text></choice>
'Numerical Response','External Response',
<choice correct="true"><text>Trust in healthcare professionals and government officials is fragile.</text></choice>
'Image Response')"
</checkboxgroup>
correct="Multiple Choice"/>1
</optionresponse>
<solution>
<solution>
<div class="detailed-solution">
<div class="detailed-solution">
<p>Explanation</p>
<p>Explanation</p>
<p>Like Option Response, Multiple Choice also allows students to select
<p>People who are not immunized against a disease may still not fall sick from the disease. If someone is trying to learn whether or not preventative measures against the disease have any impact, he or she may see these people and conclude, since they have remained healthy despite not being immunized, that immunizations have no effect. Consequently, he or she would tend to believe that immunization (or other preventative measures) have fewer benefits than they actually do.</p>
**TEMPLATE? DO WE HAVE MORE INFORMATION ABOUT HOW TO CREATE THESE?**
**DO THESE WORK?**
.. image:: ../Images/option_response1.png
The chemical equation problem type allows the student to enter chemical equations. The grader evaluates student responses by using a Python script that you create and embed in the problem.
**Sample Problem**
<optioninput>
.. image:: ../Images/ChemicalEquationExample.png
:alt: Image of a chemical equation response problem
.. image:: ../Images/optionresponse2.png
**Sample Problem XML**:
.. code-block:: xml
.. raw:: latex
<problem>
<startouttext/>
<p>Some problems may ask for a particular chemical equation. Practice by writing out the following reaction in the box below.</p>
if chemcalc.chemical_equations_equal(submission[0], 'H2SO4 -> H^+ + HSO4^-'):
===============
correct = ['correct']
else:
correct = ['incorrect']
</answer>
</customresponse>
<p>Some tips:</p>
<ul>
<li>Use real element symbols.</li>
<li>Create subscripts by using plain text.</li>
<li>Create superscripts by using a caret (^).</li>
<li>Create the reaction arrow (\(\longrightarrow\)) by using "->".</li>
</ul>
The Multiple Choice input type allows the student to select at most one choice
<endouttext/>
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
<solution>
how many choices are marked as correct in the underlying XML. If all choices are
<div class="detailed-solution">
marked as incorrect, there is no correct response.
<p>Solution</p>
<p>To create this equation, enter the following:</p>
<p>H2SO4 -> H^+ + HSO4^-</p>
</div>
</solution>
</problem>
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.
.. _Custom Response:
• 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.
Custom Response ("Write-Your-Own-Grader")
------------------------------------------
• 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.
In write-your-own-grader problems (also called “custom Python-evaluated input” problems), the grader evaluates a student’s response using a Python script that you create and embed in the problem. Students can enter more than one line of text.
Sample Problem:
**Sample Problem**
.. image:: ../Images/image289.png
.. image:: ../Images/CustomPythonExample.png
:width: 600
:alt: Image of a custom response problem
:alt: Image of a multiple choice problem
**Problem Code:**
**Sample Problem XML**:
.. code-block:: xml
.. code-block:: xml
<problem>
<problem>
<p><b>Example Problem</b></p>
<p>This question has two parts.</p>
<p>How many correct responses can a Multiple Choice question have?</p>
<p>Part 1: Enter two integers that sum to 10. </p>
<customresponse cfn="test_add_to_ten">
<textline size="10" correct_answer="3"/><br/>
<textline size="10" correct_answer="7"/>
</customresponse>
<p>Part 2: Enter two integers that sum to 20. </p>
<customresponse cfn="test_add" expect="20">
<textline size="10"/><br/>
<textline size="10"/>
</customresponse>
<solution>
<solution>
<div class="detailed-solution">
<div class="detailed-solution">
<p>Explanation</p>
<p>Explanation</p>
<p>It depends on how many choices are marked as correct in the underlying XML.</p>
<p>For part 1, any two numbers of the form <i>n</i> and <i>10-n</i>, where <i>n</i> is any integer, will work. One possible answer would be the pair 0 and 10.</p>
<p>Note that if all choices are marked as incorrect, there is no
<p>For part 2, any pair <i>x</i> and <i>20-x</i> will work, where <i>x</i> 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.</p>
correct response.</p>
</div>
</div>
</solution>
</solution>
</problem>
</problem>
**Templates**
**Template**
The following template includes suggested correct answers (to include these, add a ``correct_answer`` attribute to the ``<textline>`` tag).
.. code-block:: xml
.. code-block:: xml
<problem>
<problem>
<multiplechoiceresponse>
<script type="loncapa/python">
<choicegroup type="MultipleChoice">
def test_add(expect,ans):
<choice correct="false" name="a">A</choice>
a1=float(ans[0])
<choice correct="true" name="b">B</choice>
a2=float(ans[1])
</choicegroup>
return (a1+a2)== float(expect)
</multiplechoiceresponse>
</script>
<p>Enter two real numbers that sum to 20: </p>
<customresponse cfn="test_add" expect="20">
<textline size="10" correct_answer="11"/><br/>
<textline size="10" correct_answer="9"/>
</customresponse>
<solution>
<solution>
<div class="detailed-solution">
<div class="detailed-solution">
</div>
</div>
</solution>
</solution>
</problem>
</problem>
The following template does not include suggested correct answers.
**XML Attribute Information**
.. code-block:: xml
<problem>
<multiplechoiceresponse>
<script type="loncapa/python">
def test_add(expect,ans):
a1=float(ans[0])
a2=float(ans[1])
return (a1+a2)== float(expect)
</script>
.. image:: ../Images/multipleresponse.png
<p>Enter two real numbers that sum to 20: </p>
<customresponse cfn="test_add" expect="20">
<textline size="10" /><br/>
<textline size="10" />
</customresponse>
<choicegroup>
<solution>
<div class="detailed-solution">
</div>
</solution>
</problem>
.. image:: ../Images/multipleresponse2.png
.. _Formula Response:
Formula Response (Math Expression Input Problems)
-------------------------------------------------
<choice>
**Sample Problem**
.. image:: ../Images/multipleresponse3.png
.. image:: ../Images/MathExpressionInput_XML.png
:width: 600
:alt: Image of a math expression input problem
**Sample Problem XML**
.. raw:: latex
.. code-block:: xml
\newpage %
<problem>
<p>Some problems may ask for a mathematical expression. Practice creating mathematical expressions by answering the questions below.</p>
<p>Notes:</p>
<ul>
<li>Use standard arithmetic operation symbols.</li>
<li>Indicate multiplication explicitly by using an asterisk (*).</li>
<li>Use a caret (^) to raise to a power.</li>
<li>Use an underscore (_) to indicate a subscript.</li>
<li>Use parentheses to specify the order of operations.</li>
</ul>
<p>Write an expression for the product of R_1, R_2, and the inverse of R_3.</p>
The String Response input type provides an input box in which the student can
Image Response
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
The Image Response input type presents an image and accepts clicks on the image as an answer.
good way to get the students to engage with the material more deeply in a
Images have to be uploaded to the courseware Assets directory. Response clicks are marked as correct if they are within a certain specified sub rectangle of the image canvas.
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
*Note The Mozilla Firefox browser is currently not supported for this problem type.*
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:
Sample Problem:
.. image:: ../Images/image291.png
.. image:: ../Images/image294.png
:width: 600
:width: 600
:alt: Image of a string response problem
**Problem Code:**
**Problem Code**:
.. code-block:: xml
.. code-block:: xml
<problem>
<problem>
<p><b>Example Problem</b></p>
<p><b>Example Problem</b></p>
<p>What is the name of this unit? (What response type is this?)</p>
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 are intended to get the student to pause and think.
Sample Problem:
.. image:: ../Images/image289.png
:width: 600
:alt: Image of a multiple choice problem
**Problem Code:**
.. code-block:: xml
.. code-block:: xml
<problem>
<problem>
<stringresponse answer="REPLACE_THIS" type="ci">
<p><b>Example Problem</b></p>
<textline size="20"/>
<p>How many correct responses can a Multiple Choice question have?</p>
<td>(optional) “[ci] [regex]”. Add “ci” if the student response should be graded case-insensitively. The default is to take case into consideration when grading. Add “regexp” for correct answer to be treated as regular expression.</td>
<td> </td>
</tr>
<tr class="row-odd"><td>answer</td>
<td>The string that is used to compare with student answer. If "regexp" is not presented in value of <em>type</em> attribute, student should enter value equal to exact value of this attribute in order to get credit. If "regexp" is presented in value of <em>type</em> attribute, value of <em>answer</em> is treated as regular expression and exact match of this expression and student answer will be done. If search is successful, student will get credit.</td>
* The Multiple Choice radio button format makes it easier for students to read very long response options.
kappa lambda mu nu xi pi rho sigma tau upsilon phi varphi chi psi omega``
Note: ``epsilon`` is the lunate version, whereas ``varepsilon`` looks like a
* 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.
backward 3.
Sample Problem:
Sample Problem:
.. image:: ../Images/image293.png
.. image:: ../Images/image287.png
:width: 600
:width: 600
:alt: Image of a formula response problem
:alt: Image of an option response problem
**Problem Code**:
**Problem Code:**
.. code-block:: xml
.. code-block:: xml
<problem>
<problem>
<p><b>Example Problem</b></p>
<p>This is a short introduction to the Formula Response editor.</p>
<p>Write an expression for the product of R_1, R_2, and the inverse of R_3.</p>
The Image Response input type presents an image and accepts clicks on the image as an answer.
Images have to be uploaded to the courseware Assets directory. Response clicks are marked as correct if they are within a certain specified sub rectangle of the image canvas.
*Note The Mozilla Firefox browser is currently not supported for this problem type.*
Sample Problem:
.. image:: ../Images/image294.png
:width: 600
**Problem Code**:
.. code-block:: xml
<problem>
<p><b>Example Problem</b></p>
<startouttext/>
<p>You are given three shapes. Click on the triangle.</p>
A Custom Response input type accepts one or more lines of text input from the student and evaluate the inputs for correctness using an embedded Python script.
Sample Problem:
.. image:: ../Images/image295.png
:width: 600
:alt: Image of a custom response problem
**Problem Code**:
.. code-block:: xml
<problem>
<p><b>Example Problem</b></p>
<script type="loncapa/python">
def test_add_to_ten(expect,ans):
try:
a1=int(ans[0])
a2=int(ans[1])
except ValueError:
a1=0
a2=0
return (a1+a2)==10
def test_add(expect,ans):
try:
a1=float(ans[0])
a2=float(ans[1])
except ValueError:
a1=0
a2=0
return (a1+a2)== float(expect)
</script>
<p>This question consists of two parts. </p>
<p>First, enter two integers which sum to 10. </p>
<customresponse cfn="test_add_to_ten">
<textline size="40" /><br/>
<textline size="40" />
</customresponse>
<p>Now enter two (finite) decimals which sum to 20.</p>
<customresponse cfn="test_add" expect="20">
<textline size="40" /><br/>
<textline size="40" />
</customresponse>
<solution>
<div class="detailed-solution">
<p>Explanation</p>
<p>For the first part, any two numbers of the form <i>n</i>
and <i>10-n</i>, where <i>n</i> is any integer, will work.
One possible answer would be the pair 0 and 10.
</p>
<p>For the second part, any pair <i>x</i> and <i>20-x</i> will work, where <i>x</i> 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.
</p>
</div>
</solution>
</problem>
**Templates**
*With displayed suggested correct answers*
.. code-block:: xml
<problem>
<script type="loncapa/python">
def test_add(expect,ans):
a1=float(ans[0])
a2=float(ans[1])
return (a1+a2)== float(expect)
</script>
<p>Enter two real numbers which sum to 20: </p>
<customresponse cfn="test_add" expect="20">
<textline size="40" correct_answer="11"/><br/>
<textline size="40" correct_answer="9"/>
</customresponse>
<solution>
<div class="detailed-solution">
</div>
</solution>
</problem>
**Templates**
*With NO suggested correct answers*
.. code-block:: xml
<problem>
<script type="loncapa/python">
def test_add(expect,ans):
a1=float(ans[0])
a2=float(ans[1])
return (a1+a2)== float(expect)
</script>
<p>Enter two real numbers which sum to 20: </p>
<customresponse cfn="test_add" expect="20">
<textline size="40" /><br/>
<textline size="40" />
</customresponse>
<solution>
<div class="detailed-solution">
</div>
</solution>
</problem>
.. raw:: latex
.. raw:: latex
\newpage %
\newpage %
.. _Chemical Equation Response:
Chemical Equation Response
.. _Schematic 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
:alt: Image of a chemical equation response problem
**Problem Code**:
.. code-block:: xml
<problem>
<p><b>Example Problem</b></p>
<startouttext/>
<p>Some problems may ask for a particular chemical equation. Practice by writing out the following reaction in the box below.</p>
if chemcalc.chemical_equations_equal(submission[0], 'H2SO4 -> H^+ + HSO4^-'):
correct = ['correct']
else:
correct = ['incorrect']
</answer>
</customresponse>
<p> Some tips:<ul><li>Only real element symbols are permitted.</li><li>Subscripts are entered with plain text.</li><li>Superscripts are indicated with a caret (^).</li><li>The reaction arrow (\(\longrightarrow\)) is indicated with "->".</li></ul>
So, you can enter "H2SO4 -> H^+ + HSO4^-".</p>
<endouttext/>
</problem>
.. raw:: latex
\newpage %
Schematic Response
Schematic Response
==================
------------------
The Schematic Response input type provides an interactive grid on which the
The Schematic Response input type provides an interactive grid on which the
student can construct a schematic answer, such as a circuit.
student can construct a schematic answer, such as a circuit.
...
@@ -1135,3 +953,171 @@ Sample Problem:
...
@@ -1135,3 +953,171 @@ Sample Problem:
</div>
</div>
</solution>
</solution>
</problem>
</problem>
.. _String Response:
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
:alt: Image of a string response problem
**Problem Code:**
.. code-block:: xml
<problem>
<p><b>Example Problem</b></p>
<p>What is the name of this unit? (What response type is this?)</p>
<td>(optional) “[ci] [regex]”. Add “ci” if the student response should be graded case-insensitively. The default is to take case into consideration when grading. Add “regexp” for correct answer to be treated as regular expression.</td>
<td> </td>
</tr>
<tr class="row-odd"><td>answer</td>
<td>The string that is used to compare with student answer. If "regexp" is not presented in value of <em>type</em> attribute, student should enter value equal to exact value of this attribute in order to get credit. If "regexp" is presented in value of <em>type</em> attribute, value of <em>answer</em> is treated as regular expression and exact match of this expression and student answer will be done. If search is successful, student will get credit.</td>