Moodle  2.2.1
http://www.collinsharper.com
question_attempt_with_restricted_history Class Reference
Inheritance diagram for question_attempt_with_restricted_history:
Collaboration diagram for question_attempt_with_restricted_history:

Public Member Functions

 __construct (question_attempt $baseqa, $lastseq, $preferredbehaviour)
 get_full_qa ()
 get_full_step_iterator ()
 process_action ($submitteddata, $timestamp=null, $userid=null)
 start ($preferredbehaviour, $variant, $submitteddata=array(), $timestamp=null, $userid=null)
 set_database_id ($id)
 set_flagged ($flagged)
 set_slot ($slot)
 set_question_summary ($questionsummary)
 set_usage_id ($usageid)

Protected Member Functions

 add_step (question_attempt_step $step)

Protected Attributes

 $baseqa

Detailed Description

This subclass of question_attempt pretends that only part of the step history exists. It is used for rendering the question in past states.

All methods that try to modify the question_attempt throw exceptions.

Definition at line 1229 of file questionattempt.php.


Constructor & Destructor Documentation

__construct ( question_attempt baseqa,
lastseq,
preferredbehaviour 
)

Create a question_attempt_with_restricted_history

Parameters:
question_attempt$baseqaThe question_attempt to make a restricted version of.
int$lastseqthe index of the last step to include.
string$preferredbehaviourthe preferred behaviour. It is slightly annoyting that this needs to be passed, but unavoidable for now.

Definition at line 1242 of file questionattempt.php.

Here is the call graph for this function:


Member Function Documentation

add_step ( question_attempt_step step) [protected]

Add a step to this question attempt.

Parameters:
question_attempt_step$stepthe new step.

Reimplemented from question_attempt.

Definition at line 1277 of file questionattempt.php.

This method exists so that question_attempt_with_restricted_history can override it. You should not normally need to call it.

Returns:
question_attempt return ourself.

Reimplemented from question_attempt.

Definition at line 1269 of file questionattempt.php.

The same as get_step_iterator(). However, for a question_attempt_with_restricted_history this returns the full list of steps, while get_step_iterator() returns only the limited history.

Returns:
question_attempt_step_iterator for iterating over the steps in this attempt, in order.

Reimplemented from question_attempt.

Definition at line 1273 of file questionattempt.php.

process_action ( submitteddata,
timestamp = null,
userid = null 
)

Definition at line 1280 of file questionattempt.php.

set_database_id ( id)

For internal use only. Set the id of the corresponding database row.

Parameters:
int$idthe id of row for this question_attempt, if it is stored in the database.

Reimplemented from question_attempt.

Definition at line 1287 of file questionattempt.php.

set_flagged ( flagged)

Set the flagged state of this question.

Parameters:
bool$flaggedthe new state.

Reimplemented from question_attempt.

Definition at line 1290 of file questionattempt.php.

set_question_summary ( questionsummary)

Change the quetsion summary. Note, that this is almost never necessary. This method was only added to work around a limitation of the Opaque protocol, which only sends questionLine at the end of an attempt.

Parameters:
$questionsummarythe new summary to set.

Reimplemented from question_attempt.

Definition at line 1296 of file questionattempt.php.

set_slot ( slot)

Set the number used to identify this question_attempt within the usage. For internal use only.

Parameters:
int$slot

Reimplemented from question_attempt.

Definition at line 1293 of file questionattempt.php.

set_usage_id ( usageid)

Set the id of the question_usage_by_activity we belong to. For internal use only.

Parameters:
int|stringthe new id.

Reimplemented from question_attempt.

Definition at line 1299 of file questionattempt.php.

start ( preferredbehaviour,
variant,
submitteddata = array(),
timestamp = null,
userid = null 
)

Definition at line 1283 of file questionattempt.php.


Field Documentation

$baseqa [protected]

Definition at line 1233 of file questionattempt.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations