Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
Page_Online_Quiz Class Reference
Inheritance diagram for Page_Online_Quiz:
Page_Asset_Listing Listing_Engine Page Asset MySource_Object

Public Member Functions

 __construct ($assetid=0)
 
 _getAllowedLinks ()
 
 _createAdditional (&$link)
 
 _createBodycopies ()
 
 _createSubmissionsFolder ()
 
 _getCacheKey ()
 
createSubmission ()
 
getSubmissionsFolder ()
 
 _getDefaultBodycopyContent ($bodycopy_code)
 
 createBodycopy ($bodycopy_code, $enable_on_create=TRUE)
 
getBodycopy ($bodycopy_code, $only_if_enabled=TRUE)
 
 getBodycopyLink ($bodycopy_code, $link_type)
 
 setBodycopy ($bodycopy_code, $enabled)
 
 printBody ()
 
 printBodycopy ($bodycopy_code)
 
getForm ()
 
 getFormLink ($link_type)
 
 createForm ($link_type=SQ_LINK_TYPE_2)
 
 setForm ($enabled)
 
 getFormContentsKeywordReplacement ()
 
 getFormErrorsKeywordReplacement ()
 
 createTypeFormat ($new_type)
 
 _getFormUrlComponents ()
 
 printFrontend ()
 
 printContents ()
 
 getAssetList ()
 
 getQuestions ($refresh=NULL, $all_interactive=FALSE)
 
 getInteractiveQuestions ($grouped=FALSE)
 
 getManuallyConfiguredQuestions ()
 
 sendResultsEmail ()
 
 clearQuizData ($questions=NULL)
 
 getUserDetails ()
 
 setUserDetails ($details)
 
 handleUserDetailsCollection ()
 
 getFlag ($flag)
 
 setFlag ($flag, $value, $permanent=FALSE)
 
 getResults ()
 
 setResults ($results)
 
 loadQuestions ()
 
 saveQuestions ($questions)
 
 loadQuestionList ()
 
 saveQuestionList ($question_list)
 
 loadQuestionPagination ()
 
 saveQuestionPagination ($question_pagination)
 
 processInteractiveQuestions ()
 
 processQuestions ()
 
getChunk (&$children, &$replacements, $keywords, $result_page, $num_per_page, $group_by=NULL)
 
 onRequestKeywords (&$broadcaster, $vars=Array())
 
 _getContentsKeywords ()
 
 _getFormKeywords ()
 
 _getUserDetailsKeywords ()
 
 _getResultsKeywords ()
 
 _getInteractiveKeywords ()
 
 _getQuestionKeywords ()
 
 _getQuestionResultKeywords ()
 
 _getQuestionGroupResultKeywords ()
 
 getKeywordReplacement ($keyword)
 
 getInteractiveQuestionKeywordReplacement ($keyword)
 
 getInteractiveButtonKeywordReplacement ()
 
 getScoreKeywordReplacement ()
 
 getUserDetailsFormKeywordReplacement ($questionid)
 
 getUserDetailsCurrentUserKeywordReplacement ($keyword)
 
 getSubmitButtonKeywordReplacement ($field_name= '', $button_text= '')
 
 getErrorListKeywordReplacement ()
 
 getWarningListKeywordReplacement ()
 
 getQuestionRangeKeywordReplacement ()
 
 getQuestionCountKeywordReplacement ()
 
 getResultsTableKeywordReplacement ($show_columns=NULL, $show_totals=TRUE, $html=TRUE)
 
 getResultsTableFullKeywordReplacement ($html=TRUE)
 
 getResultsTableFullTextKeywordReplacement ()
 
 getResultsTableSimpleKeywordReplacement ($html=TRUE)
 
 getResultsTableSimpleTextKeywordReplacement ()
 
 getQuestionKeywordReplacement ($question_asset_id, $keyword)
 
 getQuestionResultKeywordReplacement ($question_asset_id, $keyword)
 
 getQuizTotalPointsKeywordReplacement ()
 
 getQuizTotalAvailablePointsKeywordReplacement ()
 
 getQuestionGroupResultKeywordReplacement ($question_group_asset_id, $keyword)
 
 _getFormSubmitMethod ()
 
 getCurrentPage ()
 
