Function __global->add_quiz
Definitions
sources/quiz2.php
- Add a quiz.
- Is abstract?: No
- Is static?: No
- Is final?: No
- Return: int
Parameters
Name | Type | Default | Set | Range | Description |
---|---|---|---|---|---|
$name | SHORT_TEXT | required parameter | N/A | N/A | The name of the quiz |
$timeout | ?integer | required parameter | N/A | N/A | The number of minutes allowed for completion (null: NA) |
$start_text | LONG_TEXT | required parameter | N/A | N/A | The text shown at the start of the quiz |
$end_text | LONG_TEXT | required parameter | N/A | N/A | The text shown at the end of the quiz |
$end_text_fail | LONG_TEXT | required parameter | N/A | N/A | The text shown at the end of the quiz on failure |
$notes | LONG_TEXT | required parameter | N/A | N/A | Notes |
$percentage | integer | required parameter | N/A | N/A | Percentage correctness required for competition |
$open_time | ?TIME | required parameter | N/A | N/A | The time the quiz is opened (null: now) |
$close_time | ?TIME | required parameter | N/A | N/A | The time the quiz is closed (null: never) |
$num_winners | integer | required parameter | N/A | N/A | The number of winners for this if it is a competition |
$redo_time | ?integer | required parameter | N/A | N/A | The minimum number of hours between attempts (null: N/A) |
$type | ID_TEXT | required parameter | N/A | N/A | The type |
$validated | BINARY | required parameter | N/A | N/A | Whether this is validated |
$text | string | required parameter | N/A | N/A | Text for questions |
$submitter | ?MEMBER | Null | N/A | N/A | The member adding it (null: current member) |
$points_for_passing | integer | 0 | N/A | N/A | The number of points awarded for completing/passing the quiz/test |
$tied_newsletter | ?AUTO_LINK | Null | N/A | N/A | Newsletter for which a member must be on to enter (null: none) |
$reveal_answers | BINARY | 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 | 0 | N/A | N/A | Whether to shuffle questions, to make cheating a bit harder |
$shuffle_answers | BINARY | 0 | N/A | N/A | Whether to shuffle multiple-choice answers, to make cheating a bit harder |
$add_time | ?TIME | Null | N/A | N/A | The add time (null: now) |
$meta_keywords | ?SHORT_TEXT | Blank (empty string) | N/A | N/A | Meta keywords for this resource (null: do not edit) (blank: implicit) |
$meta_description | ?LONG_TEXT | Blank (empty string) | N/A | N/A | Meta description for this resource (null: do not edit) (blank: implicit) |
Return
- The ID
- Type: AUTO_LINK
- Set: N/A
- Range: N/A