Initial push, working on test cases

This commit is contained in:
Jonathan Putney
2019-11-10 12:29:43 -05:00
parent 377d9f977a
commit da4af1edba
18 changed files with 9571 additions and 0 deletions

57
src/AICC.js Normal file
View File

@@ -0,0 +1,57 @@
/*
* Copyright (C) Noverant, Inc - All Rights Reserved Unauthorized copying of this file, via any
* medium is strictly prohibited Proprietary and confidential
*/
// @flow
import Scorm12API from './Scorm12API';
import {
CMIInteractionsCorrectResponsesObject,
CMIInteractionsObject,
CMIInteractionsObjectivesObject,
CMIObjectivesObject
} from "./cmi/scorm12_cmi";
import {CMIEvaluationCommentsObject, CMITriesObject, NAV} from "./cmi/aicc_cmi";
class AICC extends Scorm12API {
constructor() {
super();
this.nav = new NAV(this);
}
/**
* Gets or builds a new child element to add to the array.
*
* @param CMIElement
* @param value
*/
getChildElement(CMIElement, value) {
let newChild;
if (this.stringContains(CMIElement, "cmi.objectives")) {
newChild = new CMIObjectivesObject(this);
} else if (this.stringContains(CMIElement, ".correct_responses")) {
newChild = new CMIInteractionsCorrectResponsesObject(this);
} else if (this.stringContains(CMIElement, ".objectives")) {
newChild = new CMIInteractionsObjectivesObject(this);
} else if (this.stringContains(CMIElement, "cmi.interactions")) {
newChild = new CMIInteractionsObject(this);
} else if (this.stringContains(CMIElement, "cmi.evaluation.comments")) {
newChild = new CMIEvaluationCommentsObject(this);
} else if (this.stringContains(CMIElement, "cmi.student_data.tries")) {
newChild = new CMITriesObject(this);
}
return newChild;
}
/**
* Replace the whole API with another
*/
replaceWithAnotherScormAPI(newAPI) {
// Data Model
this.cmi = newAPI.cmi;
this.nav = newAPI.nav;
}
}