Browse files

SCORM MDL-21306 invalid management of Mastery Score - thanks to Matte…

…o Scaramuccia for the report/patch merged from HEAD
  • Loading branch information...
1 parent efefda0 commit 7845c533597852406f2bce6fa8c46c1959943dc1 @danmarsden danmarsden committed Jun 27, 2010
Showing with 7 additions and 10 deletions.
  1. +2 −3 mod/scorm/datamodels/aicc.js.php
  2. +5 −7 mod/scorm/datamodels/scorm_12.js.php
View
5 mod/scorm/datamodels/aicc.js.php
@@ -497,8 +497,7 @@ function StoreData(data,storetotaltime) {
if (storetotaltime) {
if (cmi.core.lesson_mode == 'normal') {
if (cmi.core.credit == 'credit') {
- cmi.core.lesson_status = 'completed';
- if (cmi.student_data.mastery_score != '') {
+ if (cmi.student_data.mastery_score != '' && cmi.core.score.raw != '') {
if (cmi.core.score.raw >= cmi.student_data.mastery_score) {
cmi.core.lesson_status = 'passed';
} else {
@@ -508,7 +507,7 @@ function StoreData(data,storetotaltime) {
}
}
if (cmi.core.lesson_mode == 'browse') {
- if (datamodel['cmi.core.lesson_status'].defaultvalue == '') {
+ if (datamodel['cmi.core.lesson_status'].defaultvalue == '' && cmi.core.lesson_status == 'not attempted') {
cmi.core.lesson_status = 'browsed';
}
}
View
12 mod/scorm/datamodels/scorm_12.js.php
@@ -585,13 +585,11 @@ function StoreData(data,storetotaltime) {
}
if (cmi.core.lesson_mode == 'normal') {
if (cmi.core.credit == 'credit') {
- if (cmi.core.lesson_status == 'completed') {
- if (cmi.student_data.mastery_score != '' && cmi.core.score.raw != '') {
- if (parseFloat(cmi.core.score.raw) >= parseFloat(cmi.student_data.mastery_score)) {
- cmi.core.lesson_status = 'passed';
- } else {
- cmi.core.lesson_status = 'failed';
- }
+ if (cmi.student_data.mastery_score != '' && cmi.core.score.raw != '') {
+ if (parseFloat(cmi.core.score.raw) >= parseFloat(cmi.student_data.mastery_score)) {
+ cmi.core.lesson_status = 'passed';
+ } else {
+ cmi.core.lesson_status = 'failed';
}
}
}

0 comments on commit 7845c53

Please sign in to comment.