getPageAssets (&$children, &$replacements, $result_page=NULL)
 
- Public Member Functions inherited from Page_Asset_Listing
 __construct ($assetid=0)
 
 getAssetList ()
 
 _getAssetList ($group_by, $logic, $wanted_types, $root_asset_ids, $sort_info, $link_value_wanted=NULL)
 
 _getSortedAssetLists ($assets_to_list, $sort_info)
 
 _combineAssets ($logic='OR', $new_assets=Array(), $existing=NULL)
 
 _combineRootNodes ($assets=Array(), $root_nodes=Array(), $types=Array())
 
- Public Member Functions inherited from Listing_Engine
 __construct ($assetid=0)
 
 _createAdditional (&$link)
 
 _createBodycopies ()
 
 _getDefaultBodycopyContent ($bodycopy_code)
 
 lockTypes ()
 
 prepareLink (&$asset, $side_of_link, &$link_type, &$value, &$sort_order, &$dependant, &$exclusive)
 
 describeLink ($linkid)
 
 isDeletableLink ($linkid)
 
 cloneComponentsAdditional (&$clone, $components)
 
 _getAllowedLinks ()
 
getFolder ($type='type_formats')
 
 getFormats ($type='type_formats')
 
 printBody ()
 
 _getFormUrlComponents ()
 
 printNoResultsBodycopy (&$keywords)
 
 printContents ()
 
 _getCacheKey ()
 
 _getNumPerPage ()
 
 getAssetList ()
 
 sortAssetList ($asset_list, $sort_info)
 
 filterAssetList (&$todo)
 
 filterAssetStatuses (&$todo)
 
 filterAssetTypes (&$todo)
 
 getAllowedAssetTypeMap ()
 
 adjustAssetPositions (&$todo)
 
getChunk (&$children, &$replacements, $keywords, $result_page, $num_per_page, $group_by=NULL)
 
 _getPageList ($total_pages, $current_page, $window_size=NULL)
 
 _groupChunk (&$todo, &$chunk, &$remaining_count, $num_per_page, $group_limit=NULL)
 
 printAssetList ($todo)
 
 _printGroups (&$todo, $group_info)
 
 _printAssetList ($todo)
 
 _getShadowAssetKeywordReplacements ($assetid, $bc_keywords)
 
 _printAsset ($assetid, $list_position, $num_items=0)
 
_getTypeFormatBodycopy ($type_code)
 
 _getSelectionFieldNamePrefix ($selection_name)
 
 getSortableAssetInfo ()
 
 getRootNodes ($reload=TRUE)
 
 getExtendedAssetKeywordReplacements ()
 
 isDescending ()
 
 registerFormField ($field_name)
 
 getUsedFormFields ()
 
 getSortInfo ()
 
 groupAssetsRecursively ($group_levels, $assetids, &$results)
 
 limitAssetsRecursively (&$results, $limit_array)
 
 getGroupableParentAssetids ($child_assetid, $restrict_types=Array(), $direct_parent_only=FALSE)
 
