Individual course teams frequently create tools and problem types that don't have templates in Studio. We want to make these tools available to all our course teams. We provide you with all the files and code that you need to create these problems in Studio.
Individual course teams frequently create tools and problem types that don't have templates in Studio. We want to make these tools available to all our course teams.
Below, you'll find the information you need to create the following tools.
Below, we provide you with all the files and code that you need to create the following tools and problem types.
* :ref:`Gene Explorer`
* :ref:`Chemical Equation`
* :ref:`Interactive Periodic Table`
* :ref:`Molecule Editor`
* :ref:`Multiple Choice and Numerical Input`
...
...
@@ -41,18 +42,6 @@ Specifically, the Gene Explorer does the following:
For more information about the Gene Explorer, see `The Gene Explorer <http://intro.bio.umb.edu/GX/>`_.
.. _Create the Gene Explorer:
==========================
Create the Gene Explorer
==========================
#. In the unit where you want to create the problem, click **Problem** under **Add New Component**, and then click the **Advanced** tab.
#. Click **Blank Advanced Problem**.
#. In the component that appears, click **Edit**.
#. In the component editor, paste the code from below.
#. Click **Save**.
=====================
Gene Explorer Code
=====================
...
...
@@ -82,6 +71,76 @@ In this code:
* **genex_problem_number** specifies the number of the problem. This number is based on the five gene editor problems in the MITx 7.00x course--for example, if you want this problem to look like the second gene editor problem in the 7.00x course, you would set the **genex_problem_number** value to 2. The number must be 1, 2, 3, 4, or 5.
.. _Chemical Equation:
**************************
Chemical Equation Problem
**************************
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.
.. image:: /Images/ChemicalEquationExample.png
:alt: Image of a chemical equation response problem
====================================
Create the Chemical Equation Problem
====================================
To create the above chemical equation problem:
#. In the unit where you want to create the problem, click **Problem** under **Add New Component**, and then click the **Advanced** tab.
#. Click **Blank Advanced Problem**.
#. In the component that appears, click **Edit**.
#. In the component editor, paste the code from below.
#. Click **Save**.
====================================
Chemical Equation Problem Code
====================================
.. code-block:: xml
<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>
<endouttext/>
<solution>
<div class="detailed-solution">
<p>Solution</p>
<p>To create this equation, enter the following:</p>
<p>H2SO4 -> H^+ + HSO4^-</p>
</div>
</solution>
</problem>
.. _Interactive Periodic Table:
**************************
...
...
@@ -116,7 +175,7 @@ To create the periodic table, you need an HTML component.
#. In the component editor, switch to the **HTML** tab.
#. Open the PeriodicTable.txt file in any text editor.
#. Copy all of the text in the PeriodicTable.txt file, and paste it into the HTML component editor. (Note that the PeriodicTableHTML.txt file contains over 6000 lines of code. Paste all of this code into the component editor.)
#. Make any changes that you want, and then click **Save**.
#. Click **Save**.
.. _Molecule Editor:
...
...
@@ -151,15 +210,18 @@ To create the molecule editor that appears in the image above, you need an HTML
#. Upload all of the files listed above to the **Files & Uploads** page in your course.
#. Create the HTML component.
#. In the unit where you want to create the problem, click **HTML** under **Add New Component**, and then click **HTML**.
#. In the component that appears, click **Edit**.
#. In the component editor, paste the HTML component code from below.
#. Make any changes that you want, and then click **Save**.
#. Create the Problem component.
3. Create the Problem component.
#. Under the HTML component, click **Problem** under **Add New Component**, and then click **Blank Advanced Problem**.
#. In the component that appears, click **Edit**.
#. In the component editor, paste the Problem component code from below.
#. Make any changes that you want, and then click **Save**.
#. Click **Save**.
.. _EMC Problem Code:
...
...
@@ -172,7 +234,7 @@ To create the molecule editor, you need an HTML component and a Problem componen
HTML Component Code
-------------------
::
.. code-block:: xml
<h2>Molecule Editor</h2>
<p>The molecule editor makes creating and visualizing molecules easy. A chemistry professor may have you build and submit a molecule as part of an exercise.</p>
...
...
@@ -215,12 +277,12 @@ HTML Component Code
</div>
<div id="ap_listener_added"> </div>
Problem Component
-----------------
**Problem 1**
::
Problem Component Code
----------------------
.. code-block:: xml
<problem>
<p>The dopamine molecule, as shown, cannot make ionic bonds. Edit the dopamine molecule so it can make ionic bonds.</p>
...
...
@@ -313,7 +375,7 @@ To create a multiple choice and numerical input problem:
The numerical value of pi, rounded to two decimal points, is 3.24.
...
...
@@ -356,7 +418,7 @@ To create the protein builder:
Protein Builder Code
=====================
::
.. code-block:: xml
<problem>
<p>The protein builder allows you string together the building blocks of proteins, amino acids, and see how that string will form into a structure. You are presented with a goal protein shape, and your task is to try to re-create it. In the example below, the shape that you are asked to form is a simple line.</p>
- If you want to include more information in the problem, such as a detailed explanation of the problem's answer, you'll enter the text between the two ``<div>`` tags, which are inside the ``<solution>`` tags. (These tags do not have to be on the same line.)
.. _Choice Response:
Choice Response (Checkbox Problems)
-----------------------------------
Although you can create checkbox problems by using the Simple Editor in Studio, you may want to see or change the problem's underlying XML.
**Sample Problem**
.. image:: ../Images/CheckboxExample.gif
:alt: Image of a checkbox problem
**Tags**
.. list-table::
:widths: 20 80
* - ``<choiceresponse>``
- Specifies that the problem lists answer options for students to choose from.
* - ``<checkboxgroup>``
- A child of ``<choiceresponse>``. Specifies that the problem is a checkbox problem.
* - ``<choice>``
- A child of ``<checkboxgroup>``. Designates an answer option. Each choice must include the ``correct`` attribute, set to ``true`` (for a correct answer) or ``false`` (for an incorrect answer). For checkbox problems, more than one option can be a correct answer.
**Sample Problem XML**
...
...
@@ -36,20 +71,31 @@ Sample 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>Learning about the benefits of preventative healthcare can be particularly
difficult. Check all of the reasons below why this may be the case.</p>
<choiceresponse>
<checkboxgroup>
<choice correct="true"><text>A large amount of time passes between undertaking a preventative measure and seeing the result.</text></choice>
<choice correct="false"><text>Non-immunized people will always fall sick.</text></choice>
<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>
<choice correct="true"><text>Trust in healthcare professionals and government officials is fragile.</text></choice>
<choice correct="true"><text>A large amount of time passes between undertaking
a preventative measure and seeing the result.</text></choice>
<choice correct="false"><text>Non-immunized people will always fall sick.</text>
</choice>
<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>
<choice correct="true"><text>Trust in healthcare professionals and government
officials is fragile.</text></choice>
</checkboxgroup>
<solution>
<div class="detailed-solution">
<p>Explanation</p>
<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>
<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>
</div>
</solution>
</choiceresponse>
...
...
@@ -73,28 +119,40 @@ Sample Problem:
<solution>
<div class="detailed-solution">
<p>Explanation</p>
<p>Explanation text</p>
<p>Solution or Explanation Heading</p>
<p>Solution or explanation text</p>
</div>
</solution>
</choiceresponse>
</problem>
.. _Chemical Equation Input:
Chemical Equation Input (Chemical Equation Problems)
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.
In chemical equation problems, students enter text that represents a chemical equation into a text box. The LMS converts that text into a chemical equation below the text box.
**Sample Problem**
.. image:: ../Images/ChemicalEquationExample.png
:alt: Image of a chemical equation response problem
**Required Tags**
.. list-table::
:widths: 20 80
* - ``<customresponse>``
- Indicates that this problem has a custom response. The ``<customresponse>`` tags must surround the ``<chemicalequation>`` tags.
* - ``<chemicalequationinput>``
- A child of ``<customresponse>``. Indicates that the answer to this problem is a chemical equation.
* - ``<answer type=loncapa/python>``
- A child of ``<chemicalequationinput>``. Contains the Python script that grades the problem.
Chemical equation problems use MathJax to create formulas. For more information about using MathJax in Studio, see :ref:`MathJax in Studio`.
**Sample Problem XML**:
.. code-block:: xml
...
...
@@ -135,19 +193,60 @@ The chemical equation problem type allows the student to enter chemical equation
</solution>
</problem>
**Problem Template**:
.. code-block:: xml
<problem>
<startouttext/>
<p>Problem text</p>
<customresponse>
<chemicalequationinput size="50"/>
<answer type="loncapa/python">
if chemcalc.chemical_equations_equal(submission[0], 'TEXT REPRESENTING CHEMICAL EQUATION'):
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.
In custom Python-evaluated input (also called “write-your-own-grader”) problems, the grader evaluates a student’s response using a Python script that you create and embed in the problem.
**Sample Problem**
.. image:: ../Images/CustomPythonExample.png
:alt: Image of a custom response problem
.. list-table::
:widths: 20 80
* - ``<script type="loncapa/python">``
- Indicates that the problem contains a Python script.
- This tag includes the ``size`` and ``correct_answer`` attributes. The ``correct_answer`` attribute is optional.
**Sample Problem XML**:
...
...
@@ -194,7 +293,7 @@ In write-your-own-grader problems (also called “custom Python-evaluated inputâ
**Templates**
The following template includes suggested correct answers (to include these, add a ``correct_answer`` attribute to the ``<textline>`` tag).
The following template includes answers that appear when the student clicks **Show Answer**.
.. code-block:: xml
...
...
@@ -208,7 +307,7 @@ The following template includes suggested correct answers (to include these, add
</script>
<p>Enter two real numbers that sum to 20: </p>
<p>Problem text</p>
<customresponse cfn="test_add" expect="20">
<textline size="10" correct_answer="11"/><br/>
<textline size="10" correct_answer="9"/>
...
...
@@ -216,11 +315,13 @@ The following template includes suggested correct answers (to include these, add
<solution>
<div class="detailed-solution">
<p>Solution or Explanation Heading</p>
<p>Solution or explanation text</p>
</div>
</solution>
</problem>
The following template does not include suggested correct answers.
The following template does not return answers when the student clicks **Show Answer**. If your problem doesn't include answers for the student to see, make sure to set **Show Answer** to **Never** in the problem component.
.. code-block:: xml
...
...
@@ -242,6 +343,8 @@ The following template does not include suggested correct answers.
<solution>
<div class="detailed-solution">
<p>Solution or Explanation Heading</p>
<p>Solution or explanation text</p>
</div>
</solution>
</problem>
...
...
@@ -254,9 +357,21 @@ Formula Response (Math Expression Input Problems)
@@ -335,19 +474,23 @@ size (optional) defines the size (i.e. the width)
.. _Image Response:
Image Response
--------------
Image Response (Image Mapped Input Problems)
--------------------------------------------
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.
**Sample Problem**
*Note The Mozilla Firefox browser is currently not supported for this problem type.*
.. image:: ../Images/image294.png
:alt: Image of an image mapped input problem
Sample Problem:
**XML Tags**
.. image:: ../Images/image294.png
:width: 600
.. list-table::
:widths: 20 80
* - ``<imageresponse>``
- Indicates that the problem is an image mapped input problem.
* - ``<imageinput>``
- Specifies the image file and the region the student must click. This tag includes the ``src``, ``width``, ``height``, and ``rectangle`` attributes.
**Problem Code**:
...
...
@@ -356,25 +499,27 @@ Sample Problem:
<problem>
<p><b>Example Problem</b></p>
<startouttext/>
<p>You are given three shapes. Click on the triangle.</p>
Although you can create multiple choice problems by using the Simple Editor in Studio, you may want to see or change the problem's underlying XML.
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.
**Sample Problem**
• 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.
.. image:: ../Images/MultipleChoiceExample.gif
:alt: Image of a multiple choice problem
• 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.
**XML Tags**
Sample Problem:
.. list-table::
:widths: 20 80
.. image:: ../Images/image289.png
:width: 600
:alt: Image of a multiple choice problem
* - ``<multiplechoiceresponse>``
- Indicates that the problem is a multiple choice problem.
* - ``<choicegroup type="MultipleChoice">``
- Indicates the beginning of the list of options.
* - ``<choice>``
- Lists an option. This tag includes the ``correct`` and ``name`` attributes.
**Problem Code:**
.. code-block:: xml
<problem>
<p><b>Example Problem</b></p>
<p>How many correct responses can a Multiple Choice question have?</p>
<p>Lateral inhibition, as was first discovered in the horsehoe crab...</p>
<choice correct="false">is a property of touch sensation, referring to the ability of crabs to detect nearby predators.</choice>
<choice correct="false">is a property of hearing, referring to the ability of crabs to detect low frequency noises.</choice>
<choice correct="false">is a property of vision, referring to the ability of crabs eyes to enhance contrasts.</choice>
<choice correct="true">has to do with the ability of crabs to use sonar to detect fellow horseshoe crabs nearby.</choice>
<choice correct="false">has to do with a weighting system in the crabs skeleton that allows it to balance in turbulent water.</choice>
</choicegroup>
</multiplechoiceresponse>
<solution>
<div class="detailed-solution">
<p>Explanation</p>
<p>It depends on how many choices are marked as correct in the underlying XML.</p>
<p>Note that if all choices are marked as incorrect, there is no
correct response.</p>
<p>Horseshoe crabs were essential to the discovery of lateral inhibition, a property of vision present in horseshoe crabs as well as humans, that enables enhancement of contrast at edges of objects as was demonstrated in class. In 1967, Haldan Hartline received the Nobel prize for his research on vision and in particular his research investigating lateral inhibition using horseshoe crabs.</p>
@@ -776,59 +914,72 @@ The default included functions are the following:
.. _Option Response:
Option Response (Dropdown)
--------------------------
Option Response (Dropdown Problems)
-----------------------------------
The Option Response input type allows the student to choose from a collection of
answer options, presented as a drop-down list.
Although you can create dropdown problems by using the Simple Editor in Studio, you may want to see or change the problem's underlying XML.
Option Response is structurally similar to Multiple Choice. Some conceptual
differences between the two include the following.
**Sample Problem**
* The Multiple Choice radio button format makes it easier for students to read very long response options.
.. image:: ../Images/DropdownExample.gif
:alt: Image of an option response problem
* 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.
**XML Tags**
Sample Problem:
.. list-table::
:widths: 20 80
* - ``<optionresponse>``
- Indicates that the problem is a dropdown problem.
* - ``<optioninput>``
- Lists the answer options. This tag includes the ``options`` and ``correct`` attributes.
.. image:: ../Images/image287.png
:width: 600
:alt: Image of an option response problem
**Problem Code:**
.. code-block:: xml
<problem>
<p>
<em>This exercise first appeared in HarvardX's PH207x Health in Numbers: Quantitative Methods in Clinical & Public Health Research course, fall 2012.</em>
Although you can create text input problems by using the Simple Editor in Studio, you may want to see or change the problem's underlying XML. For example, you can add hints that appear when students enter common incorrect answers, or modify the problem's XML so that students can submit regular expressions as answers.
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.
The regular expression that the student enters must contain the part of the answer that the instructor specifies. For example, if an instructor has specified ``<answer=".*example answer.*" type="regexp">``, correct answers include ``example answered``, ``two example answers``, or even ``==example answer==``, but not ``examples`` or ``example anser``.
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.
You can add ``regexp`` to the value of the ``type`` attribute, for example: ``type="ci regexp"`` or ``type="regexp"`` or ``type="regexp cs"``. In this case, any answer or hint will be treated as regular expressions.
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:
**Sample Problem**
.. image:: ../Images/image291.png
:width: 600
.. image:: ../Images/TextInputExample.gif
:alt: Image of a string response problem
**Problem Code:**
**XML Tags**
.. list-table::
:widths: 20 80
* - ``<stringresponse>``
- Indicates that the problem is a text input problem.
* - ``<textline>``
- Child of ``<stringresponse>``. Lists the answer options.
* - ``<additional_answer>`` (optional)
- Specifies an additional correct answer for the problem. A problem can contain an unlimited number of additional answers.
* - ``<hintgroup>`` (optional)
- Indicates that the instructor has provided hints for certain common incorrect answers.
* - ``<stringhint />`` (optional)
- Child of ``<hintgroup>``. Specifies the text of the incorrect answer to provide the hint for. Contains answer, type, name.
* - ``<hintpart>``
- Contains the name from ``<stringhint>``. Associates the incorrect answer with the hint text for that incorrect answer.
* - ``<startouttext />``
- Indicates the beginning of the text of the hint.
* - ``<endouttext />``
- Indicates the end of the text of the hint.
**Sample 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>
In contact immunity, a vaccinated individual passes along his immunity to another person through contact with feces or bodily fluids. The answer to the question above refers to the form of immunity that occurs when so many members of a population are protected, an infectious disease is unlikely to spread to the unprotected population.
Although a firewall provides protection for a population, the term "firewall" is used more in computing and technology than in epidemiology.
<endouttext />
</hintpart >
</hintgroup>
</stringresponse>
<solution>
<div class="detailed-solution">
<p>Explanation</p>
<p>The name of this unit is "String Response," written without the punctuation.</p>
<p>Arbitrary capitalization is accepted.</p>
<p>The correct answer is <b>herd immunity</b>. As more and more people use bednets, the risk of malaria begins to fall for everyone – users and non-users alike. This can fall to such a low probability that malaria is effectively eradicated from the group (even when the group does not have 100% bednet coverage).</p>
</div>
</solution>
</problem>
...
...
@@ -988,50 +1158,34 @@ Sample Problem:
.. code-block:: xml
<problem>
<stringresponse answer="REPLACE_THIS" type="ci">
<textline size="20"/>
</stringresponse>
<solution>
<div class="detailed-solution">
</div>
</solution>
</problem>
This response type allows to add more than one answer. Use `additional_answer` tag to add more answers.
You can add `regexp` to value of `type` attribute, for example: `type="ci regexp"` or `type="regexp"` or `type="regexp cs"`.
In this case, any answer and hint will be treated as regular expressions.
Regular expression has to match whole answer, for answer to be correct.
Student answers "foobar", "o foo" or " ==foo==", will be correct if teacher has set answer=".*foo.*" with type="regexp".
You can provide hints for common incorrect answers in text input problems. You can also set a text input problem to allow a regular expression as an answer. To do this, you'll have to modify the problem's XML in the Advanced Editor. For more information, see :ref:`String Response`.
.. You also use the Instructor Dashboard to set up the staff for your course, enroll students and access student data, and initiate, review, and adjust grades.
**Question**: I initially thought that there was enough information available about the course as a whole to make this into a longer chapter. Am I missing features or tasks that instructors use to get information about a course? It doesn't have to be something accessible on the instructor dashboard, but just info that might be useful while a course is running...
@@ -190,7 +190,7 @@ To encourage longer, threaded discussions rather than many similar, separate pos
You can respond to a redundant post or response by pasting in a link to the thread that you prefer students to contribute to, and then prevent further thread interaction by closing the entire post or a specific response. Click the **Close** button that displays below the post or response to close it.
* Provide post/response/comment guidelines.
A set of :ref:`Discussion Forum Guidelines` or a post in the General discussion can provide guidance about when to create a new thread, respond to an existing post, or comment on a response.
A set of :ref:`Guidance for Discussion Moderators` or a post in the General discussion can provide guidance about when to create a new thread, respond to an existing post, or comment on a response.