Alternatively, you can use OLX to enable the poll tool.
Enable the Poll Tool in OLX#
To enable polls in your course, 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 poll.
For example, the following XML code enables polls in a course.
<course advanced_modules="["survey",
"poll"]" display_name="Sample Course"
start="2015-01-01T00:00:00Z">
...
</course>
Add a Poll in OLX#
To add a poll XBlock in OLX, you create the poll element. You can embed
the poll element in the vertical element, or you can create the
poll element as a standalone file that you reference in the vertical.
The following example shows the OLX definition for a poll with four answers.
<poll url_name="f4ae7de0006f426aa4eed4b0b8112da5" xblock-family="xblock.v1"
feedback="Feedback"
display_name="Poll"
private_results="false"
question="What is your favorite color?"
max_submissions="1"
answers="[
["R",
{
"img": "/static/image.png",
"img_alt": "Alt 1",
"label": "Red"
}
],
["B",
{
"img": "/static/image.png",
"img_alt": "Alt 2",
"label": "Blue"
}
],
["G",
{
"img": "/static/image.png",
"img_alt": "Alt3",
"label": "Green"
}
],
["O",
{
"img": "/static/image.png",
"img_alt": "Alt 4",
"label": "Other"
}
]
]
"/>
poll Element Attributes#
The following table describes the attributes of the poll element.
Attribute |
Description |
|
The unique identifier of the poll. |
|
The XBlock version used. Must be |
|
Whether the poll results are shown to learners ( |
|
The display name for the poll. |
|
The prompt for the poll. |
|
The text shown to learners after they submit a response. |
|
The number of times a learner can submit poll answers. Use |
|
An array of answers in the poll. Each answer has a unique identifier, and a dictionary that defines values for the following names.
Each answer must have a value for |