public function links_to_other_attempts(moodle_url $url) {
        $attempts = quiz_get_user_attempts($this->get_quiz()->id, $this->attempt->userid, 'all');
        if (count($attempts) <= 1) {
            return false;
        }

        $links = new mod_quiz_links_to_other_attempts();
        foreach ($attempts as $at) {
            if ($at->id == $this->attempt->id) {
                $links->links[$at->attempt] = null;
            } else {
                $links->links[$at->attempt] = new moodle_url($url, array('attempt' => $at->id));
            }
        }
        return $links;
    }
public function links_to_other_attempts(moodle_url $url) {
        $attempts = quiz_get_user_attempts($this->get_quiz()->id, $this->attempt->userid, 'all');
        if (count($attempts) <= 1) {
            return false;
        }

        $links = new mod_quiz_links_to_other_attempts();
        foreach ($attempts as $at) {
            if ($at->id == $this->attempt->id) {
                $links->links[$at->attempt] = null;
            } else {
                $links->links[$at->attempt] = new moodle_url($url, array('attempt' => $at->id));
            }
        }
        return $links;
    }
public function links_to_other_attempts ( moodle_url $ url ) { $ attempts = quiz_get_user_attempts ( $ this -> get_quiz ( ) -> id , $ this -> attempt -> userid , 'all' ) ; if ( count ( $ attempts ) <= 1 ) { return false ; } $ links = new mod_quiz_links_to_other_attempts ( ) ; foreach ( $ attempts as $ at ) { if ( $ at -> id == $ this -> attempt -> id ) { $ links -> links [ $ at -> attempt ] = null ; } else { $ links -> links [ $ at -> attempt ] = new moodle_url ( $ url , array ( 'attempt' => $ at -> id ) ) ; } } return $ links ; }
Return an array of variant URLs to other attempts at this quiz.

The $url passed in must contain an attempt parameter.

The {@link mod_quiz_links_to_other_attempts} object returned contains an
array with keys that are the attempt number, 1, 2, 3.
The array values are either a {@link moodle_url} with the attmept parameter
updated to point to the attempt id of the other attempt, or null corresponding
to the current attempt number.

@param moodle_url $url a URL.
@return mod_quiz_links_to_other_attempts containing array int => null|moodle_url.
Return an array of variant URLs to other attempts at this quiz .