Function __global->edit_quiz

Definitions

sources/quiz2.php

  • Edit a quiz.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$id AUTO_LINK No No required parameter N/A N/A The ID
$name SHORT_TEXT No No required parameter N/A N/A The name of the quiz
$timeout ?integer No No required parameter N/A N/A The number of minutes allowed for completion (null: NA)
$start_text LONG_TEXT No No required parameter N/A N/A The text shown at the start of the quiz
$end_text LONG_TEXT No No required parameter N/A N/A The text shown at the end of the quiz
$end_text_fail LONG_TEXT No No required parameter N/A N/A The text shown at the end of the quiz on failure
$notes LONG_TEXT No No required parameter N/A N/A Notes
$percentage integer No No required parameter N/A N/A Percentage correctness required for competition
$open_time ?TIME No No required parameter N/A N/A The time the quiz is opened (null: now)
$close_time ?TIME No No required parameter N/A N/A The time the quiz is closed (null: never)
$num_winners integer No No required parameter N/A N/A The number of winners for this if it is a competition
$redo_time ?integer No No required parameter N/A N/A The minimum number of hours between attempts (null: N/A)
$type ID_TEXT No No required parameter SURVEY COMPETITION TEST N/A The type
$validated BINARY No No required parameter N/A N/A Whether this is validated
$text string No No required parameter N/A N/A Text for questions
$meta_keywords SHORT_TEXT No No required parameter N/A N/A Meta keywords
$meta_description LONG_TEXT No No required parameter N/A N/A Meta description
$points_for_passing integer No No 0 N/A N/A The number of points awarded for completing/passing the quiz/test
$tied_newsletter ?AUTO_LINK No No Null N/A N/A Newsletter for which a member must be on to enter (null: none)
$reveal_answers BINARY No No 0 N/A N/A Whether to reveal correct answers after the quiz is complete, so that the answerer can learn from the experience
$shuffle_questions BINARY No No 0 N/A N/A Whether to shuffle questions, to make cheating a bit harder
$shuffle_answers BINARY No No 0 N/A N/A Whether to shuffle multiple-choice answers, to make cheating a bit harder
$add_time ?TIME No No Null N/A N/A Add time (null: do not change)
$submitter ?MEMBER No No Null N/A N/A Submitter (null: do not change)
$null_is_literal boolean No No False N/A N/A Determines whether some nulls passed mean 'use a default' or literally mean 'set to null'

Preview

Code (PHP)

/**
 * Edit a quiz.
 *
 * @param  AUTO_LINK $id The ID
 * @param  SHORT_TEXT $name The name of the quiz
 * @param  ?integer $timeout The number of minutes allowed for completion (null: NA)
 * @param  LONG_TEXT $start_text The text shown at the start of the quiz
 * @param  LONG_TEXT $end_text The text shown at the end of the quiz
 * @param  LONG_TEXT $end_text_fail The text shown at the end of the quiz on failure
 * @param  LONG_TEXT $notes Notes
 * @param  integer $percentage Percentage correctness required for competition
 * @param  ?TIME $open_time The time the quiz is opened (null: now)
 * @param  ?TIME $close_time The time the quiz is closed (null: never)
 * @param  integer $num_winners The number of winners for this if it is a competition
 * @param  ?integer $redo_time The minimum number of hours between attempts (null: N/A)
 * @param  ID_TEXT $type The type
 * @set SURVEY COMPETITION TEST
 * @param  BINARY $validated Whether this is validated
 * @param  string $text Text for questions
 * @param  SHORT_TEXT $meta_keywords Meta keywords
 * @param  LONG_TEXT $meta_description Meta description
 * @param  integer $points_for_passing The number of points awarded for completing/passing the quiz/test
 * @param  ?AUTO_LINK $tied_newsletter Newsletter for which a member must be on to enter (null: none)
 * @param  BINARY $reveal_answers Whether to reveal correct answers after the quiz is complete, so that the answerer can learn from the experience
 * @param  BINARY $shuffle_questions Whether to shuffle questions, to make cheating a bit harder
 * @param  BINARY $shuffle_answers Whether to shuffle multiple-choice answers, to make cheating a bit harder
 * @param  ?TIME $add_time Add time (null: do not change)
 * @param  ?MEMBER $submitter Submitter (null: do not change)
 * @param  boolean $null_is_literal Determines whether some nulls passed mean 'use a default' or literally mean 'set to null'
 */

function edit_quiz(int $id, string $name, ?int $timeout, string $start_text, string $end_text, string $end_text_fail, string $notes, int $percentage, ?int $open_time, ?int $close_time, int $num_winners, ?int $redo_time, string $type, int $validated, string $text, string $meta_keywords, string $meta_description, int $points_for_passing = 0, ?int $tied_newsletter = null, int $reveal_answers = 0, int $shuffle_questions = 0, int $shuffle_answers = 0, ?int $add_time = null, ?int $submitter = null, bool $null_is_literal = false)