Skip to content

Commit e1a29bc

Browse files
Merge pull request #196 from coding-for-reproducible-research/numpy_data_download_button
Convert numeric question into multiple choice
2 parents 18ed42b + d8f7646 commit e1a29bc

File tree

3 files changed

+29
-32
lines changed

3 files changed

+29
-32
lines changed

individual_modules/python_for_data_analysis/Python_Pandas.ipynb

Lines changed: 25 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1531,7 +1531,7 @@
15311531
},
15321532
{
15331533
"cell_type": "code",
1534-
"execution_count": 1,
1534+
"execution_count": 6,
15351535
"id": "007f7a76-d99f-4f8c-a729-d26022fd6ca5",
15361536
"metadata": {
15371537
"editable": true,
@@ -1546,13 +1546,13 @@
15461546
{
15471547
"data": {
15481548
"text/html": [
1549-
"<div id=\"jDekxSutJzVz\" data-shufflequestions=\"False\"\n",
1549+
"<div id=\"rDMoONLcdwOO\" data-shufflequestions=\"False\"\n",
15501550
" data-shuffleanswers=\"True\"\n",
15511551
" data-preserveresponses=\"false\"\n",
15521552
" data-numquestions=\"1000000\"\n",
15531553
" data-maxwidth=\"600\"\n",
15541554
" style=\"border-radius: 10px; text-align: left\"> <style>\n",
1555-
"#jDekxSutJzVz {\n",
1555+
"#rDMoONLcdwOO {\n",
15561556
" --jq-multiple-choice-bg: #6f78ffff;\n",
15571557
" --jq-mc-button-bg: #fafafa;\n",
15581558
" --jq-mc-button-border: #e0e0e0e0;\n",
@@ -1734,27 +1734,20 @@
17341734
{
17351735
"data": {
17361736
"application/javascript": [
1737-
"var questionsjDekxSutJzVz=[\n",
1737+
"var questionsrDMoONLcdwOO=[\n",
17381738
" {\n",
17391739
" \"question\": \"Enter the number of rows that are within the dataframe\",\n",
1740-
" \"type\": \"numeric\",\n",
1741-
" \"precision\":1,\n",
1740+
" \"type\": \"many_choice\",\n",
17421741
" \"answers\": [\n",
17431742
" {\n",
1744-
" \"type\": \"value\",\n",
1745-
" \"value\": 32832,\n",
1743+
" \"answer\": \"32832\",\n",
17461744
" \"correct\": true,\n",
17471745
" \"feedback\": \"Correct.\"\n",
17481746
" },\n",
17491747
" {\n",
1750-
" \"type\": \"value\",\n",
1751-
" \"value\": 8,\n",
1748+
" \"answer\": \"8\",\n",
17521749
" \"correct\": false,\n",
17531750
" \"feedback\": \"Thats the number of columns!\"\n",
1754-
" },\n",
1755-
" {\n",
1756-
" \"type\": \"default\",\n",
1757-
" \"feedback\": \"Thats not quite right, try again!\"\n",
17581751
" }\n",
17591752
" ]\n",
17601753
" }\n",
@@ -2507,8 +2500,8 @@
25072500
" Someone more knowledgeable could make this better ;-) */\n",
25082501
"\n",
25092502
" function try_show() {\n",
2510-
" if(document.getElementById(\"jDekxSutJzVz\")) {\n",
2511-
" show_questions(questionsjDekxSutJzVz, jDekxSutJzVz); \n",
2503+
" if(document.getElementById(\"rDMoONLcdwOO\")) {\n",
2504+
" show_questions(questionsrDMoONLcdwOO, rDMoONLcdwOO); \n",
25122505
" } else {\n",
25132506
" setTimeout(try_show, 200);\n",
25142507
" }\n",
@@ -2517,8 +2510,8 @@
25172510
" {\n",
25182511
" // console.log(element);\n",
25192512
"\n",
2520-
" //console.log(\"jDekxSutJzVz\");\n",
2521-
" // console.log(document.getElementById(\"jDekxSutJzVz\"));\n",
2513+
" //console.log(\"rDMoONLcdwOO\");\n",
2514+
" // console.log(document.getElementById(\"rDMoONLcdwOO\"));\n",
25222515
"\n",
25232516
" try_show();\n",
25242517
" }\n",
@@ -2541,7 +2534,13 @@
25412534
"cell_type": "code",
25422535
"execution_count": 12,
25432536
"id": "7d05b94e-c3da-42ef-904f-f470cb9d21c4",
2544-
"metadata": {},
2537+
"metadata": {
2538+
"editable": true,
2539+
"slideshow": {
2540+
"slide_type": ""
2541+
},
2542+
"tags": []
2543+
},
25452544
"outputs": [
25462545
{
25472546
"data": {
@@ -2856,7 +2855,13 @@
28562855
{
28572856
"cell_type": "markdown",
28582857
"id": "535b8e63-f7c9-4295-9f07-34eb9d4c12fa",
2859-
"metadata": {},
2858+
"metadata": {
2859+
"editable": true,
2860+
"slideshow": {
2861+
"slide_type": ""
2862+
},
2863+
"tags": []
2864+
},
28602865
"source": [
28612866
"### Performing Analysis \n",
28622867
"\n",
@@ -3022,7 +3027,6 @@
30223027
"source": [
30233028
"#### Exercise 3 - Subsetting Data\n",
30243029
"* The analysis that was performed before was on the complete dataset. \n",
3025-
"* You have been given code to filter the dataset to retrieve the data that was measured in 2022.\n",
30263030
"* Adapt the code given to get the data from 2023.\n",
30273031
"* For the data from 2023 determine: \n",
30283032
" * What was the maximum air pollution seen for NO2 air pollution?\n",

individual_modules/python_for_data_analysis/questions/pandas_question_dataframe_attributes.json

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,17 @@
11
[
22
{
33
"question": "Enter the number of rows that are within the dataframe",
4-
"type": "numeric",
5-
"precision":1,
4+
"type": "many_choice",
65
"answers": [
76
{
8-
"type": "value",
9-
"value": 32832,
7+
"answer": "32832",
108
"correct": true,
119
"feedback": "Correct."
1210
},
1311
{
14-
"type": "value",
15-
"value": 8,
12+
"answer": "8",
1613
"correct": false,
1714
"feedback": "Thats the number of columns!"
18-
},
19-
{
20-
"type": "default",
21-
"feedback": "Thats not quite right, try again!"
2215
}
2316
]
2417
}

individual_modules/python_for_data_analysis/questions/summary_pandas.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
},
4747
{
4848
"answer": "Dictionary",
49-
"correct": true,
49+
"correct": false,
5050
"feedback": "Correct"
5151
}
5252
]

0 commit comments

Comments
 (0)