Skip to content

Commit

Permalink
Adapt the change exercise arguments in PR #108 also in doc (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
agoscinski authored Dec 21, 2024
1 parent eec8088 commit 444994b
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 19 deletions.
10 changes: 5 additions & 5 deletions docs/src/check.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"\n",
"\n",
"check_code_ex = CodeExercise(\n",
" exercise_key=\"sinus_with_references_1\",\n",
" key=\"sinus_with_references_1\",\n",
" code=sin,\n",
" check_registry=check_registry,\n",
")\n",
Expand Down Expand Up @@ -146,7 +146,7 @@
"code_input_sinus = CodeInput(sinus)\n",
"\n",
"check_code_ex = CodeExercise(\n",
" exercise_key=\"sinus_with_references_2\",\n",
" key=\"sinus_with_references_2\",\n",
" code=code_input_sinus,\n",
" check_registry=check_registry,\n",
")\n",
Expand Down Expand Up @@ -234,7 +234,7 @@
"code_input_sinus = CodeInput(sinus)\n",
"\n",
"check_code_ex = CodeExercise(\n",
" exercise_key=\"sinus_functional_behavior\",\n",
" key=\"sinus_functional_behavior\",\n",
" code=code_input_sinus,\n",
" check_registry=check_registry,\n",
")\n",
Expand Down Expand Up @@ -291,7 +291,7 @@
"code_input_sinus = CodeInput(riddle)\n",
"\n",
"check_code_ex = CodeExercise(\n",
" exercise_key=\"riddle\",\n",
" key=\"riddle\",\n",
" code=code_input_sinus,\n",
" check_registry=check_registry,\n",
")\n",
Expand Down Expand Up @@ -392,7 +392,7 @@
" return arr\n",
"\n",
"check_code_ex = CodeExercise(\n",
" exercise_key=\"will_raise_error\",\n",
" key=\"will_raise_error\",\n",
" code=error,\n",
" check_registry=check_registry,\n",
")\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/src/exercises.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,8 @@
"outputs": [],
"source": [
"TextExercise(\n",
" exercise_title=\"Exercise 01: Derive a solution for weights\",\n",
" exercise_description=\"\"\"\n",
" title=\"Exercise 01: Derive a solution for weights\",\n",
" description=\"\"\"\n",
" We can define ridge regression by extending the ordinary least\n",
" square solution by a penalization $\\lambda\\|\\mathbf{w}\\|_2^2$. Please derive the solution\n",
" for the weights from the optimization problem:</p>\n",
Expand Down
4 changes: 2 additions & 2 deletions docs/src/getting_started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@
" parameters={\"omega\": (0.5, 3.14, 0.1)},\n",
" update=update_func,\n",
" update_mode=\"continuous\",\n",
" exercise_title=\"Sinus function\",\n",
" exercise_description=\"Implements $\\sin(x\\omega)$\",\n",
" title=\"Sinus function\",\n",
" description=\"Implements $\\sin(x\\omega)$\",\n",
")\n",
"\n",
"code_ex.run_update() # For the demonstration we run the widget one time\n",
Expand Down
20 changes: 10 additions & 10 deletions docs/src/nbgrader.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
" return [i ** 2 for i in range(1, n + 1)]\n",
" ### END SOLUTION\n",
"\n",
"exercise_description = \"\"\"\n",
"description = \"\"\"\n",
"Write a function that returns a list of numbers,\n",
"such that $x_i=i^2$, for $1\\leq i \\leq n$.\n",
"Make sure it handles the case where $n<1$ by raising a `ValueError`.\n",
Expand All @@ -179,7 +179,7 @@
" check_registry=check_registry,\n",
" exercise_registry=exercise_registry,\n",
" key=\"Part A (2 points)\",\n",
" description=exercise_description\n",
" description=description\n",
")\n",
"\n",
"# Check that squares returns the correct output for several inputs\n",
Expand Down Expand Up @@ -286,7 +286,7 @@
" return sum(squares(n))\n",
" ### END SOLUTION\n",
"\n",
"exercise_description = \"\"\"\n",
"description = \"\"\"\n",
"Using your `squares` function, write a function\n",
"that computes the sum of the squares of the numbers\n",
"from 1 to $n$. Your function should call the `squares`\n",
Expand All @@ -300,7 +300,7 @@
" check_registry=check_registry,\n",
" exercise_registry=exercise_registry,\n",
" key=\"Part B (1 point)\",\n",
" description=exercise_description\n",
" description=description\n",
")\n",
"\n",
"# Check that sum_of_squares returns the correct answer for various inputs\n",
Expand Down Expand Up @@ -402,15 +402,15 @@
"### END SOLUTION\n",
"\"\"\"\n",
"\n",
"exercise_description = \"\"\"\n",
"description = \"\"\"\n",
"Using LaTeX math notation, write out the equation\n",
"that is implemented by your `sum_of_squares` function.\"\"\"\n",
"\n",
"text_ex = TextExercise(\n",
" value=value,\n",
" exercise_registry=exercise_registry,\n",
" key=\"Part C (1 point)\",\n",
" description=exercise_description\n",
" description=description\n",
")\n",
"text_ex"
]
Expand Down Expand Up @@ -459,7 +459,7 @@
" ### BEGIN SOLUTION\n",
" ### END SOLUTION\n",
"\n",
"exercise_description = \"\"\"\n",
"description = \"\"\"\n",
"Find a usecase for your `sum_of_squares` function and implement that usecase in the cell below.\n",
"\"\"\"\n",
"\n",
Expand All @@ -469,7 +469,7 @@
" update=lambda code_ex: print(code_ex.code(code_ex.parameters['n'])),\n",
" exercise_registry=exercise_registry,\n",
" key=\"Part D (2 points)\",\n",
" description=exercise_description\n",
" description=description\n",
")\n",
"\n",
"code_ex_pyramidal_number"
Expand Down Expand Up @@ -513,7 +513,7 @@
},
"outputs": [],
"source": [
"exercise_description = \"\"\"\n",
"description = \"\"\"\n",
"State the formulae for an arithmetic and geometric\n",
"sum and verify them numerically for an example of\n",
"your choice.\"\"\"\n",
Expand All @@ -525,7 +525,7 @@
"\"\"\",\n",
" exercise_registry=exercise_registry,\n",
" key=\"Part E (4 points)\",\n",
" description=exercise_description\n",
" description=description\n",
")\n",
"\n",
"text_ex"
Expand Down

0 comments on commit 444994b

Please sign in to comment.