Fixing an issue with double digit interaction counts

This commit is contained in:
Jonathan Putney
2020-06-26 12:07:06 -04:00
parent 8f2db32e27
commit 9847b0f1eb
6 changed files with 29 additions and 15 deletions

View File

@@ -171,16 +171,16 @@ export default class Scorm12API extends BaseAPI {
getChildElement(CMIElement, value, foundFirstIndex) {
let newChild;
if (this.stringMatches(CMIElement, 'cmi\\.objectives\\.\\d')) {
if (this.stringMatches(CMIElement, 'cmi\\.objectives\\.\\d+')) {
newChild = new CMIObjectivesObject();
} else if (foundFirstIndex && this.stringMatches(CMIElement,
'cmi\\.interactions\\.\\d\\.correct_responses\\.\\d')) {
'cmi\\.interactions\\.\\d+\\.correct_responses\\.\\d+')) {
newChild = new CMIInteractionsCorrectResponsesObject();
} else if (foundFirstIndex && this.stringMatches(CMIElement,
'cmi\\.interactions\\.\\d\\.objectives\\.\\d')) {
'cmi\\.interactions\\.\\d+\\.objectives\\.\\d+')) {
newChild = new CMIInteractionsObjectivesObject();
} else if (!foundFirstIndex &&
this.stringMatches(CMIElement, 'cmi\\.interactions\\.\\d')) {
this.stringMatches(CMIElement, 'cmi\\.interactions\\.\\d+')) {
newChild = new CMIInteractionsObject();
}