original_string: public function attempt_state($attemptobj) {
          switch ($attemptobj->get_state()) {
              case quiz_attempt::IN_PROGRESS:
                  return get_string('stateinprogress', 'quiz');
  
              case quiz_attempt::OVERDUE:
                  return get_string('stateoverdue', 'quiz') . html_writer::tag('span',
                          get_string('stateoverduedetails', 'quiz',
                                  userdate($attemptobj->get_due_date())),
                          array('class' => 'statedetails'));
  
              case quiz_attempt::FINISHED:
                  return get_string('statefinished', 'quiz') . html_writer::tag('span',
                          get_string('statefinisheddetails', 'quiz',
                                  userdate($attemptobj->get_submitted_date())),
                          array('class' => 'statedetails'));
  
              case quiz_attempt::ABANDONED:
                  return get_string('stateabandoned', 'quiz');
          }
      }
code: public function attempt_state($attemptobj) {
          switch ($attemptobj->get_state()) {
              case quiz_attempt::IN_PROGRESS:
                  return get_string('stateinprogress', 'quiz');
  
              case quiz_attempt::OVERDUE:
                  return get_string('stateoverdue', 'quiz') . html_writer::tag('span',
                          get_string('stateoverduedetails', 'quiz',
                                  userdate($attemptobj->get_due_date())),
                          array('class' => 'statedetails'));
  
              case quiz_attempt::FINISHED:
                  return get_string('statefinished', 'quiz') . html_writer::tag('span',
                          get_string('statefinisheddetails', 'quiz',
                                  userdate($attemptobj->get_submitted_date())),
                          array('class' => 'statedetails'));
  
              case quiz_attempt::ABANDONED:
                  return get_string('stateabandoned', 'quiz');
          }
      }
code_tokens: public function attempt_state ( $ attemptobj ) { switch ( $ attemptobj -> get_state ( ) ) { case quiz_attempt :: IN_PROGRESS : return get_string ( 'stateinprogress' , 'quiz' ) ; case quiz_attempt :: OVERDUE : return get_string ( 'stateoverdue' , 'quiz' ) . html_writer :: tag ( 'span' , get_string ( 'stateoverduedetails' , 'quiz' , userdate ( $ attemptobj -> get_due_date ( ) ) ) , array ( 'class' => 'statedetails' ) ) ; case quiz_attempt :: FINISHED : return get_string ( 'statefinished' , 'quiz' ) . html_writer :: tag ( 'span' , get_string ( 'statefinisheddetails' , 'quiz' , userdate ( $ attemptobj -> get_submitted_date ( ) ) ) , array ( 'class' => 'statedetails' ) ) ; case quiz_attempt :: ABANDONED : return get_string ( 'stateabandoned' , 'quiz' ) ; } }
docstring: Generate a brief textual desciption of the current state of an attempt.
  @param quiz_attempt $attemptobj the attempt
  @param int $timenow the time to use as 'now'.
  @return string the appropriate lang string to describe the state.
docstring_tokens: Generate a brief textual desciption of the current state of an attempt .