Skip to content

Commit

Permalink
document scriptq
Browse files Browse the repository at this point in the history
  • Loading branch information
seragunn committed Apr 21, 2024
1 parent afb2f22 commit f5f1390
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![](https://img.shields.io/badge/docs-dev-blue.svg)](https://jverzani.github.io/QuizQuestions.jl/dev/)

A simple means to make basic web pages using Markdown with self-grading quiz questions. Question types are for numeric response, text response (graded with a regular expression), matching, a selection of one from many, or one or more from many. Can be used with Weave, Documenter, [quarto](https://quarto.org), or Pluto.
A simple means to make basic web pages using Markdown with self-grading quiz questions. Question types are for numeric response, text response (graded with a regular expression or by JavaScript function), matching, a selection of one from many, or one or more from many. Can be used with Weave, Documenter, [quarto](https://quarto.org), or Pluto.


The package creates `show` methods for mime type `text/html` for a few objects that produce HTML showing an input widget with attached javascript code to grade the input once the widget loses focus.
Expand Down
10 changes: 10 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,15 @@ fillblankq(question, r"^lazy$")

----

(like `scriptq`)

```@example quiz_question
funct = "(input) => input >= 42"
scriptq(funct, label="a large number", explanation="should be at least 6 * 7")
```

----

(like `numericq`)

```@example quiz_question
Expand Down Expand Up @@ -235,6 +244,7 @@ multibuttonq
matchq
numericq
stringq
scriptq
fillblankq
hotspotq
plotlylightq
Expand Down
7 changes: 7 additions & 0 deletions examples/documenter.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ re = Regex("abc") # hide
stringq(re) # hide
```

Enter a large number

```@example quiz
funct = "(input) => input >= 42"
scriptq(funct, explanation="should be at least 6 * 7")
```

What is ``\sin(\frac{\pi}{2})``?

```@example quiz
Expand Down
8 changes: 8 additions & 0 deletions examples/quarto.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ re = Regex("abc")
stringq(re)
```

Enter a large number

```{julia}
#| echo: false
funct = "(input) => input >= 42"
scriptq(funct, explanation="should be at least 6 * 7")
```

```{julia}
#| echo: false
a = 1
Expand Down
5 changes: 5 additions & 0 deletions examples/weave.jmd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ re = Regex("abc")
stringq(re)
```

Enter a large number

```julia; echo=false
funct = "(input) => input >= 42"
scriptq(funct, explanation="should be at least 6 * 7")
```

```julia; echo=false
a = 1
Expand Down

0 comments on commit f5f1390

Please sign in to comment.