MDL-29793 Advanced grading - do not execute the restore step if the grading.xml is missing

This commit is contained in:
David Mudrak
2011-11-14 21:11:41 +01:00
parent c309e4f05e
commit 3319af85a9
+15
View File
@@ -1877,6 +1877,21 @@ class restore_activity_logs_structure_step extends restore_course_logs_structure
*/
class restore_activity_grading_structure_step extends restore_structure_step {
/**
* This step is executed only if the grading file is present
*/
protected function execute_condition() {
$fullpath = $this->task->get_taskbasepath();
$fullpath = rtrim($fullpath, '/') . '/' . $this->filename;
if (!file_exists($fullpath)) {
return false;
}
return true;
}
/**
* Declares paths in the grading.xml file we are interested in
*/