mirror of
https://github.com/moodle/moodle.git
synced 2025-01-30 03:58:34 +01:00
MDL-52275 core: fixed grade-to-pass being overwritten
Thanks goes to W.J. Roes for the patch.
This commit is contained in:
parent
ea3ebbf20e
commit
5d0aa9dcfe
@ -187,15 +187,14 @@ if (!empty($add)) {
|
||||
|
||||
if ($items = grade_item::fetch_all(array('itemtype'=>'mod', 'itemmodule'=>$data->modulename,
|
||||
'iteminstance'=>$data->instance, 'courseid'=>$course->id))) {
|
||||
// add existing outcomes
|
||||
// Add existing outcomes.
|
||||
foreach ($items as $item) {
|
||||
if (!empty($item->gradepass)) {
|
||||
if (!empty($item->outcomeid)) {
|
||||
$data->{'outcome_' . $item->outcomeid} = 1;
|
||||
} else if (!empty($item->gradepass)) {
|
||||
$decimalpoints = $item->get_decimals();
|
||||
$data->gradepass = format_float($item->gradepass, $decimalpoints);
|
||||
}
|
||||
if (!empty($item->outcomeid)) {
|
||||
$data->{'outcome_'.$item->outcomeid} = 1;
|
||||
}
|
||||
}
|
||||
|
||||
// set category if present
|
||||
|
Loading…
x
Reference in New Issue
Block a user