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_TEXTThe name of the quiz
\?integerThe number of minutes allowed for completion (null: NA)
\LONG_TEXTThe text shown at the start of the quiz
\LONG_TEXTThe text shown at the end of the quiz
\LONG_TEXTThe text shown at the end of the quiz on failure
\LONG_TEXTNotes
integerPercentage correctness required for competition
\?TIMEThe time the quiz is opened (null: now)
\?TIMEThe time the quiz is closed (null: never)
integerThe number of winners for this if it is a competition
integerThe minimum number of hours between attempts
\ID_TEXTThe type
\BINARYWhether this is validated
stringText for questions
\?MEMBERThe member adding it (null: current member)
integerThe number of points awarded for completing/passing the quiz/test
\?AUTO_LINKNewsletter for which a member must be on to enter (null: none)
\BINARYWhether to reveal correct answers after the quiz is complete, so that the answerer can learn from the experience
\BINARYWhether to shuffle questions, to make cheating a bit harder
\BINARYWhether to shuffle multiple-choice answers, to make cheating a bit harder
\?TIMEThe add time (null: now)
\?SHORT_TEXTMeta keywords for this resource (null: do not edit) (blank: implicit)
\?LONG_TEXTMeta description for this resource (null: do not edit) (blank: implicit)
\AUTO_LINKThe 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_LINKThe ID
\SHORT_TEXTThe name of the quiz
\?integerThe number of minutes allowed for completion (null: NA)
\LONG_TEXTThe text shown at the start of the quiz
\LONG_TEXTThe text shown at the end of the quiz
\LONG_TEXTThe text shown at the end of the quiz on failure
\LONG_TEXTNotes
integerPercentage correctness required for competition
\?TIMEThe time the quiz is opened (null: now)
\?TIMEThe time the quiz is closed (null: never)
integerThe number of winners for this if it is a competition
integerThe minimum number of hours between attempts
\ID_TEXTThe type
\BINARYWhether this is validated
stringText for questions
\SHORT_TEXTMeta keywords
\LONG_TEXTMeta description
integerThe number of points awarded for completing/passing the quiz/test
\?AUTO_LINKNewsletter for which a member must be on to enter (null: none)
\BINARYWhether to reveal correct answers after the quiz is complete, so that the answerer can learn from the experience
\BINARYWhether to shuffle questions, to make cheating a bit harder
\BINARYWhether to shuffle multiple-choice answers, to make cheating a bit harder
\?TIMEAdd time (null: do not change)
\?MEMBERSubmitter (null: do not change)
booleanDetermines 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 |
|---|
stringThe quiz question line
arrayList of possible answers (used for validation purposes)
stringThe quiz question description
booleanWhether to perform validation / corrections
arrayA 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 |
|---|
arrayThe database row
stringThe zone to show in
booleanWhether to include context (i.e. say WHAT this is, not just show the actual content)
\ID_TEXTOverridden GUID to send to templates (blank: none)
\TempcodeThe 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_LINKEntry ID
\?AUTO_LINKQuiz ID (null: look up from entry ID)
\?arrayQuiz row (null: look up from entry ID)
\?arrayQuestion rows (null: look up from entry ID)
booleanWhether to show answers, regardless of whether the quiz is set to do so
arrayA tuple of quiz result detailstyped_answer_is_correct(string $given_answer, array $all_answers, boolean $strict = false) : boolean
| package | quizzes |
|---|
stringThe given (typed) answer
arrayAnswer rows
booleanWhether to do a strict check
booleanWhether it is correct