add_quiz
delete_quiz
edit_quiz
get_quiz_data_for_csv
load_quiz_questions_to_string
parse_quiz_question_line
render_quiz
render_quiz_box
score_quiz
typed_answer_is_correct
add_quiz(\SHORT_TEXT $name, \?integer $timeout, \LONG_TEXT $start_text, \LONG_TEXT $end_text, \LONG_TEXT $end_text_fail, \LONG_TEXT $notes, integer $percentage, \?TIME $open_time, \?TIME $close_time, integer $num_winners, integer $redo_time, \ID_TEXT $type, \BINARY $validated, string $text, \?MEMBER $submitter= null
, integer $points_for_passing= 0
, \?AUTO_LINK $tied_newsletter= null
, \BINARY $reveal_answers= 0
, \BINARY $shuffle_questions= 0
, \BINARY $shuffle_answers= 0
, \?TIME $add_time= null
, \?SHORT_TEXT $meta_keywords= ''
, \?LONG_TEXT $meta_description= ''
) : \AUTO_LINK
package | quizzes |
---|---|
set | SURVEY COMPETITION TEST |
\SHORT_TEXT
The name of the quiz
\?integer
The number of minutes allowed for completion (null: NA)
\LONG_TEXT
The text shown at the start of the quiz
\LONG_TEXT
The text shown at the end of the quiz
\LONG_TEXT
The text shown at the end of the quiz on failure
\LONG_TEXT
Notes
integer
Percentage correctness required for competition
\?TIME
The time the quiz is opened (null: now)
\?TIME
The time the quiz is closed (null: never)
integer
The number of winners for this if it is a competition
integer
The minimum number of hours between attempts
\ID_TEXT
The type
\BINARY
Whether this is validated
string
Text for questions
\?MEMBER
The member adding it (null: current member)
integer
The number of points awarded for completing/passing the quiz/test
\?AUTO_LINK
Newsletter for which a member must be on to enter (null: none)
\BINARY
Whether to reveal correct answers after the quiz is complete, so that the answerer can learn from the experience
\BINARY
Whether to shuffle questions, to make cheating a bit harder
\BINARY
Whether to shuffle multiple-choice answers, to make cheating a bit harder
\?TIME
The add time (null: now)
\?SHORT_TEXT
Meta keywords for this resource (null: do not edit) (blank: implicit)
\?LONG_TEXT
Meta description for this resource (null: do not edit) (blank: implicit)
\AUTO_LINK
The IDedit_quiz(\AUTO_LINK $id, \SHORT_TEXT $name, \?integer $timeout, \LONG_TEXT $start_text, \LONG_TEXT $end_text, \LONG_TEXT $end_text_fail, \LONG_TEXT $notes, integer $percentage, \?TIME $open_time, \?TIME $close_time, integer $num_winners, integer $redo_time, \ID_TEXT $type, \BINARY $validated, string $text, \SHORT_TEXT $meta_keywords, \LONG_TEXT $meta_description, integer $points_for_passing= 0
, \?AUTO_LINK $tied_newsletter= null
, \BINARY $reveal_answers= 0
, \BINARY $shuffle_questions= 0
, \BINARY $shuffle_answers= 0
, \?TIME $add_time= null
, \?MEMBER $submitter= null
, boolean $null_is_literal= false
)
package | quizzes |
---|---|
set | SURVEY COMPETITION TEST |
\AUTO_LINK
The ID
\SHORT_TEXT
The name of the quiz
\?integer
The number of minutes allowed for completion (null: NA)
\LONG_TEXT
The text shown at the start of the quiz
\LONG_TEXT
The text shown at the end of the quiz
\LONG_TEXT
The text shown at the end of the quiz on failure
\LONG_TEXT
Notes
integer
Percentage correctness required for competition
\?TIME
The time the quiz is opened (null: now)
\?TIME
The time the quiz is closed (null: never)
integer
The number of winners for this if it is a competition
integer
The minimum number of hours between attempts
\ID_TEXT
The type
\BINARY
Whether this is validated
string
Text for questions
\SHORT_TEXT
Meta keywords
\LONG_TEXT
Meta description
integer
The number of points awarded for completing/passing the quiz/test
\?AUTO_LINK
Newsletter for which a member must be on to enter (null: none)
\BINARY
Whether to reveal correct answers after the quiz is complete, so that the answerer can learn from the experience
\BINARY
Whether to shuffle questions, to make cheating a bit harder
\BINARY
Whether to shuffle multiple-choice answers, to make cheating a bit harder
\?TIME
Add time (null: do not change)
\?MEMBER
Submitter (null: do not change)
boolean
Determines whether some NULLs passed mean 'use a default' or literally mean 'set to NULL'
get_quiz_data_for_csv(\AUTO_LINK $quiz_id) : array
load_quiz_questions_to_string(\AUTO_LINK $id) : string
parse_quiz_question_line(string $question, array $answers, string $question_extra_text= ''
, boolean $do_validation= true
) : array
package | quizzes |
---|
string
The quiz question line
array
List of possible answers (used for validation purposes)
string
The quiz question description
boolean
Whether to perform validation / corrections
array
A tuple: Question, question type, required?, marked?, question extra text (description)render_quiz(array $questions) : \Tempcode
render_quiz_box(array $row, string $zone= '_SEARCH'
, boolean $give_context= true
, \ID_TEXT $guid= ''
) : \Tempcode
package | quizzes |
---|
array
The database row
string
The zone to show in
boolean
Whether to include context (i.e. say WHAT this is, not just show the actual content)
\ID_TEXT
Overridden GUID to send to templates (blank: none)
\Tempcode
The rendered quiz linkscore_quiz(\AUTO_LINK $entry_id, \?AUTO_LINK $quiz_id= null
, \?array $quiz= null
, \?array $questions= null
, boolean $reveal_all= false
) : array
package | quizzes |
---|
\AUTO_LINK
Entry ID
\?AUTO_LINK
Quiz ID (null: look up from entry ID)
\?array
Quiz row (null: look up from entry ID)
\?array
Question rows (null: look up from entry ID)
boolean
Whether to show answers, regardless of whether the quiz is set to do so
array
A tuple of quiz result detailstyped_answer_is_correct(string $given_answer, array $all_answers, boolean $strict = false
) : boolean
package | quizzes |
---|
string
The given (typed) answer
array
Answer rows
boolean
Whether to do a strict check
boolean
Whether it is correct