original_string: public function get_attempts($retries, $correct=false, $pageid=null, $userid=null) {
          global $USER, $DB;
          $params = array("lessonid"=>$this->properties->id, "userid"=>$userid, "retry"=>$retries);
          if ($correct) {
              $params['correct'] = 1;
          }
          if ($pageid !== null) {
              $params['pageid'] = $pageid;
          }
          if ($userid === null) {
              $params['userid'] = $USER->id;
          }
          return $DB->get_records('lesson_attempts', $params, 'timeseen ASC');
      }
code: public function get_attempts($retries, $correct=false, $pageid=null, $userid=null) {
          global $USER, $DB;
          $params = array("lessonid"=>$this->properties->id, "userid"=>$userid, "retry"=>$retries);
          if ($correct) {
              $params['correct'] = 1;
          }
          if ($pageid !== null) {
              $params['pageid'] = $pageid;
          }
          if ($userid === null) {
              $params['userid'] = $USER->id;
          }
          return $DB->get_records('lesson_attempts', $params, 'timeseen ASC');
      }
code_tokens: public function get_attempts ( $ retries , $ correct = false , $ pageid = null , $ userid = null ) { global $ USER , $ DB ; $ params = array ( "lessonid" => $ this -> properties -> id , "userid" => $ userid , "retry" => $ retries ) ; if ( $ correct ) { $ params [ 'correct' ] = 1 ; } if ( $ pageid !== null ) { $ params [ 'pageid' ] = $ pageid ; } if ( $ userid === null ) { $ params [ 'userid' ] = $ USER -> id ; } return $ DB -> get_records ( 'lesson_attempts' , $ params , 'timeseen ASC' ) ; }
docstring: Get all of the attempts for the current user.
  
  @param int $retries
  @param bool $correct Optional: only fetch correct attempts
  @param int $pageid Optional: only fetch attempts at the given page
  @param int $userid Optional: defaults to the current user if not set
  @return array|false
docstring_tokens: Get all of the attempts for the current user .