/*

Author: Johnc
Proj No: 50181
Proj Name: Flash Construct 2.0
Usage:	Contains the course object. There is only one, it can be a module, section, topic or page.
				Careful use of the prototype object means memory/processor power is unaffected, structure
				can go as deep as required, as long as the ID's are consistant within the coursestructures.js

				Methods are defined in:
					- course_object_generic_methods.js
					- course_object_tracking_methods.js
					- course_object_topic_methods.js
					- course_object_menu_methods.js
					- course_object_help_methods.js

Date: 10/02/06

*/

// The Constructor object.
function courseObject(objectID, objectParent, objectTitle, objectType, hasMenu)
{
	//this.debug("NEW courseObject()", 0)
	//this.debug("courseObject(objectID: " + objectID + ", objectParent: " + objectParent + ", objectTitle: " + objectTitle + ", objectType: " + objectType + ", hasMenu: " + hasMenu + ")", 1, objectParent, true)

	this.objID = objectID;
	this.parentObj = objectParent;
	this.objTitle = objectTitle;
	this.objType = objectType;	// Module, section, topic or page.
	this.hasMenu = hasMenu;			// Used to locate the correct menu to return too.

	this.rootPath = _rootPath	// Set at this level, used to allow location independant navigation from the framset.

	this.currTopicObj = false;	// Reference the current object that is having its nav array used.

	if (this.parentObj)
		this.fullIDString = this.parentObj.fullIDString + "_" + this.objID;
	else
		this.fullIDString = this.objID;

	this.trackingState = 0;	// Default not started

	if ((this.objType == "assessment") || (this.objType == "revision"))
	{
		this.pageTrackingObject = new pageTrackingObject(this);	// See score_object.js for more info.
		this.questionBankHandlerObject = new questionBankHandlerObject(this);	// See score_object.js for more info.
	}

	this.objDepth = this.getDepth()

	//this.debug("Created courseObject(objectID: " + objectID + ")", 1, this, false)

}

//***** Prototype Variables - Set here as some objects will never need so saves memory.
courseObject.prototype.objDescription = "This object has no description."	// Set by the .addDescription method.
courseObject.prototype.objTranscript = "This object has no transcript."	// Set by the .addTranscript method.
courseObject.prototype.childObjsIndexed = false;	// Set to an array by the .addChild method.
courseObject.prototype.childObjsAssociative = false;	// Set to an array by the .addChild method.
courseObject.prototype.pageArray = false;	// Set to an array by the .addPageArray method.
courseObject.prototype.auxPageArrays = false;	// Used by the filing cabinet sections to copy the various page types into.
courseObject.prototype.currentAuxArray = false;	// Used by the filing cabinet sections to determine which auxPageArray to use.
courseObject.prototype.currentPageCursor = 0;	// Set to an array by the .addPageArray method.
/*courseObject.prototype.diagnosticScreenScoresArray = false;*/	// Set to an array by the ._addPageScore method.
courseObject.prototype.isDiagnostic = false;	// Set to an array by the ._addPageScore method.
courseObject.prototype.branchsTakenScreenIDArray = false;	// Currently used for debug purposes to allow designers to check their logic.
courseObject.prototype.trackingFileLoaded = false;	// Used to determine if a tracking file has loaded.
courseObject.prototype.timeAllowed = false;	// Reprisents the amount of time the user should complete the training in, set in coursestructures.js
courseObject.prototype.randomiseQuestions = false;	// Wether or not to randomise the screen questions, set in coursestructures.js
courseObject.prototype.mediaTypes = false;	// Set by _addMediaType(), course_object_tracking_methods.js
courseObject.prototype.assessmentPercentage = false;	// Set by _setFinalScore() in course_object_tracking_methods.js

courseObject.prototype.forceOrderInAssessmentScreenQuestions = true;	// Use to force the screen questions in the assessment



// ************* See course_object_menu_methods.js for code and comments *************
courseObject.prototype.createMenu = _createMenu;
courseObject.prototype.createBreadcrumb = _createBreadcrumb;