convertProxyAssetTypes (&$results)
 
 _getGroupableParentAssetids ($child_assetid, $restrict_types=Array(), $root_nodes=Array(), $direct_parent_only=FALSE)
 
 sortGroups ($group_levels, $assetids, &$results)
 
 reindexGroupFormats ()
 
 processAssetSelections ()
 
 getAssetSelectionValue ($selection_name, $assetid)
 
 getAssetSelectionDefaults ()
 
 getAssetTargetDefaults ()
 
 _arrayCountRecursive (&$array, $limit=NULL)
 
 _getPositionFormats ()
 
 onRequestKeywords (&$broadcaster, $vars=Array())
 
 _getGenericSingleAssetFormatKeywords ($type=NULL)
 
 _getAdditionalSingleAssetFormatKeywords ()
 
 getAvailableKeywords ()
 
 _getContentsKeywords ()
 
 _getTypeFormatsKeywords ()
 
 _getGroupFolderKeywords ()
 
 getKeywordReplacement ($original_keyword)
 
 getContentsKeywordReplacements ($keywords=Array())
 
 getSortByKeywordReplacement ()
 
 getSortOrderKeywordReplacement ()
 
 getSubmitButtonKeywordReplacement ()
 
 getResetButtonKeywordReplacement ()
 
 getRootNodesKeywordReplacement ()
 
 getAssetTargetKeywordReplacement ($name)
 
 getStructuredRootNodeKeywordReplacement ()
 
 getSelectAllJSCodeKeywordReplacement ()
 
 _recurseCheckAllRelations (&$todo, &$relations, $prefix, $limit=NULL)
 
 _analyseCheckAllRelations ($todo)
 
 _buildRelationsJS ()
 
 _getFormSubmitMethod ()
 
 createNoResultsBodycopy ($enable_on_create=TRUE)
 
getNoResultsBodycopy ($only_if_enabled=TRUE)
 
 isNoResultsBodycopyEnabled ()
 
 setUseNoResultsBodycopy ($enabled)
 
- Public Member Functions inherited from Page
 __construct ($assetid=0)
 
 _getAllowedLinks ()
 
 printBody ()
 
- Public Member Functions inherited from Asset
 Asset ($assetid=0)
 
 create (Array &$link)
 
 load ($assetid)
 
 _loadDataPaths ()
 
 reload ()
 
 canDelete ()
 
 delete ($release_lock=TRUE, $check_locked=TRUE)
 
 useSystemVersion ()
 
 loadSystemVersion ()
 
 saveSystemVersion ()
 
 clearSystemVersion ()
 
 revertToSystemVersion ()
 
 revertNoticeLinksToSystemVersion ()
 
 _updated ($update_parents=TRUE)
 
 type ()
 
 getTypeAncestors ($include_asset=TRUE)
 
 incrementVersion ($number='micro', $update_parents=TRUE)
 
 getLanguages ()
 
 setLanguages (Array $languages)
 
 setCharset ($charset)
 
 setForceSecure ($force_secure)
 
 remapAssetids (Array $map)
 
 morph ($new_type_code)
 
 _morphCleanup ($new_type_code)
 
 onRequestKeywords (Asset $broadcaster, Array $vars=Array())
 
 canClone ()
 
 cloneComponents (Asset $clone, Array $components, $override=FALSE)
 
 cloneComponentsAdditional (Asset $clone, Array $components)
 
 cloneLinks (Asset $clone)
 
 getStatus ()
 
 getAvailableStatii ()
 
 getStatusDescription ()
 
 processStatusChange ($new_status, $update_parents=TRUE, $run_updated=TRUE)
 
 setDate ($date_type, $time=NULL, $userid=NULL)
 
 lockTypes ()
 
 canForceablyAcquireLock ($lock_type)
 
 getEditingLocks ($keywords)
 
 _getAllowedLinks ()
 
 createLink (Asset $minor, $link_type, $value='', $sort_order=NULL, $dependant='0', $exclusive='0', $moving=FALSE, $locked=0)
 
 prepareLink (Asset $asset, $side_of_link, &$link_type, &$value, &$sort_order, &$dependant, &$exclusive)
 
 canCreateLink (Asset $minor, $link_type, $exclusive)
 
 canMoveLink (Asset $minor, Asset $old_major, $link_type)
 
 describeLink ($linkid)
 
 isDeletableLink ($linkid)
 
 canDeleteLink ($linkid)
 
 deleteLink ($linkid, $check_locked=TRUE)
 
 linksUpdated ()
 
 canCloneLink ()
 
 saveAttributes ($dont_run_updated=FALSE, $log_message=TRUE)
 
 setAttrValue ($name, $value)
 
 attr ($name)
 
