j1-template 2022.2.2 → 2022.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_includes/themes/j1/blocks/footer/boxes/contacts_box.proc +46 -18
- data/_includes/themes/j1/blocks/footer/boxes/links_box.proc +1 -0
- data/assets/data/fab.html +2 -2
- data/assets/data/footer.html +2 -2
- data/assets/themes/j1/adapter/js/analytics.js +13 -13
- data/assets/themes/j1/adapter/js/cookieConsent.js +1 -1
- data/assets/themes/j1/adapter/js/nbinteract.js +366 -120
- data/assets/themes/j1/core/css/themes/unodark/bootstrap.css +30 -40
- data/assets/themes/j1/core/css/themes/unodark/bootstrap.min.css +1 -1
- data/assets/themes/j1/core/css/themes/unolight/bootstrap.css +85 -216
- data/assets/themes/j1/core/css/themes/unolight/bootstrap.min.css +2 -2
- data/assets/themes/j1/core/js/template.js +1 -1
- data/assets/themes/j1/core/js/template.min.js +1 -1
- data/assets/themes/j1/core/js/template.min.js.map +1 -1
- data/assets/themes/j1/modules/carousel/css/theme/uno.css +5 -0
- data/assets/themes/j1/modules/carousel/css/theme/uno.min.css +1 -1
- data/assets/themes/j1/modules/cookieConsent/js/cookieConsent.js +1 -0
- data/assets/themes/j1/modules/justifiedGallery/css/justifiedGallery.css +6 -0
- data/assets/themes/j1/modules/justifiedGallery/css/justifiedGallery.min.css +1 -1
- data/assets/themes/j1/modules/mmenuLight/css/mmenu-light.css +2 -2
- data/assets/themes/j1/modules/mmenuLight/css/mmenu-light.min.css +1 -2
- data/assets/themes/j1/modules/nbInteract/README.md +169 -0
- data/assets/themes/j1/modules/nbInteract/css/nbinteract-core.css +4 -0
- data/assets/themes/j1/modules/nbInteract/css/nbinteract-core.min.css +4 -0
- data/assets/themes/j1/modules/nbInteract/css/theme/uno/nbinteract-core.css +33 -33
- data/assets/themes/j1/modules/nbInteract/css/theme/uno/nbinteract-core.min.css +1 -1
- data/assets/themes/j1/modules/nbInteract/js/requireJS/require.js +2068 -0
- data/assets/themes/j1/modules/nbInteract/js/requireJS/require.min.js +36 -0
- data/assets/themes/j1/modules/plotly/LICENSE +21 -0
- data/assets/themes/j1/modules/plotly/README.md +32 -0
- data/assets/themes/j1/modules/plotly/js/plotly.js +265345 -0
- data/assets/themes/j1/modules/plotly/js/plotly.min.js +65 -0
- data/assets/themes/j1/modules/requirejs/LICENSE +45 -0
- data/assets/themes/j1/modules/requirejs/README.md +79 -0
- data/assets/themes/j1/modules/requirejs/js/require.js +2068 -0
- data/assets/themes/j1/modules/requirejs/js/require.min.js +36 -0
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/Gemfile +1 -1
- data/lib/starter_web/_config.yml +1 -1
- data/lib/starter_web/_data/blocks/defaults/footer.yml +25 -17
- data/lib/starter_web/_data/blocks/footer.yml +78 -65
- data/lib/starter_web/_data/modules/analytics.yml +8 -23
- data/lib/starter_web/_data/modules/defaults/analytics.yml +1 -1
- data/lib/starter_web/_data/modules/defaults/cookieconsent.yml +4 -1
- data/lib/starter_web/_data/modules/justifiedGallery.yml +14 -8
- data/lib/starter_web/_data/modules/navigator_menu.yml +6 -3
- data/lib/starter_web/_data/modules/nbinteract.yml +12 -48
- data/lib/starter_web/_data/resources.yml +52 -18
- data/lib/starter_web/_includes/attributes.asciidoc +25 -0
- data/lib/starter_web/_plugins/lunr_index.rb +1 -1
- data/lib/starter_web/assets/images/pages/nbinteract/mandelbrot-menge-1920x1200.jpg +0 -0
- data/lib/starter_web/assets/images/pages/nbinteract/mandelbrot-menge.png +0 -0
- data/lib/starter_web/assets/images/pages/nbinteract/manual/nbi_bar.jpg +0 -0
- data/lib/starter_web/assets/images/pages/nbinteract/manual/nbi_hist.jpg +0 -0
- data/lib/starter_web/assets/images/pages/nbinteract/manual/nbi_line.jpg +0 -0
- data/lib/starter_web/assets/images/pages/nbinteract/manual/nbi_multiple_choice.jpg +0 -0
- data/lib/starter_web/assets/images/pages/nbinteract/manual/nbi_scatter.jpg +0 -0
- data/lib/starter_web/assets/images/pages/nbinteract/manual/nbi_scatter_drag.jpg +0 -0
- data/lib/starter_web/assets/images/pages/nbinteract/manual/nbi_short_answer.jpg +0 -0
- data/lib/starter_web/assets/images/pages/nbinteract/nbi-textbook-example.jpg +0 -0
- data/lib/starter_web/assets/videos/gallery/kick-it-old-school-poster.jpg +0 -0
- data/lib/starter_web/assets/videos/gallery/nye-party-shop-poster.jpg +0 -0
- data/lib/starter_web/assets/videos/gallery/stay-colorful-poster.jpg +0 -0
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-01-post-wiki-series.adoc +1 -0
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-02-post-wiki-series.adoc +1 -0
- data/lib/starter_web/collections/posts/public/series/_posts/2020-01-03-post-wiki-series.adoc +1 -0
- data/lib/starter_web/package.json +1 -2
- data/lib/starter_web/pages/public/jupyter/docs/_includes/documents/j1_docs_example_static.asciidoc +232 -232
- data/lib/starter_web/pages/public/jupyter/docs/j1-nbinteract-doc.adoc +165 -149
- data/lib/starter_web/pages/public/jupyter/docs/nbi-widget-manual.adoc +156 -11
- data/lib/starter_web/pages/public/jupyter/docs/nbinteract-doc.adoc +11 -6
- data/lib/starter_web/pages/public/jupyter/examples/j1-circular-times-table.adoc +136 -0
- data/lib/starter_web/pages/public/jupyter/examples/j1-interactive-widgets.adoc +9 -5
- data/lib/starter_web/pages/public/jupyter/examples/j1-odes-in-python.adoc +16 -7
- data/lib/starter_web/pages/public/jupyter/examples/j1-testing-plotly.adoc +95 -0
- data/lib/starter_web/pages/public/jupyter/examples/j1_climate-change-forecast.adoc +4 -4
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/{algebra_with_sympy-checkpoint.ipynb → j1_circular_times_table-checkpoint.ipynb} +5190 -7291
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_climate_change_forecast-checkpoint.ipynb +2 -2
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_docs_example_dynamic-checkpoint.ipynb +1 -1
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_interactive_widgets-checkpoint.ipynb +170 -15
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_ode_selected-checkpoint.ipynb +1 -1
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_odes_in_python-checkpoint.ipynb +520 -111
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/factor_by_factor.mp4 +0 -0
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/{.ipynb_checkpoints/j1_algebra_with_sympy-checkpoint.ipynb → j1_circular_times_table.ipynb} +5178 -7308
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/j1_climate_change_forecast.ipynb +2 -2
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/j1_docs_example_dynamic.ipynb +1 -1
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/j1_interactive_widgets.ipynb +170 -15
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/{j1_ode_selected.ipynb → j1_odes_in_python.ipynb} +783 -34
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/line_by_line.mp4 +0 -0
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/point_by_point.mp4 +0 -0
- data/lib/starter_web/pages/public/jupyter/notebooks/nbi-docs/.ipynb_checkpoints/nbi_docs_recipes_interactive_questions-checkpoint.ipynb +185 -0
- data/lib/starter_web/pages/public/jupyter/notebooks/nbi-docs/.ipynb_checkpoints/nbi_docs_tutorial_interact-checkpoint.ipynb +254 -0
- data/lib/starter_web/pages/public/jupyter/notebooks/nbi-docs/.ipynb_checkpoints/nbi_docs_tutorial_monty_hall-checkpoint.ipynb +732 -0
- data/lib/starter_web/pages/public/jupyter/notebooks/nbi-docs/nbi_docs_recipes_interactive_questions.ipynb +19 -22
- data/lib/starter_web/pages/public/jupyter/notebooks/nbi-docs/nbi_docs_tutorial_monty_hall.ipynb +25 -26
- data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_circular_times_table.html +746 -0
- data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_climate_change_forecast.html +2 -2
- data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_interactive_widgets.html +217 -0
- data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_odes_in_python.html +955 -0
- data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/nbi_docs_recipes_interactive_questions.html +1 -2
- data/lib/starter_web/pages/public/jupyter/{apis/binderhub-api.adoc → services/binderhub.adoc} +25 -28
- data/lib/starter_web/pages/public/jupyter/{apis/jupyterhub-api.adoc → services/jupyterhub.adoc} +8 -9
- data/lib/starter_web/pages/public/learn/roundtrip/100_present_images.adoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/100_present_videos.adoc +9 -15
- data/lib/starter_web/pages/public/learn/roundtrip/200_typography.adoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/300_icon_fonts.adoc +12 -1
- data/lib/starter_web/pages/public/learn/roundtrip/400_asciidoc_extensions.adoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/410_bs_modals_extentions.adoc +1 -1
- data/lib/starter_web/pages/public/learn/roundtrip/420_responsive_tables_extensions.adoc +1 -1
- data/lib/starter_web/pages/public/legal/en/300_privacy.adoc +117 -12
- data/lib/starter_web/pages/public/se/se-fake.adoc +47 -0
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +41 -41
- data/lib/starter_web/_data/_resources.yml +0 -1668
- data/lib/starter_web/assets/images/pages/nbinteract/binderhub-architecture.png +0 -0
- data/lib/starter_web/assets/videos/gallery/adriana-lima-poster.jpg +0 -0
- data/lib/starter_web/pages/public/jupyter/notebooks/binder/binder-launches.ipynb +0 -385
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/Untitled-checkpoint.ipynb +0 -6
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/binder-launches-checkpoint.ipynb +0 -385
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/climate-change-forecast-checkpoint.ipynb +0 -916
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/google_altair-checkpoint.ipynb +0 -33
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/ipympl_test_plots-checkpoint.ipynb +0 -14517
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_altair_interactive-checkpoint.ipynb +0 -16493
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_altair_interactive_test-checkpoint.ipynb +0 -14697
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_altair_visualization-checkpoint.ipynb +0 -15358
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_altair_visualization_full-checkpoint.ipynb +0 -2576
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_climate_change_forecast.ipynb +0 -1060
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_docs_hist-checkpoint.ipynb +0 -98
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_interactive-checkpoint.ipynb +0 -560
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_ipympl_test_plots-checkpoint.ipynb +0 -14511
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_pandas_creating_reading_and_writing-checkpoint.ipynb +0 -328
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/j1_recipes_layout-checkpoint.ipynb +0 -341
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/.ipynb_checkpoints/nbi_docs_recipes_graphing-checkpoint.ipynb +0 -98
- data/lib/starter_web/pages/public/jupyter/notebooks/j1/binder-launches.ipynb +0 -411
- data/lib/starter_web/pages/public/jupyter/notebooks/nbi-docs/.ipynb_checkpoints/nbi_docs_examples_correlation-checkpoint.ipynb +0 -651
- data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/binder-launches.html +0 -546
- data/lib/starter_web/pages/public/jupyter/notebooks/textbooks/j1_ode_selected.html +0 -186
- data/lib/starter_web/pages/public/jupyter/notebooks/themes/altair/excel.py +0 -55
- data/lib/starter_web/pages/public/jupyter/notebooks/themes/altair/ggplot.py +0 -108
- data/lib/starter_web/pages/public/jupyter/notebooks/themes/altair/ggplot2.py +0 -108
- data/lib/starter_web/pages/public/jupyter/notebooks/themes/altair/husky.py +0 -121
- data/lib/starter_web/pages/public/jupyter/notebooks/themes/altair/latimes.py +0 -149
- data/lib/starter_web/pages/public/jupyter/notebooks/themes/altair/pcolor.py +0 -6
- data/lib/starter_web/pages/public/jupyter/notebooks/themes/altair/quartz.py +0 -55
- data/lib/starter_web/pages/public/jupyter/notebooks/themes/altair/spacy_base.py +0 -94
- data/lib/starter_web/pages/public/jupyter/notebooks/themes/altair/spacy_mono.py +0 -158
- data/lib/starter_web/pages/public/jupyter/notebooks/themes/altair/sunsentinel.py +0 -125
@@ -116,7 +116,7 @@
|
|
116
116
|
],
|
117
117
|
"source": [
|
118
118
|
"# Reading and transforming the data file\n",
|
119
|
-
"url=\"https://github.com/jekyll-one/
|
119
|
+
"url=\"https://github.com/jekyll-one/j1-binder-repo/raw/main/data/GlobalLandTemperaturesByMajorCity.csv.zip\"\n",
|
120
120
|
"cities = pd.read_csv(url)\n",
|
121
121
|
"#cities = pd.read_csv('../input/earth-surface-temperature-data/GlobalLandTemperaturesByCity.csv.zip')\n",
|
122
122
|
"rio = cities.loc[cities['City'] == 'Rio De Janeiro', ['dt','AverageTemperature']]\n",
|
@@ -155,7 +155,7 @@
|
|
155
155
|
" * **I(d)** is the differencing part, the `d` parameter tells how many differencing orders are going to be used, it tries to make the series stationary, example:\n",
|
156
156
|
" \n",
|
157
157
|
" * Yesterday I sold 10 items of a product, today I sold 14, the \"I\" in this case is just the first difference, which is +4, if you are using logarithm base this difference is equivalent to percentual difference. \n",
|
158
|
-
" * If d = 1: $y_{t} = Y_{t} - Y_{t-1}$ where $y_{t}$ is the differenced series and $Y_{t-
|
158
|
+
" * If d = 1: $y_{t} = Y_{t} - Y_{t-1}$ where $y_{t}$ is the differenced series and $Y_{t-p}$ is the original series\n",
|
159
159
|
" * If d = 2: $y_{t} = (Y_{t} - Y_{t-1}) - (Y_{t-1} - Y_{t-2}) = Y_{t} - 2Y_{t-1} + Y_{t-2}$\n",
|
160
160
|
" * Note that the second difference is a change-in-change, which is a measure of the local \"acceleration\" rather than trend.\n",
|
161
161
|
"\n",
|
@@ -41,7 +41,7 @@
|
|
41
41
|
{
|
42
42
|
"data": {
|
43
43
|
"application/vnd.jupyter.widget-view+json": {
|
44
|
-
"model_id": "
|
44
|
+
"model_id": "1608d7a21ea54170ac685e198f887628",
|
45
45
|
"version_major": 2,
|
46
46
|
"version_minor": 0
|
47
47
|
},
|
@@ -76,7 +76,7 @@
|
|
76
76
|
{
|
77
77
|
"data": {
|
78
78
|
"application/vnd.jupyter.widget-view+json": {
|
79
|
-
"model_id": "
|
79
|
+
"model_id": "a6be50a107e24e85a292bc6145ad6d64",
|
80
80
|
"version_major": 2,
|
81
81
|
"version_minor": 0
|
82
82
|
},
|
@@ -113,7 +113,7 @@
|
|
113
113
|
{
|
114
114
|
"data": {
|
115
115
|
"application/vnd.jupyter.widget-view+json": {
|
116
|
-
"model_id": "
|
116
|
+
"model_id": "bba72987ae664d9c91bb7d72ea7a4ceb",
|
117
117
|
"version_major": 2,
|
118
118
|
"version_minor": 0
|
119
119
|
},
|
@@ -150,7 +150,7 @@
|
|
150
150
|
{
|
151
151
|
"data": {
|
152
152
|
"application/vnd.jupyter.widget-view+json": {
|
153
|
-
"model_id": "
|
153
|
+
"model_id": "623ff24264344afba1e0e2ddfaba3954",
|
154
154
|
"version_major": 2,
|
155
155
|
"version_minor": 0
|
156
156
|
},
|
@@ -164,7 +164,7 @@
|
|
164
164
|
{
|
165
165
|
"data": {
|
166
166
|
"application/vnd.jupyter.widget-view+json": {
|
167
|
-
"model_id": "
|
167
|
+
"model_id": "9498800ce6c645129e7a1d0d0960bbab",
|
168
168
|
"version_major": 2,
|
169
169
|
"version_minor": 0
|
170
170
|
},
|
@@ -178,7 +178,7 @@
|
|
178
178
|
{
|
179
179
|
"data": {
|
180
180
|
"application/vnd.jupyter.widget-view+json": {
|
181
|
-
"model_id": "
|
181
|
+
"model_id": "a85fe7587ca741c8a763f4be2e2fbce5",
|
182
182
|
"version_major": 2,
|
183
183
|
"version_minor": 0
|
184
184
|
},
|
@@ -192,7 +192,7 @@
|
|
192
192
|
{
|
193
193
|
"data": {
|
194
194
|
"application/vnd.jupyter.widget-view+json": {
|
195
|
-
"model_id": "
|
195
|
+
"model_id": "0589f62cfd2b47688ff5764899459a96",
|
196
196
|
"version_major": 2,
|
197
197
|
"version_minor": 0
|
198
198
|
},
|
@@ -232,7 +232,7 @@
|
|
232
232
|
{
|
233
233
|
"data": {
|
234
234
|
"application/vnd.jupyter.widget-view+json": {
|
235
|
-
"model_id": "
|
235
|
+
"model_id": "3a7017ac9a934ccd8c87cc9bba6561f0",
|
236
236
|
"version_major": 2,
|
237
237
|
"version_minor": 0
|
238
238
|
},
|
@@ -309,7 +309,7 @@
|
|
309
309
|
{
|
310
310
|
"data": {
|
311
311
|
"application/vnd.jupyter.widget-view+json": {
|
312
|
-
"model_id": "
|
312
|
+
"model_id": "62a37ef13bf54f0cabe1c5a75d8ad7ab",
|
313
313
|
"version_major": 2,
|
314
314
|
"version_minor": 0
|
315
315
|
},
|
@@ -363,7 +363,7 @@
|
|
363
363
|
{
|
364
364
|
"data": {
|
365
365
|
"application/vnd.jupyter.widget-view+json": {
|
366
|
-
"model_id": "
|
366
|
+
"model_id": "4b422c217fb84dc7bffec5159e36071a",
|
367
367
|
"version_major": 2,
|
368
368
|
"version_minor": 0
|
369
369
|
},
|
@@ -407,7 +407,7 @@
|
|
407
407
|
{
|
408
408
|
"data": {
|
409
409
|
"application/vnd.jupyter.widget-view+json": {
|
410
|
-
"model_id": "
|
410
|
+
"model_id": "dce293ca5d6f40878190033fd4bacb44",
|
411
411
|
"version_major": 2,
|
412
412
|
"version_minor": 0
|
413
413
|
},
|
@@ -454,12 +454,12 @@
|
|
454
454
|
{
|
455
455
|
"data": {
|
456
456
|
"application/vnd.jupyter.widget-view+json": {
|
457
|
-
"model_id": "
|
457
|
+
"model_id": "85d808e150a84179a61f5f24324eb233",
|
458
458
|
"version_major": 2,
|
459
459
|
"version_minor": 0
|
460
460
|
},
|
461
461
|
"text/plain": [
|
462
|
-
"VBox(children=(Label(value='y =
|
462
|
+
"VBox(children=(Label(value='y = 1.03x + 0.36'), Figure(animation_duration=250, axes=[Axis(scale=LinearScale(ma…"
|
463
463
|
]
|
464
464
|
},
|
465
465
|
"metadata": {},
|
@@ -494,7 +494,7 @@
|
|
494
494
|
{
|
495
495
|
"data": {
|
496
496
|
"application/vnd.jupyter.widget-view+json": {
|
497
|
-
"model_id": "
|
497
|
+
"model_id": "b9ab17c9bcb4453e96247d1c3b5376b0",
|
498
498
|
"version_major": 2,
|
499
499
|
"version_minor": 0
|
500
500
|
},
|
@@ -532,7 +532,7 @@
|
|
532
532
|
{
|
533
533
|
"data": {
|
534
534
|
"application/vnd.jupyter.widget-view+json": {
|
535
|
-
"model_id": "
|
535
|
+
"model_id": "1acc67b93a504dd68052f4f789977417",
|
536
536
|
"version_major": 2,
|
537
537
|
"version_minor": 0
|
538
538
|
},
|
@@ -557,6 +557,161 @@
|
|
557
557
|
"\n",
|
558
558
|
"nbi.line(x_values, y_values, max=(10, 50), sd=(1, 10), options=opts)"
|
559
559
|
]
|
560
|
+
},
|
561
|
+
{
|
562
|
+
"cell_type": "markdown",
|
563
|
+
"metadata": {},
|
564
|
+
"source": [
|
565
|
+
"## Interactive Questions from nbinteract\n",
|
566
|
+
"nbinteract also provides built-in methods to easily create multiple choice and short answer questions.\n"
|
567
|
+
]
|
568
|
+
},
|
569
|
+
{
|
570
|
+
"cell_type": "markdown",
|
571
|
+
"metadata": {},
|
572
|
+
"source": [
|
573
|
+
"### nbinteract.multiple_choice\n",
|
574
|
+
"\n",
|
575
|
+
"`nbinteract.multiple_choice` takes a question, a list of possible answer choices, and the correct answer. Clicking the buttons shows whether the choice was correct."
|
576
|
+
]
|
577
|
+
},
|
578
|
+
{
|
579
|
+
"cell_type": "code",
|
580
|
+
"execution_count": 13,
|
581
|
+
"metadata": {},
|
582
|
+
"outputs": [
|
583
|
+
{
|
584
|
+
"data": {
|
585
|
+
"application/vnd.jupyter.widget-view+json": {
|
586
|
+
"model_id": "69125fc46e0a4ef98151a9a233699094",
|
587
|
+
"version_major": 2,
|
588
|
+
"version_minor": 0
|
589
|
+
},
|
590
|
+
"text/plain": [
|
591
|
+
"VBox(children=(HTML(value='<p style=\"line-height:18px;\">What is 10 + 2 * 5?</p>'), HBox(children=(Button(layou…"
|
592
|
+
]
|
593
|
+
},
|
594
|
+
"metadata": {},
|
595
|
+
"output_type": "display_data"
|
596
|
+
}
|
597
|
+
],
|
598
|
+
"source": [
|
599
|
+
"nbi.multiple_choice(question=\"What is 10 + 2 * 5?\",\n",
|
600
|
+
" choices=['12', '60', '20'],\n",
|
601
|
+
" answers=2)"
|
602
|
+
]
|
603
|
+
},
|
604
|
+
{
|
605
|
+
"cell_type": "code",
|
606
|
+
"execution_count": 14,
|
607
|
+
"metadata": {
|
608
|
+
"scrolled": true
|
609
|
+
},
|
610
|
+
"outputs": [
|
611
|
+
{
|
612
|
+
"data": {
|
613
|
+
"application/vnd.jupyter.widget-view+json": {
|
614
|
+
"model_id": "7579a202c6124ff9b054ea2398505fa0",
|
615
|
+
"version_major": 2,
|
616
|
+
"version_minor": 0
|
617
|
+
},
|
618
|
+
"text/plain": [
|
619
|
+
"VBox(children=(HTML(value='<p style=\"line-height:18px;\">Select all prime numbers.</p>'), HBox(children=(Button…"
|
620
|
+
]
|
621
|
+
},
|
622
|
+
"metadata": {},
|
623
|
+
"output_type": "display_data"
|
624
|
+
}
|
625
|
+
],
|
626
|
+
"source": [
|
627
|
+
"nbi.multiple_choice(question=\"Select all prime numbers.\",\n",
|
628
|
+
" choices=['12', '3', '31'],\n",
|
629
|
+
" answers=[1, 2])"
|
630
|
+
]
|
631
|
+
},
|
632
|
+
{
|
633
|
+
"cell_type": "markdown",
|
634
|
+
"metadata": {},
|
635
|
+
"source": [
|
636
|
+
"### nbinteract.short_answer\n",
|
637
|
+
"\n",
|
638
|
+
"`nbinteract.short_answer` takes a question and an answer.\n",
|
639
|
+
"\n",
|
640
|
+
"The answer can either be a string, a list of strings, or a function that returns `True` when called with the user's input. If the function errors, an error message will be displayed."
|
641
|
+
]
|
642
|
+
},
|
643
|
+
{
|
644
|
+
"cell_type": "code",
|
645
|
+
"execution_count": 15,
|
646
|
+
"metadata": {},
|
647
|
+
"outputs": [
|
648
|
+
{
|
649
|
+
"data": {
|
650
|
+
"application/vnd.jupyter.widget-view+json": {
|
651
|
+
"model_id": "05e3ccd2d1254beab1511943bec50d2c",
|
652
|
+
"version_major": 2,
|
653
|
+
"version_minor": 0
|
654
|
+
},
|
655
|
+
"text/plain": [
|
656
|
+
"VBox(children=(HTML(value='<p style=\"line-height:18px;\">What is 1+1?</p>'), HBox(children=(Text(value='', plac…"
|
657
|
+
]
|
658
|
+
},
|
659
|
+
"metadata": {},
|
660
|
+
"output_type": "display_data"
|
661
|
+
}
|
662
|
+
],
|
663
|
+
"source": [
|
664
|
+
"nbi.short_answer('What is 1+1?', answers='2', explanation='1+1 is 2')"
|
665
|
+
]
|
666
|
+
},
|
667
|
+
{
|
668
|
+
"cell_type": "code",
|
669
|
+
"execution_count": 16,
|
670
|
+
"metadata": {},
|
671
|
+
"outputs": [
|
672
|
+
{
|
673
|
+
"data": {
|
674
|
+
"application/vnd.jupyter.widget-view+json": {
|
675
|
+
"model_id": "4a1cd24a4d61497f82e0a58f51c84409",
|
676
|
+
"version_major": 2,
|
677
|
+
"version_minor": 0
|
678
|
+
},
|
679
|
+
"text/plain": [
|
680
|
+
"VBox(children=(HTML(value='<p style=\"line-height:18px;\">Enter the first name of a member of the Beatles.</p>')…"
|
681
|
+
]
|
682
|
+
},
|
683
|
+
"metadata": {},
|
684
|
+
"output_type": "display_data"
|
685
|
+
}
|
686
|
+
],
|
687
|
+
"source": [
|
688
|
+
"nbi.short_answer('Enter the first name of a member of the Beatles.',\n",
|
689
|
+
" ['John', 'Paul', 'George', 'Ringo'])"
|
690
|
+
]
|
691
|
+
},
|
692
|
+
{
|
693
|
+
"cell_type": "code",
|
694
|
+
"execution_count": 17,
|
695
|
+
"metadata": {},
|
696
|
+
"outputs": [
|
697
|
+
{
|
698
|
+
"data": {
|
699
|
+
"application/vnd.jupyter.widget-view+json": {
|
700
|
+
"model_id": "d4b70f05b0234029861de4fc50bd3aef",
|
701
|
+
"version_major": 2,
|
702
|
+
"version_minor": 0
|
703
|
+
},
|
704
|
+
"text/plain": [
|
705
|
+
"VBox(children=(HTML(value='<p style=\"line-height:18px;\">Enter an even number.</p>'), HBox(children=(Text(value…"
|
706
|
+
]
|
707
|
+
},
|
708
|
+
"metadata": {},
|
709
|
+
"output_type": "display_data"
|
710
|
+
}
|
711
|
+
],
|
712
|
+
"source": [
|
713
|
+
"nbi.short_answer('Enter an even number.', lambda x: int(x) % 2 == 0)"
|
714
|
+
]
|
560
715
|
}
|
561
716
|
],
|
562
717
|
"metadata": {
|