original_string: public function left_during_timed_session($retriescount) {
          global $DB, $USER;
  
          $conditions = array('lessonid' => $this->properties->id, 'userid' => $USER->id, 'retry' => $retriescount);
          return $DB->count_records('lesson_attempts', $conditions) > 0 || $DB->count_records('lesson_branch', $conditions) > 0;
      }
code: public function left_during_timed_session($retriescount) {
          global $DB, $USER;
  
          $conditions = array('lessonid' => $this->properties->id, 'userid' => $USER->id, 'retry' => $retriescount);
          return $DB->count_records('lesson_attempts', $conditions) > 0 || $DB->count_records('lesson_branch', $conditions) > 0;
      }
code_tokens: public function left_during_timed_session ( $ retriescount ) { global $ DB , $ USER ; $ conditions = array ( 'lessonid' => $ this -> properties -> id , 'userid' => $ USER -> id , 'retry' => $ retriescount ) ; return $ DB -> count_records ( 'lesson_attempts' , $ conditions ) > 0 || $ DB -> count_records ( 'lesson_branch' , $ conditions ) > 0 ; }
docstring: Check if a user left a timed session.
  
  @param int $retriescount the number of retries for the lesson (the last retry number).
  @return true if the user left the timed session
  @since  Moodle 3.3
docstring_tokens: Check if a user left a timed session .