attrByRef ($name)
 
 getAttribute ($name, $mute_errors=FALSE)
 
 getAssetKeywords ($descriptions=FALSE)
 
 getAvailableKeywords ()
 
 getKeywordReplacement ($keyword)
 
 getAssetWebPathKeywordReplacement ()
 
 getCustomKeywordReplacements ($keywords=Array(), $invoke_backend=FALSE)
 
 processCustomKeywords ($keywords=Array())
 
 getContent ()
 
 setContent ()
 
 getEffectiveLastUpdatedTime ($assetids)
 
 readAccess (Array $assetids=Array())
 
 writeAccess ($lock_type='', Array $assetids=Array(), $only_workflow=TRUE)
 
 adminAccess ($lock_type='', Array $assetids=Array())
 
 backendAccess ()
 
 liveEditAccess ($lock_type)
 
 canliveEdit ($lock_type)
 
 effectiveUnrestricted ()
 
 checkAccess ($perm, $lock_type, Array $assetids=Array(), $only_workflow=TRUE)
 
 accessEffective ()
 
 permissionsUpdated ()
 
 printFrontend ()
 
 printFrontendAsset (Asset $asset, $design=NULL)
 
 getValidProtocols ()
 
 printHead ()
 
 printBody ()
 
 getCurrentPaintLayoutName ()
 
 getCurrentDesignName ()
 
 printBodyWithPaintLayout ($layout_id='')
 
 initLimbo ()
 
 printLimbo ()
 
 paintBackend (Backend_Outputter $o)
 
 getPrefix ()
 
 processBackend (Backend_Outputter $o, Array &$link)
 
 getEI ()
 
 getEditFns ()
 
 getBackendHref ($screen='', $backend_page=TRUE)
 
 getURL ($base_url=NULL, $ignore_rollback=FALSE, $base_contextid=NULL)
 
 getURLs ()
 
 getHref ($base_url=NULL, $ignore_rollback=FALSE)
 
 getWebDataPath ()
 
 getWebPaths ()
 
 saveWebPaths ($paths, $auto_add_remaps=TRUE)
 
 getLookups ($field='')
 
 getDesignLookups ()
 
 getLookupValues ($inherited=NULL, $prefix='', $like_search=TRUE, $ignore_override=FALSE)
 
 deleteLookupValue ($layout_name, $layout_value)
 
 setPaintLayouts ($layouts)
 
 updateLookups ($auto_add_remaps=TRUE)
 
 setLookupValues (Array $values)
 
 getAssetStatusDescriptionKeywordReplacement ()
 
 getAssetStatusColourKeywordReplacement ()
 
 replaceKeywordsInString ($string)
 
 fastTrack ($tasks)
 
 unFastTrack ($tasks)
 
 shouldFastTrack ($task, $assetid=NULL)
 
 getFaskTrackedTaskAssetids ($task)
 
 getDependantParentsURL ()
 
- Public Member Functions inherited from MySource_Object
 MySource_Object ()
 
 __sleep ()
 
 __wakeup ()
 

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)
 

Detailed Description

Definition at line 68 of file page_online_quiz.inc.

Constructor & Destructor Documentation

__construct (   $assetid = 0)

Constructor

Parameters
string$assetidthe assetid of the asset to load into this object
Returns
void public

Definition at line 97 of file page_online_quiz.inc.

Member Function Documentation

_createAdditional ( $link)

Perform any additional processing required during the creation of this asset

Asset listings create bopycopy and folder asset when they are created

Parameters
array&$linkinformation used to create the initial link
Returns
boolean private

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

Returns
boolean protected

Definition at line 172 of file page_online_quiz.inc.

