-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2409f4a
commit 479bb57
Showing
7 changed files
with
149 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# --- | ||
# jupyter: | ||
# jupytext: | ||
# cell_metadata_filter: all | ||
# cell_metadata_json: true | ||
# formats: py:percent | ||
# notebook_metadata_filter: all,-language_info,-jupytext.text_representation.jupytext_version | ||
# text_representation: | ||
# extension: .py | ||
# format_name: percent | ||
# format_version: '1.3' | ||
# kernelspec: | ||
# display_name: Python 3 | ||
# language: python | ||
# name: python3 | ||
# toc: | ||
# base_numbering: 1 | ||
# nav_menu: {} | ||
# number_sections: true | ||
# sideBar: true | ||
# skip_h1_title: false | ||
# title_cell: Table of Contents | ||
# title_sidebar: Contents | ||
# toc_cell: false | ||
# toc_position: {} | ||
# toc_section_display: true | ||
# toc_window_display: false | ||
# --- | ||
|
||
# %% [markdown] | ||
# # another quiz | ||
|
||
# %% {"scrolled": true} | ||
# mostly for using under binder or in a devel tree | ||
import sys | ||
sys.path.append('..') | ||
|
||
# %% {"scrolled": true} | ||
# for convenience in development | ||
# %load_ext autoreload | ||
# %autoreload 2 | ||
|
||
# %% [markdown] | ||
# ## a quizz is made of questions | ||
|
||
# %% [markdown] | ||
# a Quiz object contains one or several questions; here is an example with a single question | ||
|
||
# %% {"scrolled": false} | ||
from exercises.quizsample2 import quiz2 | ||
quiz2.widget() | ||
|
||
# %% [markdown] | ||
# ## under the hood | ||
|
||
# %% [markdown] | ||
# Here's the code that defines the above quizz | ||
|
||
# %% {"scrolled": false} | ||
# !cat ../exercises/quizsample2.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
from nbautoeval import Quiz, QuizQuestion, Option, CodeOption, MathOption | ||
|
||
|
||
############ | ||
quiz2 = Quiz( | ||
|
||
# needs a unique name for storing progress and marks | ||
"quizsample-horizontal", | ||
|
||
[ | ||
QuizQuestion(""" | ||
horizontal_layout means to have | ||
<br>the questions and the options | ||
<br>in a horizontal box""", | ||
options=[ | ||
Option('<img src="../media/image1.png">', correct=True), | ||
Option('<img src="../media/image2.png" width="250px">'), | ||
], | ||
horizontal_layout=True, | ||
), | ||
|
||
|
||
QuizQuestion(""" | ||
horizontal_options means the options appear side by side like here, | ||
because horizontal_layout is False the question spans 100% of page width | ||
""", | ||
options=[ | ||
Option('<img src="../media/image1.png">', correct=True), | ||
Option('<img src="../media/image2.png" width="250px">'), | ||
], | ||
horizontal_options=True, | ||
), | ||
|
||
|
||
QuizQuestion(""" | ||
the default is to have none of these 2 horizontal flags | ||
""", | ||
options=[ | ||
Option('<img src="../media/image1.png">', correct=True), | ||
Option('<img src="../media/image2.png" width="250px">'), | ||
], | ||
), | ||
|
||
QuizQuestion(""" | ||
of course they can be used together as well""", | ||
options=[ | ||
Option('<img src="../media/image1.png">', correct=True), | ||
Option('<img src="../media/image2.png" width="250px">'), | ||
], | ||
horizontal_layout=True, | ||
horizontal_options=True, | ||
), | ||
|
||
|
||
], | ||
max_attempts = 5, | ||
) | ||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters