Jupyter at Bryn Mawr College |
|||
Public notebooks: /services/public/dblank |
The Activity Magic is a method of giving quizzes, polls, etc. to a group of users on a jupyterhub server.
In the current implementation, it acts like a Classroom Response System (also called "clickers", audience response system, personal response systems, student response system, or electronic response system).
The main pedagogical use is for implementing instantaneous anonymous polling for gaging student understanding.
To use, you will need:
Activity magic works as follows:
Here is the docs on %%activity magic:
%%activity?
Docstring:
%%activity FILENAME - make an activity from
a JSON structure
This magic will construct a Python file from the cell's
content, a JSON structure.
Example:
%%activity /home/teacher/activity1
{"activity": "poll",
"instructors": ["teacher01"],
"items": [{"id": "...",
"type": "multiple choice",
"question": "...",
"options": ["...", ...]
}, ...]
}
In this example, users will load
/home/teacher/activity1
File: /usr/lib/python3.4/site-packages/metakernel-0.10.5-py3.4.egg/metakernel/magics/activity_magic.py
Here is an actual poll with three questions:
%%activity /home/dblank/activity1
{"activity": "poll",
"instructors": ["dblank"],
"items": [
{"id": "1",
"question": """Which of the following will print "Hello" 5 times without errors?""",
"type": "multiple choice",
"options": [
"""<pre style="width: 600px">
for (int i=0; i < 5; i++) {
println("Hello");
}
</pre>""",
"""<pre style="width: 600px">
println("Hello");
println("Hello");
println("Hello");
println("Hello");
println("Hello");
</pre>""",
"""<pre style="width: 600px">
int i = 0;
while (i < 5) {
println("Hello");
i++;
}
</pre>""",
"All of the above",
"None of the above",
]},
{"id": "2",
"question": """Which of the following is a function definition?""",
"type": "multiple choice",
"options": [
"""<pre style="width: 600px">
void draw() {
}
</pre>""",
"""<pre style="width: 600px">
rect(10, 10, 50, 50);
</pre>""",
"""<pre style="width: 600px">
drawBunny(mouseX, mouseY, 50, 100);
</pre>""",
"All of the above",
"None of the above",
]},
{"id": "3",
"question": """Which of the following has parameters?""",
"type": "multiple choice",
"options": [
"""<pre style="width: 600px">
void draw() {
}
</pre>""",
"""<pre style="width: 600px">
void drawRect(float x, float y, float w, float h) {
rect(x, y, w, h);
}
</pre>""",
"""<pre style="width: 600px">
void drawBunny() {
rect(10, 20, 100, 150);
}
</pre>""",
"All of the above",
"None of the above",
]},
{"id": "4",
"question": """Which of the following is a function call?""",
"type": "multiple choice",
"options": [
"""<pre style="width: 600px">
void draw() {
}
</pre>""",
"""<pre style="width: 600px">
rect(10, 10, 50, 50);
</pre>""",
"""<pre style="width: 600px">
drawBunny(mouseX, mouseY, 50, 100);
</pre>""",
"2 and 3",
"None of the above",
]},
]
}
When executed in a live cell, it shows the following:
Instructors in the list will be able to click on the "Results" button to show the barchart of choices.
Students enter:
%activity /home/dblank/activity1
and are ready for discussing issues.
The activities are stored in a JSON-like format as follows.
{
"activity": "poll",
"instructors": ["userid", ...],
"items": [...],
"results_filename": "/home/user/results.txt"
}
Poll has the following structure for an item:
{
"id": "1",
"type": "multiple choice",
"question": "The actual question?",
"options": ["choice 1", "choice 2", ...]
}
Currently, all of the poll items are strings that will be rendered as HTML. Future plans include adding all widget types (LaTeX, text, etc.) The options are currently limited to 5 choices or less. Also, choices are listed as 1 through 5.
question id::user id::datetime::choice
The barchart is rendered by calysto's graphics.
Try it out! Feedback welcome!