_createSubmissionsFolder ( )

Create the folder for storing submissions

Returns
boolean protected

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

Returns
array private
See Also
Asset::_getAllowLinks()

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

Returns
string private

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',
)
Returns
array public

Definition at line 2197 of file page_online_quiz.inc.

_getDefaultBodycopyContent (   $bodycopy_code)

Get the default content for a bodycopy

Parameters
string$bodycopy_codeThe code name for the bodycopy
Returns
string private

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

Returns
array public

Definition at line 2226 of file page_online_quiz.inc.

_getFormSubmitMethod ( )

Get the current form submit method (always POST)

Returns
string protected

Definition at line 3490 of file page_online_quiz.inc.

_getFormUrlComponents ( )

Returns the URL that the form will use for its target

Returns
string private

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.

Returns
array public

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

Returns
array public

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

Returns
array public

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

Returns
array public

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

Returns
array public

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

Returns
array public

Definition at line 2244 of file page_online_quiz.inc.

clearQuizData (   $questions = NULL)

Send the email containing the quiz results to the user

Parameters
array$questionsan array of question assetids to be cleared (if NULL, then the results of getQuestions() is used)
Returns
boolean public

Definition at line 1337 of file page_online_quiz.inc.

createBodycopy (   $bodycopy_code,
  $enable_on_create = TRUE 
)

Creates a bodycopy

Parameters
string$bodycopy_codethe code that indicates which bodycopy to manipulate (see $_bodycopies)
boolean$enable_on_createif TRUE, will set the bodycopy to be enabled (TYPE_2 link) when it is created. If FALSE, it creates it disabled (TYPE_3 link).
Returns
boolean public

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

Parameters
int$link_typespecifies which type of link the new form should be created with
Returns
boolean public

Definition at line 584 of file page_online_quiz.inc.

& createSubmission ( )

Creates a new submission object

Returns
object public

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

Parameters
string$new_typethe type_code of the type format to create
Returns
boolean public

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,
               ),
);
Returns
array protected

Definition at line 1034 of file page_online_quiz.inc.

& getBodycopy (   $bodycopy_code,
  $only_if_enabled = TRUE 
)

Returns the a bodycopy

Parameters
string$bodycopy_codethe code that indicates which bodycopy to manipulate (see $_bodycopies)
boolean$only_if_enabledif TRUE, will return NULL if the bodycopy is disabled. If FALSE, will only return NULL if never created.
Returns
mixed object|NULL public

Definition at line 413 of file page_online_quiz.inc.

getBodycopyLink (   $bodycopy_code,
  $link_type 
)

Returns the link to a bodycopy

Parameters
string$bodycopy_codethe code that indicates which bodycopy to manipulate (see $_bodycopies)
int$link_typeensures the link returned is of this type (eg. SQ_LINK_TYPE_2 | SQ_LINK_TYPE_3)
Returns
array public

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

Parameters
array&$childrenthe list of assets that qualify to be printed
array&$replacementsthe current replacements array, which will be added to by this function
array$keywordsKeywords that need replacing
array$result_pageresult page
array$num_per_pagenumber of assets per page
array$group_bywhat to group by
Returns
array public

Definition at line 2022 of file page_online_quiz.inc.

getCurrentPage ( )

Returns the page currently being displayed

NOTE: Cannot handle a-z grouping

Returns
int public

Definition at line 3508 of file page_online_quiz.inc.

getErrorListKeywordReplacement ( )

Get the replacement for the "error_list" keyword

Returns
string public

Definition at line 2830 of file page_online_quiz.inc.

getFlag (   $flag)

Returns a flag for the current quiz, eg. 'is_complete'

Parameters
string$flagthe flag to return the status of
Returns
mixed int|float|string|boolean|array|NULL public

Definition at line 1445 of file page_online_quiz.inc.

& getForm ( )

Get the user_details simple form linked to this asset, if any

Returns
int private

