Skip to content

Commit

Permalink
Revert to old example
Browse files Browse the repository at this point in the history
  • Loading branch information
willcrichton committed Sep 21, 2023
1 parent 8a0d595 commit 58df8ce
Showing 1 changed file with 39 additions and 22 deletions.
61 changes: 39 additions & 22 deletions example/src/quiz-example.toml
Original file line number Diff line number Diff line change
@@ -1,29 +1,46 @@
[multipart]
ex = """
Alright fam. `Let's go.`
"""

[[questions]]
type = "MultipleChoice"
multipart = "ex"
prompt.prompt = "Hmm"
prompt.prompt = """
What does it mean if a variable `x` is immutable?
```
example
intro h
apply
```
"""
prompt.distractors = [
"A",
"B"
"`x` is stored in the immutable region of memory.",
"After being defined, `x` can be changed at most once.",
"You cannot create a reference to `x`."
]
answer.answer = "C"
context = "sup"
id = "81b6552e-0250-4bb2-82ee-95a1d5858d03"
answer.answer = "`x` cannot be changed after being assigned to a value."
context = """
Immutable means "not mutable", or not changeable.
"""
id = "18ea4c61-c7c3-433f-add5-d3d3156e3e71"

[[questions]]
type = "ShortAnswer"
prompt.prompt = "What is the keyword used after `let` to indicate that a variable can be mutated?"
answer.answer = "mut"
context = """
For example, you can make a mutable variable `x` by writing: `let mut x = 1`.
"""
id = "dbbaea6a-f469-464f-9d60-99ae98456b6a"

[[questions]]
type = "MultipleChoice"
multipart = "ex"
prompt.prompt = "Alright?"
prompt.distractors = [
"D",
"E"
]
answer.answer = "F"
context = "no"
id = "81708e95-41b7-45b9-bca4-5dab003a67aa"
type = "Tracing"
prompt.program = """
fn main() {
let x = 1;
println!("{x}");
x += 1;
println!("{x}");
}
"""
answer.doesCompile = false
answer.lineNumber = 4
context = """
This is a compiler error because line 4 tries to mutate `x` when `x` is not marked as `mut`.
"""
id = "bba6a299-b20f-4685-934a-792a591df3c0"

0 comments on commit 58df8ce

Please sign in to comment.