Skip to content
Snippets Groups Projects
Commit f2eda805 authored by Timon Idema's avatar Timon Idema
Browse files

Added jupyter quiz.

parent 0902da44
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,7 @@ parts: ...@@ -10,6 +10,7 @@ parts:
- file: content/Exercise_set_1 - file: content/Exercise_set_1
- file: content/labelingtest - file: content/labelingtest
- file: content/tensorsprimer - file: content/tensorsprimer
- file: content/jupyterquiz
# - file: content/testfile # - file: content/testfile
- caption: Classical mechanics - caption: Classical mechanics
numbered: True numbered: True
......
...@@ -72503,7 +72503,7 @@ ...@@ -72503,7 +72503,7 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.11.0" "version": "3.11.0 (v3.11.0:deaf509e8f, Oct 24 2022, 14:43:23) [Clang 13.0.0 (clang-1300.0.29.30)]"
}, },
"orig_nbformat": 4, "orig_nbformat": 4,
"vscode": { "vscode": {
---
jupytext:
formats: md:myst
text_representation:
extension: .md
format_name: myst
kernelspec:
display_name: Python 3 (ipykernel)
language: python
name: python3
---
# Jupyter quiz
We'll use a Jupyter quiz for testing our knowledge.
Source: [Jupyter quiz](https://pypi.org/project/jupyterquiz/#description). Note that setting up a jupyter quiz requires installing the jupyter quiz package. $ $
% BUG: if there is no math rendered at all before the quiz, there won't be proper math rendering in the quiz. Unfortunately a hidden tag will not resolve this issue, but the math can be placed anywhere on the page, and it can just be a space (hence the space with dollars.).
```{code-cell} ipython3
:tags: [remove-input]
from jupyterquiz import display_quiz
git_path="https://raw.githubusercontent.com/jmshea/jupyterquiz/main/examples/"
# display_quiz(git_path+"questions.json")
display_quiz("questions.json")
```
[
{
"question": "Choose all of the following that can be included in Jupyter notebooks?",
"type": "many_choice",
"answers": [
{
"answer": "Text and graphics output from Python",
"correct": true,
"feedback": "Correct."
},
{
"answer": "Typeset mathematics",
"correct": true,
"feedback": "Correct."
},
{
"answer": "Python executable code",
"correct": true,
"feedback": "Correct."
},
{
"answer": "Formatted text",
"correct": true,
"feedback": "Correct."
},
{
"answer": "Live snakes via Python",
"correct": false,
"feedback": "I hope not."
}
]
},
{
"question": "Which of these are used to create formatted text in Jupyter notebooks?",
"type": "multiple_choice",
"answers": [
{
"answer": "Wiki markup",
"correct": false,
"feedback": "False."
},
{
"answer": "SVG",
"correct": false,
"feedback": "False."
},
{
"answer": "Markdown",
"correct": true,
"feedback": "Correct."
},
{
"answer": "Rich Text",
"correct": false,
"feedback": "False."
}
]
},
{
"question": "Enter the value of $\\pi$ to 2 decimal places.",
"type": "numeric",
"answers": [
{
"type": "value",
"value": 3.14,
"correct": true,
"feedback": "Correct."
},
{
"type": "range",
"range": [
3.142857,
3.142858
],
"correct": true,
"feedback": "True to 2 decimal places, but you know $\\pi$ is not really 22/7, right?"
},
{
"type": "range",
"range": [
-100000000,
0
],
"correct": false,
"feedback": "$\\pi$ is the AREA of a circle of radius 1. Try again."
},
{
"type": "default",
"feedback": "$\\pi$ is the area of a circle of radius 1. Try again."
}
]
},
{
"question": "Determine the output of the following Python code:",
"code": "a=\"1\"\nb=\"2\"\nprint(a+b)",
"type": "multiple_choice",
"answers": [
{
"answer": "1",
"correct": false,
"feedback": "No. When strings are operated on by +, they are concatenated."
},
{
"answer": "2",
"correct": false,
"feedback": "No. When strings are operated on by +, they are concatenated."
},
{
"answer": "3",
"correct": false,
"feedback": "No. When strings are operated on by +, they are concatenated."
},
{
"answer": "12",
"correct": true,
"feedback": "Yes. The + operator will concatenate the strings \"1\" and \"2\"."
},
{
"answer": "error",
"correct": false,
"feedback": "No. The + operator for strings performs string concatenation."
}
]
},
{
"question": "The variable mylist is a Python list. Choose which code snippet will append the item 3 to mylist.",
"type": "multiple_choice",
"answers": [
{
"code": "mylist+=3",
"correct": false
},
{
"code": "mylist+=[3]",
"correct": true
},
{
"code": "mylist+={3}",
"correct": false
}
]
},
{
"question": "Which of these is the ratio of a circle's circumference to its diameter?",
"type": "multiple_choice",
"answers": [
{
"answer": "$\\pi$",
"correct": true,
"feedback": "Correct."
},
{
"answer": "$\\frac{22}{7}$",
"correct": false,
"feedback": "$\\frac{22}{7}$ is only an approximation to the true value."
},
{
"answer": "3",
"correct": false,
"feedback": "This is a crude approximation to the true value."
},
{
"answer": "$\\tau$",
"correct": false,
"feedback": "True for the ratio of the circle's circumference to its radius, not diameter."
}
]
}
]
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment