public function feedback(question_attempt $qa, question_display_options $options)
 {
     if (!$options->feedback) {
         return '';
     }
     if ($qa->get_state() == question_state::$gaveup || $qa->get_state() == question_state::$mangaveup) {
         return '';
     }
     $feedback = '';
     if (!$qa->get_last_behaviour_var('certainty') && $qa->get_last_behaviour_var('_assumedcertainty')) {
         $feedback .= html_writer::tag('p', get_string('assumingcertainty', 'qbehaviour_deferredcbm', question_cbm::get_string($qa->get_last_behaviour_var('_assumedcertainty'))));
     }
     if ($options->marks >= question_display_options::MARK_AND_MAX) {
         $a->rawmark = format_float($qa->get_last_behaviour_var('_rawfraction') * $qa->get_max_mark(), $options->markdp);
         $a->mark = $qa->format_mark($options->markdp);
         $feedback .= html_writer::tag('p', get_string('markadjustment', 'qbehaviour_deferredcbm', $a));
     }
     return $feedback;
 }
Ejemplo n.º 2
0
 /**
  * Generate the display of the marks for this question out of the available marks.
  * @param question_attempt $qa the question attempt to display.
  * @param question_display_options $options controls what should and should not be displayed.
  * @return HTML fragment.
  */
 public function standard_mark_out_of_max(question_attempt $qa, question_display_options $options)
 {
     $a = new stdClass();
     $a->mark = $qa->format_mark($options->markdp);
     $a->max = $qa->format_max_mark($options->markdp);
     return get_string('markoutofmax', 'question', $a);
 }
Ejemplo n.º 3
0
 /**
  * Generate the display of the marks for this question.
  * @param question_attempt $qa the question attempt to display.
  * @param question_display_options $options controls what should and should not be displayed.
  * @return HTML fragment.
  */
 protected function mark_summary(question_attempt $qa, question_display_options $options)
 {
     if (!$options->marks) {
         return '';
     }
     if ($qa->get_max_mark() == 0) {
         $summary = get_string('notgraded', 'question');
     } else {
         if ($options->marks == question_display_options::MAX_ONLY || is_null($qa->get_fraction())) {
             //$summary = get_string('markedoutofmax', 'question',
             if ($qa->format_max_mark($options->markdp) > 1) {
                 $summary = get_string('points', 'question', $qa->format_max_mark($options->markdp));
             } else {
                 $summary = get_string('point', 'question', $qa->format_max_mark($options->markdp));
             }
         } else {
             $a = new stdClass();
             $a->mark = $qa->format_mark($options->markdp);
             $a->max = $qa->format_max_mark($options->markdp);
             $summary = get_string('markoutofmax', 'question', $a);
         }
     }
     return html_writer::tag('h2', $summary, array('class' => 'grade quizpoints_no'));
 }
Ejemplo n.º 4
0
 public function mark_out_of_max(question_attempt $qa, core_question_renderer $qoutput, question_display_options $options)
 {
     return get_string('cbmmark', 'qbehaviour_deferredcbm', $qa->format_mark($options->markdp));
 }