Definition at line 546 of file page_online_quiz.inc.

getFormContentsKeywordReplacement ( )

Get the replacement for the form_contents keyword

Returns
string public

Definition at line 643 of file page_online_quiz.inc.

getFormErrorsKeywordReplacement ( )

Get the replacement for the form_errors keyword

Returns
string public

Definition at line 664 of file page_online_quiz.inc.

getFormLink (   $link_type)

Returns the link to a form

Parameters
int$link_typeensures the link returned is of this type (eg. SQ_LINK_TYPE_2 | SQ_LINK_TYPE_3)
Returns
array public

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.

Returns
string public

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.

Parameters
string$keywordKeyword to find a replacement for
Returns
string public

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.

Parameters
boolean$groupedgroup by root node (pool)?
Returns
array public

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##)

Parameters
string$keywordKeyword to find a replacement for
Returns
string public

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.

Returns
array public

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

Parameters
array&$childrenthe list of assets to paginate
array&$replacementsan array to catch the keyword replacements spat out by getChunk() during the chunking process
int$result_pagethe page of assets to return
Returns
array public

Definition at line 3555 of file page_online_quiz.inc.

getQuestionCountKeywordReplacement ( )

Returns the keyword replacements for the 'question_count' keyword

Returns
array public

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%)

Parameters
int$question_group_asset_idThe asset ID of the question group
string$keywordThe keyword to retrieve from the question group
Returns
string public

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%)

Parameters
int$question_asset_idThe asset ID of the question
string$keywordThe keyword to retrieve from the question
Returns
array public

Definition at line 3281 of file page_online_quiz.inc.

getQuestionRangeKeywordReplacement ( )

Returns the keyword replacements for the 'question_range' keyword

Returns
array public

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%)

Parameters
int$question_asset_idThe asset ID of the question
string$keywordThe keyword to retrieve from the question
Returns
array public

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.

Parameters
boolean$refreshDetermines whether or not the question list will be refreshed (see above)
boolean$all_interactiveIn 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().
Returns
array public

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.

Returns
string public

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.

Returns
string public

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
                   ),
)
Returns
array public

Definition at line 1541 of file page_online_quiz.inc.

getResultsTableFullKeywordReplacement (   $html = TRUE)

Returns the keyword replacements for the 'results_table_full' keyword

Parameters
boolean$htmlWhether the resulting table should be formatted with HTML or plain-text spacing
Returns
array public

Definition at line 3206 of file page_online_quiz.inc.

getResultsTableFullTextKeywordReplacement ( )

Returns the keyword replacements for the 'results_table_full_text' keyword

Returns
array public

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

Parameters
array$show_columnsthe columns to include in the table
boolean$show_totalswhether or not to show totals at the bottom of the table
boolean$htmlwhether or not to render the table in HTML or plain text
Returns
array public

Definition at line 2936 of file page_online_quiz.inc.

getResultsTableSimpleKeywordReplacement (   $html = TRUE)

Returns the keyword replacements for the 'results_table_simple' keyword

Parameters
boolean$htmlWhether the resulting table should be formatted with HTML or plain-text spacing
Returns
array public

Definition at line 3245 of file page_online_quiz.inc.

getResultsTableSimpleTextKeywordReplacement ( )

Returns the keyword replacements for the 'results_table_simple_text' keyword

Returns
array public

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.

Returns
string public

Definition at line 2615 of file page_online_quiz.inc.

& getSubmissionsFolder ( )

Get the submissions folder

Returns
object public

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

Parameters
string$field_name
string$button_text
Returns
string public

Prints an alert() or confirm() containing errors taken from the error_stack

Returns
boolean

Definition at line 2712 of file page_online_quiz.inc.

getUserDetails ( )

Returns whatever details we have on the current user

Returns
array public

Definition at line 1361 of file page_online_quiz.inc.

getUserDetailsCurrentUserKeywordReplacement (   $keyword)

Returns the keyword replacements for any 'user_details_current_user_[keyword]' keywords

Parameters
string$keywordthe keyword to get the replacement of
Returns
array public

Definition at line 2693 of file page_online_quiz.inc.

getUserDetailsFormKeywordReplacement (   $questionid)

Returns the keyword replacements for any 'user_details_form_[##-q##]' keywords

Parameters
string$questionidthe form question to get the answer from
Returns
array public

Definition at line 2672 of file page_online_quiz.inc.

getWarningListKeywordReplacement ( )

Get the replacement for the "error_list" keyword

Returns
string public

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

Returns
boolean public

Definition at line 1402 of file page_online_quiz.inc.

loadQuestionList ( )

Load the list of questions associated with this quiz & user

Returns
array public

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.

Returns
array public

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

Returns
array public

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

Parameters
object&$broadcasterthe asset that triggered the event
array$varsthe vars that get submitted by the broadcaster we add keywords to the $vars['keywords'] array
Returns
boolean private

Definition at line 2107 of file page_online_quiz.inc.

printBody ( )

Called by the design to print the body of this asset

Returns
boolean public

Definition at line 490 of file page_online_quiz.inc.

printBodycopy (   $bodycopy_code)

Prints a bodycopy (if available)

Parameters
string$bodycopy_codethe code that indicates which bodycopy to manipulate (see $_bodycopies)
Returns
boolean public

Definition at line 513 of file page_online_quiz.inc.

printContents ( )

Constructs the carts contents

Returns
void public

Definition at line 816 of file page_online_quiz.inc.

printFrontend ( )

Prints out the Frontend for this asset

Returns
void public

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.

Returns
boolean public

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

Returns
boolean public

private

Definition at line 1934 of file page_online_quiz.inc.

saveQuestionList (   $question_list)

Saves the list of questions associated with this quiz & user

Parameters
array$question_listthe questions to save
Returns
boolean public

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.

Parameters
array$question_paginationthe question pagination details to save
Returns
boolean public

Definition at line 1807 of file page_online_quiz.inc.

saveQuestions (   $questions)

Take the raw question data and save it in the session

Parameters
array$questionsthe question data to be saved
Returns
void public

Definition at line 1610 of file page_online_quiz.inc.

sendResultsEmail ( )

Send the email containing the quiz results to the user

Returns
boolean public

Definition at line 1295 of file page_online_quiz.inc.

setBodycopy (   $bodycopy_code,
  $enabled 
)

Handles the enabling or disabling of a bodycopy

Parameters
string$bodycopy_codethe code that indicates which bodycopy to manipulate (see $_bodycopies)
boolean$enabledset to TRUE to enable the bodycopy, and FALSE to disable it
Returns
boolean public

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'

Parameters
string$flagthe flag to set the status of
mixed$valuethe value to set the flag to
boolean$permanentif TRUE, then use a link to store the flag, instead of just using the (temporary) session
Returns
boolean public

Definition at line 1480 of file page_online_quiz.inc.

setForm (   $enabled)

Handles the enabling or disabling of a bodycopy

Parameters
boolean$enabledset to TRUE to enable the bodycopy, and FALSE to disable it
Returns
boolean public

Definition at line 614 of file page_online_quiz.inc.

setResults (   $results)

Sets the results for the for the current user

Parameters
array$resultsthe results array to store
Returns
boolean public
See Also
getResults()

Definition at line 1562 of file page_online_quiz.inc.

setUserDetails (   $details)

Sets the details we have of the user for later use

Parameters
array$detailsuser details in the format: Array('assetid:questionid' => 'Answer Summary')
Returns
boolean public

Definition at line 1381 of file page_online_quiz.inc.

Field Documentation

$_error_stack
Initial value:
= Array(
'errors' => Array(),
'warnings' => Array(),
)

Definition at line 83 of file page_online_quiz.inc.


The documentation for this class was generated from the following file: