Permalink
Browse files

MDL-20636 Added viuew object as class

  • Loading branch information...
1 parent fcd5e24 commit 3b7efd6d8f421cbcaa080b6177ab1e14061ff7e8 Dean Lennard committed with timhunt May 6, 2011
Showing with 23 additions and 1 deletion.
  1. +21 −0 mod/quiz/renderer.php
  2. +2 −1 mod/quiz/view.php
View
@@ -710,4 +710,25 @@ class mod_quiz_links_to_other_attempts implements renderable {
* @var array string attempt number => url, or null for the current attempt.
*/
public $links = array();
+}
+
+class mod_quiz_view_object {
+ public $attempts;
+ public $accessmanager;
+ public $canattempt;
+ public $canpreview;
+ public $canreviewmine;
+ public $attemptcolumn;
+ public $gradecolumn;
+ public $markcolumn;
+ public $overallstats;
+ public $feedbackcolumn;
+ public $timenow;
+ public $numattempts;
+ public $mygrade;
+ public $moreattempts;
+ public $mygradeoverridden;
+ public $gradebookfeedback;
+ public $unfinished;
+ public $lastfinishedattempt;
}
View
@@ -30,6 +30,7 @@
require_once($CFG->libdir.'/gradelib.php');
require_once($CFG->dirroot.'/mod/quiz/locallib.php');
require_once($CFG->libdir . '/completionlib.php');
+require_once($CFG->dirroot.'/mod/quiz/renderer.php');
$id = optional_param('id', 0, PARAM_INT); // Course Module ID, or
$q = optional_param('q', 0, PARAM_INT); // quiz ID
@@ -119,7 +120,7 @@
/*
* Create view object for use within renderers file
*/
-$viewobj = new stdClass();
+$viewobj = new mod_quiz_view_object;
$viewobj->attempts = $attempts;
$viewobj->accessmanager = $accessmanager;
$viewobj->canattempt = $canattempt;

0 comments on commit 3b7efd6

Please sign in to comment.