original_string: protected function feedback_popup(question_graded_automatically $subq,
              $fraction, $feedbacktext, $rightanswer, question_display_options $options) {
  
          $feedback = array();
          if ($options->correctness) {
              if (is_null($fraction)) {
                  $state = question_state::$gaveup;
              } else {
                  $state = question_state::graded_state_for_fraction($fraction);
              }
              $feedback[] = $state->default_string(true);
          }
  
          if ($options->feedback && $feedbacktext) {
              $feedback[] = $feedbacktext;
          }
  
          if ($options->rightanswer) {
              $feedback[] = get_string('correctansweris', 'qtype_shortanswer', $rightanswer);
          }
  
          $subfraction = '';
          if ($options->marks >= question_display_options::MARK_AND_MAX && $subq->maxmark > 0
                  && (!is_null($fraction) || $feedback)) {
              $a = new stdClass();
              $a->mark = format_float($fraction * $subq->maxmark, $options->markdp);
              $a->max = format_float($subq->maxmark, $options->markdp);
              $feedback[] = get_string('markoutofmax', 'question', $a);
          }
  
          if (!$feedback) {
              return '';
          }
  
          return html_writer::tag('span', implode('<br />', $feedback),
                  array('class' => 'feedbackspan accesshide'));
      }
code: protected function feedback_popup(question_graded_automatically $subq,
              $fraction, $feedbacktext, $rightanswer, question_display_options $options) {
  
          $feedback = array();
          if ($options->correctness) {
              if (is_null($fraction)) {
                  $state = question_state::$gaveup;
              } else {
                  $state = question_state::graded_state_for_fraction($fraction);
              }
              $feedback[] = $state->default_string(true);
          }
  
          if ($options->feedback && $feedbacktext) {
              $feedback[] = $feedbacktext;
          }
  
          if ($options->rightanswer) {
              $feedback[] = get_string('correctansweris', 'qtype_shortanswer', $rightanswer);
          }
  
          $subfraction = '';
          if ($options->marks >= question_display_options::MARK_AND_MAX && $subq->maxmark > 0
                  && (!is_null($fraction) || $feedback)) {
              $a = new stdClass();
              $a->mark = format_float($fraction * $subq->maxmark, $options->markdp);
              $a->max = format_float($subq->maxmark, $options->markdp);
              $feedback[] = get_string('markoutofmax', 'question', $a);
          }
  
          if (!$feedback) {
              return '';
          }
  
          return html_writer::tag('span', implode('<br />', $feedback),
                  array('class' => 'feedbackspan accesshide'));
      }
code_tokens: protected function feedback_popup ( question_graded_automatically $ subq , $ fraction , $ feedbacktext , $ rightanswer , question_display_options $ options ) { $ feedback = array ( ) ; if ( $ options -> correctness ) { if ( is_null ( $ fraction ) ) { $ state = question_state :: $ gaveup ; } else { $ state = question_state :: graded_state_for_fraction ( $ fraction ) ; } $ feedback [ ] = $ state -> default_string ( true ) ; } if ( $ options -> feedback && $ feedbacktext ) { $ feedback [ ] = $ feedbacktext ; } if ( $ options -> rightanswer ) { $ feedback [ ] = get_string ( 'correctansweris' , 'qtype_shortanswer' , $ rightanswer ) ; } $ subfraction = '' ; if ( $ options -> marks >= question_display_options :: MARK_AND_MAX && $ subq -> maxmark > 0 && ( ! is_null ( $ fraction ) || $ feedback ) ) { $ a = new stdClass ( ) ; $ a -> mark = format_float ( $ fraction * $ subq -> maxmark , $ options -> markdp ) ; $ a -> max = format_float ( $ subq -> maxmark , $ options -> markdp ) ; $ feedback [ ] = get_string ( 'markoutofmax' , 'question' , $ a ) ; } if ( ! $ feedback ) { return '' ; } return html_writer :: tag ( 'span' , implode ( '<br />' , $ feedback ) , array ( 'class' => 'feedbackspan accesshide' ) ) ; }
docstring: Render the feedback pop-up contents.
  
  @param question_graded_automatically $subq the subquestion.
  @param float $fraction the mark the student got. null if this subq was not answered.
  @param string $feedbacktext the feedback text, already processed with format_text etc.
  @param string $rightanswer the right answer, already processed with format_text etc.
  @param question_display_options $options the display options.
  @return string the HTML for the feedback popup.
docstring_tokens: Render the feedback pop - up contents .