-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from jverzani/clean_up
clean up; close issue #1
- Loading branch information
Showing
8 changed files
with
139 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,8 @@ | ||
# QuizQuestions | ||
|
||
[![](https://img.shields.io/badge/docs-stable-blue.svg)](https://juliahub.com/docs/QuizQuestions/) | ||
|
||
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 a selection of one from many. Can be used with Weave, Documenter, 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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
build/ | ||
site/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
using Documenter | ||
using QuizQuestions | ||
|
||
makedocs(sitename="QuizQuestions documentation", | ||
format = Documenter.HTML(ansicolor=true) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# QuizQuestions | ||
|
||
[QuizQuestions](https://github.com/jverzani/QuizQuestions.jl) allows the inclusion of self-grading quiz questions within a `Documenter`, `Weave`, or `Pluto` HTML page. | ||
|
||
|
||
The basic idea is: | ||
|
||
* load the package: | ||
|
||
```@example quiz_question | ||
using QuizQuestions | ||
``` | ||
|
||
* create a question: | ||
|
||
```@example quiz_question | ||
choices = ["one", "``2``", raw"``\sqrt{9}``"] | ||
question = "Which is largest?" | ||
answer = 3 | ||
radioq(choices, answer; label=question, hint="A hint") | ||
``` | ||
|
||
* repeat as desired. | ||
|
||
---- | ||
|
||
The `show` method of the object for the `text/html` mime type produced by `radioq` inserts the necessary HTML and JavaScript code to show the input widget and grading logic. | ||
|
||
|
||
The above question uses radio buttons for allowing one choice from many. | ||
|
||
The `hint` argument allows an optional text-only hint available to the user on hover. The `label` is used to flag the question. This is also optional. For example, the question can be asked in the body of the document (the position of any hint will be different): | ||
|
||
What is ``\sqrt{2}``? | ||
|
||
```@example quiz_question | ||
answer = sqrt(2) | ||
tol = 1e-3 | ||
numericq(answer, tol, hint="you need to be within 1/1000") | ||
``` | ||
|
||
|
||
The quiz questions are written in markdown, as would be the rest of the Documenter or Weave document containing the questions. The above code cells would be enclosed in triple-backtick blocks and would have their contents hidden from the user. How this is done varies from `Documenter`, `Weave`, and `Pluto`. The `examples` directory shows examples of each. Here is an example of a numeric question: | ||
|
||
```@example quiz_question | ||
answer = 1 + 1 | ||
numericq(answer; label="``1 + 1``?", hint="Do the math") | ||
``` | ||
|
||
|
||
---- | ||
|
||
Currently only a few question types are available: | ||
|
||
```@docs | ||
numericq | ||
stringq | ||
radioq | ||
yesnoq | ||
booleanq | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters