Squiz Matrix
4.12.2
|
Data Fields | |
$_bodycopies | |
$_error_stack | |
Additional Inherited Members | |
Protected Member Functions inherited from Listing_Engine | |
_getAssetContentsBCKeywordReplacement (Asset $asset, $contextid=NULL) | |
_getAssetContentsRawBCKeywordReplacement (Asset $asset, $contextid=NULL) | |
_getAssetContentsPaintBCKeywordReplacement (Asset $asset, $paint_layout, $contextid=NULL) | |
Definition at line 68 of file page_online_quiz.inc.
__construct | ( | $assetid = 0 | ) |
Constructor
string | $assetid | the assetid of the asset to load into this object |
Definition at line 97 of file page_online_quiz.inc.
_createAdditional | ( | & | $link | ) |
Perform any additional processing required during the creation of this asset
Asset listings create bopycopy and folder asset when they are created
array | &$link | information used to create the initial link |
Definition at line 150 of file page_online_quiz.inc.
_createBodycopies | ( | ) |
Creates bodycopies for this asset
Overridden, as we need an extra Thank You bodycopy
Definition at line 172 of file page_online_quiz.inc.
_createSubmissionsFolder | ( | ) |
Create the folder for storing submissions
Definition at line 209 of file page_online_quiz.inc.
_getAllowedLinks | ( | ) |
Returns an array of all the permitted link type, the type asset and the cardinality
Definition at line 119 of file page_online_quiz.inc.
_getCacheKey | ( | ) |
Work out the unique cache key to represent the current page Overridden to ensure that the Online Quiz asset is not cached
Definition at line 244 of file page_online_quiz.inc.
_getContentsKeywords | ( | ) |
Return the available keywords in the Page Contents Bodycopy for this asset
The return value is in the form:
Array( 'keyword' => 'name', )
Definition at line 2197 of file page_online_quiz.inc.
_getDefaultBodycopyContent | ( | $bodycopy_code | ) |
Get the default content for a bodycopy
string | $bodycopy_code | The code name for the bodycopy |
Definition at line 315 of file page_online_quiz.inc.
_getFormKeywords | ( | ) |
Returns a list of keywords that can be used on the User Details bodycopy when printing the user details form
Definition at line 2226 of file page_online_quiz.inc.
_getFormSubmitMethod | ( | ) |
Get the current form submit method (always POST)
Definition at line 3490 of file page_online_quiz.inc.
_getFormUrlComponents | ( | ) |
Returns the URL that the form will use for its target
Definition at line 751 of file page_online_quiz.inc.
_getInteractiveKeywords | ( | ) |
Returns a list of keywords that can be used in the page contents bodycopy in interactive mode.
Definition at line 2295 of file page_online_quiz.inc.
_getQuestionGroupResultKeywords | ( | ) |
Returns a list of keywords that can be used to print an Online Quiz Question asset and its score. The keywords available here are specific only to results, and do not contain inherited Question asset keywords
Definition at line 2395 of file page_online_quiz.inc.
_getQuestionKeywords | ( | ) |
Returns a list of keywords that can be used to print an Online Quiz Question asset
Definition at line 2317 of file page_online_quiz.inc.
_getQuestionResultKeywords | ( | ) |
Returns a list of keywords that can be used to print an Online Quiz Question asset and its score. The keywords available here are specific only to results, and do not contain inherited Question asset keywords
Definition at line 2358 of file page_online_quiz.inc.
_getResultsKeywords | ( | ) |
Returns a list of keywords that can be used to print to display the user's details
Definition at line 2277 of file page_online_quiz.inc.
_getUserDetailsKeywords | ( | ) |
Returns a list of keywords that can be used to print to display the user's details
Definition at line 2244 of file page_online_quiz.inc.
clearQuizData | ( | $questions = NULL | ) |
Send the email containing the quiz results to the user
array | $questions | an array of question assetids to be cleared (if NULL, then the results of getQuestions() is used) |
Definition at line 1337 of file page_online_quiz.inc.
createBodycopy | ( | $bodycopy_code, | |
$enable_on_create = TRUE |
|||
) |
Creates a bodycopy
string | $bodycopy_code | the code that indicates which bodycopy to manipulate (see $_bodycopies) |
boolean | $enable_on_create | if TRUE, will set the bodycopy to be enabled (TYPE_2 link) when it is created. If FALSE, it creates it disabled (TYPE_3 link). |
Definition at line 367 of file page_online_quiz.inc.
createForm | ( | $link_type = SQ_LINK_TYPE_2 | ) |
Add a simple form linked under this asset
int | $link_type | specifies which type of link the new form should be created with |
Definition at line 584 of file page_online_quiz.inc.
& createSubmission | ( | ) |
Creates a new submission object
Definition at line 257 of file page_online_quiz.inc.
createTypeFormat | ( | $new_type | ) |
Creates a new type format for the type_code specified by $new_type
string | $new_type | the type_code of the type format to create |
Definition at line 694 of file page_online_quiz.inc.
getAssetList | ( | ) |
Get the list of asset that should be printed
The return array is in the form Array(assetid => type_code) unless we are grouping by letter, in which case the return array is
Array( assetid => Array( 'type_code' => type_code, 'first_letter' => first_letter, ), );
Definition at line 1034 of file page_online_quiz.inc.
& getBodycopy | ( | $bodycopy_code, | |
$only_if_enabled = TRUE |
|||
) |
Returns the a bodycopy
string | $bodycopy_code | the code that indicates which bodycopy to manipulate (see $_bodycopies) |
boolean | $only_if_enabled | if TRUE, will return NULL if the bodycopy is disabled. If FALSE, will only return NULL if never created. |
Definition at line 413 of file page_online_quiz.inc.
getBodycopyLink | ( | $bodycopy_code, | |
$link_type | |||
) |
Returns the link to a bodycopy
string | $bodycopy_code | the code that indicates which bodycopy to manipulate (see $_bodycopies) |
int | $link_type | ensures the link returned is of this type (eg. SQ_LINK_TYPE_2 | SQ_LINK_TYPE_3) |
Definition at line 442 of file page_online_quiz.inc.
& getChunk | ( | & | $children, |
& | $replacements, | ||
$keywords, | |||
$result_page, | |||
$num_per_page, | |||
$group_by = NULL |
|||
) |
Gets the specified chunk based on group-by and pagination options
Overridden because we need to modify the pagination keyword replacements so that they use javascript to submit the form
array | &$children | the list of assets that qualify to be printed |
array | &$replacements | the current replacements array, which will be added to by this function |
array | $keywords | Keywords that need replacing |
array | $result_page | result page |
array | $num_per_page | number of assets per page |
array | $group_by | what to group by |
Definition at line 2022 of file page_online_quiz.inc.
getCurrentPage | ( | ) |
Returns the page currently being displayed
NOTE: Cannot handle a-z grouping
Definition at line 3508 of file page_online_quiz.inc.
getErrorListKeywordReplacement | ( | ) |
Get the replacement for the "error_list" keyword
Definition at line 2830 of file page_online_quiz.inc.
getFlag | ( | $flag | ) |
Returns a flag for the current quiz, eg. 'is_complete'
string | $flag | the flag to return the status of |
Definition at line 1445 of file page_online_quiz.inc.
& getForm | ( | ) |
Get the user_details simple form linked to this asset, if any
Definition at line 546 of file page_online_quiz.inc.
getFormContentsKeywordReplacement | ( | ) |
Get the replacement for the form_contents keyword
Definition at line 643 of file page_online_quiz.inc.
getFormErrorsKeywordReplacement | ( | ) |
Get the replacement for the form_errors keyword
Definition at line 664 of file page_online_quiz.inc.
getFormLink | ( | $link_type | ) |
Returns the link to a form
int | $link_type | ensures the link returned is of this type (eg. SQ_LINK_TYPE_2 | SQ_LINK_TYPE_3) |
Definition at line 568 of file page_online_quiz.inc.
getInteractiveButtonKeywordReplacement | ( | ) |
Return a keyword replacement for 'interactive_button' keyword. Prints the appropriate interactive mode submission button based on the pages current status.
Definition at line 2582 of file page_online_quiz.inc.
getInteractiveQuestionKeywordReplacement | ( | $keyword | ) |
Returns a replacement for interactive_question_X keywords using the current page question.
string | $keyword | Keyword to find a replacement for |
Definition at line 2538 of file page_online_quiz.inc.
getInteractiveQuestions | ( | $grouped = FALSE | ) |
Get all the online_quiz_question_multichoice questions that can be used for the interactive mode.
boolean | $grouped | group by root node (pool)? |
Definition at line 1196 of file page_online_quiz.inc.
getKeywordReplacement | ( | $keyword | ) |
Get bodycopy keyword replacement
Provides a mechanism for providing keyword replacement functions by looking up the function named 'getKeywordNameKeywordReplacement' so an asset wishing to add support for 'best_ever' custom keyword should implement a function getBestEverKeywordReplacement() which returns a replacement string (Overridden in page_online_quiz to handle dynamic keywords, eg. user_details_form_q##)
string | $keyword | Keyword to find a replacement for |
Definition at line 2424 of file page_online_quiz.inc.
getManuallyConfiguredQuestions | ( | ) |
Checks whether the questions were supplied via an asset listing (by using the 'asset_listing' keyword), or manually. If the questions were supplied manually, the asset IDs and types returned will consist of these assets instead of using the Listing Engine.
Definition at line 1244 of file page_online_quiz.inc.
& getPageAssets | ( | & | $children, |
& | $replacements, | ||
$result_page = NULL |
|||
) |
Returns a page of assets
NOTE: Cannot handle a-z grouping, Also, both $children and $replacements are modified during the course of this function
array | &$children | the list of assets to paginate |
array | &$replacements | an array to catch the keyword replacements spat out by getChunk() during the chunking process |
int | $result_page | the page of assets to return |
Definition at line 3555 of file page_online_quiz.inc.
getQuestionCountKeywordReplacement | ( | ) |
Returns the keyword replacements for the 'question_count' keyword
Definition at line 2913 of file page_online_quiz.inc.
getQuestionGroupResultKeywordReplacement | ( | $question_group_asset_id, | |
$keyword | |||
) |
Returns the keyword replacements for Question Group-based result keywords (format: question_group_X_keyword%)
int | $question_group_asset_id | The asset ID of the question group |
string | $keyword | The keyword to retrieve from the question group |
Definition at line 3432 of file page_online_quiz.inc.
getQuestionKeywordReplacement | ( | $question_asset_id, | |
$keyword | |||
) |
Returns the keyword replacements for Question-based keywords (format: question_X_keyword%)
int | $question_asset_id | The asset ID of the question |
string | $keyword | The keyword to retrieve from the question |
Definition at line 3281 of file page_online_quiz.inc.
getQuestionRangeKeywordReplacement | ( | ) |
Returns the keyword replacements for the 'question_range' keyword
Definition at line 2878 of file page_online_quiz.inc.
getQuestionResultKeywordReplacement | ( | $question_asset_id, | |
$keyword | |||
) |
Returns the keyword replacements for Question-based result keywords (format: result_X_keyword%)
int | $question_asset_id | The asset ID of the question |
string | $keyword | The keyword to retrieve from the question |
Definition at line 3305 of file page_online_quiz.inc.
getQuestions | ( | $refresh = NULL , |
|
$all_interactive = FALSE |
|||
) |
Returns the questions for the current user, and optionally generates a new list of questions depending on the value of $refresh:
If $refresh is TRUE, the question list will be refreshed regardless of whether it currently exists or not If FALSE, the list will not be generated if it doesn't exist If NULL, the list will only be generated if it doesn't already exist In Interactive Mode, the question list is always refreshed.
boolean | $refresh | Determines whether or not the question list will be refreshed (see above) |
boolean | $all_interactive | In interactive mode, whether to return all quiz questions under the root nodes, otherwise only the relevant subset of questions loaded into the user quiz session. See Page_Online_Quiz::loadQuestionPagination(). |
Definition at line 1072 of file page_online_quiz.inc.
getQuizTotalAvailablePointsKeywordReplacement | ( | ) |
Return the total available points for the quiz. This value is dependent on the questions displayed in the results if the results are customised.
Definition at line 3411 of file page_online_quiz.inc.
getQuizTotalPointsKeywordReplacement | ( | ) |
Return the total points obtained by the current user for the quiz. This value is dependent on the questions displayed in the results if the results are customised.
Definition at line 3391 of file page_online_quiz.inc.
getResults | ( | ) |
Returns the quiz results for the current user, in the following format:
Array( 'questions' => Array( question_num => Array( 'assetid' => assetid, 'value' => string, // raw value 'summary' => string, // human-readible value 'points' => int, // number of points scored 'available_points' => int, // maximum number of points able to be scored ), ), 'totals' => Array( 'points' => int, // total number of points scored 'available_points => int, // maximum number of points able to be scored across the entire quiz ), )
Definition at line 1541 of file page_online_quiz.inc.
getResultsTableFullKeywordReplacement | ( | $html = TRUE | ) |
Returns the keyword replacements for the 'results_table_full' keyword
boolean | $html | Whether the resulting table should be formatted with HTML or plain-text spacing |
Definition at line 3206 of file page_online_quiz.inc.
getResultsTableFullTextKeywordReplacement | ( | ) |
Returns the keyword replacements for the 'results_table_full_text' keyword
Definition at line 3230 of file page_online_quiz.inc.
getResultsTableKeywordReplacement | ( | $show_columns = NULL , |
|
$show_totals = TRUE , |
|||
$html = TRUE |
|||
) |
Returns the keyword replacements for any 'results_[type]_table' keywords
array | $show_columns | the columns to include in the table |
boolean | $show_totals | whether or not to show totals at the bottom of the table |
boolean | $html | whether or not to render the table in HTML or plain text |
Definition at line 2936 of file page_online_quiz.inc.
getResultsTableSimpleKeywordReplacement | ( | $html = TRUE | ) |
Returns the keyword replacements for the 'results_table_simple' keyword
boolean | $html | Whether the resulting table should be formatted with HTML or plain-text spacing |
Definition at line 3245 of file page_online_quiz.inc.
getResultsTableSimpleTextKeywordReplacement | ( | ) |
Returns the keyword replacements for the 'results_table_simple_text' keyword
Definition at line 3265 of file page_online_quiz.inc.
getScoreKeywordReplacement | ( | ) |
Return a keyword replacement for 'quiz_score' keyword in the format given by 'score_format' attribute. Also used for submission log records.
Definition at line 2615 of file page_online_quiz.inc.
& getSubmissionsFolder | ( | ) |
Get the submissions folder
Definition at line 295 of file page_online_quiz.inc.
getSubmitButtonKeywordReplacement | ( | $field_name = '' , |
|
$button_text = '' |
|||
) |
Get the replacement for "submit_button" keyword
Overridden so we can have the list of warnings appear when the user clicks the submit button
string | $field_name | |
string | $button_text |
Prints an alert() or confirm() containing errors taken from the error_stack
Definition at line 2712 of file page_online_quiz.inc.
getUserDetails | ( | ) |
Returns whatever details we have on the current user
Definition at line 1361 of file page_online_quiz.inc.
getUserDetailsCurrentUserKeywordReplacement | ( | $keyword | ) |
Returns the keyword replacements for any 'user_details_current_user_[keyword]' keywords
string | $keyword | the keyword to get the replacement of |
Definition at line 2693 of file page_online_quiz.inc.
getUserDetailsFormKeywordReplacement | ( | $questionid | ) |
Returns the keyword replacements for any 'user_details_form_[##-q##]' keywords
string | $questionid | the form question to get the answer from |
Definition at line 2672 of file page_online_quiz.inc.
getWarningListKeywordReplacement | ( | ) |
Get the replacement for the "error_list" keyword
Definition at line 2854 of file page_online_quiz.inc.
handleUserDetailsCollection | ( | ) |
Attempts to gather the user details - if they haven't been collected (and need to be, in the case of public_users or 'user_details_source' being set to 'form'), then print the user details form and return FALSE Otherwise, return TRUE
Definition at line 1402 of file page_online_quiz.inc.
loadQuestionList | ( | ) |
Load the list of questions associated with this quiz & user
Definition at line 1633 of file page_online_quiz.inc.
loadQuestionPagination | ( | ) |
Load the question pagination cache containing the 'questions_to_pages' and 'pages_to_questions' indices. Additionally containing 'pages_to_status' and 'pages_to_retry_questions' indices in interactive mode.
This mode heavily depends on this question pagination cache, and is updated frequently while undertaking the quiz.
'pages_to_questions' index will always contain up to date information on which question is to be displayed on each page and each page will only contain one question at any one time. This question may be the initial question or the retry question.
'questions_to_pages' index initially contains all questions to be displayed and is updated by adding the questions used on a retry.
'pages_to_retry_questions' index contains the retry reserve available for each page.
'pages_to_status' index contains each page status used to control what is to be displayed on each page & to combat browser navigation.
Definition at line 1676 of file page_online_quiz.inc.
loadQuestions | ( | ) |
Retrieve the questions, along with their data
Definition at line 1576 of file page_online_quiz.inc.
onRequestKeywords | ( | & | $broadcaster, |
$vars = Array() |
|||
) |
Add valid keywords for this asset to an array of keywords when asked
object | &$broadcaster | the asset that triggered the event |
array | $vars | the vars that get submitted by the broadcaster we add keywords to the $vars['keywords'] array |
Definition at line 2107 of file page_online_quiz.inc.
printBody | ( | ) |
Called by the design to print the body of this asset
Definition at line 490 of file page_online_quiz.inc.
printBodycopy | ( | $bodycopy_code | ) |
Prints a bodycopy (if available)
string | $bodycopy_code | the code that indicates which bodycopy to manipulate (see $_bodycopies) |
Definition at line 513 of file page_online_quiz.inc.
printContents | ( | ) |
Constructs the carts contents
Definition at line 816 of file page_online_quiz.inc.
printFrontend | ( | ) |
Prints out the Frontend for this asset
Definition at line 782 of file page_online_quiz.inc.
processInteractiveQuestions | ( | ) |
Process the interactive questions before later displaying or submitting the quiz. Save the question answers and update all session data.
Definition at line 1824 of file page_online_quiz.inc.
array $_error_stack a list of warnings and errors populated during processQuestions | ( | ) |
Process the questions (validating, saving answers) before later displaying or submitting the quiz
private
Definition at line 1934 of file page_online_quiz.inc.
saveQuestionList | ( | $question_list | ) |
Saves the list of questions associated with this quiz & user
array | $question_list | the questions to save |
Definition at line 1655 of file page_online_quiz.inc.
saveQuestionPagination | ( | $question_pagination | ) |
Save the question pagination cache containing the 'questions_to_pages' and' pages_to_questions' indices. Additionally containing 'pages_to_status' and 'pages_to_retry_questions' indices in interactive mode.
array | $question_pagination | the question pagination details to save |
Definition at line 1807 of file page_online_quiz.inc.
saveQuestions | ( | $questions | ) |
Take the raw question data and save it in the session
array | $questions | the question data to be saved |
Definition at line 1610 of file page_online_quiz.inc.
sendResultsEmail | ( | ) |
Send the email containing the quiz results to the user
Definition at line 1295 of file page_online_quiz.inc.
setBodycopy | ( | $bodycopy_code, | |
$enabled | |||
) |
Handles the enabling or disabling of a bodycopy
string | $bodycopy_code | the code that indicates which bodycopy to manipulate (see $_bodycopies) |
boolean | $enabled | set to TRUE to enable the bodycopy, and FALSE to disable it |
Definition at line 459 of file page_online_quiz.inc.
setFlag | ( | $flag, | |
$value, | |||
$permanent = FALSE |
|||
) |
Sets a flag for the current quiz, eg. 'is_complete'
string | $flag | the flag to set the status of |
mixed | $value | the value to set the flag to |
boolean | $permanent | if TRUE, then use a link to store the flag, instead of just using the (temporary) session |
Definition at line 1480 of file page_online_quiz.inc.
setForm | ( | $enabled | ) |
Handles the enabling or disabling of a bodycopy
boolean | $enabled | set to TRUE to enable the bodycopy, and FALSE to disable it |
Definition at line 614 of file page_online_quiz.inc.
setResults | ( | $results | ) |
Sets the results for the for the current user
array | $results | the results array to store |
Definition at line 1562 of file page_online_quiz.inc.
setUserDetails | ( | $details | ) |
Sets the details we have of the user for later use
array | $details | user details in the format: Array('assetid:questionid' => 'Answer Summary') |
Definition at line 1381 of file page_online_quiz.inc.
$_error_stack |
Definition at line 83 of file page_online_quiz.inc.