Commit 39fddd1f by Mark Hoeber

Merge pull request #1943 from edx/markhoeber/documentation/glossary

Markhoeber/documentation/glossary
parents 64ec4e02 8ffe169a
...@@ -17,10 +17,10 @@ templates for these problems, but the problems open directly in the ...@@ -17,10 +17,10 @@ templates for these problems, but the problems open directly in the
create. These problems can be any type. create. These problems can be any type.
- :ref:`Drag and Drop` Drag and drop problems require students to drag text - :ref:`Drag and Drop` Drag and drop problems require students to drag text
or objects to a specific location on an image. or objects to a specific location on an image.
- :ref:`JavaScript Input` JavaScript input problems allow you to incorporate
problem types that you've created in HTML into Studio via an IFrame.
- :ref:`Image Mapped Input` Image mapped input problems require students to - :ref:`Image Mapped Input` Image mapped input problems require students to
click a specific location on an image. click a specific location on an image.
- :ref:`JavaScript Input` JavaScript input problems allow you to incorporate
problem types that you've created in HTML into Studio via an IFrame.
- :ref:`Math Expression Input` Math expression input problems require - :ref:`Math Expression Input` Math expression input problems require
students to enter a mathematical expression as text, such as students to enter a mathematical expression as text, such as
e=m\*c^2. e=m\*c^2.
...@@ -136,6 +136,120 @@ To create a image mapped input problem: ...@@ -136,6 +136,120 @@ To create a image mapped input problem:
#. In the component editor, replace the example code with your own code. #. In the component editor, replace the example code with your own code.
#. Click **Save**. #. Click **Save**.
.. _JavaScript Input:
JavaScript Input
----------------
The JavaScript Input problem type allows you to create your own learning tool
using HTML and other standard Internet languages and then add the tool directly
into Studio. When you use this problem type, Studio embeds your tool in an
IFrame so that your students can interact with it in the LMS. You can grade
your students' work using JavaScript and some basic Python, and the grading
is integrated into the edX grading system.
This problem type doesn't appear in the menu of advanced problems in Studio. To
create a JavaScript input problem type, you'll create a blank advanced problem,
and then enter your code into the component editor.
.. image:: /Images/JavaScriptInputExample.gif
Create a JavaScript Input Problem
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#. Create your JavaScript application, and then upload all files associated with
that application to the **Files & Uploads** page.
#. 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**.
#. Click the **Settings** tab.
#. Set **Maximum Attempts** to a number larger than zero.
#. In the component editor, enter your code.
#. Click **Save**.
To re-create the example problem above, follow these steps.
#. Go to :ref:`Appendix F` and use the code samples to create the following files:
- webGLDemo.html
- webGLDemo.js
- webGLDemo.css
- three.min.js
#. On the **Files & Uploads** page, upload the four files you just created.
#. Create a new blank advanced problem component.
#. On the **Settings** tab, set **Maximum Attempts** to a number larger than
zero.
#. In the problem component editor, paste the code below.
#. Click **Save.**
JavaScript Input Problem Code
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
::
<problem display_name="webGLDemo">
In the image below, click the cone.
<script type="loncapa/python">
import json
def vglcfn(e, ans):
'''
par is a dictionary containing two keys, "answer" and "state"
The value of answer is the JSON string returned by getGrade
The value of state is the JSON string returned by getState
'''
par = json.loads(ans)
# We can use either the value of the answer key to grade
answer = json.loads(par["answer"])
return answer["cylinder"] and not answer["cube"]
# Or we can use the value of the state key
'''
state = json.loads(par["state"])
selectedObjects = state["selectedObjects"]
return selectedObjects["cylinder"] and not selectedObjects["cube"]
'''
</script>
<customresponse cfn="vglcfn">
<jsinput
gradefn="WebGLDemo.getGrade"
get_statefn="WebGLDemo.getState"
set_statefn="WebGLDemo.setState"
width="400"
height="400"
html_file="/static/webGLDemo.html"
/>
</customresponse>
</problem>
.. notes:: When you create a JavaScript Input problem, keep the following in mind.
- The webGLDemo.js file defines the three JavaScript functions (**WebGLDemo.getGrade**,
**WebGLDemo.getState**, and **WebGLDemo.setState**).
- The JavaScript input problem code uses **WebGLDemo.getGrade**, **WebGLDemo.getState**,
and **WebGLDemo.setState** to grade, save, or restore a problem. These functions must
be global in scope.
- **WebGLDemo.getState** and **WebGLDemo.setState** are optional. You only have to define
these functions if you want to conserve the state of the problem.
- **Width** and **height** represent the dimensions of the IFrame that holds the
application.
- When the problem opens, the cone and the cube are both blue, or "unselected." When
you click either shape once, the shape becomes yellow, or "selected." To unselect
the shape, click it again. Continue clicking the shape to select and unselect it.
- The response is graded as correct if the cone is selected (yellow) when the user
clicks **Check**.
- Clicking **Check** or **Save** registers the problem's current state.
.. _Math Expression Input: .. _Math Expression Input:
Math Expression Input Math Expression Input
......
...@@ -529,6 +529,7 @@ We urge usage of <formulaequationinput />. See the opening paragraphs of the ...@@ -529,6 +529,7 @@ We urge usage of <formulaequationinput />. See the opening paragraphs of the
.. image:: ../Images/numericalresponse5.png .. image:: ../Images/numericalresponse5.png
.. _Math Expression Syntax:
Math Expression Syntax Math Expression Syntax
---------------------- ----------------------
...@@ -788,6 +789,7 @@ XML Attribute Information ...@@ -788,6 +789,7 @@ XML Attribute Information
\newpage % \newpage %
.. _Custom Response:
Custom Response Custom Response
=============== ===============
...@@ -916,6 +918,8 @@ Sample Problem: ...@@ -916,6 +918,8 @@ Sample Problem:
\newpage % \newpage %
.. _Chemical Equation Response:
Chemical Equation Response Chemical Equation Response
========================== ==========================
......
.. _Common Problems: .. _Common Problems:
############################# ############################
Common Problems Common Problems
############################# ############################
*Common problems* are typical problems such as multiple choice problems *Common problems* are typical problems such as multiple choice problems
and other problems whose answers are simple for students to select or and other problems whose answers are simple for students to select or
......
...@@ -32,8 +32,8 @@ See the following topics: ...@@ -32,8 +32,8 @@ See the following topics:
Create an HTML Component Create an HTML Component
***************************** *****************************
To create a new HTML component in an existing Unit, ensure the Unit is Private. To create a new HTML component in an existing unit, ensure the unit is private.
For more information on Public and Private Units, see :ref:`Public and Private Units`. For more information on public and private units, see :ref:`Public and Private Units`.
#. Under **Add New Component**, click the **html** icon. #. Under **Add New Component**, click the **html** icon.
......
...@@ -114,6 +114,8 @@ visible. ...@@ -114,6 +114,8 @@ visible.
- **Weight.** Different problems in a particular problem set may be - **Weight.** Different problems in a particular problem set may be
given different weights. given different weights.
.. _Studio UI:
============================== ==============================
The Studio User Interface The Studio User Interface
============================== ==============================
...@@ -204,6 +206,8 @@ Maximum Attempts ...@@ -204,6 +206,8 @@ Maximum Attempts
This setting specifies the number of times a student can try to answer This setting specifies the number of times a student can try to answer
the problem. By default, a student has an unlimited number of attempts. the problem. By default, a student has an unlimited number of attempts.
.. _Problem Weight:
============================== ==============================
Problem Weight Problem Weight
============================== ==============================
......
...@@ -103,6 +103,8 @@ upload and submit their files. You can let students know what to expect ...@@ -103,6 +103,8 @@ upload and submit their files. You can let students know what to expect
after they submit responses. You can also mention the number of times after they submit responses. You can also mention the number of times
that a student will be able to submit a response for the problem. that a student will be able to submit a response for the problem.
.. _Rubrics:
Rubrics Rubrics
~~~~~~~ ~~~~~~~
......
...@@ -20,6 +20,7 @@ unit. ...@@ -20,6 +20,7 @@ unit.
- :ref:`Word Cloud` Word cloud problems show a colorful graphic of the - :ref:`Word Cloud` Word cloud problems show a colorful graphic of the
words that students enter as responses to a prompt. words that students enter as responses to a prompt.
.. _ Add Advanced Component:
**Add the Advanced Component to Your Course** **Add the Advanced Component to Your Course**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment