Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
question_attempt_steps_with_submitted_response_iterator Class Reference

A variant of question_attempt_step_iterator that iterates through the steps with submitted tries. More...

Inheritance diagram for question_attempt_steps_with_submitted_response_iterator:
question_attempt_step_iterator

Public Member Functions

 __construct (question_attempt $qa)
 Do not call this constructor directly. More...
 
 count ()
 
 current ()
 
 key ()
 
 next ()
 
 offsetExists ($submittedresponseno)
 
 offsetGet ($submittedresponseno)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 
 rewind ()
 
 step_no_for_try ($submittedresponseno)
 
 valid ()
 

Protected Member Functions

 find_steps_with_submitted_response ()
 Find the step nos in which a student has submitted a response. More...
 

Protected Attributes

integer $i
 records the current position in the iteration.
 
question_attempt $qa
 the question_attempt being iterated over.
 
int[] $stepswithsubmittedresponses
 Index is the submitted response number and value is the step no.
 
integer $submittedresponseno
 records the current position in the iteration.
 

Detailed Description

A variant of question_attempt_step_iterator that iterates through the steps with submitted tries.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

question_attempt_steps_with_submitted_response_iterator::__construct ( question_attempt  $qa)

Do not call this constructor directly.

Use question_attempt::get_submission_step_iterator().

Parameters
question_attempt$qathe attempt to iterate over.

Reimplemented from question_attempt_step_iterator.

Member Function Documentation

◆ count()

question_attempt_steps_with_submitted_response_iterator::count ( )
Return values
intthe count of steps with tries.

◆ current()

question_attempt_steps_with_submitted_response_iterator::current ( )
Return values
question_attempt_step

Reimplemented from question_attempt_step_iterator.

◆ find_steps_with_submitted_response()

question_attempt_steps_with_submitted_response_iterator::find_steps_with_submitted_response ( )
protected

Find the step nos in which a student has submitted a response.

Including any step with a response that is saved before the question attempt finishes.

Called from constructor, should not be called from elsewhere.

◆ key()

question_attempt_steps_with_submitted_response_iterator::key ( )
Return values
int

Reimplemented from question_attempt_step_iterator.

◆ next()

question_attempt_steps_with_submitted_response_iterator::next ( )

Reimplemented from question_attempt_step_iterator.

◆ offsetExists()

question_attempt_steps_with_submitted_response_iterator::offsetExists (   $submittedresponseno)
Parameters
int$submittedresponseno
Return values
bool

Reimplemented from question_attempt_step_iterator.

◆ offsetGet()

question_attempt_steps_with_submitted_response_iterator::offsetGet (   $submittedresponseno)
Parameters
int$submittedresponseno
Return values
question_attempt_step

Reimplemented from question_attempt_step_iterator.

◆ offsetSet()

question_attempt_steps_with_submitted_response_iterator::offsetSet (   $offset,
  $value 
)

Reimplemented from question_attempt_step_iterator.

◆ offsetUnset()

question_attempt_steps_with_submitted_response_iterator::offsetUnset (   $offset)

Reimplemented from question_attempt_step_iterator.

◆ rewind()

question_attempt_steps_with_submitted_response_iterator::rewind ( )

Reimplemented from question_attempt_step_iterator.

◆ step_no_for_try()

question_attempt_steps_with_submitted_response_iterator::step_no_for_try (   $submittedresponseno)
Parameters
int$submittedresponseno
Exceptions
coding_exception
Return values
int|nullthe step number or null if there is no such submitted response.

◆ valid()

question_attempt_steps_with_submitted_response_iterator::valid ( )
Return values
bool

Reimplemented from question_attempt_step_iterator.


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