Exemple #1
0
 protected function get_state_string(question_attempt $qa, $showcorrectness)
 {
     if ($qa->get_question()->length > 0) {
         return $qa->get_state_string($showcorrectness);
     }
     // Special case handling for 'information' items.
     if ($qa->get_state() == question_state::$todo) {
         return get_string('notyetviewed', 'quiz');
     } else {
         return get_string('viewed', 'quiz');
     }
 }
Exemple #2
0
 /**
  * Generate the display of the status line that gives the current state of
  * the question.
  * @param question_attempt $qa the question attempt to display.
  * @param qbehaviour_renderer $behaviouroutput the renderer to output the behaviour
  *      specific parts.
  * @param question_display_options $options controls what should and should not be displayed.
  * @return HTML fragment.
  */
 protected function status(question_attempt $qa, qbehaviour_renderer $behaviouroutput, question_display_options $options)
 {
     return html_writer::tag('div', $qa->get_state_string($options->correctness), array('class' => 'state'));
 }