Skip to content

Commit 27c4089

Browse files
authored
Update index.md
1 parent eb203f6 commit 27c4089

File tree

1 file changed

+35
-3
lines changed

1 file changed

+35
-3
lines changed

docs/index.md

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,8 @@ You'll also notice we are calling a source file to display our slides. These sli
474474

475475
[Ines explaines](https://github.com/ines/course-starter-python#slides) how your slide mardown document should be structured.
476476

477-
***⚠️ Warning: Be wary of trailing spaces 😵😱!! Although ```---``` may appear to be the same as ```--- ``` they are not and any information placed after the latter will break your slides.***
477+
***⚠️ Warning: Be wary of trailing spaces 😵😱!!
478+
Although ```---``` may appear to be the same as ```--- ``` they are not and any information placed after the latter will break your slides.***
478479

479480
#### Enbedding Video and Audio
480481

@@ -530,13 +531,14 @@ Try again! This is incorrect.
530531
- Each option will live in `<opt>`. If you want to specify a solution option as correct you can give it an argument `correct="true"` otherwise if it's wrong, no argument is needed. ***🔆You can have multiple right answers in a question***
531532

532533

533-
***⚠️ Warning: You must have padding (empty lines) above and below your question text as well as your answer feedback text as shown above._
534+
***⚠️ Warning: You must have padding (empty lines) above and below your question text as well as your answer feedback text as shown above.***
534535

535536
#### 🔆You can have several questions in one exercise container
536537

537538
![](img/multi-q-exercise.png)
538539
<font size="1" color="grey"> Source: Hayley Boyce @ UBC MDS from https://mcl-dsci-571-intro-machine-learning.netlify.com/module1 </font>
539540

541+
<br>
540542

541543
The key to having several questions in one exercise container is to give `<choice>` an id.
542544
```
@@ -591,7 +593,7 @@ your code in `chapter.md` will look like this:
591593
You can type your question instructions here
592594
593595
594-
<codeblock id="exercise-file-name">
596+
<codeblock id="coding-question">
595597
596598
In this space is where you will write any coding or question hints
597599
@@ -600,6 +602,36 @@ In this space is where you will write any coding or question hints
600602
</exercise>
601603
```
602604

605+
This is where things can get a bit tricky. Each coding exercise will require 3 files:
606+
607+
- `exc_coding-question.py` -> The code displayed to the student that they will have to fill in
608+
- `solution_coding-question.py` -> the expected coding solution
609+
- `test_coding-question.py` -> Tests to see if the input done by the student were correct (output when student clicks "submit")
610+
611+
These are all saved in the `exercises` folder.
612+
613+
When we want to specify this exercise in the `chapter.md` file in the exercise container, we must only write `id = coding-question`.
614+
615+
Ines has explain more of this [here](https://github.com/ines/course-starter-python#codeblock)
616+
617+
***🔆You can also have multiple codeblocks in a single exercise container***
618+
619+
Code is written in the same way that you would run normal python scripts, with importing packages and self made functions that can be stored stored and imported from the exercise folder.
620+
621+
***🔆When you are calling files ***
622+
623+
#### Let's talk about importing functions!
624+
625+
If you want to import a functions you made the script can be stored in the `exercises` folder. However, since you are running everything from the root of the directory it's crucial you locate yourself into the `exercises` folder. You can do this with the following code.
626+
```
627+
import sys
628+
sys.path.insert(0, 'exercises/')
629+
```
630+
631+
you can then import as normal.
632+
633+
634+
603635

604636
#### `binder/requirements.txt`
605637

0 commit comments

Comments
 (0)