Skip to content

Commit f410bb7

Browse files
committed
TST: new gated directives
1 parent bb41f2d commit f410bb7

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

environment.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ dependencies:
1010
- quantecon-book-theme==0.2.7
1111
- sphinx-tojupyter==0.2.0
1212
- sphinxext-rediraffe==0.2.7
13-
- sphinx-exercise==0.2.1
13+
# - sphinx-exercise==0.2.1
14+
- git+https://github.com/executablebooks/sphinx-exercise@gated-directive
1415
- ghp-import==1.1.0
1516
# Temporary Fixes
1617
- networkx==2.6.3

lectures/functions.md

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,10 @@ Use no import besides `from numpy.random import uniform`.
355355

356356
## Solutions
357357

358-
```{solution} exercise_1
358+
```{solution-start} exercise_1
359359
:label: solution_1
360360
361361
Here's one solution.
362-
363362
```
364363

365364
```{code-cell} python3
@@ -372,7 +371,10 @@ def factorial(n):
372371
factorial(4)
373372
```
374373

375-
````{solution} exercise_2
374+
```{solution-end}
375+
```
376+
377+
```{solution-start} exercise_2
376378
:label: solution_2
377379
````
378380
@@ -390,7 +392,11 @@ def binomial_rv(n, p):
390392
binomial_rv(10, 0.5)
391393
```
392394

393-
```{solution} exercise_3
395+
```{solution-end}
396+
```
397+
398+
399+
```{solution-start} exercise_3
394400
:label: solution_3
395401
396402
Here's a function for the first random device.
@@ -416,9 +422,7 @@ def draw(k): # pays if k consecutive successes in a sequence
416422
draw(3)
417423
```
418424

419-
```{solution} exercise_3
420425
Here's another function for the second random device.
421-
```
422426

423427
```{code-cell} python3
424428
def draw_new(k): # pays if k successes in a sequence
@@ -438,3 +442,5 @@ def draw_new(k): # pays if k successes in a sequence
438442
draw_new(3)
439443
```
440444

445+
```{solution-end}
446+
```

0 commit comments

Comments
 (0)