MDL-10544 basic support for outcomes grading in modules - implemented in assignment popup grading (TODO: fix html and css there)

This commit is contained in:
skodak 2007-07-31 22:56:29 +00:00
parent 56c28adb97
commit 3a5ae6602b
3 changed files with 128 additions and 19 deletions

View file

@ -988,14 +988,14 @@ class grade_item extends grade_object {
* @param int $userid
* @return object grade_grade object instance
*/
function get_grade($userid) {
function get_grade($userid, $create=true) {
if (empty($this->id)) {
debugging('Can not use before insert');
return false;
}
$grade = new grade_grade(array('userid'=>$userid, 'itemid'=>$this->id));
if (empty($grade->id)) {
if (empty($grade->id) and $create) {
$grade->insert();
}