Functions

Add a quiz.

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, integer $points_for_passing, \?AUTO_LINK $tied_newsletter) : \AUTO_LINK

set SURVEY COMPETITION TEST

Parameters

$name

\SHORT_TEXT

The name of the quiz

$timeout

\?integer

The number of minutes allowed for completion (NULL: NA)

$start_text

\LONG_TEXT

The text shown at the start of the quiz

$end_text

\LONG_TEXT

The text shown at the end of the quiz

$end_text_fail

\LONG_TEXT

The text shown at the end of the quiz on failure

$notes

\LONG_TEXT

Notes

$percentage

integer

Percentage correctness required for competition

$open_time

\?TIME

The time the quiz is opened (NULL: now)

$close_time

\?TIME

The time the quiz is closed (NULL: never)

$num_winners

integer

The number of winners for this if it is a competition

$redo_time

integer

The minimum number of hours between attempts

$type

\ID_TEXT

The type

$validated

\BINARY

Whether this is validated

$text

string

Text for questions

$submitter

\?MEMBER

The member adding it (NULL: current member)

$points_for_passing

integer

The number of points awarded for completing/passing the quiz/test

$tied_newsletter

\?AUTO_LINK

Newsletter for which a member must be on to enter (NULL: none)

Returns

\AUTO_LINKThe ID

Delete a quiz.

delete_quiz(\AUTO_LINK $id) 

Parameters

$id

\AUTO_LINK

The ID

Edit a quiz.

edit_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, \?AUTO_LINK $tied_newsletter) 

set SURVEY COMPETITION TEST

Parameters

$id

\AUTO_LINK

The ID

$name

\SHORT_TEXT

The name of the quiz

$timeout

\?integer

The number of minutes allowed for completion (NULL: NA)

$start_text

\LONG_TEXT

The text shown at the start of the quiz

$end_text

\LONG_TEXT

The text shown at the end of the quiz

$end_text_fail

\LONG_TEXT

The text shown at the end of the quiz on failure

$notes

\LONG_TEXT

Notes

$percentage

integer

Percentage correctness required for competition

$open_time

\?TIME

The time the quiz is opened (NULL: now)

$close_time

\?TIME

The time the quiz is closed (NULL: never)

$num_winners

integer

The number of winners for this if it is a competition

$redo_time

integer

The minimum number of hours between attempts

$type

\ID_TEXT

The type

$validated

\BINARY

Whether this is validated

$text

string

Text for questions

$meta_keywords

\SHORT_TEXT

Meta keywords

$meta_description

\LONG_TEXT

Meta description

$points_for_passing

integer

The number of points awarded for completing/passing the quiz/test

$tied_newsletter

\?AUTO_LINK

Newsletter for which a member must be on to enter (NULL: none)

Get quiz data for exporting it as csv

get_quizz_data_for_csv(\AUTO_LINK $quiz_id) : array

Parameters

$quiz_id

\AUTO_LINK

Quiz ID

Returns

arrayQuiz data array

Add the answers for a quiz.

handle_quiz_answers(\AUTO_LINK $id, string $text, \ID_TEXT $type) 

set COMPETITION TEST SURVEY

Parameters

$id

\AUTO_LINK

The quiz ID

$text

string

Text for questions

$type

\ID_TEXT

The type

Get quiz data for exporting it as csv

render_quiz(array $questions) : \tempcode

Parameters

$questions

array

The quiz questions

Returns

\tempcodeThe rendered quiz

Show a quiz box.

render_quiz_box(array $row, string $zone) : \tempcode

Parameters

$row

array

The database row

$zone

string

The zone to show in

Returns

\tempcodeThe rendered quiz link