From c7c1adeb8dfebcede60869b04d7456e2e5521670 Mon Sep 17 00:00:00 2001 From: bobopinna Date: Thu, 2 Nov 2006 15:19:40 +0000 Subject: [PATCH] Fixed a small problem with whatgrade field --- mod/scorm/lib.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/mod/scorm/lib.php b/mod/scorm/lib.php index d6132222ed0..dab29d6ca96 100755 --- a/mod/scorm/lib.php +++ b/mod/scorm/lib.php @@ -23,6 +23,10 @@ function scorm_add_instance($scorm) { //sanitize submitted values a bit $scorm->width = clean_param($scorm->width, PARAM_INT); $scorm->height = clean_param($scorm->height, PARAM_INT); + + if (!isset($scorm->whatgrade)) { + $scorm->whatgrade = 0; + } $scorm->grademethod = ($scorm->whatgrade * 10) + $scorm->grademethod; $id = insert_record('scorm', $scorm); @@ -64,6 +68,9 @@ function scorm_update_instance($scorm) { $scorm->width = str_replace('%','',$scorm->width); $scorm->height = str_replace('%','',$scorm->height); + if (!isset($scorm->whatgrade)) { + $scorm->whatgrade = 0; + } $scorm->grademethod = ($scorm->whatgrade * 10) + $scorm->grademethod; // Check if scorm manifest needs to be reparsed