Пример #1
0
 public function get_question_states($attempt, $question, moodle_recordset $questionsstatesrs)
 {
     $qstates = array();
     while ($questionsstatesrs->valid()) {
         $state = $questionsstatesrs->current();
         if ($state->attempt != $attempt->uniqueid || $state->question != $question->id) {
             // We have found all the states for this attempt. Stop.
             break;
         }
         // Add the new state to the array, and advance.
         $qstates[] = $state;
         $questionsstatesrs->next();
     }
     return $qstates;
 }
Пример #2
0
 /**
  * Our only real magic here, we are converting the record
  * to our model.
  *
  * @return mr_model_record_abstract
  */
 public function current()
 {
     return $this->repo->record_to_model($this->rs->current());
 }