original_string: public function stop_timer() {
          global $USER, $DB;
          unset($USER->startlesson[$this->properties->id]);
  
          $cm = get_coursemodule_from_instance('lesson', $this->properties()->id, $this->properties()->course,
              false, MUST_EXIST);
  
          // Trigger lesson ended event.
          $event = \mod_lesson\event\lesson_ended::create(array(
              'objectid' => $this->properties()->id,
              'context' => context_module::instance($cm->id),
              'courseid' => $this->properties()->course
          ));
          $event->trigger();
  
          return $this->update_timer(false, false, true);
      }
code: public function stop_timer() {
          global $USER, $DB;
          unset($USER->startlesson[$this->properties->id]);
  
          $cm = get_coursemodule_from_instance('lesson', $this->properties()->id, $this->properties()->course,
              false, MUST_EXIST);
  
          // Trigger lesson ended event.
          $event = \mod_lesson\event\lesson_ended::create(array(
              'objectid' => $this->properties()->id,
              'context' => context_module::instance($cm->id),
              'courseid' => $this->properties()->course
          ));
          $event->trigger();
  
          return $this->update_timer(false, false, true);
      }
code_tokens: public function stop_timer ( ) { global $ USER , $ DB ; unset ( $ USER -> startlesson [ $ this -> properties -> id ] ) ; $ cm = get_coursemodule_from_instance ( 'lesson' , $ this -> properties ( ) -> id , $ this -> properties ( ) -> course , false , MUST_EXIST ) ; // Trigger lesson ended event. $ event = \ mod_lesson \ event \ lesson_ended :: create ( array ( 'objectid' => $ this -> properties ( ) -> id , 'context' => context_module :: instance ( $ cm -> id ) , 'courseid' => $ this -> properties ( ) -> course ) ) ; $ event -> trigger ( ) ; return $ this -> update_timer ( false , false , true ) ; }
docstring: Updates the timer to the current time then stops it by unsetting the user var
  @return bool Returns true
docstring_tokens: Updates the timer to the current time then stops it by unsetting the user var