MDL-80880 quiz: change display of previous attempts summary
[moodle.git] / mod / quiz / classes / output / view_page.php
bloba1e9ed55b39a20c7a8bb55b96f702fb158c8d9b8
1 <?php
2 // This file is part of Moodle - http://moodle.org/
3 //
4 // Moodle is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // Moodle is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with Moodle. If not, see <http://www.gnu.org/licenses/>.
17 namespace mod_quiz\output;
19 use mod_quiz\access_manager;
20 use mod_quiz\form\preflight_check_form;
21 use mod_quiz\quiz_attempt;
22 use moodle_url;
24 /**
25 * This class captures all the various information to render the front page of the quiz activity.
27 * This class is not currently renderable or templatable, but it very nearly could be,
28 * which is why it is in the output namespace. It is used to send data to the renderer.
30 * @package mod_quiz
31 * @category output
32 * @copyright 2011 The Open University
33 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
35 class view_page {
36 /** @var array $infomessages of messages with information to display about the quiz. */
37 public $infomessages;
38 /** @var array $attempts contains all the user's attempts at this quiz. */
39 public $attempts;
40 /** @var quiz_attempt[] $attemptobjs objects corresponding to $attempts. */
41 public $attemptobjs;
42 /** @var list_of_attempts list of past attempts for rendering. */
43 public $attemptslist;
44 /** @var access_manager $accessmanager contains various access rules. */
45 public $accessmanager;
46 /** @var bool $canreviewmine whether the current user has the capability to
47 * review their own attempts. */
48 public $canreviewmine;
49 /** @var bool $canedit whether the current user has the capability to edit the quiz. */
50 public $canedit;
51 /** @var moodle_url $editurl the URL for editing this quiz. */
52 public $editurl;
53 /** @var int $attemptcolumn contains the number of attempts done. */
54 public $attemptcolumn;
55 /** @var int $gradecolumn contains the grades of any attempts. */
56 public $gradecolumn;
57 /** @var int $markcolumn contains the marks of any attempt. */
58 public $markcolumn;
59 /** @var int $overallstats contains all marks for any attempt. */
60 public $overallstats;
61 /** @var string $feedbackcolumn contains any feedback for and attempt. */
62 public $feedbackcolumn;
63 /** @var string $timenow contains a timestamp in string format. */
64 public $timenow;
65 /** @var int $numattempts contains the total number of attempts. */
66 public $numattempts;
67 /** @var float $mygrade contains the user's final grade for a quiz. */
68 public $mygrade;
69 /** @var bool $moreattempts whether this user is allowed more attempts. */
70 public $moreattempts;
71 /** @var int $mygradeoverridden contains an overriden grade. */
72 public $mygradeoverridden;
73 /** @var string $gradebookfeedback contains any feedback for a gradebook. */
74 public $gradebookfeedback;
75 /** @var bool $unfinished contains 1 if an attempt is unfinished. */
76 public $unfinished;
77 /** @var stdClass $lastfinishedattempt the last attempt from the attempts array. */
78 public $lastfinishedattempt;
79 /** @var array $preventmessages of messages telling the user why they can't
80 * attempt the quiz now. */
81 public $preventmessages;
82 /** @var string $buttontext caption for the start attempt button. If this is null, show no
83 * button, or if it is '' show a back to the course button. */
84 public $buttontext;
85 /** @var moodle_url $startattempturl URL to start an attempt. */
86 public $startattempturl;
87 /** @var preflight_check_form|null $preflightcheckform confirmation form that must be
88 * submitted before an attempt is started, if required. */
89 public $preflightcheckform;
90 /** @var moodle_url $startattempturl URL for any Back to the course button. */
91 public $backtocourseurl;
92 /** @var bool $showbacktocourse should we show a back to the course button? */
93 public $showbacktocourse;
94 /** @var bool whether the attempt must take place in a popup window. */
95 public $popuprequired;
96 /** @var array options to use for the popup window, if required. */
97 public $popupoptions;
98 /** @var bool $quizhasquestions whether the quiz has any questions. */
99 public $quizhasquestions;