Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
Online_Quiz_Question Class Reference
Inheritance diagram for Online_Quiz_Question:
Asset MySource_Object Online_Quiz_Question_Multichoice

Public Member Functions

 Online_Quiz_Question ($assetid=0)
 
 _getName ($short_name=FALSE)
 
 _getAllowedLinks ()
 
 loadQuestion ()
 
 saveQuestion ()
 
 getValue ()
 
 setValue ($value)
 
 getSummary ()
 
 getCorrectValue ()
 
 getCorrectSummary ()
 
 getPosition ()
 
 setPosition ($position)
 
 getQuestionText ()
 
 getQuestionNote ()
 
 getQuestionData ()
 
 processResponseForm ()
 
 validateValue ($value=NULL)
 
 getValidationJS ()
 
 getPoints ($value=NULL)
 
 getAvailablePoints ()
 
 getResults ()
 
 createQuestionTextBodycopy ($enable_on_create=TRUE)
 
getQuestionTextBodycopy ($only_if_enabled=TRUE)
 
 getQuestionTextBodycopyLink ($link_type)
 
 setQuestionTextBodycopy ($enabled)
 
 printQuestionTextBodycopy ()
 
 getAvailableKeywords ()
 
 getQuestionTextKeywordReplacement ()
 
 getResponseFormKeywordReplacement ()
 
 getAvailablePointsKeywordReplacement ()
 
 getQuestionNumberKeywordReplacement ()
 
 getQuestionNoteKeywordReplacement ()
 
- 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

 $_value = NULL
 
 $_position = NULL
 
- Data Fields inherited from Asset
 $id = 0
 
 $version = ''
 
 $name = ''
 
 $short_name = ''
 
 $status
 
 $languages = ''
 
 $charset = ''
 
 $force_secure = '0'
 
 $created
 
 $created_userid
 
 $updated
 
 $updated_userid
 
 $published
 
 $published_userid
 
 $status_changed
 
 $status_changed_userid
 
 $_is_cacheable = FALSE
 
 $vars = Array()
 
 $_available_keywords = Array()
 
 $data_path_suffix = ''
 
 $data_path = ''
 
 $data_path_public = ''
 
 $_ser_attrs = FALSE
 
- Data Fields inherited from MySource_Object
 $_tmp
 

Additional Inherited Members

- Protected Member Functions inherited from Asset
 _preCreateCheck (Array &$link)
 
 _createAdditional (Array &$link)
 
 _abortCreate ($trigger_level_changed=FALSE, $linkid=0)
 
 _loadVars ()
 
 _getName ($short_name=FALSE, $contextid=NULL)
 
 _getKeywordReplacement ($keyword)
 
 _checkPermissionAccess ($perm, $assetids=Array(), $only_workflow=TRUE)
 
 makeAndSaveInitialWebPath ($path, $parent_link=NULL)
 

Detailed Description

Definition at line 41 of file online_quiz_question.inc.

Member Function Documentation

_getAllowedLinks ( )

Returns an array of all the permitted link type, the type asset and the cardinality

Returns
array private
See Also
Asset::_getAllowedLinks()

Definition at line 104 of file online_quiz_question.inc.

_getName (   $short_name = FALSE)

Returns name of the asset

Parameters
boolean$short_namewhether or not we are after the short name or the full name
Returns
string private
See Also
Asset::_getName()

Definition at line 90 of file online_quiz_question.inc.

createQuestionTextBodycopy (   $enable_on_create = TRUE)

Creates the Question Text bodycopy

Parameters
boolean$enable_on_createif TRUE, will set the bodycopy to be enabled (TYPE_2 link) when it is created. If FALSE, creates it disabled (TYPE_3 link).
Returns
boolean public

Definition at line 483 of file online_quiz_question.inc.

getAvailableKeywords ( )

Return the available keywords from the parents

The return value is in the form:

Array(
    'keyword' => 'name',
)
Returns
array public

Definition at line 633 of file online_quiz_question.inc.

getAvailablePoints ( )

Determine how many points are available from this question in total

Returns
int public

Definition at line 421 of file online_quiz_question.inc.

getAvailablePointsKeywordReplacement ( )

Get the replacement for the "available_points" keyword

Returns
string public

Definition at line 690 of file online_quiz_question.inc.

getCorrectSummary ( )

Returns the correct response in a human-readable format

Returns
string public

Definition at line 220 of file online_quiz_question.inc.

getCorrectValue ( )

Returns the correct response

Returns
string public

Definition at line 207 of file online_quiz_question.inc.

getPoints (   $value = NULL)

Determine how many points the given value (or the question's current value) is worth

Parameters
mixed$valuethe value to use determining the number of points scored - if NULL, use the question's value
Returns
int public

Definition at line 406 of file online_quiz_question.inc.

getPosition ( )

Returns the current position for this question in the question list

Returns
int public

Definition at line 233 of file online_quiz_question.inc.

getQuestionData ( )

Returns the question data array

Returns
array public

Definition at line 305 of file online_quiz_question.inc.

getQuestionNote ( )

Returns the Question Note associated with this question

Returns
string public

Definition at line 282 of file online_quiz_question.inc.

getQuestionNoteKeywordReplacement ( )

Get the replacement for the "question_note" keyword

Returns
string public

Definition at line 716 of file online_quiz_question.inc.

getQuestionNumberKeywordReplacement ( )

Get the replacement for the "question_number" keyword

Returns
string public

Definition at line 703 of file online_quiz_question.inc.

getQuestionText ( )

Returns either the straight question text, or gets the question text bodycopy to print itself

Returns
string public

Definition at line 261 of file online_quiz_question.inc.

& getQuestionTextBodycopy (   $only_if_enabled = TRUE)

Returns the Question Text bodycopy

Parameters
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 529 of file online_quiz_question.inc.

getQuestionTextBodycopyLink (   $link_type)

Returns the link to the Question Text bodycopy

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 557 of file online_quiz_question.inc.

getQuestionTextKeywordReplacement ( )

Get the replacement for the "question_text" keyword

Returns
string public

Definition at line 654 of file online_quiz_question.inc.

getResponseFormKeywordReplacement ( )

Get the replacement for the "response_form" keyword

To be overridden by the children

Returns
string public

Definition at line 669 of file online_quiz_question.inc.

getResults ( )

Compiles the results array to be used by the quiz during marking

The results are returned in the following format:

Array(
  'assetid'         => assetid,
  'value'               => string,  // flattened raw value
  'summary'         => string,  // flattened human-readible value
  'points'          => int,     // earned points
  'available_points'    => int,     // available points
)
Returns
array public

Definition at line 445 of file online_quiz_question.inc.

getSummary ( )

Returns the current user response in a human-readable format

Returns
string public

Definition at line 194 of file online_quiz_question.inc.

getValidationJS ( )

Returns the javascript used to validate the question

Returns
string public

Definition at line 391 of file online_quiz_question.inc.

getValue ( )

Returns the current user response

Returns
string public

Definition at line 166 of file online_quiz_question.inc.

loadQuestion ( )

Retrieve the question data

Returns
boolean public

Definition at line 120 of file online_quiz_question.inc.

Online_Quiz_Question (   $assetid = 0)

Constructor

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

Definition at line 71 of file online_quiz_question.inc.

printQuestionTextBodycopy ( )

Prints the "Question Text" bodycopy (if available)

Returns
boolean public

Definition at line 602 of file online_quiz_question.inc.

processResponseForm ( )

Processes the form using submitted values

NOTE: Returns TRUE if the value is valid, otherwise returns FALSE or an array in the following format:

Array(
    'errors'    => Array('Sample error string'),
    'warnings'  => Array('Question #12 has not been answered'),
)
Returns
boolean public

Definition at line 330 of file online_quiz_question.inc.

saveQuestion ( )

Save the question data

Returns
boolean public

Definition at line 148 of file online_quiz_question.inc.

setPosition (   $position)

Sets the current position for this question in the question list

Parameters
int$positionthe position number to set
Returns
void public

Definition at line 248 of file online_quiz_question.inc.

setQuestionTextBodycopy (   $enabled)

Handles the enabling or disabling of the Question Text bodycopy

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

Definition at line 573 of file online_quiz_question.inc.

setValue (   $value)

Sets the current user response

Parameters
mixed$valuethe value to set
Returns
void public

Definition at line 181 of file online_quiz_question.inc.

validateValue (   $value = NULL)

Determine whether or not this question currently has a valid value

NOTE: Returns an array in the following format:

Array(
    'errors'    => Array('Sample error string'),
    'warnings'  => Array('Question #12 has not been answered'),
)

The 'errors' and 'warnings' keys will always be present, but empty if no errors or warnings need to be returned

Parameters
mixed$valueCustom value to compare with - if left NULL (or unspecified), use the current value of the question
Returns
array public

Definition at line 367 of file online_quiz_question.inc.


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