courseObject.prototype.checkBookmarkStatus = _checkBookmarkStatus;

courseObject.prototype.createMenuLink = _createMenuLink;
courseObject.prototype.createBreadcrumbLink = _createBreadcrumbLink;

courseObject.prototype.createTrackingStateIcon = _createTrackingStateIcon;


// ************* See course_object_help_methods.js for code and comments *************
courseObject.prototype.gotoHelp = _gotoHelp;
courseObject.prototype.returnToContent = _returnToContent;

// ************* See course_object_topic_methods.js for code and comments *************
courseObject.prototype.loadCurrentPage = _loadCurrentPage;
courseObject.prototype.addPageArray = _addPageArray;
courseObject.prototype.parsePageArray = _parsePageArray;
/*courseObject.prototype.parseDiagnosticNavArray = _parseDiagnosticNavArray;*/
courseObject.prototype.parseQuizNavArray = _parseQuizNavArray;
courseObject.prototype.checkIsDiagnosticPage = _checkIsDiagnosticPage;

courseObject.prototype.startTopic = _startTopic;
courseObject.prototype.showSubMenu = _showSubMenu;
courseObject.prototype.showSitemap = _showSitemap;
courseObject.prototype.startTextTopic = _startTextTopic;
courseObject.prototype.startBookmarkTopic = _startBookmarkTopic;
courseObject.prototype.startScenario = _startScenario
courseObject.prototype.startPowerPoint = _startPowerPoint
courseObject.prototype.startAssessment = _startAssessment
courseObject.prototype.checkForAssessmentTopic = _checkForAssessmentTopic

courseObject.prototype.setToBookmark = _setToBookmark;

courseObject.prototype.nextPage = _nextPage;
courseObject.prototype.bookmarkPage = _bookmarkPage;
courseObject.prototype.prevPage = _prevPage;
courseObject.prototype.gotoMenu = _gotoMenu;
courseObject.prototype.gotoPage = _gotoPage;
courseObject.prototype.synchToCurrentPage = _synchToCurrentPage;
courseObject.prototype.generatePageLinkList = _generatePageLinkList;


// ************* See course_object_LMS_methods.js for code and comments *************
courseObject.prototype.exitCourse = _exitCourse;
courseObject.prototype.addLMSData = _addLMSData;
courseObject.prototype.commitLMS = _commitLMS;
courseObject.prototype.finalizeLMS = _finalizeLMS;
courseObject.prototype.addTrackingDataToCourse = _addTrackingDataToCourse;
courseObject.prototype.sendTrackingDataToLMS = _sendTrackingDataToLMS;

courseObject.prototype.getTopicObjects = _getTopicObjects;
courseObject.prototype.getCourseObj = _getCourseObj;

// ************* See course_object_tracking_methods.js for code and comments *************
courseObject.prototype.upDateTracking = _upDateTracking;
courseObject.prototype.setFinalScore = _setFinalScore;

courseObject.prototype.findObject = _findObject;
courseObject.prototype.addChild = _addChild;
courseObject.prototype.setDescription = _setDescription;
courseObject.prototype.setTranscript = _setTranscript;
courseObject.prototype.setTime = _setTime;
courseObject.prototype.addMediaType = _addMediaType;
courseObject.prototype.setScreenRandomisation = _setScreenRandomisation;
//courseObject.prototype.addPageScore = _addPageScore;
courseObject.prototype.getDepth = _getDepth;
courseObject.prototype.getTrackingStateInEnglish = _getTrackingStateInEnglish;

// ************* See course_object_generic_methods.js for code and comments *************
courseObject.prototype.alertAll = _alertAll;
courseObject.prototype.randomSort = _randomSort;
courseObject.prototype.alertStructure = _alertStructure;
courseObject.prototype.returnStructureInfo = _returnStructureInfo;
courseObject.prototype.removeArrayElement = _removeArrayElement;
courseObject.prototype.getRandom = _getRandom;
courseObject.prototype.joinArrays = _joinArrays;
courseObject.prototype.debug = _debug;
courseObject.prototype.unCamelCase = _unCamelCase;

