Skip to content
Snippets Groups Projects
Commit 5d5bdcc7 authored by Philipp Risius's avatar Philipp Risius
Browse files

edit showcase notebook

parent a5d50f94
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,7 @@ dependencies: ...@@ -7,6 +7,7 @@ dependencies:
# Jupyter notebook, -lab, and plugins # Jupyter notebook, -lab, and plugins
- jupyter - jupyter
- jupyterlab - jupyterlab
- jupyterlab-deck
# Scientific stack # Scientific stack
- matplotlib - matplotlib
- numpy - numpy
......
%% Cell type:markdown id:9774c4db-446a-4736-9b81-3147f7f2bb86 tags: %% Cell type:markdown id:9774c4db-446a-4736-9b81-3147f7f2bb86 tags:
# Showcase of nbgrader Features # Showcase of nbgrader Features
%% Cell type:markdown id:fd8395f8-7c55-4ff3-9f65-305fb14c6c87 tags: %% Cell type:markdown id:fd8395f8-7c55-4ff3-9f65-305fb14c6c87 tags:
## Read-Only Cells ## Read-Only Cells
%% Cell type:code id:317bf900-a253-427c-b462-f46906223f16 tags: %% Cell type:code id:317bf900-a253-427c-b462-f46906223f16 tags:
``` python ``` python
import jupyterquiz
``` ```
%% Cell type:markdown id:2c76fb6c-c223-4378-8bb8-e93dc7598942 tags: %% Cell type:markdown id:2c76fb6c-c223-4378-8bb8-e93dc7598942 tags:
## Manually graded cells ## Manually graded cells
%% Cell type:code id:a9bc8ade-2bd7-4d2a-a517-b6aee50fc49c tags: %% Cell type:markdown id:9bb543ea-7672-48f5-b61c-131c9360a93d tags:
``` python Two options for manually graded cells:
``` * set a read-only task to be done elsewhere
* provide space for an answer
* both options can be markdown or code cells
%% Cell type:markdown id:1011509a-9018-4bcb-9bd6-ab28746312c0 tags: %% Cell type:markdown id:1011509a-9018-4bcb-9bd6-ab28746312c0 tags:
## Automatically graded cells ## Automatically graded cells
%% Cell type:code id:859cec0c-0ed2-48e0-8e3b-a5354b517652 tags: %% Cell type:code id:859cec0c-0ed2-48e0-8e3b-a5354b517652 tags:
``` python ``` python
# This is an autograded cell
### BEGIN SOLUTION
def fib(n):
"""calculate the n-th fibonacci number."""
return 1 if 0 <= n <= 1 else fib(n-1) + fib(n-2)
### END SOLUTION
```
%% Cell type:code id:0e9bbfd5-94f1-4b85-94d5-29151a89963c tags:
``` python
# This test is visible
assert fib(0) == 1
# This is an autotest. It will evaluate using the solution
### AUTOTEST fib(1)
### BEGIN HIDDEN TESTS
# These tests are hidden. Students won't see them.
### END HIDDEN TESTS
``` ```
%% Cell type:markdown id:977d17b7-9643-42d1-9eb8-5c657a76fa9e tags: %% Cell type:markdown id:977d17b7-9643-42d1-9eb8-5c657a76fa9e tags:
## Quizzes ## Quizzes (thanks to jupyterquiz)
%% Cell type:markdown id:3a8fa6dd-8e96-4e34-9e6a-d44d56bf0af1 tags: %% Cell type:markdown id:3a8fa6dd-8e96-4e34-9e6a-d44d56bf0af1 tags:
* Quizzes are converted to json and embedded as spans
* the converted version is "invisible"
#### Quiz #### Quiz
* (SC) What are ungraded quizzes good for? * (SC) What are ungraded quizzes good for?
+ This + This
- That - That
#### End Quiz #### End Quiz
%% Cell type:code id:49d89943-fcd2-49b8-850c-886b73075a8a tags: %% Cell type:code id:b7e97aee-911e-448a-be5a-0ab4a7f71ab2 tags:
``` python ``` python
jupyterquiz.display_quiz('#quiz0')
``` ```
%% Output
---------------------------------------------------------------------------
NameError Traceback (most recent call last)
Cell In[4], line 1
----> 1 jupyterquiz.display_quiz('#quiz0')
NameError: name 'jupyterquiz' is not defined
......
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