original_string: public function check_time($timer) {
          if ($this->properties->timelimit) {
              $timeleft = $timer->starttime + $this->properties->timelimit - time();
              if ($timeleft <= 0) {
                  // Out of time.
                  $this->add_message(get_string('eolstudentoutoftime', 'lesson'));
                  return false;
              } else if ($timeleft < 60) {
                  // One minute warning.
                  $this->add_message(get_string('studentoneminwarning', 'lesson'));
              }
          }
          return true;
      }
code: public function check_time($timer) {
          if ($this->properties->timelimit) {
              $timeleft = $timer->starttime + $this->properties->timelimit - time();
              if ($timeleft <= 0) {
                  // Out of time.
                  $this->add_message(get_string('eolstudentoutoftime', 'lesson'));
                  return false;
              } else if ($timeleft < 60) {
                  // One minute warning.
                  $this->add_message(get_string('studentoneminwarning', 'lesson'));
              }
          }
          return true;
      }
code_tokens: public function check_time ( $ timer ) { if ( $ this -> properties -> timelimit ) { $ timeleft = $ timer -> starttime + $ this -> properties -> timelimit - time ( ) ; if ( $ timeleft <= 0 ) { // Out of time. $ this -> add_message ( get_string ( 'eolstudentoutoftime' , 'lesson' ) ) ; return false ; } else if ( $ timeleft < 60 ) { // One minute warning. $ this -> add_message ( get_string ( 'studentoneminwarning' , 'lesson' ) ) ; } } return true ; }
docstring: Check if the user is out of time in a timed lesson.
  
  @param  stdClass $timer timer object
  @return bool True if the user is on time, false is the user ran out of time
  @since  Moodle 3.3
docstring_tokens: Check if the user is out of time in a timed lesson .