Adding more API tests

This commit is contained in:
Jonathan Putney
2019-11-14 13:17:16 -05:00
parent 1636f8b443
commit 360d30bdf0
9 changed files with 449 additions and 111 deletions

View File

@@ -26,15 +26,16 @@ export default class AICC extends Scorm12API {
*
* @param {string} CMIElement
* @param {any} value
* @param {boolean} foundFirstIndex
* @return {object}
*/
getChildElement(CMIElement, value) {
let newChild = super.getChildElement(CMIElement);
getChildElement(CMIElement, value, foundFirstIndex) {
let newChild = super.getChildElement(CMIElement, value, foundFirstIndex);
if (!newChild) {
if (this.stringContains(CMIElement, 'cmi.evaluation.comments')) {
if (this.stringMatches(CMIElement, 'cmi\\.evaluation\\.comments\\.\\d')) {
newChild = new CMIEvaluationCommentsObject(this);
} else if (this.stringContains(CMIElement, 'cmi.student_data.tries')) {
} else if (this.stringMatches(CMIElement, 'cmi\\.student_data\\.tries\\.\\d')) {
newChild = new CMITriesObject(this);
}
}