18 require_once SQ_INCLUDE_PATH.
'/asset_management.inc';
47 'type' =>
'serialise',
49 'online_quiz_question' => 1,
55 'type' =>
'selection',
56 'default' =>
'number',
57 'parameters' => Array(
59 'allow_empty' => FALSE,
61 'number' =>
'Standard',
62 'grouped' =>
'Custom Grouping',
66 'num_questions' => Array(
70 'description' =>
'The number of questions to draw from the question pool (all, if zero)',
72 'user_details_source' => Array(
74 'type' =>
'selection',
75 'default' =>
'current_user',
76 'description' =>
'Where to source the user details from: either the currently logged in user, or a form',
77 'parameters' => Array(
79 'current_user' =>
'Current User',
82 'allow_empty' => FALSE,
85 'can_retake' => Array(
89 'description' =>
'Whether or not the user can take the quiz again',
90 'parameters' => Array(
91 'allow_empty' => FALSE,
94 'after_submit_action' => Array(
96 'type' =>
'selection',
97 'default' =>
'thank_you',
98 'description' =>
'What to do after a quiz has been finished (eg. display a "thank you" page)',
99 'parameters' => Array(
101 'thank_you' =>
'Show "Thank You" page',
102 'return_to_quiz' =>
'Return to quiz immediately',
104 'allow_empty' => FALSE,
107 'results_email_format' => Array(
109 'type' =>
'email_format',
110 'default' => Array(),
111 'description' =>
'The format of the email that will be sent out at the completion of the quiz',
113 'clientside_validation' => Array(
117 'description' =>
'Whether or not to warn with user with a JS popup when submitting if some answers are empty or invalid',
118 'parameters' => Array(
119 'allow_empty' => FALSE,
122 'log_submissions' => Array(
126 'description' =>
'When enabled, User Details and submitted Quiz results will be logged. These will then be available to export from the "Submission Logs" screen',
127 'parameters' => Array(
128 'allow_empty' => FALSE,
131 'score_format' => Array(
135 'is_contextable' => TRUE,
136 'description' =>
'Used for %quiz_score% keyword and submission logs.',
138 'interactive_mode' => Array(
142 'description' =>
'If enabled, bypasses the listing engine, displaying one question per page, providing feedback and allowing retries.',
143 'parameters' => Array(
144 'allow_empty' => FALSE,
147 'question_pool_setup' => Array(
149 'type' =>
'serialise',
150 'default' => Array(),
152 'question_option_format'=> Array(
156 'is_contextable'=> TRUE,
157 'description' =>
'Online Quiz Question Multichoice radio/checkbox option print format.'
159 'retry_button_text' => Array(
162 'default' =>
'Retry',
163 'is_contextable' => TRUE,
165 'next_button_text' => Array(
169 'is_contextable' => TRUE,
171 'submit_question_button_text' => Array(
174 'default' =>
'Submit Answer',
175 'is_contextable' => TRUE,
192 'event_name' =>
'requestKeywords',
193 'broadcast_type_code' =>
'content_type',
194 'broadcast_strict_type_code' => FALSE,
196 'side_of_link' =>
'major',
198 'is_exclusive' => NULL,
201 'link_type' => SQ_LINK_TYPE_2 | SQ_LINK_TYPE_1,
219 $res = parent::_upgrade($current_version);
221 if (version_compare($current_version,
'0.3',
'<')) {
222 pre_echo(
'UPGRADING ONLINE QUIZ TO v0.3');
223 $quizids = $GLOBALS[
'SQ_SYSTEM']->am->getTypeAssetids(
'page_online_quiz', FALSE);
224 foreach ($quizids as $quizid) {
225 $quiz = $GLOBALS[
'SQ_SYSTEM']->am->getAsset($quizid);
226 if (!$quiz->_createSubmissionsFolder()) {
227 trigger_error(
'Error creating submissions folder for Online Quiz #'.$quizid, E_USER_WARNING);
229 $GLOBALS[
'SQ_SYSTEM']->am->forgetAsset($quiz);
231 pre_echo(count($quizids).
' ONLINE QUIZ ASSETS UPDATED');