-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EVOSTDM-3175 MDL 4.3 - Valider nos plugins - Partie 3 - Divers (parta…
…gés)
- Loading branch information
1 parent
08ea4a0
commit 30b4f6a
Showing
8 changed files
with
76 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,9 @@ | |
|
||
namespace quiz_markspersection; | ||
|
||
use mod_quiz\access_manager; | ||
use mod_quiz\quiz_attempt; | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
global $CFG; | ||
|
@@ -36,7 +39,7 @@ | |
* @author Marie-Eve Lévesque <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class quiz_attemptreport extends \quiz_attempt { | ||
class quiz_attemptreport extends quiz_attempt { | ||
|
||
/** @var array Already calculated sections marks, stored in this variable for further use (to avoid recalculation). */ | ||
private $sectionmarks = null; | ||
|
@@ -97,7 +100,7 @@ public function get_sectionid($slot) { | |
* @return quiz_attempt the new quiz_attempt object | ||
*/ | ||
public static function create($attemptid) { | ||
return self::create_helper(array('id' => $attemptid)); | ||
return self::create_helper(['id' => $attemptid]); | ||
} | ||
|
||
/** | ||
|
@@ -110,8 +113,8 @@ protected static function create_helper($conditions) { | |
global $DB; | ||
|
||
$attempt = $DB->get_record('quiz_attempts', $conditions, '*', MUST_EXIST); | ||
$quiz = \quiz_access_manager::load_quiz_and_settings($attempt->quiz); | ||
$course = $DB->get_record('course', array('id' => $quiz->course), '*', MUST_EXIST); | ||
$quiz = access_manager::load_quiz_and_settings($attempt->quiz); | ||
$course = $DB->get_record('course', ['id' => $quiz->course], '*', MUST_EXIST); | ||
$cm = get_coursemodule_from_instance('quiz', $quiz->id, $course->id, false, MUST_EXIST); | ||
|
||
// Update quiz with override information. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,9 +23,7 @@ | |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
require_once($CFG->dirroot . '/mod/quiz/report/attemptsreport_form.php'); | ||
use mod_quiz\local\reports\attempts_report_options_form; | ||
|
||
/** | ||
* Quiz marks per section report settings form. | ||
|
@@ -34,6 +32,6 @@ | |
* @author Marie-Eve Lévesque <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class quiz_markspersection_settings_form extends mod_quiz_attempts_report_form { | ||
class quiz_markspersection_settings_form extends attempts_report_options_form { | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,9 +23,8 @@ | |
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
require_once($CFG->dirroot . '/mod/quiz/report/attemptsreport_options.php'); | ||
use mod_quiz\local\reports\attempts_report; | ||
use mod_quiz\local\reports\attempts_report_options; | ||
|
||
/** | ||
* Class to store the options for a quiz_markspersection_report. | ||
|
@@ -34,7 +33,7 @@ | |
* @author Marie-Eve Lévesque <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
class quiz_markspersection_options extends mod_quiz_attempts_report_options { | ||
class quiz_markspersection_options extends attempts_report_options { | ||
|
||
/** @var bool whether to show only attempt that need regrading. | ||
* This variable is necessary to stay compatible with quiz_overview_options even if we do not extend it. */ | ||
|
@@ -53,7 +52,7 @@ public function resolve_dependencies() { | |
// We only want to show the checkbox to delete attempts | ||
// if the user has permissions and if the report mode is showing attempts. | ||
$this->checkboxcolumn = has_any_capability( | ||
array('mod/quiz:deleteattempts'), context_module::instance($this->cm->id)) | ||
&& ($this->attempts != quiz_attempts_report::ENROLLED_WITHOUT); | ||
['mod/quiz:deleteattempts'], context_module::instance($this->cm->id)) | ||
&& ($this->attempts != attempts_report::ENROLLED_WITHOUT); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.