Skip to content
Browse files

AICC MDL-26672 fix for handling of value = 0

  • Loading branch information...
1 parent 48fe5c6 commit 69c3d39a9c0d00661f0d204c4a08485b18aeb321 @danmarsden danmarsden committed Mar 7, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 mod/scorm/aicc.php
View
8 mod/scorm/aicc.php
@@ -93,7 +93,7 @@
if ($sco = scorm_get_sco($scoid)) {
$userdata->course_id = $sco->identifier;
$userdata->datafromlms = isset($sco->datafromlms)?$sco->datafromlms:'';
- $userdata->mastery_score = isset($sco->mastery_score)?$sco->mastery_score:'';
+ $userdata->mastery_score = isset($sco->mastery_score) && is_numeric($sco->mastery_score)?trim($sco->mastery_score):'';
$userdata->max_time_allowed = isset($sco->max_time_allowed)?$sco->max_time_allowed:'';
$userdata->time_limit_action = isset($sco->time_limit_action)?$sco->time_limit_action:'';
@@ -278,9 +278,9 @@
}
if ($mode == 'normal') {
if ($sco = scorm_get_sco($scoid)) {
- if (!empty($sco->mastery_score)) {
- if (!empty($score)) {
- if ($score >= $sco->mastery_score) {
+ if (isset($sco->mastery_score) && is_numeric($sco->mastery_score)) {
+ if ($score != '') { // $score is correctly initialized w/ an empty string, see above
+ if ($score >= trim($sco->mastery_score)) {
$lessonstatus = 'passed';
} else {
$lessonstatus = 'failed';

0 comments on commit 69c3d39

Please sign in to comment.
Something went wrong with that request. Please try again.