Import Outcomes error

Import Outcomes error

by Jean FRUITET -
Number of replies: 3
Is there a way to allow a teacher to import Outcomes in CSV format in his course (Moodle is 1.9.7) ?
It seams that only admin can import outcomes.
That's don't fit our needs.
The only capacity I can see for that is "moodle/grade:manageoutcomes" inherited but when a teacher try to import an outcomes files he gets an error :
'An error occurred, this script wasn't called with the right parameters.'




In reply to Jean FRUITET

Re: Import Outcomes error

by Maryel Mendiola -
Hi Jean

I'm not sure, but you could try changing teachers rol
in order to add the capacity to import outcomes


I'm going to do it in my moodle site too

cheers
In reply to Maryel Mendiola

Re: Import Outcomes error

by Jean FRUITET -
Teachers have yet moodle/grade:manage and moodle/grade:manageoutcomes to yes but that's don't work sad

The error seams to be that you need to change site configuration when importing outcomes.

The error is triggered by moodle/grade/edit/outcome/import.php lines 90 to 100

/// which scope are we importing the outcomes in?
if (isset($courseid) && ($scope == 'local' || $scope == 'custom')) {
// custom scale
$local_scope = true;
} elseif (($scope == 'global') && has_capability('moodle/grade:manage', get_context_instance(CONTEXT_SYSTEM))) {
// global scale
$local_scope = false;
} else {
// shouldn't happen .. user might be trying to access this script without the right permissions.
redirect('index.php', get_string('importerror', 'grades'));
}

The scope is incorrect because it is set up to 'global' which is not true when a teacher is importing outcomes from a course...

Do I rewrite moodle grade source code now ! smile