コード例 #1
0
ファイル: questionbase.php プロジェクト: nigeldaley/moodle
 public function __construct() {
     parent::__construct();
     $this->defaultmark = 0;
     $this->penalty = 0;
     $this->length = 0;
 }
コード例 #2
0
 /**
  * Generate the standard PRT feedback for a pearticular score.
  * @param question_attempt $qa the question attempt to display.
  * @param question_definition $question the question being displayed.
  * @param stack_potentialresponse_tree_state $result the results to display.
  * @return string nicely standard feedback, for display.
  */
 protected function standard_prt_feedback($qa, $question, $result)
 {
     if ($result->errors) {
         return '';
     }
     $state = question_state::graded_state_for_fraction($result->score);
     $class = $state->get_feedback_class();
     $field = 'prt' . $class . 'instantiated';
     $format = 'prt' . $class . 'format';
     if ($question->{$field}) {
         return html_writer::tag('div', $question->format_text(stack_maths::process_display_castext($question->{$field}, $this), $question->{$format}, $qa, 'qtype_stack', $field, $question->id), array('class' => $class));
     }
     return '';
 }