From 3460111498478751785c4dd1f5b67a7d89bad2c2 Mon Sep 17 00:00:00 2001 From: skodak Date: Sun, 3 Jun 2007 10:30:23 +0000 Subject: [PATCH] MDL-9549 no grading fix --- mod/glossary/lib.php | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/mod/glossary/lib.php b/mod/glossary/lib.php index f8c7e1579c..36f8d0e5ec 100644 --- a/mod/glossary/lib.php +++ b/mod/glossary/lib.php @@ -409,7 +409,11 @@ function glossary_grade_item_update($glossary) { $grade_item->name = $glossary->name; $grade_item->cmidnumber = $glossary->cmidnumber; - if ($glossary->scale > 0) { + if (!$glossary->assessed) { + //how to indicate no grading? + $grade_item->gradetype = GRADE_TYPE_TEXT; + + } else if ($glossary->scale > 0) { $grade_item->gradetype = GRADE_TYPE_VALUE; $grade_item->grademax = $glossary->scale; $grade_item->grademin = 0; @@ -417,13 +421,6 @@ function glossary_grade_item_update($glossary) { } else if ($glossary->scale < 0) { $grade_item->gradetype = GRADE_TYPE_SCALE; $grade_item->scaleid = -$glossary->scale; - - } else { - //how to indicate no grading? - $grade_item->gradetype = GRADE_TYPE_TEXT; - $grade_item->grademax = $glossary->scale; - $grade_item->grademax = 0; - $grade_item->grademin = 0; } $grade_item->update(); @@ -443,7 +440,11 @@ function glossary_grade_item_create($glossary) { 'itemname' =>$glossary->name, 'idnumber' =>$glossary->cmidnumber); - if ($glossary->scale > 0) { + if (!$glossary->assessed) { + //how to indicate no grading? + $params['gradetype'] = GRADE_TYPE_TEXT; + + } else if ($glossary->scale > 0) { $params['gradetype'] = GRADE_TYPE_VALUE; $params['grademax'] = $glossary->scale; $params['grademin'] = 0; @@ -451,13 +452,6 @@ function glossary_grade_item_create($glossary) { } else if ($glossary->scale < 0) { $params['gradetype'] = GRADE_TYPE_SCALE; $params['scaleid'] = -$glossary->scale; - - } else { - //how to indicate no grading? - $params['gradetype'] = GRADE_TYPE_TEXT; - $params['grademax'] = $glossary->scale; - $params['grademax'] = 0; - $params['grademin'] = 0; } $itemid = grade_create_item($params); -- 2.39.5