Still trying to make sure that cmi is sorted properly
This commit is contained in:
26
dist/scorm-again.js
vendored
26
dist/scorm-again.js
vendored
File diff suppressed because one or more lines are too long
2
dist/scorm-again.js.map
vendored
2
dist/scorm-again.js.map
vendored
File diff suppressed because one or more lines are too long
2
dist/scorm-again.min.js
vendored
2
dist/scorm-again.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -870,18 +870,11 @@ export default class BaseAPI {
|
||||
* @return {number}
|
||||
*/
|
||||
function testPattern(a, c, a_pattern, c_pattern) {
|
||||
if (a.match(a_pattern) && c.match(c_pattern)) {
|
||||
if (Number(a.match(a_pattern)[1]) <
|
||||
Number(c.match(c_pattern)[1])) return -1;
|
||||
if (Number(a.match(a_pattern)[1]) >
|
||||
Number(c.match(c_pattern)[1])) return 1;
|
||||
return -1;
|
||||
} else if (a.match(c_pattern) && c.match(a_pattern)) {
|
||||
if (Number(a.match(c_pattern)[1]) <
|
||||
Number(c.match(a_pattern)[1])) return -1;
|
||||
if (Number(a.match(c_pattern)[1]) >
|
||||
Number(c.match(a_pattern)[1])) return 1;
|
||||
return 1;
|
||||
if (a.match(c_pattern) && c.match(a_pattern)) {
|
||||
const a1 = Number(a.match(c_pattern)[1]);
|
||||
const c1 = Number(c.match(a_pattern)[1]);
|
||||
if (a1 === c1) return -1;
|
||||
else return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -896,10 +889,18 @@ export default class BaseAPI {
|
||||
if (id_test !== 0) {
|
||||
return id_test;
|
||||
}
|
||||
id_test = testPattern(a, c, int_pattern, int_id_pattern);
|
||||
if (id_test !== 0) {
|
||||
return id_test;
|
||||
}
|
||||
id_test = testPattern(a, c, int_type_pattern, int_pattern);
|
||||
if (id_test !== 0) {
|
||||
return id_test;
|
||||
}
|
||||
id_test = testPattern(a, c, int_pattern, int_type_pattern);
|
||||
if (id_test !== 0) {
|
||||
return id_test;
|
||||
}
|
||||
id_test = testPattern(a, c, obj_id_pattern, obj_pattern);
|
||||
if (id_test !== 0) {
|
||||
return id_test;
|
||||
|
||||
Reference in New Issue
Block a user