Skip to content
Snippets Groups Projects
Commit 9d761006 authored by André Noack's avatar André Noack Committed by David Siegfried
Browse files

Resolve #4283 "Gradebook: Beim Speichern einer Note wird das chdate immer aktualisiert"

Closes #4283

Merge request studip/studip!3101
parent 2ab989c7
No related branches found
No related tags found
No related merge requests found
......@@ -66,4 +66,22 @@ class Instance extends \SimpleORMap
return self::findBySql('definition_id IN (?) AND user_id = ?', [$definitionIds, $user->id]);
}
/**
* setter for the rawgrade column. The database type is decimal(6,5) UNSIGNED, therefore
* the setter mimics the database behaviour to get valid results from ::isFieldDirty()
*
* @param mixed $grade
* @return string
*/
public function setRawgrade($grade = 0): string
{
if ($grade < 0) {
$grade = 0;
}
if ($grade >= 10) {
$grade = 9.99999;
}
return $this->content['rawgrade'] = number_format($grade, 5, '.', '');
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment