Quiz - nomadjimbob/mikioplugin GitHub Wiki
Add simple multiple choice quizzes to your site
<quiz>
<quiz-item choice question="What is the best animal?" text="I don't know" options="dog|cat" answer="cat">
<quiz-item choice question="What is the best food?" options="chicken|fish" answer="chicken">
<quiz-item choice question="What is the fruit?" options="banana|apple" answer="apple">
</quiz>
<quiz resettable>
<quiz-item multiple question="What is the best animal?" text="I don't know" options="dog|cat" scores="1000|100000">
<quiz-item multiple question="What is the best food?" options="chicken|fish" scores="1|5">
<quiz-item choice question="What is the fruit?" options="banana|apple" scores="10|15">
</quiz>
Quiz supports styles that are applied to buttons. By default Prev/Next buttons will use the style while Submit/Retry will use the outline version (or standard if you are using outline initially). This function can be overridden using the submit-type
attribute.
resettable: Shows the option to reset and retake the quiz after submission
full: Shows the quiz in its entirety instead of paginated
reset-text: Change the retry button text. Default is "Retry"
submit-text: Change the submit button text. Default is "Submit"
status-type: Override the submit/retry button style type
prev-text: Change the previous page button text. Default is "Prev"
next-text: Change the next page button text. Default is "Next"
correct-text: Change the word used for "Correct". Default is "Correct"
incorrect-text: Change the word used for "Incorrect". Default is "Incorrect"
status-text: Change the text used in the quiz footer. Default is "Question $1 of $2". ($1 - the current question. $2 - the number of questions)
result-correct-text: Change the text used on the result page of correct questions. Default is "You got $1 out of $2 correct". ($1 - the number of current questions. $2 - the number of questions)
result-score-text: Change the text used on the result page of each questions score. Default is "Score: $1". ($1 - the question score)
result-score-total-text: Change the text used on the result page of the total questions score. Default is "Total score: $1". ($1 - the total question score)\
choice: Sets the quiz item type to a choice
multiple: Sets the quiz item type to allow multiple selections
question: The question to ask for this quiz item
text: Descriptive text for the quiz item
options: Options for the quiz item, separated by the pipe (|) character
answer: The answer to this quiz item. If multiple
is used, Then all the options must be selected listed in answer
separated by the pipe (|) character
scores: The score for each option in this quiz item. There must be a number for each option separated by the pipe (|) character. For invalid options, use a score of 0
-
You can combine multiple and choice types in the same quiz. If a quiz item has both
score
andanswer
, thenscore
will take preference, however it is not recommended in mixing these 2 attributes within a quiz item. -
If a quiz item text begins with a letter/number and a closing bracket/colon, [ie a) / 1:] then only that prefix is shown on the answer page.
-
The results can be styled manually using the
variables.css
file in/styles/
(It may need to be created if it does not exist).
/* make the question result font color blue */
.mikiop-quiz-result .mikiop-quiz-result-question {
color: blue;
}
/* make the question result question itself be red and bold */
.mikiop-quiz-result .mikiop-quiz-result-question strong {
color: red;
font-weight: bold;
}
/* change the total result to be bold and font size 24pt */
.mikiop-quiz-result .mikiop-quiz-result-total {
font-weight: bold;
font-size: 24pt;
}