mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-9636 grade_items are now limited to current course only - can not import into other courses anymore
This commit is contained in:
parent
d15da061a1
commit
235b07fb64
@ -1,5 +1,6 @@
|
||||
<?php //$Id$
|
||||
require_once '../../../config.php';
|
||||
require_once $CFG->libdir.'/gradelib.php';
|
||||
require_once $CFG->dirroot.'/grade/lib.php';
|
||||
require_once '../grade_import_form.php';
|
||||
require_once '../lib.php';
|
||||
@ -226,8 +227,7 @@ if (($formdata = data_submitted()) && !empty($formdata->map)) {
|
||||
|
||||
// case of an id, only maps id of a grade_item
|
||||
// this was idnumber
|
||||
include_once($CFG->libdir.'/grade/grade_item.php');
|
||||
if (!$gradeitem = new grade_item(array('id'=>$map[$key]))) {
|
||||
if (!$gradeitem = new grade_item(array('id'=>$map[$key], 'courseid'=>$course->id))) {
|
||||
// supplied bad mapping, should not be possible since user
|
||||
// had to pick mapping
|
||||
$status = false;
|
||||
@ -319,7 +319,6 @@ if (($formdata = data_submitted()) && !empty($formdata->map)) {
|
||||
|
||||
} else if ($formdata = $mform->get_data()) {
|
||||
// else if file is just uploaded
|
||||
|
||||
$filename = $mform->get_userfile_name();
|
||||
|
||||
// Large files are likely to take their time and memory. Let PHP know
|
||||
@ -371,7 +370,6 @@ if (($formdata = data_submitted()) && !empty($formdata->map)) {
|
||||
echo '</table>';
|
||||
|
||||
/// feeding gradeitems into the grade_import_mapping_form
|
||||
include_once($CFG->libdir.'/grade/grade_item.php');
|
||||
$gradeitems = array();
|
||||
if ($id) {
|
||||
if ($grade_items = grade_item::fetch_all(array('courseid'=>$id))) {
|
||||
|
@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
require_once '../../../config.php';
|
||||
require_once $CFG->libdir.'/gradelib.php';
|
||||
require_once $CFG->dirroot.'/grade/lib.php';
|
||||
require_once '../grade_import_form.php';
|
||||
require_once '../lib.php';
|
||||
@ -85,8 +86,7 @@ if ( $formdata = $mform->get_data()) {
|
||||
$numlines ++;
|
||||
}
|
||||
|
||||
include_once($CFG->libdir.'/grade/grade_item.php');
|
||||
if (!$gradeitem = new grade_item(array('idnumber'=>$result['#']['assignment'][0]['#']))) {
|
||||
if (!$gradeitem = new grade_item(array('idnumber'=>$result['#']['assignment'][0]['#'], 'courseid'=>$course->id))) {
|
||||
// gradeitem does not exist
|
||||
// no data in temp table so far, abort
|
||||
$status = false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user