Closed inglesp closed 4 days ago
Crude steps / thoughts towards implementing this (branch): Command
opensafely exec ehrql:v1 quiz
command (ehrql quiz
in devenv) to print something (anything) to the terminal.dump-example-data
, have a dump-quiz-file
command. First duplicate then refactor.quiz
assuming that most users won't bother to change the default file name we give them.ehrql quiz
using the executable from the local ehrql repo on a file that prints hello worldFunctionality
question.check(answer)
that creates a sandbox engine (if one is not already provided) and calls check_answer
.create_engine
attempted
and correct
and have check
update them.Things to think about:
run_quiz
should provide some helpful message. Closed by #2241
This is an alternative to #2168.
We can provide a quiz-like experience by giving users an incomplete file with gaps for them to fill in. The file would look something like this:
When they run the file, they would see output like:
There is one line of output for every call to
.check()
, and one line from the call to.summarise()
.The incomplete file can be included in the tutorial repo, so that users can do the quiz after they've done the tutorial.
To run the file, we should provide a VS Code command for users to run from the command palette and/or a button they can click on.
We should add a script to the scripts directory that produces the incomplete file, based on a list of questions that looks something like this, and which uses the answer-checking functionality in #2214.
Writing real questions is out of scope for this ticket.