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

Public Member Functions

 Online_Quiz_Question_Multichoice ($assetid=0)
 
 setAttrValue ($name, $value)
 
 processResponseForm ()
 
 validateValue ($value=NULL)
 
 getValidationJS ()
 
 getSummary ()
 
 _getCorrectOptionKeys ()
 
 getCorrectValue ()
 
 getCorrectSummary ()
 
 getPoints ($value=NULL)
 
 getAvailablePoints ()
 
 getResults ($flatten=TRUE)
 
 getResponseFormKeywordReplacement ($option_format='', $feedback_mode=FALSE)
 
 getResponseSupplement ($selected_option=NULL)
 
- Public Member Functions inherited from Online_Quiz_Question
 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 ()
 

Additional Inherited Members

- Data Fields inherited from Online_Quiz_Question
 $_value = NULL
 
 $_position = NULL
 
- 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 38 of file online_quiz_question_multichoice.inc.

Member Function Documentation

_getCorrectOptionKeys ( )

Returns the option keys of the correct answers

Returns
array public

Definition at line 265 of file online_quiz_question_multichoice.inc.

getAvailablePoints ( )

Determine how many points are available from this question in total

Returns
int public

Definition at line 381 of file online_quiz_question_multichoice.inc.

getCorrectSummary ( )

Returns the correct response in a human-readable format

Returns
string public

Definition at line 301 of file online_quiz_question_multichoice.inc.

getCorrectValue ( )

Returns the correct response

Returns
string public

Definition at line 288 of file online_quiz_question_multichoice.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 326 of file online_quiz_question_multichoice.inc.

getResponseFormKeywordReplacement (   $option_format = '',
  $feedback_mode = FALSE 
)

Get the replacement for the "response_form" keyword

To be overridden by the children

Parameters
text$option_formatused by Page_Online_Quiz Interactive Mode, control print format of radio/checkbox options.
boolean$feedback_modeused by Page_Online_Quiz Interactive Mode, will disable fields and add special classes & tags
Returns
string public

Definition at line 489 of file online_quiz_question_multichoice.inc.

getResponseSupplement (   $selected_option = NULL)

Get the Response Supplement content for the selected option

Parameters
string$selected_optionoverride the selected option with another key
Returns
string public

Definition at line 628 of file online_quiz_question_multichoice.inc.

getResults (   $flatten = TRUE)

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
)
Parameters
boolean$flattenwhether not to flatten the human-readable 'summary' array into a single string (TRUE by default)
Returns
array public

Definition at line 435 of file online_quiz_question_multichoice.inc.

getSummary ( )

Returns the current user response in a human-readable format

NOTE: Arrays of answers will stay in array format, with the exception that each element of the array will be rendered human-readable

Returns
string public

Definition at line 237 of file online_quiz_question_multichoice.inc.

getValidationJS ( )

Returns the javascript used to validate the question

Returns
string public

Definition at line 177 of file online_quiz_question_multichoice.inc.

Constructor

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

Definition at line 50 of file online_quiz_question_multichoice.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 93 of file online_quiz_question_multichoice.inc.

setAttrValue (   $name,
  $value 
)

Set Attribute Value

Parameters
string$namename of attribute
mixed$valuevalue of attribute
Returns
boolean public

Definition at line 67 of file online_quiz_question_multichoice.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 153 of file online_quiz_question_multichoice.inc.


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