Enable the Survey Tool in OLX#
To enable the survey tool, you edit the XML file that defines the course structure.
Open the XML file for the course in the course
directory. In the course
element’s advanced-modules
attribute, add the string survey
.
For example, the following XML code enables the survey tool.
<course advanced_modules="["survey",
"poll"]" display_name="Sample Course"
start="2015-01-01T00:00:00Z">
...
</course>
Add a Survey in OLX#
To add a survey XBlock in OLX, you create the survey
element. You can embed
the survey
element in the vertical
element, or you can create the
survey
element as a stand-alone file that you reference in the vertical.
The following example shows the OLX definition for a survey with two questions.
<survey
url_name="unique identifier for the survey"
xblock-family="xblock.v1"
questions="[
["unique code for question 1",
{
"img": "Static URL to image",
"img_alt": "Alternative text for image",
"label": "Text of question 1"
}
],
["unique code for question 2",
{
"img": "Static URL to image",
"img_alt": "Alternative text for image",
"label": "Text of question 2"
}
]
]"
feedback="Feedback displayed to learner after submission"
private_results="false"
block_name="Display name for survey"
max_submissions="1"
answers="[
[
"Unique identifier for answer 1",
"Answer text"
],
[
"Unique identifier for answer 2",
"Answer text"
]
]"
/>
survey Element Attributes#
The following table describes the attribute of the survey
element.
Attribute |
Description |
|
The unique identifier of the survey. |
|
The XBlock version used. Must be |
|
An array of questions in the survey. Each question has a unique identifier, and a dictionary that defines values for the following names.
Each question must have a value for |
|
An array of answers in the survey. Each answer has a unique identifier, and a dictionary that defines values for the following names.
Each answer must have a value for |
|
The text shown to learners after they submit a response. |
|
Whether the survey results are shown to learners ( |
|
The display name for the survey. |
|
The number of times a learner can submit survey answers. Use |
See also
Survey Tool (how to)