コード例 #1
0
ファイル: question_hint_test.php プロジェクト: evltuma/moodle
 public function test_with_parts()
 {
     $row = new stdClass();
     $row->id = 123;
     $row->hint = 'A hint';
     $row->hintformat = FORMAT_HTML;
     $row->shownumcorrect = 1;
     $row->clearwrong = 1;
     $hint = question_hint_with_parts::load_from_record($row);
     $this->assertEquals($row->id, $hint->id);
     $this->assertEquals($row->hint, $hint->hint);
     $this->assertEquals($row->hintformat, $hint->hintformat);
     $this->assertNotEmpty($hint->shownumcorrect);
     $this->assertNotEmpty($hint->clearwrong);
 }
コード例 #2
0
ファイル: questiontype.php プロジェクト: evltuma/moodle
 protected function make_hint($hint)
 {
     return question_hint_with_parts::load_from_record($hint);
 }
コード例 #3
0
 /**
  * Constructor.
  * @param int the hint id from the database.
  * @param string $hint The hint text
  * @param int the corresponding text FORMAT_... type.
  * @param bool $shownumcorrect whether the number of right parts should be shown.
  * @param bool $clearwrong whether the wrong parts should be reset.
  * @param string options a number of specific hint keys, separated by line break character.
  */
 public function __construct($id, $hint, $hintformat, $shownumcorrect, $clearwrong, $options)
 {
     parent::__construct($id, $hint, $hintformat, $shownumcorrect, $clearwrong);
     $this->options = $options;
 }
コード例 #4
0
 public function adjust_display_options(question_display_options $options)
 {
     parent::adjust_display_options($options);
     $options->suppresschoicefeedback = !$this->showchoicefeedback;
 }
コード例 #5
0
 public function adjust_display_options(question_display_options $options)
 {
     parent::adjust_display_options($options);
     $options->statewhichincorrect = $this->statewhichincorrect;
 }