Ejemplo n.º 1
0
 public function test_basic()
 {
     $row = new stdClass();
     $row->id = 123;
     $row->hint = 'A hint';
     $row->hintformat = FORMAT_HTML;
     $hint = question_hint::load_from_record($row);
     $this->assertEquals($row->id, $hint->id);
     $this->assertEquals($row->hint, $hint->hint);
     $this->assertEquals($row->hintformat, $hint->hintformat);
 }
Ejemplo n.º 2
0
 /**
  * Create a question_hint, or an appropriate subclass for this question,
  * from a row loaded from the database.
  * @param object $hint the DB row from the question hints table.
  * @return question_hint
  */
 protected function make_hint($hint) {
     return question_hint::load_from_record($hint);
 }
Ejemplo n.º 3
0
 public function adjust_display_options(question_display_options $options) {
     parent::adjust_display_options($options);
     if ($this->clearwrong) {
         $options->clearwrong = true;
     }
     $options->numpartscorrect = $this->shownumcorrect;
 }