function CMIComponent(A, D, C, B) {
this.Name = A;
this.Value = D;
this.DefaultValue = D;
this.ReadStatus = C;
this.DataType = B
}
var ScormState = {
StateNotInitialized: "notinitialized",
StateRunning: "running",
StateTerminated: "terminated"
};
var ScormStatus = {
StatusReadOnly: "readonly",
StatusWriteOnly: "writeonly",
StatusBoth: "both"
};
RatingsPanel = Ext.extend(Ext.Panel, {
constructor: function(A) {
Ext.apply(this, A, {
width: "auto",
rating: 0,
averageRating: 0,
hoverRating: 0,
active: true
});
RatingsPanel.superclass.constructor.call(this, A);
this._Rate1Star = this._Rate1Star || "Click to rate this activity with 1 star";
this._RateNStars = this._RateNStars || "Click to rate this activity with {0} stars";
this._AverageRating = this._AverageRating || "Average: {0}";
this.addEvents("rated");
this.on("render", function(B) {
this.ratingsBar = Ext.DomHelper.append(B.body, {
tag: "div",
cls: "x-ratings-bar"
},
true);
this.ratingsDisplay = Ext.DomHelper.append(this.ratingsBar, {
tag: "div",
cls: "x-ratings-display x-ratings-chosen"
},
true);
this.ratingsLabel = Ext.DomHelper.append(B.body, {
tag: "div",
cls: "x-ratings-label"
},
true);
if (this.active) {
this.ratingsBar.on("mousemove", this.onMouseMove, this, {
buffer: 25
});
this.ratingsBar.on("mouseleave", this.onMouseLeave, this, {
delay: 30
});
this.ratingsBar.on("click", this.onClick, this);
this.tip = new Ext.ToolTip({
id: "ratings-tip",
anchorToTarget: false,
autoShow: false,
hideDelay: 0,
showDelay: 10,
target: this.ratingsDisplay,
trackMouse: true
})
}
this.updateRating()
},
this)
},
getRatingByMouse: function(D) {
var B = this.ratingsBar;
var A = D.getPageX() - B.getX();
var C = A / B.getWidth();
return Math.max(0, Math.min(5, Math.ceil(5 * C)))
},
onMouseMove: function(C, A, D) {
var B = this.getRatingByMouse(C);
if (B != this.hoverRating) {
this.hoverRating = B;
if (this.tip && !this.tip.targetXY) {
this.tip.targetXY = C.getXY()
}
this.updateRating(true)
}
},
onMouseLeave: function(B, A, C) {
this.hoverRating = 0;
this.updateRating()
},
onClick: function(B, A, C) {
this.rating = this.getRatingByMouse(B);
this.hoverRating = this.rating;
this.updateRating(false);
this.fireEvent("rated", this, this.rating)
},
setQtip: function(B, A) {
if (this.tip) {
if (A && !Ext.isEmpty(B) && !this.tip.body) {
this.tip.show()
}
if (this.tip.body) {
this.tip.body.update(B);
this.tip.doLayout()
}
if (A && !Ext.isEmpty(B)) {
this.tip.show()
}
else {
this.tip.hide()
}
}
},
updateRating: function(E) {
this.rating = Math.max(0, Math.min(5, Math.round(this.rating)));
this.averageRating = Math.max(0, Math.min(5, this.averageRating));
var D = this.rating;
var B = false;
if (!D) {
D = this.averageRating;
B = true
}
if (E) {
D = this.hoverRating
}
var C = (D / 5) * 100;
if (isNaN(C)) {
C = 0
}
this.ratingsDisplay.setWidth(C + "%");
if (E) {
this.ratingsDisplay.removeClass(["x-ratings-chosen", "x-ratings-average"]).addClass("x-ratings-hover")
}
else {
if (B) {
this.ratingsDisplay.removeClass(["x-ratings-chosen", "x-ratings-hover"]).addClass("x-ratings-average")
}
else {
this.ratingsDisplay.removeClass(["x-ratings-average", "x-ratings-hover"]).addClass("x-ratings-chosen")
}
}
if (E) {
this.setQtip((D == 1) ? this._Rate1Star : String.format(this._RateNStars, D), true)
}
else {
if (this.tip.body) {
this.setQtip("", false)
}
}
var A = "";
if (this.averageRating) {
A = String.format(this._AverageRating, this.averageRating)
}
this.ratingsLabel.update(A)
},
setRating: function(B, A) {
this.rating = B.toFixed(1);
this.averageRating = A.toFixed(1);
this.updateRating()
}
});
Ext.reg("ratingspanel", RatingsPanel);
PlayerPanel = function(E) {
Ext.apply(this, E, {
_DataDebug: false,
courseTree: null,
nodeLookup: null,
viewport: null,
messageBoxShouldBeClosed: true,
itemInfo: null,
itemId: null,
shortcutId: null,
lastLogicalId: null,
courseContent: null,
assignmentForm: null,
assignmentWindow: null,
rubricPanel: null,
rubricWindow: null,
detailsPanel: null,
detailsWindow: null,
peerReviewPanel: null,
peerReviewWindow: null,
lastItemInfoRequest: null,
dropboxDetailsButton: null,
dropboxCompletedButton: null,
dropboxSubmitButton: null,
dropboxOpenSubmitButton: null,
dropboxSaveProgressButton: null,
dropboxOpenSaveProgressButton: null,
dropboxOpenButton: null,
dropboxOpenSplitButton: null,
dropboxRubricButton: null,
dropboxSubmitTooltip: null,
dropboxSurveyButton: null,
mainCourseContentPanel: null,
attachmentPanel: null,
idealHeight: 800,
idealWidth: 850,
idealAssignmentHeight: 380,
idealAssignmentWidth: 620,
scoreColumnWidth: 92,
scoreColumnHeight: 18,
firstColumnWidthStyle: null,
allColumnsWidthStyle: null,
configureGroupSetupWindow: null,
playerInitialized: false,
needsItemInitialization: false,
needsTreeInitialization: false,
itemCurrentlyGrading: null,
downloadIframe: null,
sizeTimer: null,
autoScrollTree: Ext.isOpera
});
PlayerPanel.superclass.constructor.call(this);
this.setupStyles();
if (this.showToc) {
playerColumnNodeUI = Ext.extend(Ext.tree.TreeNodeUI, {
focus: Ext.emptyFn,
scoreColumnWidth: 92,
scoreColumnHeight: 18,
playerId: this.playerId,
renderElements: function(P, X, T, Y) {
this.indentMarkup = P.parentNode ? P.parentNode.ui.getChildIndent() : "";
if (!T) {
return
}
var Z = P.getOwnerTree();
var W = Z.columns;
var V = Z.borderWidth;
var U = W[0];
var O = ['<li class="x-tree-node"><div ext:tree-node-id="', P.id, '" style="height:', this.scoreColumnHeight, ';" class="x-tree-node-el x-tree-node-leaf ', X.cls, '">', '<div class="x-tree-col x-tree-col-first" style="overflow:visible">', '<span class="x-tree-node-indent">', this.indentMarkup, "</span>", '<img src="', this.emptyIcon, '" class="x-tree-ec-icon x-tree-elbow">', '<img src="', X.icon || this.emptyIcon, '" class="x-tree-node-icon', (X.icon ? " x-tree-node-inline-icon" : ""), (X.iconCls ? " " + X.iconCls : ""), '" unselectable="on">', '<a hidefocus="on" class="x-tree-node-anchor" href="', X.href ? X.href : "#", '" tabIndex="1" ', X.hrefTarget ? ' target="' + X.hrefTarget + '"' : "", ">", '<span unselectable="on" class="x-tree-col-text ', X.excused ? "grade-excused" : "", '" ext:qtip="', Ext.util.Format.htmlEncode(P.text), '">', P.text || (U.renderer ? U.renderer(X[U.dataIndex], P, X) : X[U.dataIndex]), "</span></a>"];
O.push("</div>");
U = W[1];
var R = "";
if (P.isSelected()) {
R = "x-tree-selected"
}
O.push('<div id="', P.id, "_", this.playerId, '_grade" class="x-tree-col color_light', (U.cls ? U.cls : ""), " ", R, '" style="float:right;margin-right:', V, 'px">');
if (X.gradeHtml && (X.gradeHtml.indexOf("<span> </span>") == -1 || X.gradeHtml.indexOf("gbi-retry") > 0)) {
var Q = 0;
if (Ext.isIE) {
Q = -2
}
Q -= 4;
O.push('<div class="x-tree-col-text x-tree-grade" style="height:', this.scoreColumnHeight, "px;margin-top:-2px;margin-left:", Q, 'px">', X.gradeHtml, "</div>")
}
O.push("</div>");
O.push('<div class="x-clear"></div></div>', '<ul class="x-tree-node-ct" style="display:none;"></ul>', "</li>");
if (Y !== true && P.nextSibling && P.nextSibling.ui.getEl()) {
this.wrap = Ext.DomHelper.insertHtml("beforeBegin", P.nextSibling.ui.getEl(), O.join(""))
}
else {
this.wrap = Ext.DomHelper.insertHtml("beforeEnd", T, O.join(""))
}
this.elNode = this.wrap.childNodes[0];
this.ctNode = this.wrap.childNodes[1];
var S = this.elNode.firstChild.childNodes;
this.indentNode = S[0];
this.ecNode = S[1];
this.iconNode = S[2];
this.anchor = S[3];
this.textNode = S[3].firstChild;
var b = Ext.get(this.elNode);
b.on("mouseover", this.addHighlight.createDelegate(this, [this.elNode]));
b.on("mouseout", this.removeHighlight.createDelegate(this, [this.elNode]))
},
addHighlight: function(P) {
if (P.childNodes.length > 1) {
var O = Ext.get(P.childNodes[1]);
O.removeClass("color_light");
O.addClass("x-tree-node-over")
}
},
removeHighlight: function(P) {
var O = Ext.get(P);
O.removeClass("x-tree-node-over");
if (P.childNodes.length > 1) {
O = Ext.get(P.childNodes[1]);
O.removeClass("x-tree-node-over");
O.addClass("color_light")
}
}
});
var D = 280;
var C = Ext.util.CSS.getRule(".course-tree-initial-width");
if (C) {
D = parseInt(C.style.width)
}
this.courseTree = new Ext.tree.TreePanel({
id: "course-tree_" + this.playerId,
region: "west",
split: true,
width: D > 0 ? D.constrain(175, 500) : 280,
minSize: 175,
maxSize: 500,
collapsible: true,
hidden: !this.showToc,
margins: "0 0 0 0",
cmargins: "0 0 0 0",
rootVisible: false,
useArrows: true,
lines: false,
autoScroll: this.autoScrollTree,
animCollapse: false,
animate: (false && (Ext.isIE)),
collapseMode: "mini",
cls: "color_light tree_control default_border course_tree course_tree_" + this.playerId,
bodyStyle: "overflow-y:scroll; overflow-x:hidden",
loader: new Ext.tree.TreeLoader({
preloadChildren: true,
clearOnLoad: false,
baseAttrs: {
uiProvider: playerColumnNodeUI
}
}), columns: [
{
width: 200,
dataIndex: "text"
},
{
width: this.scoreColumnWidth,
dataIndex: "score"
}
], tbar: [
{
text: this._Configure,
icon: this.appRoot + "/Images/gear.png",
hidden: this.isTeacher,
cls: "player-options",
menu: {
cls: "player-options-menu",
items: [
{
hidden: false,
text: this._ShowScores,
cls: "show-scores-option",
iconCls: this.showScores ? "menu_check_image" : "",
scope: this,
handler: function() {
this.recordItemTimeSpent();
window.location = this.pageRoot + "?enrollmentid=" + this.enrollmentId + "&itemid=" + this.shortcutId + "&showscores=" + !this.showScores
}
},
{
disabled: !this.showExcusedCheckbox,
text: this.showExcusedString,
cls: "show-excused-option",
iconCls: (this.showExcused && this.showExcusedCheckbox) ? "menu_check_image" : "",
scope: this,
handler: function() {
this.recordItemTimeSpent();
window.location = this.pageRoot + "?enrollmentid=" + this.enrollmentId + "&itemid=" + this.shortcutId + "&showexcused=" + !this.showExcused
}
}
]
}
},
{
xtype: "tbfill"
},
{
tooltip: this.refreshString,
icon: this.appRoot + "/Images/refresh.png",
cls: "x-btn-icon",
handler: function() {
this.recordItemTimeSpent();
var O = this.getChildNavigateAwayFunction();
if (O) {
O(this.navToItem.createDelegate(this, [this.shortcutId, true]))
}
else {
this.navToItem(this.shortcutId, true)
}
},
scope: this
}
], root: new Ext.tree.AsyncTreeNode({
expanded: true,
children: this.CourseItems
}), collapseFirst: false,
listeners: {
resize: this.sizeTree,
expandnode: this.sizeTree,
collapsenode: this.sizeTree,
expand: this.resizeContentFrame,
collapse: this.resizeContentFrame,
contextmenu: function(P, O) {
O.stopEvent()
},
scope: this
}
});
this.courseTree.on("click", function(P, Q) {
var O = this.getChildNavigateAwayFunction();
this.skipSelectionChange = true;
this.navToItem(P.id);
Q.stopEvent();
if (O) {
return false
}
else {
this.navigateTreeToNode(P, true);
return true
}
},
this);
this.courseTree.getSelectionModel().on("beforeselect", function(Q, O, P) {
this.navigateTreeToNode(O, true, null, true)
},
this);
this.courseTree.getSelectionModel().on("selectionchange", function(Q, O, P) {
if (this.skipSelectionChange) {
this.skipSelectionChange = false
}
else {
if (O.id != this.itemId) {
this.navToItem(O.id)
}
}
},
this, {
buffer: 1000
})
}
this.mainCourseContentPanel = new Ext.Panel({
region: "center",
contentEl: "content_" + this.playerId,
listeners: {
resize: this.resizeContentFrame,
scope: this
}
});
var H = [];
if (this.showAdornments) {
this.attachmentPanel = new Ext.Panel({
region: "south",
autoHeight: true,
forceLayout: true,
hidden: true,
cls: "default_border color_medium",
style: "padding:8px; border-right-width: 0px; border-left-width: 0px; border-bottom-width:0px; border-top-width:1px",
html: " ",
listeners: {
scope: this,
show: {
fn: function(P) {
var O = P.el.select("a[class=attachment-link]");
O.each(function(R, T, Q) {
var S = R.getAttribute("downloadFile");
R.on("click", function(U) {
U.stopEvent();
this.downloadFile(S)
},
this)
},
this)
},
delay: 500
}
}
});
H.push(this.attachmentPanel)
}
H.push(this.mainCourseContentPanel);
var L = null;
if (this.showHeader) {
L = [];
L.push({
id: "comments_" + this.playerId,
text: this._InstructorNote,
icon: this.appRoot + "/Images/document_dirty.png",
cls: "x-btn-text-icon",
hidden: true,
scope: this,
handler: this.showComments
},
{
xtype: "label",
id: "content_status_" + this.playerId,
cls: "default_font",
style: "font-size:10pt;font-style:italic;padding-left:6px;",
text: ""
});
var A = (this.componentType != "contentplayer") && this.showRatings;
if (A) {
this.ratingsPanel = new RatingsPanel({
hidden: true,
_Rate1Star: this._Rate1Star,
_RateNStars: this._RateNStars,
_AverageRating: this._AverageRating,
listeners: {
scope: this,
rated: function(O, P) {
Ext.Ajax.request({
url: this.appRoot + "/Learn/ScormData.ashx",
params: {
action: "rateitem",
enrollmentid: this.enrollmentId,
itemid: this.lastLogicalId,
data: (P / 5)
},
scope: this,
callback: function(S, T, R) {
var Q = null;
if (!Ext.isEmpty(R.responseText)) {
Q = Ext.util.JSON.decode(R.responseText)
}
if (!T || Q == null || Q.success != true) {
T = false
}
if (T) {
this.ratingsPanel.setRating(Q.rating * 5, Q.avgRating * 5)
}
}
})
}
}
});
L.push(this.ratingsPanel)
}
L.push("->");
var G = (false && this.componentType != "contentplayer");
if (G) {
L.push({
tooltip: this._GetContentUrl,
icon: this.appRoot + "/Images/link.png",
cls: "x-btn-icon",
handler: function() {
var P = "ActivityPlayer";
var O = this.absoluteFrameRoot + "/Component/" + P + "?enrollmentid=" + this.courseId + "&itemid=" + this.itemId;
FRAME_API.fireEvent("jswindowopening");
Ext.Msg.prompt(this._ContentUrlTitle, this._ContentUrlInstructions, function(R) {
FRAME_API.fireEvent("jswindowclosed")
},
this, false, O);
var Q = Ext.Msg.getDialog().el;
Q = Q.child("input", true);
Q.focus();
Q.select()
},
scope: this
})
}
if (this.showAuthorLink && this.componentType != "contentplayer") {
L.push({
xtype: "panel",
html: '<a class="course_player_edit_item default_font hover_link" href="javascript:void(0)">' + Ext.util.Format.htmlEncode(this._Edit) + "</a>",
listeners: {
scope: this,
afterrender: function(P) {
var O = P.getEl().child('a[class*=course_player_edit_item"]');
O.on("click", function(Q) {
Q.stopEvent();
this.editActivity()
},
this)
}
}
})
}
if (this.componentType == "courseplayer") {
if (this.showNavPrev) {
L.push({
xtype: "panel",
html: '<div class="course_player_nav_prev" ext:qtip="' + this._Previous + '"></div>',
listeners: {
scope: this,
afterrender: function(P) {
var O = P.getEl().child('div[class*=course_player_nav_prev"]');
O.on("click", this.navPrev, this)
}
}
})
}
if (this.showNavNext) {
L.push({
xtype: "panel",
html: '<div class="course_player_nav_next" ext:qtip="' + this._Next + '"></div>',
listeners: {
scope: this,
afterrender: function(P) {
var O = P.getEl().child('div[class*=course_player_nav_next"]');
O.on("click", this.navNext, this)
}
}
})
}
}
}
this.mainContentLayout = new Ext.Panel({
layout: "border",
region: "center",
cls: this.showToc ? "course-main-content default_border" : "",
items: H,
tbar: L
});
var J = [];
if (this.showToc) {
J.push(new Ext.Panel({
layout: "border",
region: "center",
items: [this.courseTree, this.mainContentLayout]
}))
}
else {
J.push(this.mainContentLayout)
}
if (this.showAdornments) {
J.push(new Ext.Panel({
border: false,
region: "south",
autoHeight: true,
contentEl: "footer_" + this.playerId
}))
}
this.viewport = new Ext.Panel({
renderTo: "player_" + this.playerId,
layout: "border",
items: J
});
this.resizePlayerContainer();
Ext.EventManager.onWindowResize(this.resizePlayerContainer, this);
if (this.showHeader) {
var I = this.mainContentLayout.getTopToolbar();
if (I) {
I.hide()
}
}
if (this.showAdornments) {
this.dropboxSurveyButton = new Ext.Button({
renderTo: "dropboxSurvey_" + this.playerId,
text: this.surveyButtonString,
handler: this.dropboxSurveyClick,
scope: this
});
this.dropboxRubricButton = new Ext.Button({
renderTo: "dropboxRubric_" + this.playerId,
text: this.rubricButtonString,
handler: this.dropboxRubricClick,
scope: this
});
this.dropboxCompletedButton = new Ext.Button({
renderTo: "dropboxCompleted_" + this.playerId,
text: this.completedButtonString,
handler: this.dropboxCompletedClick,
scope: this
});
this.dropboxDetailsButton = new Ext.Button({
renderTo: "dropboxDetails_" + this.playerId,
text: this.detailsButtonString,
handler: this.dropboxDetailsClick,
scope: this
});
this.dropboxSubmitButton = new Ext.Button({
renderTo: "dropboxSubmit_" + this.playerId,
text: this.submitButtonString,
handler: this.submitAssignment,
scope: this
});
this.dropboxOpenButton = new Ext.Button({
renderTo: "dropboxOpen_" + this.playerId,
text: this.openButtonString,
handler: this.openAssignment,
scope: this
});
this.dropboxOpenSplitButton = new Ext.SplitButton({
renderTo: "dropboxOpenSplit_" + this.playerId,
text: this.openButtonString,
handler: this.openAssignment,
scope: this,
menu: new Ext.menu.Menu({
items: [
{
text: this.openLatestString,
handler: this.openWipAssignment,
scope: this,
tooltip: this.openLatestTipString,
listeners: {
afterrender: this.menuItemAfterRender,
scope: this
}
},
{
text: this.openSubmittedString,
handler: this.openSubmittedAssignment,
scope: this,
tooltip: this.openSubmittedTipString,
listeners: {
afterrender: this.menuItemAfterRender,
scope: this
}
},
{
text: this.openOriginalString,
handler: this.openAssignmentTemplate,
scope: this,
tooltip: this.openOriginalTipString,
listeners: {
afterrender: this.menuItemAfterRender,
scope: this
}
}
]
})
});
this.dropboxSaveProgressButton = new Ext.Button({
renderTo: "dropboxSaveProgress_" + this.playerId,
text: this.saveButtonString,
tooltip: this.saveProgressString + "<br/><b>" + this.saveNotSubmitString + "</b>",
handler: this.saveProgress,
scope: this
});
this.dropboxPeerReviewButton = new Ext.Button({
renderTo: "dropboxPeerReview_" + this.playerId,
text: this._ReviewPeers,
minWidth: 110,
handler: this.peerReviewClick,
scope: this
})
}
FRAME_API.addListener("viewgradedetails", this.dropboxDetailsClick, this);
this.prepareForNavigation();
this.playerInitialized = true;
if (this.needsItemInitialization) {
this.recordBookmark();
this.updateForNewItemInfo();
this.needsItemInitialization = false
}
if (this.needsTreeInitialization) {
this.navigateTreeToItem(this.shortcutId)
}
function N(O) {
this.closePopup = function(P) {
if (typeof P == "boolean") {
P = {
refreshAll: P
}
}
O.closeWindows(!P.cancelled);
O.showMainContent()
}
}
this.playerAssemblyApi = new N(this);
this.version12 = false;
this.lastError = "0";
this.sessionState = ScormState.StateNotInitialized;
this.dataModel = new Ext.util.MixedCollection();
this.argOnTerminate = null;
this.requestOnTerminate = "";
this.dataInitialized = false;
this.needsResetData = false;
this.readOnly = false;
if (typeof(FRAME_API) != "undefined") {
this.pageRoot = FRAME_API.frameRoot + "/Component/" + this.componentType;
FRAME_API.setComponentState(this.componentType, this.playerId, {
courseId: this.courseId,
sectionId: this.sectionId,
enrollmentId: this.enrollmentId,
pageTitle: this.pageTitle || "",
subTitle1: this.courseTitle,
subTitle2: this.sectionTitle,
helpToken: "STUDENT_VIEW_COURSE"
});
var K = FRAME_API.findEnrollment(this.enrollmentId);
this.readOnly = true;
if (K && K.userId == FRAME_API.proxyUserId) {
this.readOnly = false
}
FRAME_API.addListener("jswindowopening", this.hideMainContent, this);
FRAME_API.addListener("jswindowclosed", this.showMainContent, this);
var M = function(P, R, Q, O) {
if (P == this.componentType && R == this.playerId) {
this.navToItem(Q, false, O)
}
};
FRAME_API.addListener("navtoitem", M, this);
var F = function(O) {
this.closeWindows(!O.cancelled)
};
FRAME_API.addListener("editorclosed", F, this);
var B = function(O) {
this.closeWindows(O)
};
FRAME_API.addListener("closegroupsetupwindow", B, this);
Ext.EventManager.on(window, "unload", function() {
FRAME_API.removeListener("jswindowopening", this.hideMainContent, this);
FRAME_API.removeListener("jswindowclosed", this.showMainContent, this);
FRAME_API.removeListener("navtoitem", M, this);
FRAME_API.removeListener("editorclosed", F, this);
FRAME_API.removeListener("closegroupsetupwindow", B, this);
FRAME_API.removeListener("viewgradedetails", this.dropboxDetailsClick, this)
},
this)
}
window.onunload = this.onUnload.createDelegate(this)
};
Ext.extend(PlayerPanel, Ext.Panel, {
onUnload: function() {
this.recordItemTimeSpent(true);
window.onunload = null
},
updateRatings: function() {
if (this.ratingsPanel) {
var B = 0;
var A = 0;
if (this.itemInfo != null) {
if (this.itemInfo.rating || this.itemInfo.avgRating) {
B = this.itemInfo.rating;
A = this.itemInfo.avgRating
}
}
this.ratingsPanel.setRating(B * 5, A * 5)
}
},
showComments: function() {
var C = Ext.get(document.body).getSize();
var D = Math.min(C.height / 1.5, this.idealHeight);
var A = Math.min(C.width / 1.5, this.idealWidth);
var B = String.format("{0}/Editor/GetActivityHtml.ashx?wrapper=1&entityid={1}&courseid={1}&enrollmentid={2}§ionid={3}&itemid={4}&path={5}", this.appRoot, Ext.isEmpty(this.itemInfo.resourceEntityId) ? this.courseId : this.itemInfo.resourceEntityId, this.enrollmentId, this.sectionId, this.itemId, encodeURIComponent(this.itemInfo.comments));
this.commentsWindow = new Ext.Window({
title: this._InstructorNote,
constrainHeader: true,
height: D,
width: A,
layout: "fit",
plain: true,
buttonAlign: "center",
items: [
{
html: '<iframe class="x-panel-body page_color default_font" style="width:100%;height:100%;overflow:auto;" frameborder="0" src="' + B + '" title="' + this._InstructorNoteFrame + '"></iframe>'
}
], shim: true,
modal: true,
frame: true,
closable: true,
closeAction: "close",
listeners: {
close: function() {
FRAME_API.fireEvent("jswindowclosed")
},
scope: this
}
});
FRAME_API.fireEvent("jswindowopening");
this.commentsWindow.show()
},
processResponse: function(request, options) {
var root = eval("(" + request.responseText + ")");
var newURL = "";
if (root != null) {
this.Log("processResponse: " + root.url);
if (root.url && root.url.length > 0) {
frames["contentBody_" + this.playerId].location = root.url
}
else {
if (root.status == "empty") {
this.messageBoxHide();
frames["contentBody_" + this.playerId].location = this.appRoot + "/Learn/MissingContent.aspx"
}
else {
this.messageBoxHide();
this.messageBoxAlertWithMinWidth(this.errorTitle, String.format(this.failedToLoadItemString, root.status, options.url))
}
}
if (!Ext.isEmpty(root.id)) {
this.navigateTreeToItem(root.id)
}
}
else {
this.messageBoxHide();
this.messageBoxAlertWithMinWidth(this.errorTitle, String.format(this.failedToLoadItemString, "invalid response", options.url))
}
},
failedRequest: function(A, B) {
if (A.status == 403) {
location.reload(true)
}
else {
this.messageBoxHide();
FRAME_API.fireEvent("jswindowopening");
Ext.MessageBox.alert(this.errorTitle, String.format(this.failedToLoadItemString, A.statusText + ":" + A.status, B.url), function() {
FRAME_API.fireEvent("jswindowclosed")
})
}
},
sizeTree: function() {
if ((this.courseTree == null) || (this.courseTree.collapsed)) {
return
}
if (this.sizeTimer != null) {
clearInterval(this.sizeTimer);
this.sizeTimer = null
}
this.sizeTimer = this.doSizeTree.defer(50, this)
},
doSizeTree: function() {
if (this.sizeTimer != null) {
clearInterval(this.sizeTimer);
this.sizeTimer = null
}
if ((this.courseTree == null) || (this.courseTree.collapsed)) {
return
}
var A = Math.max(0, this.courseTree.innerCt.getSize().width);
var B = Math.max(0, A - this.scoreColumnWidth);
B = Math.max(0, B - 2);
this.firstColumnWidthStyle.style.width = B + "px";
this.allColumnsWidthStyle.style.width = A + "px";
this.resizeContentFrame()
},
getStylesOnPage: function() {
if (!document.styleSheets) {
return null
}
var A = [];
var G = document.styleSheets;
for (var E = G.length - 1; E >= 0; E--) {
var D = G[E];
var C = null;
if (D.cssRules) {
C = D.cssRules
}
else {
if (D.rules) {
C = D.rules
}
}
if (C != null) {
for (var B = 0; B <= C.length; B++) {
var F = C[B];
if (F) {
A.push(F)
}
}
}
}
return A
},
getLocalCSSRule: function(D) {
var A = this.getStylesOnPage();
if (!A) {
return
}
for (var C = 0; C < A.length; C++) {
var B = A[C];
if (B.selectorText == D) {
return B
}
}
},
setupStyles: function() {
this.firstColumnWidthStyle = this.getLocalCSSRule(".course_tree_" + this.playerId + " .x-tree-col-first");
this.allColumnsWidthStyle = this.getLocalCSSRule(".course_tree_" + this.playerId + " .x-tree-node-el")
},
menuItemAfterRender: function(A) {
if (A.initialConfig.tooltip) {
A.tip = new Ext.ToolTip({
target: A.getEl().getAttribute("id"),
delegate: ".x-menu-item",
renderTo: document.body,
html: A.initialConfig.tooltip,
trackMouse: true,
anchor: "bottom"
})
}
},
resizePlayerContainer: function() {
var A = Ext.get("player_" + this.playerId);
if (A != null) {
this.viewport.setSize(A.getSize());
this.viewport.doLayout()
}
},
resizeContentFrame: function(C, A) {
var B = Ext.get("content_" + this.playerId);
var D = this.mainCourseContentPanel.body.dom;
if (B != null && D != null) {
var A = D.offsetHeight;
var C = D.offsetWidth;
B.setSize(C, A)
}
},
resizeContent: function() {
var A = document.getElementById("contentBody_" + this.playerId);
var B = null;
try {
B = A.contentWindow.document.getElementsByTagName("iframe")[0].contentWindow.forceResize
}
catch (C) {}
if (B) {
B()
}
},
getChildNavigateAwayFunction: function() {
var A = null;
try {
var C = frames["contentBody_" + this.playerId].frameElement.contentWindow;
if (C) {
if (C.navigateAway) {
A = C.navigateAway
}
else {
if (C.frames.length > 0) {
for (var B = 0; B < C.frames.length; B++) {
A = C.frames[B].frameElement.contentWindow.navigateAway;
if (A) {
break
}
}
}
}
}
}
catch (D) {
A = null
}
return A
},
prepareForNavigation: function() {
if (!this.courseTree) {
return
}
this.nodeLookup = {};
this.createNodeLookup(this.courseTree.root.childNodes[0])
},
createNodeLookup: function(D) {
this.nodeLookup[D.id] = D;
var B = D.childNodes;
for (var A = 0, C = B.length; A < C; A++) {
this.createNodeLookup(B[A])
}
},
findNode: function(E, F) {
if (E.id == F) {
return E
}
if (this.nodeLookup && (this.nodeLookup[F] != null)) {
return this.nodeLookup[F]
}
var C = E.childNodes;
for (var B = 0, D = C.length; B < D; B++) {
var A = this.findNode(C[B], F);
if (A != null) {
return A
}
}
return null
},
navigateTreeToItem: function(D) {
if (!this.courseTree || Ext.isEmpty(D)) {
return
}
var B = this.findNode(this.courseTree.root, D);
if (!B) {
var C = "_STUB";
var A = D.length - C.length;
if (A >= 0 && D.lastIndexOf(C) === A) {
D = D.substring(0, A)
}
B = this.findNode(this.courseTree.root, D);
if (!B) {
return
}
}
this.navigateTreeToNode(B)
},
navigateTreeToNode: function(A, C, I, D) {
var H = this.courseTree.getSelectionModel();
var B = H.getSelectedNode();
if (B != null) {
var F = B.getUI();
var J = F.getAnchor();
var G = J.parentNode.parentNode;
if (G.childNodes.length > 1) {
var E = Ext.get(G.childNodes[1]);
E.removeClass("x-tree-selected");
E.addClass("color_light")
}
}
if (!C && !A.isSelected()) {
A.ensureVisible()
}
if (!D && !A.isSelected()) {
A.select()
}
if (A.expanded) {
if (I) {
I()
}
}
else {
A.expand(false, false, I)
}
this.courseTree.getTreeEl().dom.scrollLeft = 0;
var F = A.getUI();
var J = F.getAnchor();
var G = J.parentNode.parentNode;
if (G.childNodes.length > 1) {
var E = Ext.get(G.childNodes[1]);
E.addClass("x-tree-selected");
E.removeClass("color_light")
}
},
showLoadingMessageBox: function() {}, sendNavigationRequest: function(B) {
var A = this.getChildNavigateAwayFunction();
if (A) {
A(this.sendNavigationRequestHelper.createDelegate(this, [B]), this.sendNavigationRequestCancel.createDelegate(this));
return
}
this.sendNavigationRequestHelper(B)
},
sendNavigationRequestCancel: function() {
if (this.showToc) {
var A = this.findNode(this.courseTree.root, this.itemId);
this.navigateTreeToNode(A, true)
}
},
sendNavigationRequestHelper: function(A) {
this.messageBoxShouldBeClosed = false;
this.showLoadingMessageBox.defer(1000, this);
Ext.Ajax.request({
url: A,
success: this.processResponse,
failure: this.failedRequest,
scope: this
})
},
messageBoxHide: function() {
this.messageBoxShouldBeClosed = true;
FRAME_API.fireEvent("jswindowclosed");
Ext.MessageBox.hide()
},
messageBoxHidden: function() {
FRAME_API.fireEvent("jswindowclosed");
var A = Ext.MessageBox.getDialog();
A.un("move", this.testAndCloseDialog, this);
A.un("hide", this.messageBoxHidden, this)
},
testAndCloseDialog: function() {
if (this.messageBoxShouldBeClosed) {
this.messageBoxHide()
}
},
resetDropbox: function() {
var A = document.getElementById("dropboxStatusAndButtons_" + this.playerId);
if (this.ensureHidden(A)) {
this.viewport.syncSize()
}
if (this.assignmentForm != null) {
this.assignmentWindow.remove(this.assignmentForm, true);
this.assignmentForm = null;
if (Ext.isIE) {
document.body.focus()
}
}
if (this.attachmentPanel) {
this.attachmentPanel.hide()
}
this.mainContentLayout.doLayout();
this.resizeContentFrame()
},
show: function(B, A) {
if (A) {
return this.ensureVisible(B)
}
return this.ensureHidden(B)
},
ensureVisible: function(A) {
if (A != null && A.style.display != "") {
A.style.display = "";
return true
}
return false
},
ensureHidden: function(A) {
if (A != null && A.style.display != "none") {
A.style.display = "none";
return true
}
return false
},
ensureClassName: function(B, A) {
if (B.className != A) {
B.className = A;
return true
}
return false
},
closeWindows: function(A) {
if (this.rubricWindow && this.rubricWindow.isVisible()) {
this.rubricWindow.hide()
}
if (this.detailsWindow && this.detailsWindow.isVisible()) {
this.detailsWindow.hide()
}
if (this.assignmentWindow && this.assignmentWindow.isVisible()) {
this.assignmentWindow.hide()
}
if (this.peerReviewWindow && this.peerReviewPanel.isVisible()) {
this.peerReviewWindow.hide()
}
if ((this.configureGroupSetupWindow != null) && (!this.configureGroupSetupWindow.hidden)) {
this.configureGroupSetupWindow.hide();
Ext.EventManager.removeResizeListener(this.resizeConfigureGroupSetupWindow, this)
}
if (A == true) {
this.navToItem(this.shortcutId)
}
},
configureGroupSetup: function(C) {
this.closeWindows();
if (this.itemId == null) {
return
}
var B = Ext.get(document.body).getSize();
if (this.configureGroupSetupWindow == null) {
this.configureGroupSetupWindow = new Ext.Window({
width: B.width - 64,
height: B.height - 64,
layout: "fit",
plain: false,
buttonAlign: "center",
shim: true,
x: 32,
y: 32,
modal: true,
frame: true,
closable: false,
closeAction: "hide",
resizable: true,
draggable: true,
listeners: {
hide: function() {
FRAME_API.fireEvent("jswindowclosed")
},
scope: this
}
})
}
else {
this.configureGroupSetupWindow.remove(this.configureGroupSetupArea)
}
var A = this.appRoot + "/Component/GroupSetup?enrollmentid=" + C + "&itemid=" + encodeURIComponent(this.itemId);
this.configureGroupSetupArea = new Ext.Panel({
xtype: "panel",
layout: "fit",
monitorResize: true,
id: "configureGroupSetupArea_" + this.playerId,
html: '<iframe class="x-panel-body page_color default_font" style="width:100%;height:100%;" frameborder="0" src="' + A + '"></iframe>'
});
this.configureGroupSetupWindow.add(this.configureGroupSetupArea);
this.configureGroupSetupWindow.setTitle(this.groupSetupString);
FRAME_API.fireEvent("jswindowopening");
this.configureGroupSetupWindow.show();
this.resizeConfigureGroupSetupWindow();
Ext.EventManager.onWindowResize(this.resizeConfigureGroupSetupWindow, this)
},
resizeConfigureGroupSetupWindow: function() {
if (this.configureGroupSetupWindow == null) {
return
}
if (this.configureGroupSetupWindow.hidden) {
return
}
var A = Ext.get(document.body).getSize();
this.configureGroupSetupWindow.setSize(A.width - 64, A.height - 64)
},
dropboxSurveyClick: function() {
if (this.itemInfo == null || this.itemInfo.surveyUrl == null) {
return
}
window.open(this.itemInfo.surveyUrl)
},
dropboxRubricClick: function() {
if (this.rubricPanel == null) {
this.rubricPanel = new Ext.Panel({
header: false,
autoScroll: true,
cls: "color_light",
buttons: [
{
xtype: "tbfill"
},
{
text: this.closeString,
handler: this.closeWindows,
scope: this
}
]
});
this.rubricPanel.on("render", function() {
this.loadRubric()
},
this, {
delay: 50
})
}
else {
this.loadRubric()
}
if (this.rubricWindow == null) {
var B = Ext.get(document.body).getSize();
var C = Math.min(B.height / 1.5, this.idealHeight);
var A = Math.min(B.width / 1.5, this.idealWidth);
this.rubricWindow = new Ext.Window({
constrainHeader: true,
height: C,
width: A,
layout: "fit",
plain: true,
buttonAlign: "center",
items: [this.rubricPanel],
shim: true,
modal: true,
frame: true,
closable: true,
closeAction: "hide",
listeners: {
hide: function() {
FRAME_API.fireEvent("jswindowclosed")
},
scope: this
}
})
}
FRAME_API.fireEvent("jswindowopening");
this.rubricWindow.show()
},
loadRubric: function() {
if (!this.rubricPanel) {
return
}
this.rubricPanel.body.load({
url: this.appRoot + "/Content/Dropbox/RubricDetails.ashx?" + Ext.urlEncode({
courseid: this.courseId,
enrollmentid: this.enrollmentId,
sectionid: this.sectionId,
itemid: this.itemId
}), text: this.loadingMessage,
callback: this.rubricLoadingFinished,
scope: this
})
},
rubricLoadingFinished: function(B, C) {
if (!C) {
var D = this.failedLoadingRubricString;
D += " <a class='load-rubric' href='javascript:void(0)'>";
D += this.clickToRetryString;
D += "</a>";
B.dom.innerHTML = D;
var A = B.child("a[class=load-rubric]");
A.on("click", this.loadRubric, this)
}
this.rubricPanel.footer.addClass("color_medium default_border dashboard_list_btns")
},
dropboxCompletedClick: function() {
Ext.Ajax.request({
url: this.appRoot + "/Content/Assignment.ashx",
silent: true,
params: {
actiontype: "complete",
enrollmentid: this.enrollmentId,
itemid: this.itemInfo.id
},
success: function(B, A) {
this.recordItemTimeSpent();
this.successUpdate(B, A)
},
failure: this.failureUpdate,
scope: this
})
},
dropboxDetailsClick: function() {
if (this.detailsPanel == null) {
this.detailsPanel = new Ext.Panel({
header: false,
layout: "fit",
cls: "color_light"
});
this.detailsPanel.on("render", function() {
this.loadGradingDetails()
},
this)
}
else {
this.loadGradingDetails()
}
if (this.detailsWindow == null) {
var B = Ext.get(document.body).getSize();
var C = Math.min(B.height / 1.5, this.idealHeight);
var A = Math.min(B.width / 1.5, this.idealWidth);
this.detailsWindow = new Ext.Window({
constrainHeader: true,
height: C,
width: A,
layout: "fit",
plain: true,
buttonAlign: "center",
items: [this.detailsPanel],
modal: true,
frame: true,
closable: true,
closeAction: "hide",
listeners: {
hide: function() {
FRAME_API.fireEvent("jswindowclosed")
},
scope: this
}
})
}
FRAME_API.fireEvent("jswindowopening");
this.detailsWindow.show()
},
loadGradingDetails: function() {
if (!this.detailsPanel) {
return
}
if (!this.itemId) {
return
}
var B = false;
var A = FRAME_API.findEnrollment(this.enrollmentId);
if (A && A.isTestStudent) {
B = true
}
this.detailsPanel.body.load({
url: this.appRoot + "/Gradebook/Grade.aspx?" + Ext.urlEncode({
courseid: this.courseId,
sectionid: this.sectionId,
enrollmentid: this.enrollmentId,
itemid: this.itemId,
list: "studentdropbox",
readonly: B,
linktoitem: false,
peerreview: false
}), text: this.loadingMessage,
scripts: true,
callback: this.finishDetailsClick,
scope: this
})
},
peerReviewClick: function() {
if (this.detailsPanel) {
var A = this.detailsPanel;
if (A.items) {
while (A.items.length > 0) {
A.remove(A.items.items[0])
}
}
}
if (this.peerReviewPanel == null) {
this.peerReviewPanel = new Ext.Panel({
id: "peerReviewContainer_" + this.playerId,
header: false,
layout: "fit",
cls: "color_light"
});
this.peerReviewPanel.on("render", function() {
this.loadPeerReviewContent()
},
this);
this.peerReviewPanel.on("resize", function(E, I, H) {
var F = Ext.get("mainPeerReviewPanel");
if (F) {
F.setSize(I, H)
}
var G = Ext.getCmp("peerReviewBodyPanel");
if (G) {
G.setSize(I, H);
G.doLayout(false, true)
}
},
this)
}
else {
this.loadPeerReviewContent()
}
if (this.peerReviewWindow == null) {
var C = Ext.get(document.body).getSize();
var D = Math.min(C.height / 1.1, this.idealHeight);
var B = Math.min(C.width / 1.1, this.idealWidth);
this.peerReviewWindow = new Ext.Window({
id: "peerReviewWindow_" + this.playerId,
constrainHeader: true,
height: D,
width: B,
layout: "fit",
plain: true,
items: [this.peerReviewPanel],
modal: true,
frame: true,
title: this._ReviewPeers,
resizable: true,
closable: true,
closeAction: "hide",
manager: Ext.WindowMgr,
listeners: {
hide: function() {
FRAME_API.fireEvent("jswindowclosed");
var E = Ext.getCmp("peerReviewBodyPanel");
if (E) {
E.destroy()
}
},
scope: this
}
})
}
FRAME_API.fireEvent("jswindowopening");
this.peerReviewWindow.show()
},
loadPeerReviewContent: function() {
if (!this.peerReviewPanel) {
return
}
if (!this.itemId) {
return
}
this.peerReviewPanel.body.load({
url: this.appRoot + "/Gradebook/PeerReview.aspx?" + Ext.urlEncode({
courseid: this.courseId,
sectionid: this.sectionId,
enrollmentid: this.enrollmentId,
itemid: this.itemId,
list: "student",
linktoitem: false,
playerid: this.playerId
}), text: this.loadingMessage,
scripts: true,
callback: this.finishPeerReviewClick,
scope: this
})
},
finishPeerReviewClick: function(B, C) {
if (!C) {
var D = this.failedLoadingPeerReviewListString;
D += " <a class='lanuch-peer-review-list' href='javascript:void(0)'>";
D += this.clickToRetryString;
D += "</a>";
B.dom.innerHTML = D;
var A = B.child("a[class=lanuch-peer-review-list]");
A.on("click", this.loadPeerReviewContent, this);
return
}
},
setItem: function(A) {
this.itemCurrentlyGrading = A
},
getItem: function() {
return this.itemCurrentlyGrading
},
saveItem: function() {}, setItemPanel: function(B) {
var A = this.detailsPanel;
if (A) {
if (A.items) {
while (A.items.length > 0) {
A.remove(A.items.items[0])
}
}
A.add(B);
A.doLayout();
this.itemCurrentlyGrading.focus()
}
},
closeItem: function() {
this.closeWindows()
},
itemSaving: function(A) {
return null
},
itemSaved: function(A) {}, finishDetailsClick: function(B, C) {
if (!C) {
var D = this.failedLoadingGradeDetailsString;
D += " <a class='load-grading-details' href='javascript:void(0)'>";
D += this.clickToRetryString;
D += "</a>";
B.dom.innerHTML = D;
var A = B.child("a[class=load-grading-details]");
A.on("click", this.loadGradingDetails, this);
return
}
},
submitAssignment: function() {
if (!this.itemInfo) {
return
}
if (this.itemInfo.templateName) {
this.submitTemplatedAssignment()
}
else {
var C = Ext.getCmp("attachedUrl_" + this.playerId);
if (C != null) {
if (!this.validateSiteAddress(C.getValue())) {
return
}
}
var A = Ext.get("fileInput_" + this.playerId);
if (A != null) {
var B = A.child("input[@type=file]", true);
if (!Ext.isEmpty(B) && !Ext.isEmpty(B.value) && this.isProhib(B.value)) {
return
}
}
FRAME_API.fireEvent("jswindowopening");
Ext.MessageBox.confirm(this.itemInfo.title, this.confirmSubmitAssignmentText, function(D) {
FRAME_API.fireEvent("jswindowclosed");
if (D == "yes") {
if (this.itemInfo.externalLink) {
Ext.Ajax.request({
url: this.appRoot + "/Content/Assignment.ashx",
success: this.successUpdate,
failure: this.failureUpdate,
params: {
actiontype: "submit",
enrollmentid: this.enrollmentId,
itemid: this.itemInfo.id
},
scope: this
})
}
else {
var E = Ext.getCmp("notes_" + this.playerId);
E.syncValue();
document.getElementById("actiontype_" + this.playerId).value = "submit";
this.messageBoxShouldBeClosed = false;
this.showUploadingMessageBox(this.submittingYourAssignmentString, this.submittingDotDotDotString);
Ext.Ajax.request({
url: this.appRoot + "/Content/Assignment.ashx",
success: this.successUpdate,
failure: this.failureUpdate,
form: this.assignmentForm.getForm().getEl().dom,
method: "POST",
isUpload: true,
scope: this
})
}
}
},
this)
}
},
submitTemplatedAssignment: function() {
var D = "";
var C = "";
if (this.itemInfo.wipFileDisplay) {
D = this.itemInfo.wipFileDisplay;
C = this.itemInfo.wipDate
}
if (D) {
var B = "<a href='javascript:void(0);' id='wipFileName_" + this.playerId + "'>" + D + "</a>";
var A = '<div style="display:none;"><form id="submitTemplatedAssignmentForm_' + this.playerId + '" action="' + this.appRoot + '/Content/Assignment.ashx" enctype="multipart/form-data"><input type="hidden" id="actiontype_' + this.playerId + '" name="actiontype" value="submit" /><input type="hidden" name="enrollmentid" value="' + this.enrollmentId + '" /><input type="hidden" id="itemid_' + this.playerId + '" name="itemid" value="' + this.itemId + "\" /><input name='useWipFile' id='useWipFile_" + this.playerId + "' type='hidden' /></form></div>";
if (C) {
A += String.format(this.wantToSubmitWithDateString, B, C)
}
else {
A += String.format(this.wantToSubmitString, B)
}
Ext.MessageBox.getDialog().on("show", this.onShowSubmitDialog, this);
FRAME_API.fireEvent("jswindowopening");
Ext.MessageBox.show({
title: this.itemInfo.title,
msg: A,
buttons: Ext.MessageBox.YESNOCANCEL,
icon: Ext.MessageBox.QUESTION,
scope: this,
fn: function(E) {
FRAME_API.fireEvent("jswindowclosed");
if (E == "yes") {
var F = document.getElementById("useWipFile_" + this.playerId);
F.value = "y";
this.submitTemplatedAssignmentButtonClick("ok")
}
else {
if (E == "no") {
this.submitTemplatedAssignmentHelper()
}
}
}
})
}
else {
this.submitTemplatedAssignmentHelper()
}
},
onShowSubmitDialog: function(A) {
A.un("show", this.onShowSubmitDialog, this);
(function() {
var B = A.el.child("a[id=wipFileName_" + this.playerId + "]");
B.on("click", this.openWipOrSubmittedAssignment, this)
}).defer(500, this)
},
submitTemplatedAssignmentHelper: function() {
var D = String.format(this.submitAssignmentText, this.itemInfo.templateName);
var A = D + '<br/><br/><form id="submitTemplatedAssignmentForm_' + this.playerId + '" action="' + this.appRoot + '/Content/Assignment.ashx" enctype="multipart/form-data"><div style="display:none;"><input type="hidden" id="actiontype_' + this.playerId + '" name="actiontype" value="submit" /><input type="hidden" name="enrollmentid" value="' + this.enrollmentId + '" /><input type="hidden" id="itemid_' + this.playerId + '" name="itemid" value="' + this.itemId + "\" /><input name='useWipFile' id='useWipFile_" + this.playerId + "' type='hidden' /></div><input name=\"fileUpload\" id=\"fileUpload_" + this.playerId + '" type="file" style="width:350px;" onkeyup="return false;" onkeydown="return false;" onkeypress="return false;"/><br/>';
A += "</form>";
try {
Ext.MessageBox.updateText("")
}
catch (C) {}
var B = Math.min(600, this.getLabelWidth(D));
FRAME_API.fireEvent("jswindowopening");
Ext.MessageBox.show({
title: this.submitAssignmentTitle,
msg: A,
buttons: Ext.MessageBox.OKCANCEL,
fn: this.submitTemplatedAssignmentButtonClick,
scope: this,
icon: Ext.MessageBox.QUESTION,
minWidth: B
});
Ext.MessageBox.getDialog().on("beforehide", this.returnFalse, this)
},
getFileExtension: function(B) {
var A = B.replace(/.*\./, ".");
return A.toLowerCase()
},
isProhib: function(A) {
if (!Ext.isEmpty(this.prohibitedExts) && !Ext.isEmpty(A)) {
if (A.indexOf(".") >= 0) {
var B = A.substr(A.lastIndexOf(".")).toLowerCase();
if (this.prohibitedExts.indexOf(B) >= 0) {
Ext.Msg.alert(this.errorTitle, String.format(this._SubmitProhibitedFileType, B));
return true
}
}
}
return false
},
submitTemplatedAssignmentButtonClick: function(E) {
FRAME_API.fireEvent("jswindowclosed");
Ext.MessageBox.getDialog().un("beforehide", this.returnFalse, this);
if (E == "ok") {
var C = document.getElementById("fileUpload_" + this.playerId);
var A = document.getElementById("useWipFile_" + this.playerId);
if (!A || !A.value) {
var F = C.value;
if (!F) {
FRAME_API.fireEvent("jswindowopening");
Ext.MessageBox.alert(this.errorTitle, this.submitBlankAssignmentTypeText, function() {
FRAME_API.fireEvent("jswindowclosed")
});
return
}
F = F.replace(/.*\//, "");
F = F.replace(/.*\\/,"");if(this.isProhib(F)){return }var D=this.getFileExtension(this.itemInfo.templateName);var B=this.getFileExtension(F);if(B!=D){this.messageBoxAlertWithMinWidth(this.errorTitle,String.format(this.submitWrongAssignmentTypeText,D,B));return }}Ext.Ajax.request({url:this.appRoot+"/Content / Assignment.ashx ",success:this.successUpdate,failure:this.failureUpdate,scope:this,form:" submitTemplatedAssignmentForm_ "+this.playerId,method:" POST ",isUpload:true});this.messageBoxShouldBeClosed=false;this.showUploadingMessageBox(this.submittingYourAssignmentString,this.submittingDotDotDotString)}else{this.messageBoxHide()}},successUpdate:function(B,A){if(B.responseText!=" success "){this.failureUpdate(B,A);return }Ext.Ajax.request({url:this.appRoot+" / Learn / GetItemInfo.ashx ",originalOptions:A,params:{enrollmentid:this.enrollmentId,itemid:this.itemId},scope:this,failure:this.failureUpdate,success:function(G,O){O=O.originalOptions;this.messageBoxHide();var M=G.responseText;try{this.itemInfo=Ext.util.JSON.decode(M)}catch(L){this.failureUpdate(G,O);return }if(O.saveProgress){this.messageBoxAlertWithMinWidth(this.savedAssignmentTitle,O.successDisplayString?O.successDisplayString:this.savedAssignmentText,null,Ext.MessageBox.INFO)}else{this.closeWindows();if(!O.silent){this.messageBoxAlertWithMinWidth(this.submittedAssignmentTitle,this.submittedAssignmentText,null,Ext.MessageBox.INFO)}}this.updateForNewItemInfo();if(this.assignmentForm!=null){var D=document.getElementById(" wipFileDeleteFlag_ "+this.playerId);if(D!=null){D.value=" "}D=document.getElementById(" wipFileDelete_ "+this.playerId);if(D!=null){D.style.visibility=" visible "}var J=Ext.getCmp(" attachedUrl_ "+this.playerId);if(J!=null){if(this.itemInfo.wipUrl){J.setValue(this.itemInfo.wipUrl)}else{if(this.itemInfo.submittedUrl){J.setValue(this.itemInfo.submittedUrl)}else{J.setValue(" ")}}}var K=Ext.getCmp(" notes_ "+this.playerId);var N=Ext.getCmp(" lastpackage_ "+this.playerId);if(this.itemInfo.wipNotes){K.setValue(this.itemInfo.wipNotes);N.setValue(" wip ")}else{if(this.itemInfo.submittedNotes){K.setValue(this.itemInfo.submittedNotes);N.setValue(" submit ")}else{K.setValue(" ");N.setValue(" ")}}if(this.itemInfo.submitEnabled){this.dropboxOpenSubmitButton.enable();this.dropboxOpenSaveProgressButton.enable();this.ensureVisible(document.getElementById(" changeWipFile_ "+this.playerId))}else{this.dropboxOpenSubmitButton.disable();this.dropboxOpenSaveProgressButton.disable();this.ensureHidden(document.getElementById(" changeWipFile_ "+this.playerId))}if(!O.saveProgress){this.closeWindows()}var H=Ext.get(" fileInput_ "+this.playerId);if(H!=null){if(this.itemInfo.dropboxType==DropboxType.MultipleDocuments){H.update(" ");if(this.itemInfo.wipFiles||this.itemInfo.submittedFiles){var C=[];if(this.itemInfo.wipFiles){C=this.itemInfo.wipFiles}else{if(this.itemInfo.submittedFiles){C=this.itemInfo.submittedFiles}}var I=Ext.get(" wipFileInfo_ "+this.playerId);I.update(this.loadDropboxAttachments(C));this.ensureVisible(I.dom)}else{this.ensureHidden(document.getElementById(" wipFileInfo_ "+this.playerId))}var F=Ext.get(" addFileInput_ "+this.playerId).dom;if(this.itemInfo.submitEnabled){H.update('<input type=" file " name=" attachment " style=" width: 300 px; " onkeyup=" return false; " onkeydown=" return false; " onkeypress=" return false; "/>');this.ensureVisible(F)}else{this.ensureHidden(F)}this.addMultipleAttachmentListeners()}else{if(this.itemInfo.wipFiles||this.itemInfo.submittedFiles){H.update(" ");var E=Ext.get(" wipFileName_ "+this.playerId);E.setOpacity(1,false);var D=document.getElementById(" changeAssignmentDocument_ "+this.playerId);if(D){D.checked=false}if(this.itemInfo.wipFiles){document.getElementById(" wipFileName_ "+this.playerId).innerHTML=this.itemInfo.wipFiles[0].display}else{document.getElementById(" wipFileName_ "+this.playerId).innerHTML=this.itemInfo.submittedFiles[0].display}if(this.itemInfo.submitEnabled){this.ensureVisible(document.getElementById(" wipFileDelete_ "+this.playerId))}else{this.ensureHidden(document.getElementById(" wipFileDelete_ "+this.playerId))}this.ensureVisible(document.getElementById(" wipFileInfo_ "+this.playerId))}else{if(this.itemInfo.submitEnabled){var H=Ext.get(" fileInput_ "+this.playerId);H.update('<input type=" file " id=" attachfile_ '+this.playerId+' " name=" attachment " style=" width: 300 px; " onkeyup=" return false; " onkeydown=" return false; " onkeypress=" return false; "/>');this.ensureHidden(document.getElementById(" wipFileInfo_ "+this.playerId))}else{var H=Ext.get(" fileInput_ "+this.playerId);H.update(" ");this.ensureHidden(document.getElementById(" wipFileInfo_ "+this.playerId))}}}}}}})},failureUpdate:function(B,A){this.messageBoxHide();var C=B.responseText;FRAME_API.fireEvent(" jswindowopening ");if(A.saveProgress){Ext.MessageBox.alert(this.failedSavingAssignmentString,String.format(this.errorWithMessageString,C),function(){FRAME_API.fireEvent(" jswindowclosed ")})}else{Ext.MessageBox.alert(this.failedSubmittingAssignmentString,String.format(this.errorWithMessageString,C),function(){FRAME_API.fireEvent(" jswindowclosed ")})}},openWipAssignment:function(A){var B=this.appRoot+" / Content / Assignment.ashx ? "+Ext.urlEncode({enrollmentid:this.enrollmentId,itemid:this.itemId,actiontype:" wip ",filename:A,timestamp:(new Date()).format(" Y : m : d : H : i : s : u ")});this.downloadFile(B)},openSubmittedAssignment:function(A){var B=this.appRoot+" / Content / Assignment.ashx ? "+Ext.urlEncode({enrollmentid:this.enrollmentId,itemid:this.itemId,actiontype:" submitted ",filename:A,timestamp:(new Date()).format(" Y : m : d : H : i : s : u ")});this.downloadFile(B)},openAssignmentTemplate:function(){if(!this.itemInfo.templateName){return }var A=this.appRoot+" / Content / Assignment.ashx ? "+Ext.urlEncode({enrollmentid:this.enrollmentId,itemid:this.itemId,actiontype:" template ",timestamp:(new Date()).format(" Y : m : d : H : i : s : u ")});this.downloadFile(A)},openWipOrSubmittedAssignment:function(A){if(this.itemInfo.wipFiles){this.openWipAssignment(A)}else{if(this.itemInfo.submittedFiles){this.openSubmittedAssignment(A)}}},openAssignment:function(){if(!this.itemInfo){return }if(this.dropboxSubmitTooltip){this.dropboxSubmitTooltip.destroy()}if(this.itemInfo.templateName){var E=this.appRoot+" / Content / Assignment.ashx ? "+Ext.urlEncode({enrollmentid:this.enrollmentId,itemid:this.itemId,actiontype:" latest ",timestamp:(new Date()).format(" Y : m : d : H : i : s : u ")});this.downloadFile(E)}else{if(this.itemInfo.externalLink){window.open(this.itemInfo.externalLink)}else{var I=this.getLabelWidth(this.assignmentCommentsLabel);var G=0;switch(this.itemInfo.dropboxType){case DropboxType.Url:I=Math.max(I,this.getLabelWidth(this.assignmentURLLabel));G+=24;break;case DropboxType.SingleDocument:I=Math.max(I,this.getLabelWidth(this.assignmentAttachmentLabel));G+=24;break;case DropboxType.MultipleDocuments:I=Math.max(I,this.getLabelWidth(this.assignmentAttachmentLabel));G+=100;break;default:break}I+=10;var J=Ext.get(document.body).getSize();var A=Math.min(J.height/1.25,this.idealAssignmentHeight+G);var D=Math.min(J.width/1.25,this.idealAssignmentWidth+I);if(this.assignmentForm==null){this.dropboxOpenSaveProgressButton=new Ext.Button({id:" dropboxOpenSaveProgress_ "+this.playerId,text:this.saveButtonString,minWidth:75,tooltip:this.saveProgressString+" < br / > < b > "+this.saveNotSubmitString+" < /b>",handler:this.saveProgress,scope:this});this.dropboxOpenSubmitButton=new Ext.Button({id:"dropboxOpenSubmit_"+this.playerId,minWidth:75,text:this.submitButtonString,handler:this.submitAssignment,scope:this});this.assignmentForm=new Ext.form.FormPanel({header:false,autoScroll:true,labelWidth:I,fileUpload:true,url:this.appRoot+"/Content / Assignment.ashx ",items:[{xtype:" panel ",id:" assignmentTitle_ "+this.playerId,style:" margin - bottom : 8 px ",cls:" gradeHeaderText color_medium title_font "},{xtype:" tinymce ",id:" notes_ "+this.playerId,name:" notes ",fieldLabel:this.assignmentCommentsLabel,width:575,height:220,autoScroll:false,tinymceSettings:Ext.apply(tinymce_basic_with_images,{document_base_url:this.documentRoot,file_browser_callback:this.uploadImage.createDelegate(this),course_link_base_params:{courseId:this.courseId,enrollmentId:this.enrollmentId,forcePopup:true}})},{xtype:" panel ",border:false,bodyStyle:" clear : left; ",html:" < div id = 'progressSavedIndicator_"+this.playerId+"' class = 'small_font' style = 'padding-left:"+(I+5)+"px;' > "+this.getProgressSavedDateText()+" < /div>"},{xtype:"hidden",name:"enrollmentid",value:this.enrollmentId},{xtype:"hidden",name:"itemid",value:this.itemId},{xtype:"hidden",id:"lastpackage_"+this.playerId,name:"lastpackage",value:""},{xtype:"hidden",name:"actiontype",id:"actiontype_"+this.playerId,value:"submit"}],cls:"color_light assignment_area",buttonAlign:"right",buttons:[{xtype:"tbfill"},this.dropboxOpenSaveProgressButton,this.dropboxOpenSubmitButton,{text:this.closeString,handler:this.closeWindows,scope:this}],listeners:{scope:this,afterrender:{fn:function(){var L=this.assignmentForm.el.child("a[id=wipFileName_"+this.playerId+"]");if(L!=null){L.on("click",this.openWipOrSubmittedAssignment,this)}L=this.assignmentForm.el.child("a[id=wipFileDelete_"+this.playerId+"]");if(L!=null){L.on("click",this.deleteWipFile.createDelegate(this,[""]),this)}L=this.assignmentForm.el.child("input[id=changeAssignmentDocument_"+this.playerId+"]");if(L!=null){L.on("click",this.toggleChangeAssignmentDocument,this)}this.addMultipleAttachmentListeners();if(this.itemInfo.dropboxType==DropboxType.MultipleDocuments&&this.itemInfo.submitEnabled){L=this.assignmentWindow.el.child(".add-dropbox-attachment");if(L){L.on("click",function(){var M=Ext.get("fileInput_"+this.playerId);html='<input type="file" name="attachment" style="width:300px;" onkeyup="return false;" onkeydown="return false;" onkeypress="return false;"/ > ';M.insertHtml("beforeEnd",html)},this)}}},delay:500}}});switch(this.itemInfo.dropboxType){case DropboxType.Url:this.assignmentForm.insert(1,{xtype:"textfield",fieldLabel:this.assignmentURLLabel,id:"attachedUrl_"+this.playerId,name:"attachedUrl",width:575,value:this.itemInfo.wipUrl?this.itemInfo.wipUrl:this.itemInfo.submittedUrl});this.assignmentForm.insert(2,{xtype:"label",style:"font-style:italic;margin-left:"+(I+5)+"px;",text:this.exampleURL});break;case DropboxType.SingleDocument:var F="";if(this.itemInfo.wipFiles){F=this.itemInfo.wipFiles[0].display}else{if(this.itemInfo.submittedFiles){F=this.itemInfo.submittedFiles[0].display}}var C="<div id=' wipFileInfo_ "+this.playerId+" '"+(F?"style=' margin - bottom : 6 px; '":"style=' display : none; white - space : nowrap; float : left; '")+"><a href=' javascript : void(0); ' id=' wipFileName_ "+this.playerId+" '>"+F+"</a>";C+="<a href=' javascript : void(0); ' id=' wipFileDelete_ "+this.playerId+" '"+((this.itemInfo.submitEnabled&&F)?"":" style=' display : none; '")+"><img class=' delete_saved_file_img ' src=' "+Ext.BLANK_IMAGE_URL+" ' alt=' "+this._Delete+" '/></a>";C+="<span id=' changeWipFile_ "+this.playerId+" '"+(this.itemInfo.submitEnabled?"":"style=' display : none; '")+"> <input id=' changeAssignmentDocument_ "+this.playerId+" ' name=' changeAssignmentDocument ' type=' checkbox ' /> <label for=' changeAssignmentDocument_ "+this.playerId+" '>"+this.changeFileString+"</label> </span></span><input type=' hidden ' name=' wipFileDeleteFlag ' id=' wipFileDeleteFlag_ "+this.playerId+" ' value=' ' />";C+="</div>";this.assignmentForm.insert(1,{xtype:"panel",layout:"table",border:false,autoHeight:true,style:"margin-bottom:8px",items:[{html:"<div style=' padding : 3 px; '>"+this.assignmentAttachmentLabel+":</div>",width:I+5,cls:"x-form-item-label"},{html:C+' < div id = "fileInput_'+this.playerId+'" style : "float:left;" > '+((!F&&this.itemInfo.submitEnabled)?' < input type = "file" name = "attachment" style = "width:300px;" onkeyup = "return false;" onkeydown = "return false;" onkeypress = "return false;" / > ':"")+"</div>"}]});break;case DropboxType.MultipleDocuments:var B=[];if(this.itemInfo.wipFiles){B=this.itemInfo.wipFiles}else{if(this.itemInfo.submittedFiles){B=this.itemInfo.submittedFiles}}var C=[];C.push("<div id=' wipFileInfo_ ",this.playerId," ' ",((B&&B.length)?"style=' margin - bottom : 6 px; '":"style=' display : none; white - space : nowrap; float : left; '"),">");C.push(this.loadDropboxAttachments(B));C.push("</div>");C.push(' < div id = "fileInput_',this.playerId,'" style : "float:left;" > ',(this.itemInfo.submitEnabled?' < input type = "file" name = "attachment" style = "width:300px;" onkeyup = "return false;" onkeydown = "return false;" onkeypress = "return false;" / > ':""),"</div>");C.push(' < div id = "addFileInput_',this.playerId,'" style = "margin-top:6px;',(this.itemInfo.submitEnabled?" ":" display : none; "),'" > < a href = "javascript:void(0)" class = "add-dropbox-attachment" > < img alt = "" height = "10" width = "10" style = "margin-right:4px;" src = "',this.appRoot,'/Images/add2.png" / > ',this._AddAttachment,"</a></div>");C.push("<input type=' hidden ' name=' wipFileDeleteFlag ' id=' wipFileDeleteFlag_ ",this.playerId," ' value=' ' />");this.assignmentForm.insert(1,{xtype:"panel",layout:"table",border:false,autoHeight:true,style:"margin-bottom:8px",items:[{html:"<div style=' padding : 3 px; '>"+this.assignmentAttachmentsLabel+":</div>",width:I+5,cls:"x-form-item-label"},{html:C.join("")}]});break;default:break}var H=Ext.getCmp("notes_"+this.playerId);var K=Ext.getCmp("lastpackage_"+this.playerId);if(this.itemInfo.wipNotes){H.setValue(this.itemInfo.wipNotes);K.setValue("wip")}else{if(this.itemInfo.submittedNotes){H.setValue(this.itemInfo.submittedNotes);K.setValue("submit")}else{H.setValue("");K.setValue("")}}}if(this.assignmentWindow==null){this.assignmentWindow=new Ext.Window({constrainHeader:true,height:A,width:D,layout:"fit",plain:true,items:[this.assignmentForm],shim:true,modal:true,frame:true,closable:true,closeAction:"hide",listeners:{hide:function(){FRAME_API.fireEvent("jswindowclosed")},scope:this}})}else{if(!this.assignmentWindow.items||this.assignmentWindow.items.length==0){this.assignmentWindow.add(this.assignmentForm)}}FRAME_API.fireEvent("jswindowopening");this.assignmentWindow.show();this.assignmentWindow.setSize(D,A);if(this.itemInfo.submitEnabled){this.dropboxOpenSubmitButton.enable();this.dropboxOpenSaveProgressButton.enable()}else{this.dropboxOpenSubmitButton.disable();if(this.itemInfo.submitDisabledReason){this.dropboxSubmitTooltip=new Ext.ToolTip({target:"dropboxOpenSubmit_"+this.playerId,title:this.itemInfo.submitDisabledReason,plain:true})}this.dropboxOpenSaveProgressButton.disable()}this.layoutHtmlEditor.defer(0,this)}}},addMultipleAttachmentListeners:function(){var A=this.assignmentForm.el.select("a[class~=dropbox-file-name]");if(A){A.each(function(C){var B=C.dom.attributes["data-file"].value;C.on("click",this.openWipOrSubmittedAssignment.createDelegate(this,[B]),this)},this)}A=this.assignmentForm.el.select("a[class~=dropbox-file-delete]");if(A){A.each(function(C){var B=C.dom.attributes["data-file"].value;C.on("click",this.deleteWipFile.createDelegate(this,[B]),this)},this)}},loadDropboxAttachments:function(B){var C=[];for(var A=0;A<B.length;A++){if(A>0){C.push(" | ")}if(this.itemInfo.submitEnabled){C.push("<a href=' javascript : void(0); ' class=' dropbox - file - delete ' data-file=' ",B[A].name," '>","<img alt=' ",this._Delete," height = '10' width = '10' style = 'margin-right:4px;' src = '",this.appRoot,"/Images/delete2.png' / > < /a>")}C.push("<a href='javascript:void(0);' class='dropbox-file-name' data-file='",B[A].name,"'>",B[A].display,"</a > ")}return C.join(" ")},showMainContent:function(){this.mainCourseContentPanel.show();this.mainContentLayout.doLayout();this.resizeContentFrame();if(Ext.isIE){this.viewport.doLayout()}},hideMainContent:function(){this.mainCourseContentPanel.hide()},proxyCallback:function(A){if(A){this.hideMainContent()}else{this.showMainContent()}},uploadImage:function(D,A,B,C){if(B===" image "){tinyMCE.activeEditor.windowManager.open({file:this.appRoot+" / Editor / UploadImage.aspx ? url = "+encodeURIComponent(A),title:this.uploadFileMessage,name:this.uploadFileMessage,width:275,height:95,resizable:" yes ",popup_css:false,inline:" yes ",close_previous:" no "},{window:C,input:D});return false}},layoutHtmlEditor:function(){if(this.assignmentForm!=null){var A=this.assignmentForm.findById(" assignmentTitle_ "+this.playerId).getEl();var C=String.format(this.assignmentSubmitPanelHeader,this.itemInfo.title);Ext.QuickTips.unregister(A);Ext.QuickTips.register({target:A,text:C});A.update(C);this.assignmentForm.footer.addClass(" color_medium default_border dashboard_list_btns ");this.assignmentForm.doLayout();var B=Ext.getCmp(" notes_ "+this.playerId);if(B!=null){B.setSize(574,221);B.setSize(575,222)}}},deleteWipFile:function(D){var B=" ";if(this.itemInfo.wipFiles){D=D||this.itemInfo.wipFiles[0].name;for(var C=0;C<this.itemInfo.wipFiles.length;C++){if(D==this.itemInfo.wipFiles[C].name){B=this.itemInfo.wipFiles[C].display;break}}}else{if(this.itemInfo.submittedFiles){D=D||this.itemInfo.submittedFiles[0].name;for(var C=0;C<this.itemInfo.submittedFiles.length;C++){if(D==this.itemInfo.submittedFiles[C].name){B=this.itemInfo.submittedFiles[C].display;break}}}}if(!B){B=D}var A=String.format(this.deletePermanentlyConfirmString," < a id = 'deleteWip_"+this.playerId+"' href = 'javascript:void(0);' > "+B+" < /a>");Ext.MessageBox.getDialog().on("show",this.onShowDeleteWipDialog.createDelegate(this,[D],true),this);FRAME_API.fireEvent("jswindowopening");Ext.MessageBox.confirm(this.itemInfo.title,A,function(E){FRAME_API.fireEvent("jswindowclosed");if(E=="yes"){var F=Ext.getCmp("notes_"+this.playerId);F.syncValue();document.getElementById("actiontype_"+this.playerId).value="saveprogress";var G=document.getElementById("wipFileDeleteFlag_"+this.playerId);if(G!=null){G.value=D}messageBoxShouldBeClosed=false;this.showUploadingMessageBox(String.format(this.deletingAndSavingString,D),this.savingDotDotDotString);Ext.Ajax.request({url:this.appRoot+"/Content / Assignment.ashx ",success:this.successUpdate,failure:this.failureUpdate,scope:this,form:this.assignmentForm.getForm().getEl().dom,saveProgress:true,method:" POST ",successDisplayString:String.format(this.deleteAndSaveSuccessString,B),isUpload:true})}},this)},onShowDeleteWipDialog:function(A,B){A.un(" show ",this.onShowDeleteWipDialog,this);(function(){var C=A.el.child(" a[id = deleteWip_ "+this.playerId+"] ");if(C){C.on(" click ",this.openWipOrSubmittedAssignment.createDelegate(this,[B]),this)}}).defer(500,this)},toggleChangeAssignmentDocument:function(){var C=Ext.get(" fileInput_ "+this.playerId);if(C!=null){var D=Ext.get(" wipFileName_ "+this.playerId);var A=Ext.get(" wipFileDelete_ "+this.playerId);var B=document.getElementById(" changeAssignmentDocument_ "+this.playerId);if(B.checked){D.animate({opacity:{to:0.3}},0.35,function(){C.update('<input type=" file " name=" attachment " style=" width : 300 px; " onkeyup=" return false; " onkeydown=" return false; " onkeypress=" return false; "/>');A.dom.style.visibility=" hidden "}," easeIn ")}else{D.animate({opacity:{to:1}},0.35,function(){C.update(" ");A.dom.style.visibility=" visible "}," easeIn ")}}},getProgressSavedDateText:function(){if(!this.itemInfo.wipDate){if(this.itemInfo.submittedDate){return String.format(this.submittedDateString,this.itemInfo.submittedDate)}else{if(!this.itemInfo.submitEnabled){return" "}}return this.noProgressString}return String.format(this.progressSavedString,this.itemInfo.wipDate)},getLabelWidth:function(A){var B=Ext.util.TextMetrics.measure(" footerLabelSizer_ "+this.playerId,A);return(Math.max(B.width,10)+10)},downloadFile:function(A){if(this.downloadIframe==null){this.downloadIframe=document.createElement(" iframe ");this.downloadIframe.style.display=" none ";document.body.appendChild(this.downloadIframe)}this.downloadIframe.src=A;return false},validateSiteAddress:function(B,C){var A=B.toLowerCase();if(C&&Ext.isEmpty(B)){return true}if(Ext.isEmpty(B)||(A.indexOf(" http :
//")!=0&&A.indexOf("https://")!=0&&A.indexOf("gateway://")!=0)){Ext.Msg.alert(this._InvalidAddressCaption,this._InvalidAddress);return false}else{if(A=="http://"||A=="https://"||A=="gateway://"){Ext.Msg.alert(this._InvalidAddressCaption,this._MissingAddress);return false}}return true},saveProgress:function(){if(!this.itemInfo){return }if(this.itemInfo.templateName){this.saveTemplatedAssignmentProgress()}else{var C=Ext.getCmp("notes_"+this.playerId);C.syncValue();var D=Ext.getCmp("attachedUrl_"+this.playerId);if(D!=null){if(!this.validateSiteAddress(D.getValue(),true)){return }}var A=Ext.get("fileInput_"+this.playerId);if(A!=null){var B=A.child("input[@type=file]",true);if(!Ext.isEmpty(B)&&!Ext.isEmpty(B.value)&&this.isProhib(B.value)){return }}document.getElementById("actiontype_"+this.playerId).value="saveprogress";this.messageBoxShouldBeClosed=false;this.showUploadingMessageBox(this.savingYourProgressString,this.savingDotDotDotString);Ext.Ajax.request({url:this.appRoot+"/Content/Assignment.ashx",success:this.successUpdate,failure:this.failureUpdate,scope:this,form:this.assignmentForm.getForm().getEl().dom,saveProgress:true,method:"POST",isUpload:true})}},saveTemplatedAssignmentProgress:function(){var D=String.format(this.saveAssignmentText,this.itemInfo.templateName);var A=D+'<br/><br/><form id="saveProgressForm_'+this.playerId+'" action="'+this.appRoot+'/Content/Assignment.ashx" enctype="multipart/form-data"><div style="display:none;"><input type="hidden" id="actiontype_'+this.playerId+'" name="actiontype" value="saveprogress" /><input type="hidden" name="enrollmentid" value="'+this.enrollmentId+'" /><input type="hidden" id="itemid_'+this.playerId+'" name="itemid" value="'+this.itemId+'" /></div><input name="fileUpload" id="fileUpload_'+this.playerId+'" type="file" style="width:350px;" onkeyup="return false;" onkeydown="return false;" onkeypress="return false;"/><br/></form>';try{Ext.MessageBox.updateText("")}catch(C){}var B=Math.min(600,this.getLabelWidth(D));FRAME_API.fireEvent("jswindowopening");Ext.MessageBox.show({title:this.saveAssignmentTitle,msg:A,buttons:Ext.MessageBox.OKCANCEL,fn:this.saveTemplatedAssignmentProgressButtonClick,scope:this,icon:Ext.MessageBox.QUESTION,minWidth:B});Ext.MessageBox.getDialog().on("beforehide",this.returnFalse,this)},messageBoxAlertWithMinWidth:function(D,C,B,A){A=A||Ext.MessageBox.ERROR;B=B||Math.min(450,this.getLabelWidth(C));FRAME_API.fireEvent("jswindowopening");Ext.MessageBox.show({title:D,msg:C,buttons:Ext.MessageBox.OK,minWidth:B,icon:A,fn:function(){FRAME_API.fireEvent("jswindowclosed")}})},saveTemplatedAssignmentProgressButtonClick:function(C){FRAME_API.fireEvent("jswindowclosed");Ext.MessageBox.getDialog().un("beforehide",this.returnFalse,this);if(C=="ok"){var D=document.getElementById("fileUpload_"+this.playerId).value;if(!D){FRAME_API.fireEvent("jswindowopening");Ext.MessageBox.alert(this.errorTitle,this.saveBlankAssignmentTypeText,function(){FRAME_API.fireEvent("jswindowclosed")});return }D=D.replace(/.*\//,"");D=D.replace(/.*\\/,"");if(this.isProhib(D)){return }var B=this.getFileExtension(this.itemInfo.templateName);var A=this.getFileExtension(D);if(A!=B){this.messageBoxAlertWithMinWidth(this.errorTitle,String.format(this.submitWrongAssignmentTypeText,B,A));return }Ext.Ajax.request({url:this.appRoot+"/Content/Assignment.ashx",success:this.successUpdate,failure:this.failureUpdate,scope:this,form:"saveProgressForm_"+this.playerId,method:"POST",saveProgress:true,isUpload:true});this.messageBoxShouldBeClosed=false;this.showUploadingMessageBox(this.savingYourProgressString,this.savingDotDotDotString)}else{this.messageBoxHide()}},successSaveProgress:function(B,A){FRAME_API.fireEvent("jswindowopening");Ext.MessageBox.alert(this.uploadingFileCompleteTitle,"<br/>"+this.uploadingFileCompleteMessage+"<br/>",function(){FRAME_API.fireEvent("jswindowclosed")})},failureSaveProgress:function(B,A){if(B.responseXML&&B.responseXML.lastChild&&B.responseXML.lastChild.firstChild){errorCode=this.getTextFromXMLNode(B.responseXML.lastChild.firstChild)}else{errorCode=this.serverErrorString}FRAME_API.fireEvent("jswindowopening");Ext.MessageBox.alert(this.failedUploadingAssignmentString,String.format(this.errorWithMessageString,errorCode),function(){FRAME_API.fireEvent("jswindowclosed")})},returnFalse:function(){return false},showUploadingMessageBox:function(B,A){if(!this.messageBoxShouldBeClosed){FRAME_API.fireEvent("jswindowopening");Ext.MessageBox.show({msg:B?B:this.uploadingFileProgressMessage,progressText:A?A:this.savingDotDotDotString,width:300,wait:true,waitConfig:{interval:200},proxyDrag:true});var C=Ext.MessageBox.getDialog();C.on("move",this.testAndCloseDialog,this);C.on("hide",this.messageBoxHidden,this)}},getTextFromXMLNode:function(A){if(Ext.isIE){return A.text}return A.textContent},findShowEditWindow:function(A){if(A.showEditWindow!=null){return A.showEditWindow}if(A.parent!=A){return this.findShowEditWindow(A.parent)}return null},editActivity:function(){if(this.shortcutId&&frames["contentBody_"+this.playerId].location!="about:blank"){var B=this._Edit;if(this.itemInfo!=null){B+=" - "+this.itemInfo.typeDisplay+" - "+this.itemInfo.title}this.closeWindows(false);if(typeof (FRAME_API)!="undefined"){FRAME_API.editItem(this.enrollmentId,this.shortcutId,B)}else{var A=this.findShowEditWindow(window);if(A){A(this.courseId,this.shortcutId,B,this.playerAssemblyApi)}}}},navToItem:function(D,C,A){if(C){var B=this.pageRoot+"?enrollmentid="+this.enrollmentId+"&itemid="+encodeURIComponent(D);if(A){B+="&extra="+encodeURIComponent(A)}this.recordItemTimeSpent();window.location=B}else{var B=this.appRoot+"/Learn/GetNavItem.ashx?enrollmentid="+this.enrollmentId+"&cmd=absolute&itemid="+encodeURIComponent(D);if(A){B+="&extra="+encodeURIComponent(A)}this.sendNavigationRequest(B)}},navPrev:function(){if(this.shortcutId!=null){var A=this.appRoot+"/Learn/GetNavItem.ashx?enrollmentid="+this.enrollmentId+"&cmd=prev&itemid="+encodeURIComponent(this.shortcutId);this.sendNavigationRequest(A)}},navNext:function(){if(this.shortcutId!=null){var A=this.appRoot+"/Learn/GetNavItem.ashx?enrollmentid="+this.enrollmentId+"&cmd=next&itemid="+encodeURIComponent(this.shortcutId);this.sendNavigationRequest(A)}},navToExternal:function(C){var B="_blank";if(C.toLowerCase().indexOf("x-target://")==0){B="_top";var E=C.toLowerCase().substr(11);if(E.indexOf("_blank")==0||E.indexOf("_external")==0){B="_blank"}else{if(E.indexOf("_self")==0){B="_self"}}var D=C.toLowerCase().indexOf("?url=");if(D>=0){C=C.substr(D+5);var A=C.indexOf("&");if(A>=0){C=C.substr(0,A)}A=C.indexOf("#");if(A>=0){C=C.substr(0,A)}C=unescape(C)}}else{if(C.indexOf(this.appRoot)==0){B="_top"}}window.open(C,B)},navExit:function(){this.recordItemTimeSpent()},getSectionSummary:function(A){if(Ext.isObject(A)&&A.callback){Ext.Ajax.request({url:this.appRoot+"/Learn/ScormData.ashx",params:{action:"getsectionsummary",enrollmentid:this.enrollmentId,itemid:this.lastLogicalId,allstatus:A.allStatus?"1":"0"},callback:this.getSectionSummaryCallback,scope:this,agxOptions:A})}},enterItem:function(C,A){this.Log("enterItem:"+C);this.itemId=C;this.skipSelectionChange=false;this.shortcutId=A||C;this.lastLogicalId=C;this.newAttempt="1";this.itemStart=new Date();var B=encodeURIComponent(this.shortcutId);if(typeof (FRAME_API)!="undefined"){FRAME_API.setComponentState(this.componentType,this.playerId,{itemId:B})}if(this.courseTree){this.navigateTreeToItem(A)}else{this.needsTreeInitialization=true}this.closeWindows();this.messageBoxHide()},leaveItem:function(){this.Log("leaveItem");this.recordItemTimeSpent();this.itemId=null;this.shortcutId=null;this.itemInfo=null;try{this.ResetData.defer(1,this,[true]);this.resetDropbox()}catch(A){}},setItemInfoJson:function(json){this.Log("setItemInfoJson");this.itemInfo=eval("("+json+")");if(!this.playerInitialized){this.needsItemInitialization=true;return }this.recordBookmark();this.updateForNewItemInfo()},updateForNewItemInfo:function(){this.Log("updateForNewItemInfo");var V=true;if(this.itemInfo!=null){if(!this.itemInfo.sco){var c=this.itemInfo.maxMinutes;var b=c*60*1000;this.recordItemTimeSpent.defer(b,this)}var I=this.componentType=="courseplayer";var P=Ext.getCmp("content_status_"+this.playerId);if(P){if(this.itemInfo.flagEdits&&this.itemInfo.available){P.setText(this._ModifiedFromOriginal);I=true}else{P.setText("")}}var U=Ext.getCmp("comments_"+this.playerId);if(U){if(!Ext.isEmpty(this.itemInfo.comments)&&this.itemInfo.available){I=true;U.show()}else{U.hide()}}if(this.ratingsPanel){if(this.itemInfo.available){this.updateRatings();this.ratingsPanel.show()}else{this.ratingsPanel.hide.defer(10,this.ratingsPanel)}}var H=this.mainContentLayout.getTopToolbar();if(H){var M=(H.items.getCount()<=3)&&!I;if(M){H.hide()}else{H.show()}}if(this.itemInfo.showDropbox&&this.showAdornments&&this.itemInfo.available&&!this.itemInfo.isExam&&!this.itemInfo.isHomework){V=false;var R=Ext.get("dropboxScore_"+this.playerId);var D=Ext.get("dropboxScoreBox_"+this.playerId);if(this.itemInfo.grade!=null){R.update(this.itemInfo.grade,true);if(Ext.isIE){D.setStyle("width","auto")}}else{R.update("");if(Ext.isIE){D.setStyle("width","46px")}}if(this.itemInfo.dropboxStatus){document.getElementById("dropboxStatus_"+this.playerId).innerHTML=this.itemInfo.dropboxStatus}else{document.getElementById("dropboxStatus_"+this.playerId).innerHTML=""}var O=document.getElementById("dropboxScoreBox_"+this.playerId);var F=document.getElementById("dropboxDetails_"+this.playerId);var E=document.getElementById("dropboxOpen_"+this.playerId);var C=document.getElementById("dropboxOpenSplit_"+this.playerId);var A=document.getElementById("dropboxSubmit_"+this.playerId);var B=document.getElementById("dropboxSaveProgress_"+this.playerId);var d=document.getElementById("dropboxRubric_"+this.playerId);var J=document.getElementById("dropboxCompleted_"+this.playerId);var T=document.getElementById("dropboxSurvey_"+this.playerId);if(this.itemInfo.canSubmit&&!this.itemInfo.isDropboxDisabled){this.showOpenButton();this.ensureVisible(A);this.ensureVisible(B)}else{this.ensureHidden(E);this.ensureHidden(C);this.ensureHidden(A);this.ensureHidden(B)}if(this.itemInfo.gradable){this.ensureVisible(O);this.ensureVisible(F);this.ensureHidden(J)}else{if(this.itemInfo.isExam&&this.itemInfo.detailsEnabled){this.ensureVisible(O);this.ensureVisible(F)}else{this.ensureHidden(O);this.ensureHidden(F)}if(this.itemInfo.submitEnabled){this.dropboxCompletedButton.enable()}else{this.dropboxCompletedButton.disable()}if(this.itemInfo.completionTrigger==CompletionTrigger.Minutes||this.itemInfo.completionTrigger==CompletionTrigger.PassingScore||this.itemInfo.isExam||this.itemInfo.isHomework){this.ensureHidden(J)}else{this.ensureVisible(J)}}if(this.itemInfo.hasRubric){this.ensureVisible(d)}else{this.ensureHidden(d)}if(this.dropboxSubmitTooltip){this.dropboxSubmitTooltip.destroy()}var L=document.getElementById("dropboxSubmit_"+this.playerId);var Z=document.getElementById("dropboxSaveProgress_"+this.playerId);if(this.itemInfo.submitEnabled&&(this.itemInfo.templateName||this.itemInfo.externalLink)){this.ensureVisible(Z);this.ensureVisible(L);this.dropboxSubmitButton.enable();if(this.itemInfo.externalLink){this.dropboxSaveProgressButton.disable()}else{this.dropboxSaveProgressButton.enable()}}else{this.ensureHidden(Z);this.ensureHidden(L)}if(this.itemInfo.detailsEnabled){this.dropboxDetailsButton.enable()}else{this.dropboxDetailsButton.disable()}var N=document.getElementById("progressSavedIndicator_"+this.playerId);if(N){N.innerHTML=this.getProgressSavedDateText()}this.show(T,this.itemInfo.isSurvey);if(this.itemInfo.isSurvey){this.dropboxSurveyButton.setDisabled(this.itemInfo.surveyUrl==null)}var Y=document.getElementById("dropboxPeerReview_"+this.playerId);if(this.itemInfo.allowPeerReview){this.ensureVisible(Y);this.dropboxPeerReviewButton.setDisabled(!this.itemInfo.peerReviewEnabled)}else{this.ensureHidden(Y)}}}var K=document.getElementById("dropboxStatusAndButtons_"+this.playerId);if(this.showAdornments){if(V){if(this.ensureHidden(K)){this.viewport.syncSize()}}else{if(this.ensureVisible(K)){this.viewport.syncSize()}}}if(this.itemInfo==null||this.itemInfo.attachments.length==0){if(this.attachmentPanel){this.attachmentPanel.hide()}this.mainContentLayout.doLayout();this.resizeContentFrame()}else{if(this.showAdornments){var G='<span class="attachment-el bold_font">'+this.attachmentsLabel+":</span>";for(var X=0;X<this.itemInfo.attachments.length;X++){var W=this.appRoot+this.itemInfo.attachments[X][0];var Q=this.itemInfo.attachments[X][1];var S="";if(X>0){S="|"}G+=String.format('<span class="attachment-el">{3}</span><span class="attachment-el"><a href="{1}" class="attachment-link" downloadFile="{1}">{2}</a></span>',X,Ext.util.Format.htmlEncode(W),Q,S)}var a=this.attachmentPanel.body;if(a!=null&&this.attachmentPanel!=null){a.update(G);this.attachmentPanel.show()}}this.mainContentLayout.doLayout();this.resizeContentFrame();if(Ext.isWebKit){this.viewport.doLayout()}}},showOpenButton:function(){var B=document.getElementById("dropboxOpen_"+this.playerId);var A=document.getElementById("dropboxOpenSplit_"+this.playerId);if(this.itemInfo.templateName){if(this.itemInfo.wipFiles||this.itemInfo.submittedFiles){this.ensureVisible(A);this.ensureHidden(B);if(this.itemInfo.submittedFiles&&this.itemInfo.wipFiles){this.dropboxOpenSplitButton.menu.items.itemAt(0).show();this.dropboxOpenSplitButton.menu.items.itemAt(1).show()}else{if(this.itemInfo.submittedFiles){this.dropboxOpenSplitButton.menu.items.itemAt(0).hide();this.dropboxOpenSplitButton.menu.items.itemAt(1).show()}else{this.dropboxOpenSplitButton.menu.items.itemAt(0).show();this.dropboxOpenSplitButton.menu.items.itemAt(1).hide()}}}else{this.ensureHidden(A);this.ensureVisible(B)}}else{this.ensureHidden(A);this.ensureVisible(B)}},recordItemTimeSpent:function(D){if(this.itemId!=null&&this.itemStart!=null&&this.itemInfo!=null&&this.itemInfo.available&&!this.readOnly){var H=new Date();var K=Math.max(0,H.getTime()-this.itemStart.getTime());if(this.itemInfo.sco){if(!this.itemInfo.scoTimeRecorded){if(K>(31*60*1000)){K=15*60*1000}var C=this.dataModel.get("cmi.session_time");if(C!=null){if(!Ext.isEmpty(C.Value)){var F=this.StringToTimeSpan(C.Value);var J=this.dataModel.get("cmi.total_time");if(J!=null){var B=this.StringToTimeSpan(J.Value);B+=F;J.Value=this.TimeSpantoString(B)}K=Math.floor(F*10)}C.Value=""}this.itemInfo.scoTimeRecorded=true}else{K=0}}var I=this.itemId;if(this.itemId.indexOf("_STUB")>=0){I=this.itemId.replace("_STUB","")}var A=this.appRoot+"/Learn/RecordActivity.ashx?enrollmentid="+this.enrollmentId+"&newattempt="+this.newAttempt+"&itemid="+encodeURIComponent(I)+"&starttime="+encodeURIComponent(this.itemStart.toUTCString().replace(/UTC/,"GMT"))+"×pent="+K;var L={url:A,recordedItemId:I,success:this.recordActivitySuccess,scope:this};var G=false;if(D){var E;if(window.XMLHttpRequest){E=new XMLHttpRequest()}else{E=new ActiveXObject("Microsoft.XMLHTTP")}if(E){E.open("GET",A,false);E.send(null);this.recordActivitySuccess(E,L);G=true}}if(!G){Ext.Ajax.request(L)}}this.newAttempt="0";this.itemStart=new Date()},recordActivitySuccess:function(request,options){if(!Ext.isEmpty(request.responseText)){var itemid=options.recordedItemId;var root=eval("("+request.responseText+")");if(root&&root.gradeHtml){var toUpdate=[];if(root.updateShortcuts){toUpdate=root.updateShortcuts}toUpdate.push(itemid);for(var i=0;i<toUpdate.length;i++){itemid=toUpdate[i];var div=Ext.get(itemid+"_"+this.playerId+"_grade");if(div){if(!Ext.isEmpty(root.gradeHtml)&&root.gradeHtml.indexOf("<span> </span>")==-1){var offset=0;if(Ext.isIE){offset=-2}offset-=4;div.update('<div class="x-tree-col-text x-tree-grade" style="height:'+this.scoreColumnHeight+"px;margin-top:-2px;margin-left:"+offset+'px">'+root.gradeHtml+"</div>")}else{div.update("")}}else{this.updateGradeHtml(this.CourseItems,itemid,root.gradeHtml)}}}}},updateGradeHtml:function(A,D,C){if(Ext.isEmpty(A)){return false}for(var B=0;B<A.length;B++){if(A[B].id==D){A[B].gradeHtml=C;return true}if(!Ext.isEmpty(A[B].children)){if(this.updateGradeHtml(A[B].children,D,C)){return true}}}return false},recordBookmark:function(){if(this.enrollmentId==this.sectionId||this.enrollmentId==this.courseId||!this.showToc||this.readOnly){return }if(this.itemInfo!=null&&this.itemInfo.logicalId!=null){var A='<sequence suspended="'+this.itemInfo.logicalId+'"/>';Ext.Ajax.request({url:this.appRoot+"/Learn/ScormData.ashx",params:{action:"postbookmark",courseid:this.courseId,sectionid:this.sectionId,enrollmentid:this.enrollmentId,data:A}})}},Log:function(A){if(this._DataDebug){console.log(A)}},Initialize:function(A){this.Log("Initialize('"+A+"')");var B;if(Ext.isObject(A)){B=""}else{B=A;A={}}if(B!=null&&B.length>0){this.lastError="201";return"false"}if(this.sessionState==ScormState.StateRunning){this.lastError="103";return"false"}if(this.sessionState==ScormState.StateTerminated){this.lastError="104";return"false"}this.InitializeData();this.LoadData();this.sessionState=ScormState.StateRunning;this.lastError="0";if(A.callback){this.initializeCallback.defer(1,A.scope||window,[A,true,new XMLHttpRequest()])}return"true"},Terminate:function(C){this.Log("Terminate('"+C+"')");if(C!=null&&C.length>0){this.lastError="201";return"false"}if(this.sessionState==ScormState.StateNotInitialized){this.lastError="112";return"false"}if(this.sessionState==ScormState.StateTerminated){this.lastError="113";return"false"}var B=false;var A="";if(this.dataModel.containsKey("cmi.exit")){A=this.dataModel.get("cmi.exit")}switch(A){case"suspend":this.dataModel.get("cmi.entry").Value="resume";break;case"logout":this.requestOnTerminate="suspendAll";this.argOnTerminate=null;this.dataModel.get("cmi.entry").Value="resume";B=true;break;case"time-out":this.requestOnTerminate="exitAll";this.argOnTerminate=null;this.dataModel.get("cmi.entry").Value="";B=true;break;default:if(this.requestOnTerminate=="suspendAll"){B=true;this.dataModel.get("cmi.entry").Value="resume"}else{this.dataModel.get("cmi.entry").Value=""}break}this.recordItemTimeSpent();this.Commit("");this.sessionState=ScormState.StateTerminated;if(!Ext.isEmpty(this.requestOnTerminate)){switch(this.requestOnTerminate){case"continue":this.navNext();break;case"previous":this.navPrev();break;case"choice":if(!Ext.isEmpty(this.argOnTerminate)){this.navToItem(this.argOnTerminate)}break;case"exit":case"exitAll":case"abandon":case"abandonAll":case"suspendAll":this.navExit();break;default:break}}if(B&&!this.version12){this.navExit()}if(this.requestOnTerminate=="abandon"||this.needsResetData){this.ResetData()}this.lastError="0";this.requestOnTerminate="";this.argOnTerminate=null;return"true"},setLoaded:function(){this.bhVars.loaded=true},getBrainHoneyValue:function(A){this.lastError="0";switch(A){case"bh.domain_id":return this.bhVars.domainId;case"bh.domain_name":return this.bhVars.domainName;case"bh.user_id":return this.bhVars.userId;case"bh.username":return this.bhVars.userName;case"bh.userspace":return this.bhVars.userSpace;case"bh.user_display":return this.userDisplayName||"";case"bh.user_first":return this.bhVars.userFirst||"";case"bh.user_last":return this.bhVars.userLast||"";case"bh.user_rights":return this.bhVars.userRights||"";case"bh.enrollment_id":return this.enrollmentId||"";case"bh.enrollment_first":return this.bhVars.enrollmentFirst||"";case"bh.enrollment_last":return this.bhVars.enrollmentLast||"";case"bh.enrollment_username":return this.bhVars.enrollmentUser||"";case"bh.enrollment_rights":return this.bhVars.enrollmentRights||"";case"bh.course_id":return this.courseId||"";case"bh.course_name":return this.bhVars.courseName||"";case"bh.section_id":return this.sectionId||"";case"bh.section_name":return this.bhVars.sectionName;case"bh.item_id":return this.itemId||"";case"bh.item_duedate":if(this.itemInfo!=null&&!Ext.isEmpty(this.itemInfo.itemDuedate)){return this.itemInfo.itemDuedate}else{return""}case"bh.item_name":if(this.itemInfo!=null&&!Ext.isEmpty(this.itemInfo.title)){return this.itemInfo.title}else{return""}case"bh.loaded":return !!this.bhVars.loaded;default:this.lastError="401";return""}},GetValue:function(C){this.Log("GetValue('"+C+"')");if(Ext.isEmpty(C)){this.lastError="301";return"false"}if(this.startsWith(C,"bh.")&&!this.startsWith(C,"bh.custom.")){return this.getBrainHoneyValue(C)}if(this.sessionState==ScormState.StateNotInitialized){this.lastError="122";return"false"}if(this.sessionState==ScormState.StateTerminated){this.lastError="123";return"false"}var B="";if(this.version12){B=C;if(B=="cmi.core.lesson_status"){C="cmi.success_status"}else{C=this.ConvertScorm12Name(C)}}if(C.indexOf(".")==-1){this.lastError="401";return""}if(this.startsWith(C,"adl.nav.request_valid.")){return this.GetNavRequestValid(C)}if(this.startsWith(C,"cmi.comments_from_learner.")){return this.GetCommentsFromLearnerValue(C)}if(this.startsWith(C,"cmi.comments_from_lms.")){return this.GetCommentsFromLmsValue(C)}if(this.startsWith(C,"cmi.objectives.")){return this.GetObjectiveValue(C)}if(this.startsWith(C,"cmi.interactions.")){return this.GetInteractionValue(C)}if(this.endsWith(C,"._count")){this.lastError="1001";return""}if(this.endsWith(C,"._children")&&C!="cmi.learner_preference._children"&&C!="cmi.score._children"&&(!this.version12||C!="cmi._children")){this.lastError="1000";return""}if(!this.dataModel.containsKey(C)){this.lastError="401";return""}var A=this.dataModel.get(C);if(A.ReadStautus==ScormStatus.StatusWriteOnly){this.lastError="405";return""}else{var D=A.Value;if(C=="cmi.completion_status"){D=this.GetCompletionStatus(D)}else{if(C=="cmi.success_status"){D=this.GetSuccessStatus(D)}}if(B=="cmi.core.lesson_status"){if(D==null||D=="unknown"){A=this.dataModel.get("cmi.completion_status");D=A.Value;D=this.GetCompletionStatus(D)}}this.lastError="0";if(D==null){if(this.contains(C,".score.")||C=="cmi.location"||C=="cmi.suspend_data"||C=="cmi.max_time_allowed"||C=="cmi.progress_measure"||C=="cmi.scaled_passing_score"){this.lastError="403"}D=""}return D}},SetValue:function(A,B){this.Log("SetValue('"+A+", "+B+"')");if(Ext.isEmpty(A)){this.lastError="351";return"false"}if(this.startsWith(A,"bh.")){lastError="404";return"false"}if(this.sessionState==ScormState.StateNotInitialized){this.lastError="132";return"false"}if(this.sessionState==ScormState.StateTerminated){this.lastError="133";return"false"}if(this.version12){if(A=="cmi.core.lesson_status"){switch(B){case"passed":case"failed":case"unknown":A="cmi.success_status";break;case"completed":case"incomplete":case"not attempted":default:A="cmi.completion_status";break}}else{A=this.ConvertScorm12Name(A)}}if(A.indexOf("._children")!=-1||A.indexOf("._count")!=-1){this.lastError="404";return"false"}if(A.indexOf(".")==-1){this.lastError="401";return"false"}if(this.endsWith(A,"._count")){this.lastError="1001";return"false"}if(this.endsWith(A,"._children")){this.lastError="1001";return"false"}if(A=="adl.nav.request"){return this.SetNavRequest(B)}if(this.startsWith(A,"adl.nav.request_valid.")){this.lastError="404";return"false"}if(this.startsWith(A,"cmi.comments_from_learner.")){return this.SetCommentsFromLearnerValue(A,B)}if(this.startsWith(A,"cmi.comments_from_lms.")){return this.SetCommentsFromLmsValue(A,B)}if(this.startsWith(A,"cmi.objectives.")){return this.SetObjectiveValue(A,B)}if(this.startsWith(A,"cmi.interactions.")){return this.SetInteractionValue(A,B)}return this.DoSetValue(A,B)},Commit:function(A){this.Log("Commit('"+A+"')");var B;if(Ext.isObject(A)){B=""}else{B=A}if(B!=null&&B.length>0){this.lastError="201";return"false"}if(this.sessionState==ScormState.StateNotInitialized){this.lastError="142";return"false"}if(this.sessionState==ScormState.StateTerminated){lastError="143";return"false"}if(this.dataNeedsSave()){this.SaveData(A)}this.lastError="0";return"true"},GetLastError:function(){this.Log("GetLastError(): "+this.lastError);return this.lastError},GetErrorString:function(A){this.Log("GetErrorString('"+A+"')");switch(A){case"0":return"Success";case"101":return"General Exception";case"102":return"General Initialization Failure";case"103":return"Already Initialized";case"104":return"Content Instance Terminated";case"111":return"General Termination Failure";case"112":return"Termination Before Initialization";case"113":return"Termination After Termination";case"122":return"Retrieve Data Before Initialization";case"123":return"Retrieve Data After Termination";case"132":return"Store Data Before Initialization";case"133":return"Store Data After Termination";case"142":return"Commit Before Initialization";case"143":return"Commit After Termination";case"201":return"General Argument Error";case"301":return"General Get Failure";case"351":return"General Set Failure";case"391":return"General Commit Failure";case"401":return"Undefined Data Model Element";case"402":return"Unimplemented Data Model Element";case"403":return"Data Model Element Value Not Initialized";case"404":return"Data Model Element Is Read Only";case"405":return"Data Model Element Is Write Only";case"406":return"Data Model Element Type Mismatch";case"407":return"Data Model Element Value Out Of Range";case"408":return"Data Model Dependency Not Established";case"1000":return"Data Model Element Does Not Have Children";case"1001":return"Data Model Element Cannot Have Count";case"1002":return"Data Model Element Collection Set Out Of Order";case"1003":return"Data Model Collection Element Request Out Of Range";case"1004":return"Data Model Element Not Specified";case"1005":return"Unique Identifier Constraint Violated";case"1006":return"Smallest Permitted Maximum Exceeded";case"1007":return"Data Model Element Does Not Have Version"}return"Unknown Error Code"},GetDiagnostic:function(A){this.Log("GetDiagnostic('"+A+"')");var B=this.GetErrorString(A);if(B=="Unknown Error Code"){return""}return B},LMSInitialize:function(A){this.Log("LMSInitialize('"+A+"')");this.version12=true;return this.Initialize(A)},LMSFinish:function(A){this.Log("LMSFinish('"+A+"')");return this.Terminate(A)},LMSGetValue:function(A){var B=this.GetValue(A);this.Log("LMSGetValue('"+A+"') = '"+B+"'");return B},LMSSetValue:function(A,B){this.Log("LMSSetValue('"+A+"', '"+B+"')");if(A=="cmi.core.score.raw"){this.InternalSetValue("cmi.score.min","0");this.InternalSetValue("cmi.score.max","100")}return this.SetValue(A,B)},LMSCommit:function(A){this.Log("LMSCommit('"+A+"')");return this.Commit(A)},LMSGetLastError:function(){this.Log("LMSGetLastError()");return this.GetLastError()},LMSGetErrorString:function(A){this.Log("LMSGetErrorString('"+A+"')");return this.GetErrorString(A)},LMSGetDiagnostic:function(A){this.Log("LMSDiagnostic('"+A+"')");return this.GetDiagnostic(A)},ResetData:function(A){if(this.sessionState==ScormState.StateNotInitialized){return }if(!A&&this.sessionState!=ScormState.StateTerminated){this.needsResetData=true;return }this.Log("ResetData");this.dataModel.clear();this.version12=false;this.dataInitialized=false;this.lastError="0";this.requestOnTerminate="";this.argOnTerminate=null;this.sessionState=ScormState.StateNotInitialized;this.needsResetData=false},InternalSetValue:function(A,B){if(this.dataModel.containsKey(A)){this.dataModel.get(A).Value=B}},InternalGetValue:function(A){if(this.dataModel.containsKey(A)){return this.dataModel.get(A).Value}return""},dataNeedsSave:function(){var B=false;for(i=0;i<this.dataModel.getCount();i++){var A=this.dataModel.get(i);if(A.Value!=A.DefaultValue){B=true;break}}return B},initializeCallback:function(B,C,A){if(B.callback){B.callback.call(B.scope||window,B,C,A)}},getSectionSummaryCallback:function(C,E,B){if(C.agxOptions.callback){var D=null;var A=null;if(!Ext.isEmpty(B.responseText)){A=Ext.util.JSON.decode(B.responseText)}if(!E||A==null||A.success!=true){E=false;D=[]}else{D=A.data||[]}C.agxOptions.callback.call(C.agxOptions.scope||window,C.agxOptions,E,D,B)}},commitCallback:function(B,C,A){if(B.agxOptions.callback){B.agxOptions.callback.call(B.agxOptions.scope||window,B.agxOptions,C,A)}},SaveData:function(C){if(this.enrollmentId==this.sectionId||this.enrollmentId==this.courseId){return }if(this.readOnly){if(this.itemInfo&&this.itemInfo.allowScoReviewCommit){}else{return }}var D="";if(this.version12){D=D.concat('<data version="1.2">')}else{D=D.concat('<data version="2004">')}for(i=0;i<this.dataModel.getCount();i++){var B=this.dataModel.get(i);if(B.Value!=B.DefaultValue){D=D.concat('<entry name="'+Ext.util.Format.htmlEncode(B.Name)+'" value="'+Ext.util.Format.htmlEncode(B.Value)+'"/>')}}D=D.concat("</data>");var A={url:this.appRoot+"/Learn/ScormData.ashx",params:{action:"postdata",courseid:this.courseId,sectionid:this.sectionId,enrollmentid:this.enrollmentId,itemid:this.lastLogicalId,data:D}};if(C&&C.callback){A.callback=this.commitCallback;A.scope=this;A.agxOptions=C}Ext.Ajax.request(A)},LoadData:function(){if(this.itemInfo!=null&&this.itemInfo.scormData!=null){this.Log("Loading itemInfo.scormData");for(var B=0;B<this.itemInfo.scormData.length;B++){var A=this.itemInfo.scormData[B].name;var C=this.itemInfo.scormData[B].value;if(!Ext.isEmpty(A)){if(A=="cmi.session_time"){continue}if(!this.dataModel.containsKey(A)){if(this.startsWith(A,"cmi.interactions")){this.CreateInteraction(A,true);if(this.contains(A,".objectives.")){this.CreateObjectivesInteraction(A,true)}if(this.contains(A,".correct_responses.")){this.CreateCorrectResponsesInteraction(A,true)}}else{if(this.startsWith(A,"cmi.objectives")){this.CreateObjective(A,true)}else{if(this.startsWith(A,"cmi.comments_from_learner")){this.CreateCommentFromLearner(A,true)}else{if(this.startsWith(A,"cmi.comments_from_lms")){this.CreateCommentFromLms(A,true)}}}}}if(this.dataModel.containsKey(A)){this.dataModel.get(A).Value=C}}}}},InitializeData:function(){if(!this.dataInitialized){this.Log("InitializeData()");this.dataModel.replace("adl.nav.request",new CMIComponent("adl.nav.request","_none_",ScormStatus.StatusReadOnly,"CMIString255"));this.dataModel.replace("cmi._version",new CMIComponent("cmi._version","1.0",ScormStatus.StatusReadOnly,"CMIIdentifier"));if(this.version12){this.dataModel.replace("cmi._children",new CMIComponent("cmi._children","student_id,student_name,lesson_location,credit,lesson_status,entry,score,total_time,exit,session_time",ScormStatus.StatusReadOnly,"CMIIdentifier"))}this.dataModel.replace("cmi.completion_status",new CMIComponent("cmi.completion_status",(this.version12?"not attempted":""),ScormStatus.StatusBoth,"CMIVocabularyStatus"));var A=null;this.dataModel.replace("cmi.completion_threshold",new CMIComponent("cmi.completion_threshold",A,ScormStatus.StatusReadOnly,"CMIDecimalZeroToOne"));this.dataModel.replace("cmi.credit",new CMIComponent("cmi.credit","credit",ScormStatus.StatusReadOnly,"CMIVocabularyCredit"));this.dataModel.replace("cmi.entry",new CMIComponent("cmi.entry","ab-initio",ScormStatus.StatusReadOnly,"CMIVocabularyEntry"));this.dataModel.replace("cmi.exit",new CMIComponent("cmi.exit","",ScormStatus.StatusWriteOnly,"CMIVocabularyExit"));this.dataModel.replace("cmi.launch_data",new CMIComponent("cmi.launch_data","",ScormStatus.StatusReadOnly,"CMIString4096"));this.dataModel.replace("cmi.learner_id",new CMIComponent("cmi.learner_id",this.enrollmentId,ScormStatus.StatusReadOnly,"CMIIdentifier"));this.dataModel.replace("cmi.learner_name",new CMIComponent("cmi.learner_name",this.userDisplayName,ScormStatus.StatusReadOnly,"CMILocalizedString"));this.dataModel.replace("cmi.learner_preference._children",new CMIComponent("cmi.learner_preference._children","audio_level,language,audio_captioning,delivery_speed",ScormStatus.StatusReadOnly,"CMIString255"));this.dataModel.replace("cmi.learner_preference.audio_level",new CMIComponent("cmi.learner_preference.audio_level","1",ScormStatus.StatusBoth,"CMIDecimalPositive"));this.dataModel.replace("cmi.learner_preference.language",new CMIComponent("cmi.learner_preference.language","",ScormStatus.StatusBoth,"CMILanguage"));this.dataModel.replace("cmi.learner_preference.delivery_speed",new CMIComponent("cmi.learner_preference.delivery_speed","1",ScormStatus.StatusBoth,"CMIDecimalPositive"));this.dataModel.replace("cmi.learner_preference.audio_captioning",new CMIComponent("cmi.learner_preference.audio_captioning","0",ScormStatus.StatusBoth,"CMISInteger"));this.dataModel.replace("cmi.location",new CMIComponent("cmi.location",null,ScormStatus.StatusBoth,"CMIString4096"));var G=null;this.dataModel.replace("cmi.max_time_allowed",new CMIComponent("cmi.max_time_allowed",G,ScormStatus.StatusReadOnly,"CMITimespan"));this.dataModel.replace("cmi.mode",new CMIComponent("cmi.mode","normal",ScormStatus.StatusReadOnly,"CMIVocabularyMode"));this.dataModel.replace("cmi.progress_measure",new CMIComponent("cmi.progress_measure",null,ScormStatus.StatusBoth,"CMIDecimalZeroToOne"));var C=Number.NaN;this.dataModel.replace("cmi.scaled_passing_score",new CMIComponent("cmi.scaled_passing_score",(isNaN(C))?null:C.toString(),ScormStatus.StatusReadOnly,"CMIDecimalMinusOneToOne"));this.dataModel.replace("cmi.score._children",new CMIComponent("cmi.score._children","scaled,min,max,raw",ScormStatus.StatusReadOnly,"CMIString255"));this.dataModel.replace("cmi.score.scaled",new CMIComponent("cmi.score.scaled",null,ScormStatus.StatusBoth,"CMIDecimalMinusOneToOne"));this.dataModel.replace("cmi.score.raw",new CMIComponent("cmi.score.raw",null,ScormStatus.StatusBoth,"CMIDecimalOrCMIBlank"));this.dataModel.replace("cmi.score.max",new CMIComponent("cmi.score.max",null,ScormStatus.StatusBoth,"CMIDecimalOrCMIBlank"));this.dataModel.replace("cmi.score.min",new CMIComponent("cmi.score.min",null,ScormStatus.StatusBoth,"CMIDecimalOrCMIBlank"));this.dataModel.replace("cmi.session_time",new CMIComponent("cmi.session_time","",ScormStatus.StatusWriteOnly,"CMITimespan"));this.dataModel.replace("cmi.success_status",new CMIComponent("cmi.success_status","",ScormStatus.StatusBoth,"CMIVocabularyStatus"));this.dataModel.replace("cmi.suspend_data",new CMIComponent("cmi.suspend_data",null,ScormStatus.StatusBoth,"CMIString4096"));this.dataModel.replace("cmi.time_limit_action",new CMIComponent("cmi.time_limit_action","continue,no message",ScormStatus.StatusReadOnly,"CMIVocabularyTimeLimitAction"));var E="PT0H0M0S";if(this.version12){E="00:00:00"}this.dataModel.replace("cmi.total_time",new CMIComponent("cmi.total_time",E,ScormStatus.StatusReadOnly,"CMITimespan"));this.dataModel.replace("cmi.comments_from_learner._children",new CMIComponent("cmi.comments_from_learner._children","comment,location,timestamp",ScormStatus.StatusReadOnly,"CMIString255"));this.dataModel.replace("cmi.comments_from_learner._count",new CMIComponent("cmi.comments_from_learner._count","0",ScormStatus.StatusReadOnly,"CMIInteger"));this.dataModel.replace("cmi.comments_from_lms._children",new CMIComponent("comments_from_lms._children","comment,location,timestamp",ScormStatus.StatusReadOnly,"CMIString255"));this.dataModel.replace("cmi.comments_from_lms._count",new CMIComponent("cmi.comments_from_lms._count","0",ScormStatus.StatusReadOnly,"CMIInteger"));this.dataModel.replace("cmi.objectives._children",new CMIComponent("cmi.objectives._children","id,score,success_status,completion_status,description,progress_measure",ScormStatus.StatusReadOnly,"CMIString255"));this.dataModel.replace("cmi.objectives._count",new CMIComponent("cmi.objectives._count","0",ScormStatus.StatusReadOnly,"CMIInteger"));var B="cmi.objectives.0.id";this.CreateObjective(B,false);this.dataModel.replace("cmi.interactions._children",new CMIComponent("cmi.interactions._children","id,type,objectives,timestamp,correct_responses,weighting,learner_response,result,latency,description",ScormStatus.StatusReadOnly,"CMIString255"));this.dataModel.replace("cmi.interactions._count",new CMIComponent("cmi.interactions._count","0",ScormStatus.StatusReadOnly,"CMIInteger"));if(this.itemInfo.customFields!=null){for(var D=0;D<this.itemInfo.customFields.length;D++){var B=this.itemInfo.customFields[D][0];var F=this.itemInfo.customFields[D][1];if(!Ext.isEmpty(B)){B="bh.custom."+B;this.dataModel.replace(B,new CMIComponent(B,F,ScormStatus.StatusReadOnly,"CMIString4096"))}}}this.dataInitialized=true}},StringToTimeSpan:function(A){if(this.version12){return this.SCORM12DurationToCs(A)}return this.ISODurationToCentisec(A)},TimeSpantoString:function(A){if(this.version12){return this.centisecsToSCORM12Duration(A)}return this.centisecsToISODuration(A,false)},centisecsToISODuration:function(n,bPrecise){var str="P";var nCs=n;var nY=0,nM=0,nD=0,nH=0,nMin=0,nS=0;n=Math.max(n,0);var nCs=n;with(Math){nCs=round(nCs);if(bPrecise==true){nD=floor(nCs/8640000)}else{nY=floor(nCs/3155760000);nCs-=nY*3155760000;nM=floor(nCs/262980000);nCs-=nM*262980000;nD=floor(nCs/8640000)}nCs-=nD*8640000;nH=floor(nCs/360000);nCs-=nH*360000;var nMin=floor(nCs/6000);nCs-=nMin*6000}if(nY>0){str+=nY+"Y"}if(nM>0){str+=nM+"M"}if(nD>0){str+=nD+"D"}if((nH>0)||(nMin>0)||(nCs>0)){str+="T";if(nH>0){str+=nH+"H"}if(nMin>0){str+=nMin+"M"}if(nCs>0){str+=(nCs/100)+"S"}}if(str=="P"){str="PT0H0M0S"}return str},ISODurationToCentisec:function(F){var D=new Array(0,0,0,0,0,0);var B=false;var E=false;if(F.indexOf("P")!=0){B=true}if(!B){var G=new Array("Y","M","D","H","M","S");var C=0,A=0;F=F.substr(1);for(A=0;A<G.length;A++){if(F.indexOf("T")==0){F=F.substr(1);A=Math.max(A,3);E=true}C=F.indexOf(G[A]);if(C>-1){if((A==1)&&(F.indexOf("T")>-1)&&(F.indexOf("T")<C)){continue}if(G[A]=="S"){D[A]=parseFloat(F.substr(0,C))}else{D[A]=parseInt(F.substr(0,C))}if(isNaN(D[A])){B=true;break}else{if((A>2)&&(!E)){B=true;break}}F=F.substr(C+1)}}if((!B)&&(F.length!=0)){B=true}}if(B){return }return D[0]*3155760000+D[1]*262980000+D[2]*8640000+D[3]*360000+D[4]*6000+Math.round(D[5]*100)},SCORM12DurationToCs:function(E){var A=E.split(":");var B=0,F=0;var D=1;var C=((A.length<2)||(A.length>3));if(!C){for(i=A.length-1;i>=0;i--){F=parseFloat(A[i]);if(isNaN(F)){C=true;break}B+=F*D;D*=60}}if(C){alert("Incorrect format: "+E+"\n\nFormat must be [HH]HH:MM:SS[.SS]");return NaN}return Math.round(B*100)},centisecsToSCORM12Duration:function(n){var bTruncated=false;with(Math){n=round(n);var nH=floor(n/360000);var nCs=n-nH*360000;var nM=floor(nCs/6000);nCs=nCs-nM*6000;var nS=floor(nCs/100);nCs=nCs-nS*100}if(nH>9999){nH=9999;bTruncated=true}var str="0000"+nH+":";str=str.substr(str.length-5,5);if(nM<10){str+="0"}str+=nM+":";if(nS<10){str+="0"}str+=nS;if(nCs>0){str+=".";if(nCs<10){str+="0"}str+=nCs}return str},ConvertScorm12Name:function(A){if(!this.version12){return A}var B=A;switch(A){case"cmi.core.student_id":B="cmi.learner_id";break;case"cmi.core.student_name":B="cmi.learner_name";break;case"cmi.core.lesson_location":B="cmi.location";break;case"cmi.core.lesson_mode":B="cmi.mode";break;case"cmi.core.lesson_status":B="cmi.success_status";break;case"cmi.comments":B="cmi.comments_from_learner.0.comment";break;case"cmi.student_data.mastery_score":B="cmi.scaled_passing_score";break;case"cmi.student_preference.audio":B="cmi.learner_preference.audio_level";break;case"cmi.student_preference.speed":B="cmi.learner_preference.delivery_speed";break;case"cmi.student_preference.text":B="cmi.learner_preference.audio_captioning";break}if(B.indexOf(".core.")>=0){B=B.replace(".core","")}if(B.indexOf(".student_data.")>=0){B=B.replace(".student_data","")}if(B.indexOf(".student_preference.")>=0){B=B.replace(".student_preference.",".learner_preference.")}if(this.startsWith(B,"cmi.objectives.")&&this.endsWith(B,".status")){B.replace(".status",".completion_status")}if(this.startsWith(B,"cmi.interactions.")){if(this.endsWith(B,".time")){B+="stamp"}else{if(this.endsWith(B,".student_response")){B=B.replace(".student_",".learner_")}}}return B},startsWith:function(B,A){return(B.indexOf(A)==0)},endsWith:function(B,A){return(B.indexOf(A)==Math.max(0,(B.length-A.length)))},contains:function(B,A){return(B.indexOf(A)>=0)},DoSetValue:function(B,E){if(!this.dataModel.containsKey(B)){this.lastError="401";return"false"}var A=this.dataModel.get(B);if(A.ReadStautus==ScormStatus.StatusReadOnly){this.lastError="404";return"false"}else{var C=A.DataType;if(this.CheckDataTypeAndVocab(B,E,C)){if(C=="CMIDecimalZeroToOne"){var D=Number(E);if(isNaN(D)||D<0||D>1){this.lastError="407";return"false"}}if(C=="CMIDecimalMinusOneToOne"){var D=Number(E);if(isNaN(D)||D<-1||D>1){this.lastError="407";return"false"}}if(C=="CMIDecimalPositive"){var D=Number(E);if(isNaN(D)||D<0){this.lastError="407";return"false"}}A.Value=E;this.lastError="0";return"true"}else{this.lastError="406";return"false"}}},GetNavRequestValid:function(A){var B=A.substr("adl.nav.request_valid.".length);if(B=="continue"){this.lastError="0";return true}if(B=="previous"){this.lastError="0";return true}if(this.startsWith(B,"choice.{target=")){this.lastError="0";return true}this.lastError="401";return""},SetNavRequest:function(A){this.requestOnTerminate="";this.argOnTerminate=null;switch(A){case"continue":case"previous":case"exit":case"exitAll":case"abandon":case"abandonAll":case"suspendAll":this.requestOnTerminate=A;break;case"_none_":break;default:if(this.endsWith(A,"choice")){this.requestOnTerminate="choice";if(this.startsWith(A,"{target=")){this.argOnTerminate=A.substr(0,A.indexOf("}")).substr("{target=".length)}}else{this.lastError="406";return"false"}break}this.lastError="0";this.InternalSetValue("adl.nav.request",A);return"true"},GetCommentsFromLearnerValue:function(A){if(A=="cmi.comments_from_learner._children"||A=="cmi.comments_from_learner._count"){this.lastError="0";return this.dataModel.get(A).Value}if(!this.IsValidCommentsFromLearnerIndex(A,false)){this.lastError="301";return""}if(this.dataModel.containsKey(A)){this.lastError="0";var B=this.dataModel.get(A).Value;if(B==null){if(this.endsWith(A,".comment")){this.lastError="301"}else{if(this.endsWith(A,".location")||this.endsWith(A,".timestamp")){this.lastError="403"}}B=""}return B}this.lastError="401";return""},SetCommentsFromLearnerValue:function(A,B){if(this.contains(A,"._children")||this.contains(A,"._count")){this.lastError="404";return"false"}if(!this.IsValidCommentsFromLearnerIndex(A,true)){this.lastError="351";return"false"}return this.DoSetValue(A,B)},IsValidCommentsFromLearnerIndex:function(B,C){var F=B;if(this.startsWith(B,"cmi.comments_from_learner.")){F=B.substr("cmi.comments_from_learner.".length)}var G=F.split(".");if(G.length>1){var A=Number(G[0]);if(isNaN(A)){return false}var E="cmi.comments_from_learner."+G[0]+".";var D=Number(this.dataModel.get("cmi.comments_from_learner._count").Value);if(A>D-1){if(A==D&&(C||this.version12)){this.CreateCommentFromLearner(B,false);return true}else{return false}}else{if(A>=0){if(this.dataModel.get(B)==null&&this.version12){this.CreateCommentFromLearner(B,true)}return true}}}return false},CreateCommentFromLearner:function(B,F){var E=B;if(this.startsWith(B,"cmi.comments_from_learner.")){E=B.substr("cmi.comments_from_learner.".length)}var G=E.split(".");if(G.length>1){var A=Number(G[0]);if(isNaN(A)){return false}var D="cmi.comments_from_learner."+G[0]+".";var C=Number(this.dataModel.get("cmi.comments_from_learner._count").Value);if(A>C-1||F){if(A==C||F){this.dataModel.replace(D+"comment",new CMIComponent(D+"comment",(this.version12?"":null),ScormStatus.StatusBoth,"CMILocalizedString"));this.dataModel.replace(D+"location",new CMIComponent(D+"location",null,ScormStatus.StatusBoth,"CMIString255"));this.dataModel.replace(D+"timestamp",new CMIComponent(D+"timestamp",null,ScormStatus.StatusBoth,"CMITime"));if(A>C-1){this.dataModel.get("cmi.comments_from_learner._count").Value=(A+1).toString()}}}}},GetCommentsFromLmsValue:function(A){if(A=="cmi.comments_from_lms._children"||A=="cmi.comments_from_lms._count"){this.lastError="0";return this.dataModel.get(A).Value}if(!this.IsValidCommentsFromLmsIndex(A,false)){this.lastError="301";return""}if(this.dataModel.containsKey(A)){this.lastError="0";var B=this.dataModel.get(A).Value;if(B==null){if(this.endsWith(A,".comment")||this.endsWith(A,".location")||this.endsWith(A,".timestamp")){this.lastError="403"}B=""}return B}this.lastError="401";return""},SetCommentsFromLmsValue:function(A,B){if(this.contains(A,"._children")||this.contains(A,"._count")){this.lastError="404";return"false"}if(!this.IsValidCommentsFromLmsIndex(A,true)){this.lastError="351";return"false"}return this.DoSetValue(A,B)},IsValidCommentsFromLmsIndex:function(B,C){var F=B;if(this.startsWith(B,"cmi.comments_from_lms.")){F=B.substr("cmi.comments_from_lms.".length)}var G=F.split(".");if(G.length>1){var A=Number(G[0]);if(isNaN(A)){return false}var E="cmi.comments_from_lms."+G[0]+".";var D=Number(this.dataModel.get("cmi.comments_from_lms._count").Value);if(A>D-1){if(A==D&&C){this.CreateCommentFromLms(B,false);return true}else{return false}}else{if(A>=0){return true}}}return false},CreateCommentFromLms:function(B,F){var E=B;if(this.startsWith(B,"cmi.comments_from_lms.")){E=B.substr("cmi.comments_from_lms.".length)}var G=E.split(".");if(G.length>1){var A=Number(G[0]);if(isNaN(A)){return false}var D="cmi.comments_from_lms."+G[0]+".";var C=Number(this.dataModel.get("cmi.comments_from_lms._count").Value);if(A>C-1||F){if(A==C||F){this.dataModel.replace(D+"comment",new CMIComponent(D+"comment",null,ScormStatus.StatusReadOnly,"CMILocalizedString"));this.dataModel.replace(D+"location",new CMIComponent(D+"location",null,ScormStatus.StatusReadOnly,"CMIString255"));this.dataModel.replace(D+"timestamp",new CMIComponent(D+"timestamp",null,ScormStatus.StatusReadOnly,"CMITime"));if(A>C-1){this.dataModel.get("cmi.comments_from_lms._count").Value=(A+1).toString()}}}}},GetObjectiveValue:function(A){if(A=="cmi.objectives._children"||A=="cmi.objectives._count"){this.lastError="0";return this.dataModel.get(A).Value}if(!this.IsValidObjectiveIndex(A,false)){this.lastError="301";return""}if(this.dataModel.containsKey(A)){var B=this.dataModel.get(A).Value;this.lastError="0";if(B==null){if(this.contains(A,".score.")||this.endsWith(A,".progress_measure")||this.endsWith(A,".description")){this.lastError="403"}else{if(this.endsWith(A,".id")){this.lastError="301"}}B=""}return B}this.lastError="401";return""},SetObjectiveValue:function(D,G){if(this.contains(D,"._children")||this.contains(D,"._count")){this.lastError="404";return"false"}if(!this.IsValidObjectiveIndex(D,true)){this.lastError="351";return"false"}if(this.contains(D,".score.")){var H=D.substr(0,D.indexOf(".score."))+".id";if(!this.dataModel.containsKey(H)||Ext.isEmpty(this.dataModel.get(H).Value)){this.lastError="408";return"false"}}if(this.endsWith(D,".success_status")||this.endsWith(D,".completion_status")){var H=D.substr(0,D.lastIndexOf("."))+".id";if(!this.dataModel.containsKey(H)||Ext.isEmpty(this.dataModel.get(H).Value)){this.lastError="408";return"false"}}if(this.endsWith(D,".id")){var C=0;var F="cmi.objectives.";var A=F+C.toString()+".id";while(this.dataModel.containsKey(A)){if(A==D){var E=this.dataModel.get(D).Value;if(!Ext.isEmpty(E)&&E!=G){this.lastError="351";return"false"}}else{if(this.dataModel.get(A).Value==G){this.lastError="351";return"false"}}C++;A=F+C.toString()+".id"}}var B="CMIDecimalOrCMIBlank";if(this.endsWith(D,".id")){B="CMIIdentifier"}else{if(this.endsWith(D,".success_status")||this.endsWith(D,".completion_status")){B="CMIVocabularyStatus"}else{if(this.endsWith(D,".description")){B="CMILocalizedString"}else{if(this.endsWith(D,".progress_measure")){B="CMIString255"}else{if(this.endsWith(D,".score.scaled")){B="CMIDecimalMinusOneToOne"}}}}}if(!this.CheckDataTypeAndVocab(D,G,B)){this.lastError="406";return"false"}this.CreateObjective(D,false);return this.DoSetValue(D,G)},IsValidObjectiveIndex:function(B,C){var F=B;if(this.startsWith(B,"cmi.objectives.")){F=B.substr("cmi.objectives.".length)}var G=F.split(".");if(G.length>1){var A=Number(G[0]);if(isNaN(A)){return false}var E="cmi.objectives."+G[0]+".";var D=Number(this.dataModel.get("cmi.objectives._count").Value);if(A>D-1){if(A==D&&C){return true}else{return false}}else{if(A>=0){return true}}}return false},CreateObjective:function(B,F){var E=B;if(this.startsWith(B,"cmi.objectives.")){E=B.substr("cmi.objectives.".length)}var G=E.split(".");if(G.length>1){var A=Number(G[0]);if(!isNaN(A)){var D="cmi.objectives."+G[0]+".";var C=Number(this.dataModel.get("cmi.objectives._count").Value);if(A>C-1||F){if(A==C||F){this.dataModel.replace(D+"id",new CMIComponent(D+"id",null,ScormStatus.StatusBoth,"CMIIdentifier"));this.dataModel.replace(D+"success_status",new CMIComponent(D+"success_status","unknown",ScormStatus.StatusBoth,"CMIVocabularyStatus"));this.dataModel.replace(D+"completion_status",new CMIComponent(D+"completion_status","unknown",ScormStatus.StatusBoth,"CMIVocabularyStatus"));this.dataModel.replace(D+"description",new CMIComponent(D+"description",null,ScormStatus.StatusBoth,"CMILocalizedString"));this.dataModel.replace(D+"progress_measure",new CMIComponent(D+"progress_measure",null,ScormStatus.StatusBoth,"CMIDecimalZeroToOne"));this.dataModel.replace(D+"score._children",new CMIComponent(D+"score._children","scaled,min,max,raw",ScormStatus.StatusReadOnly,"CMIString255"));this.dataModel.replace(D+"score.scaled",new CMIComponent(D+"score.scaled",null,ScormStatus.StatusBoth,"CMIDecimalMinusOneToOne"));this.dataModel.replace(D+"score.raw",new CMIComponent(D+"score.raw",null,ScormStatus.StatusBoth,"CMIDecimalOrCMIBlank"));this.dataModel.replace(D+"score.max",new CMIComponent(D+"score.max",null,ScormStatus.StatusBoth,"CMIDecimalOrCMIBlank"));this.dataModel.replace(D+"score.min",new CMIComponent(D+"score.min",null,ScormStatus.StatusBoth,"CMIDecimalOrCMIBlank"));if(A>C-1){this.dataModel.get("cmi.objectives._count").Value=(A+1).toString()}}}}}},GetInteractionValue:function(A){if(A=="cmi.interactions._children"||A=="cmi.interactions._count"){this.lastError="0";return this.dataModel.get(A).Value}if(!this.IsValidInteractionIndex(A,false)){this.lastError="301";return""}if(this.contains(A,".correct_responses.")){return this.GetCorrectResponsesInteractionValue(A)}if(this.contains(A,".objectives.")){return this.GetObjectivesInteractionValue(A)}if(this.dataModel.containsKey(A)){this.lastError="0";var B=this.dataModel.get(A).Value;if(B==null){if(this.endsWith(A,".type")||this.endsWith(A,".timestamp")||this.endsWith(A,".learner_response")||this.endsWith(A,".result")||this.endsWith(A,".latency")||this.endsWith(A,".description")||this.endsWith(A,".weighting")){this.lastError="403"}B=""}return B}this.lastError="401";return""},SetInteractionValue:function(A,C){if(this.contains(A,"._children")||this.contains(A,"._count")){this.lastError="404";return"false"}if(!this.IsValidInteractionIndex(A,true)){this.lastError="351";return"false"}if(this.contains(A,".correct_responses.")){return this.SetCorrectResponsesInteractionValue(A,C)}if(this.contains(A,".objectives.")){return this.SetObjectivesInteractionValue(A,C)}if(this.endsWith(A,".type")||this.endsWith(A,".timestamp")||this.endsWith(A,".timestamp")||this.endsWith(A,".result")||this.endsWith(A,".latency")||this.endsWith(A,".description")||this.endsWith(A,".weighting")){var D=A.substr(0,A.lastIndexOf("."))+".id";if(!this.dataModel.containsKey(D)||Ext.isEmpty(this.dataModel.get(D).Value)){this.lastError="408";return"false"}}else{if(this.endsWith(A,".learner_response")){var D=A.substr(0,A.lastIndexOf("."))+".id";if(!this.dataModel.containsKey(D)||Ext.isEmpty(this.dataModel.get(D).Value)){this.lastError="408";return"false"}var B=A.substr(0,A.lastIndexOf("."))+".type";if(!this.dataModel.containsKey(B)||Ext.isEmpty(this.dataModel.get(B).Value)){this.lastError="408";return"false"}}}this.CreateInteraction(A,false);return this.DoSetValue(A,C)},IsValidInteractionIndex:function(B,C){var F=B;if(this.startsWith(B,"cmi.interactions.")){F=B.substr("cmi.interactions.".length)}var G=F.split(".");if(G.length>1){var A=Number(G[0]);if(isNaN(A)){return false}var E="cmi.interactions."+G[0]+".";var D=Number(this.dataModel.get("cmi.interactions._count").Value);if(A>D-1){if(A==D&&C){return true}else{return false}}else{if(A>=0){return true}}}return false},CreateInteraction:function(B,F){var E=B;if(this.startsWith(B,"cmi.interactions.")){E=B.substr("cmi.interactions.".length)}var G=E.split(".");if(G.length>1){var A=Number(G[0]);if(isNaN(A)){return false}var D="cmi.interactions."+G[0]+".";var C=Number(this.dataModel.get("cmi.interactions._count").Value);if(A==C||F){if(!this.dataModel.containsKey(D+"id")){this.dataModel.replace(D+"id",new CMIComponent(D+"id","",ScormStatus.StatusBoth,"CMIIdentifier"));this.dataModel.replace(D+"type",new CMIComponent(D+"type",null,ScormStatus.StatusBoth,"CMIVocabularyInteraction"));this.dataModel.replace(D+"timestamp",new CMIComponent(D+"timestamp",null,ScormStatus.StatusBoth,"CMITime"));this.dataModel.replace(D+"weighting",new CMIComponent(D+"weighting",null,ScormStatus.StatusBoth,"CMIDecimal"));this.dataModel.replace(D+"learner_response",new CMIComponent(D+"learner_response",null,ScormStatus.StatusBoth,"CMIFeedback"));this.dataModel.replace(D+"result",new CMIComponent(D+"result",null,ScormStatus.StatusBoth,"CMIVocabularyResult"));this.dataModel.replace(D+"latency",new CMIComponent(D+"latency",null,ScormStatus.StatusBoth,"CMITimespan"));this.dataModel.replace(D+"description",new CMIComponent(D+"description",null,ScormStatus.StatusBoth,"CMILocalizedString"));this.dataModel.replace(D+"displaytype",new CMIComponent(D+"displaytype",null,ScormStatus.StatusBoth,"CMIString4096"));this.dataModel.replace(D+"tag",new CMIComponent(D+"tag",null,ScormStatus.StatusBoth,"CMIString4096"));this.dataModel.replace(D+"objectives._count",new CMIComponent(D+"objectives._count","0",ScormStatus.StatusReadOnly,"CMIInteger"));this.dataModel.replace(D+"correct_responses._count",new CMIComponent(D+"correct_responses._count","0",ScormStatus.StatusReadOnly,"CMIInteger"));if(A>C-1){this.dataModel.get("cmi.interactions._count").Value=(A+1).toString()}}}}},GetObjectivesInteractionValue:function(A){if(this.endsWith(A,".objectives._count")){this.lastError="0";return this.dataModel.get(A).Value}if(!this.IsValidObjectivesInteractionIndex(A,false)){this.lastError="301";return""}if(this.dataModel.containsKey(A)){var B=this.dataModel.get(A).Value;this.lastError="0";if(B==null){if(this.endsWith(A,".id")){this.lastError="301"}B=""}return B}this.lastError="401";return""},SetObjectivesInteractionValue:function(C,E){if(this.endsWith(C,".objectives._count")){this.lastError="404";return"false"}if(!this.IsValidObjectivesInteractionIndex(C,true)){this.lastError="351";return"false"}if(this.contains(C,".objectives.")&&this.endsWith(C,".id")){var F=C.substr(0,C.indexOf(".objectives."))+".id";if(!this.dataModel.containsKey(F)||Ext.isEmpty(this.dataModel.get(F).Value)){this.lastError="408";return"false"}var B=0;var D=C.substr(0,C.indexOf(".objectives."))+".objectives.";var A=D+B.toString()+".id";while(this.dataModel.containsKey(A)){if(A!=C){if(this.dataModel.get(A).Value==E){this.lastError="351";return"false"}}B++;A=D+B.toString()+".id"}}this.CreateObjectivesInteraction(C,false);return this.DoSetValue(C,E)},IsValidObjectivesInteractionIndex:function(C,D){var G=C;if(this.startsWith(C,"cmi.interactions.")){G=C.substr("cmi.interactions.".length)}var H=G.split(".");if(H.length>3&&H[1]=="objectives"){var A=Number(H[0]);var B=Number(H[2]);if(isNaN(B)||isNaN(A)){return false}var F="cmi.interactions."+H[0]+".objectives."+H[2]+".";var E=0;if(this.dataModel.containsKey("cmi.interactions."+H[0]+".objectives._count")){E=Number(this.dataModel.get("cmi.interactions."+H[0]+".objectives._count").Value)}if(B>E-1){if(B==E&&D){return true}else{return false}}else{if(B>=0){return true}}}return false},CreateObjectivesInteraction:function(C,G){var F=C;if(this.startsWith(C,"cmi.interactions.")){F=C.substr("cmi.interactions.".length)}var H=F.split(".");if(H.length>3&&H[1]=="objectives"){var A=Number(H[0]);var B=Number(H[2]);if(isNaN(B)||isNaN(A)){return false}var E="cmi.interactions."+H[0]+".objectives."+H[2]+".";if(!this.dataModel.containsKey("cmi.interactions."+H[0]+".objectives._count")){this.CreateInteraction(C,G)}var D=Number(this.dataModel.get("cmi.interactions."+H[0]+".objectives._count").Value);if(B>D-1||G){if(B==D||G){this.dataModel.replace(E+"id",new CMIComponent(E+"id",null,ScormStatus.StatusBoth,"CMIIdentifier"));if(B>D-1){this.dataModel.get("cmi.interactions."+H[0]+".objectives._count").Value=(B+1).toString()}}}}},GetCorrectResponsesInteractionValue:function(A){if(this.endsWith(A,".correct_responses._count")){this.lastError="0";return this.dataModel.get(A).Value}if(!this.IsValidCorrectResponsesInteractionIndex(A,false)){this.lastError="301";return""}if(this.dataModel.containsKey(A)){var B=this.dataModel.get(A).Value;this.lastError="0";if(B==null){if(this.endsWith(A,".pattern")){this.lastError="301"}B=""}return B}this.lastError="401";return""},SetCorrectResponsesInteractionValue:function(D,G){if(this.endsWith(D,".correct_responses._count")){this.lastError="404";return"false"}if(!this.IsValidCorrectResponsesInteractionIndex(D,true)){this.lastError="351";return"false"}if(this.contains(D,".correct_responses.")&&this.endsWith(D,".pattern")){var H=D.substr(0,D.indexOf(".correct_responses."))+".id";if(!this.dataModel.containsKey(H)||Ext.isEmpty(this.dataModel.get(H).Value)){this.lastError="408";return"false"}var E=D.substr(0,D.indexOf(".correct_responses."))+".type";if(!this.dataModel.containsKey(E)||Ext.isEmpty(this.dataModel.get(E).Value)){this.lastError="408";return"false"}var B=this.GetValue(E);switch(B){case"true-false":case"likert":case"numeric":case"other":var C=Number(D.split(".")[4]);if(isNaN(C)||C!=0){this.lastError="351";return"false"}break;case"choice":case"multiple-choice":case"sequencing":var C=0;var F=D.substr(0,D.indexOf(".correct_responses."))+".correct_responses.";var A=F+C.toString()+".pattern";while(this.dataModel.containsKey(A)){if(A!=D){if(this.dataModel.get(A).Value==G){this.lastError="351";return"false"}}C++;A=F+C.toString()+".pattern"}break}if(!this.CheckDataTypeAndVocab(D,G,"CMIFeedback")){this.lastError="406";return"false"}}this.CreateCorrectResponsesInteraction(D,false);return this.DoSetValue(D,G)},IsValidCorrectResponsesInteractionIndex:function(C,D){var G=C;if(this.startsWith(C,"cmi.interactions.")){G=C.substr("cmi.interactions.".length)}var H=G.split(".");if(H.length>3&&H[1]=="correct_responses"){var A=Number(H[0]);var B=Number(H[2]);if(isNaN(B)||isNaN(A)){return false}var F="cmi.interactions."+H[0]+".correct_responses."+H[2]+".";var E=0;if(this.dataModel.containsKey("cmi.interactions."+H[0]+".correct_responses._count")){E=Number(this.dataModel.get("cmi.interactions."+H[0]+".correct_responses._count").Value)}if(B>E-1){if(B==E&&D){return true}else{return false}}else{if(B>=0){return true}}}return false},CreateCorrectResponsesInteraction:function(C,G){var F=C;if(this.startsWith(C,"cmi.interactions.")){F=C.substr("cmi.interactions.".length)}var H=F.split(".");if(H.length>3&&H[1]=="correct_responses"){var A=Number(H[0]);var B=Number(H[2]);if(isNaN(B)||isNaN(A)){return false}var E="cmi.interactions."+H[0]+".correct_responses."+H[2]+".";if(!this.dataModel.containsKey("cmi.interactions."+H[0]+".correct_responses._count")){this.CreateInteraction(C,G)}var D=Number(this.dataModel.get("cmi.interactions."+H[0]+".correct_responses._count").Value);if(B>D-1||G){if(B==D||G){this.dataModel.replace(E+"pattern",new CMIComponent(E+"pattern",null,ScormStatus.StatusBoth,"CMIFeedback"));if(B>D-1){this.dataModel.get("cmi.interactions."+H[0]+".correct_responses._count").Value=(B+1).toString()}}}}},GetCompletionStatus:function(E){var C=this.InternalGetValue("cmi.completion_threshold");if(Ext.isEmpty(C)){return Ext.isEmpty(E)?"unknown":E}var B=this.InternalGetValue("cmi.progress_measure");if(Ext.isEmpty(B)){return"unknown"}var D=Number(B);var A=Number(C);if(!isNaN(D)&&!isNaN(A)){if(D>=A){return"completed"}else{return"incomplete"}}return E},GetSuccessStatus:function(A){var E=this.GetValue("cmi.scaled_passing_score");if(Ext.isEmpty(E)){return Ext.isEmpty(A)?"unknown":A}var D=this.GetValue("cmi.score.scaled");if(Ext.isEmpty(D)){return"unknown"}var B=Number(E);var C=Number(D);if(!isNaN(B)&&!isNaN(C)){if(C>=B){return"passed"}else{return"failed"}}return A},CheckDataTypeAndVocab:function(A,C,B){switch(B){case"CMIBlank":return this.CheckCMIBlank(C);case"CMIBoolean":return this.CheckCMIBoolean(C);case"CMIDecimalZeroToOne":case"CMIDecimalMinusOneToOne":case"CMIDecimalPositive":case"CMIDecimal":return this.CheckCMIDecimal(C);case"CMIFeedback":return this.CheckCMIFeedback(A,C);case"CMIIdentifier":return this.CheckCMIIdentifier(C);case"CMIInteger":return this.CheckCMIInteger(C);case"CMISInteger":return this.CheckCMISInteger(A,C);case"CMIString255":return this.CheckCMIString255(C);case"CMIString4096":return this.CheckCMIString4096(C);case"CMITime":return this.CheckCMITime(C);case"CMITimespan":return this.CheckCMITimespan(C);case"CMIVocabularyCredit":return this.CheckCMIVocabularyCredit(C);case"CMIVocabularyStatus":return this.CheckCMIVocabularyStatus(A,C);case"CMIVocabularyEntry":return this.CheckCMIVocabularyEntry(C);case"CMIVocabularyMode":return this.CheckCMIVocabularyMode(C);case"CMIVocabularyExit":return this.CheckCMIVocabularyExit(C);case"CMIVocabularyTimeLimitAction":return this.CheckCMIVocabularyTimeLimitAction(C);case"CMIVocabularyInteraction":return this.CheckCMIVocabularyInteraction(C);case"CMIVocabularyResult":return this.CheckCMIVocabularyResult(C);case"CMIDecimalOrCMIBlank":return this.CheckCMIDecimalOrCMIBlank(C);case"CMILocalizedString":return this.CheckCMILocalizedString(C);case"CMILanguage":return this.CheckCMILanguage(C);default:return true}},CheckCMILanguage:function(D){if(Ext.isEmpty(D)){return true}var C=D.split("-");if(C.length<1){return false}if(C[0].length!=2&&C[0].length!=3&&C[0]!="i"&&C[0]!="x"){return false}if(C[0]!="i"&&C[0]!="x"){var B="ab,aa,af,ak,sq,am,ar,an,hy,as,av,ae,ay,az,bm,ba,eu,be,bn,bh,bi,nb,bs,br,bg,my,es,ca,ch,ce,ny,zh,za,cu,cv,kw,co,cr,hr,cs,da,dv,nl,dz,en,eo,et,ee,fo,fj,fi,nl,fr,fy,ff,gd,gl,lg,ka,de,ki,el,kl,gn,gu,ht,ha,he,hz,hi,ho,hu,is,io,ig,id,ia,ie,iu,ik,ga,it,ja,jv,kl,kn,kr,ks,kk,km,ki,rw,ky,kv,kg,ko,kj,ku,kj,lo,la,lv,lb,li,ln,lt,lu,lb,mk,mg,ms,ml,mt,gv,mi,mr,mh,mo,mn,na,nv,nd,nr,ng,ne,se,nd,no,nb,nn,ny,nn,oc,oj,cu,or,om,os,os,pi,pa,fa,pl,pt,oc,pa,ps,qu,rm,ro,rn,ru,sm,sg,sa,sc,gd,sr,sn,ii,sd,si,sk,sl,so,st,nr,es,su,sw,ss,sv,tl,ty,tg,ta,tt,te,th,bo,ti,to,ts,tn,tr,tk,tw,ug,uk,ur,uz,ca,ve,vi,vo,wa,cy,wo,xh,yi,yo,za,zu,";var A="abk,ace,ach,ada,ady,ady,aar,afh,afr,afa,aka,akk,alb,sqi,ale,alg,tut,amh,apa,ara,arg,arc,arp,arn,arw,arm,hye,art,asm,ast,ath,aus,map,ava,ave,awa,aym,aze,ast,ban,bat,bal,bam,bai,bad,bnt,bas,bak,baq,eus,btk,bej,bel,bem,ben,ber,bho,bih,bik,byn,bin,bis,byn,nob,bos,bra,bre,bug,bul,bua,bur,mya,cad,car,spa,cat,cau,ceb,cel,cai,chg,cmc,cha,che,chr,nya,chy,chb,nya,chi,zho,chn,chp,cho,zha,chu,chk,chv,nwc,nwc,cop,cor,cos,cre,mus,and,crp,cpe,cpf,cpp,crh,crh,scr,hrv,cus,cze,ces,dak,dan,dar,day,del,din,div,doi,dgr,dra,dua,dut,nld,dum,dyu,dzo,efi,egy,eka,elx,eng,enm,ang,myv,epo,est,ewe,ewo,fan,fat,fao,fij,fil,fin,fiu,fon,fre,fra,frm,fro,fry,fur,ful,gaa,gla,glg,lug,gay,gba,gez,geo,kat,ger,deu,nds,gmh,goh,gem,kik,gil,gon,gor,got,grb,grc,gre,ell,grn,guj,gwi,hai,hat,hat,hau,haw,heb,her,hil,him,hin,hmo,hit,hmn,hun,hup,iba,ice,isl,ido,ibo,ijo,ilo,smn,inc,ine,ind,inh,ina,ile,iku,ipk,ira,gle,mga,sga,iro,ita,jpn,jav,jrb,jpr,kbd,kab,kac,kal,xal,kam,kan,kau,krc,kaa,kar,kas,csb,kaw,kaz,kha,khm,khi,kho,kik,kmb,kin,kir,tlh,kom,kon,kok,kor,kos,kpe,kro,kua,kum,kur,kru,kut,kua,lad,lah,lam,lao,lat,lav,ltz,lez,lim,lim,lim,lin,lit,jbo,dsb,loz,lub,lua,lui,smj,lun,luo,ltz,lus,mac,mkd,mad,mag,mai,mak,mlg,may,msa,mal,mlt,mnc,mdr,man,mni,mno,glv,mao,mri,mar,chm,mah,mwr,mas,myn,men,mic,min,mwl,mis,moh,mdf,mol,mkh,lol,mon,mos,mul,mun,nah,nau,nav,nde,nbl,ndo,nap,new,nep,new,nia,nic,ssa,niu,nog,non,nai,sme,nde,nor,nob,nno,nub,nym,nya,nyn,nno,nyo,nzi,oci,oji,chu,nwc,ori,orm,osa,oss,oto,pal,pau,pli,pam,pag,pan,pap,paa,per,fas,peo,phi,phn,fil,pon,pol,por,pra,oci,pro,pan,pus,que,roh,raj,rap,rar,roa,rum,ron,rom,run,rus,sal,sam,smi,smo,sad,sag,san,sat,srd,sas,sco,gla,sel,sem,scc,srp,srr,shn,sna,iii,scn,sid,sgn,bla,snd,sin,sit,sio,sms,den,sla,slo,slk,slv,sog,som,son,snk,wen,nso,sot,sai,sma,nbl,spa,suk,sux,sun,sus,swa,ssw,swe,syr,tgl,tah,tai,tgk,tmh,tam,tat,tel,ter,tet,tha,tib,bod,tig,tir,tem,tiv,tlh,tli,tpi,tkl,tog,ton,tsi,tso,tsn,tum,tup,tur,ota,tuk,tvl,tyv,twi,udm,uga,uig,ukr,umb,und,hsb,urd,uzb,vai,cat,ven,vie,vol,vot,wak,wal,wln,war,was,wel,cym,wol,xho,sah,yao,yap,yid,yor,ypk,znd,zap,zen,zha,zul,zun,";if(C[0].length==2&&!this.contains(B,C[0].toLowerCase()+",")){return false}if(C[0].length==3&&!this.contains(A,C[0].toLowerCase()+",")){return false}}if(C.length>1){var E=D.substr(D.indexOf("-")+1);while(!Ext.isEmpty(E)&&E[0]=="("){E=E.substr(1)}while(!Ext.isEmpty(E)&&E[E.length-1]==")"){E=E.substr(0,Math.max(0,E.length-2))}if(E.length<2||E.length>8){return false}}return true},CheckCMILocalizedString:function(D){var B=D;if(this.startsWith(D,"{lang=")){var A=D.indexOf("}");if(A!=-1){var C=D.substr(0,A).substr("{lang=".length);B=D.substr(A+1);if(Ext.isEmpty(C)){return false}if(!this.CheckCMILanguage(C)){return false}}}return this.CheckCMIString4096(B)},CheckCMIDecimalOrCMIBlank:function(D){var A=this.CheckCMIBlank(D);var C=this.CheckCMIDecimal(D);if(A==true||C==true){var B=Number(D);if(!isNaN(B)&&(B>100||B<0)){return false}else{return true}}else{return false}},CheckCMIVocabularyResult:function(B){var A=this.CheckCMIDecimal(B);if(A==true){return true}if(B=="correct"||B=="incorrect"||B=="unanticipated"||B=="neutral"){return true}else{return(this.version12&&B=="wrong")}},CheckCMIVocabularyInteraction:function(A){if(A=="true-false"||A=="multiple-choice"||A=="choice"||A=="fill-in"||A=="long-fill-in"||A=="matching"||A=="other"||A=="performance"||A=="likert"||A=="sequencing"||A=="numeric"){return true}else{return false}},CheckCMIVocabularyTimeLimitAction:function(A){if(A=="exit,message"||A=="exit,no message"||A=="continue,message"||A=="continue,no message"){return true}else{return false}},CheckCMIVocabularyExit:function(A){if(A=="time-out"||A=="suspend"||A=="logout"||A=="normal"||A==""){return true}else{return false}},CheckCMIVocabularyMode:function(A){if(A=="normal"||A=="review"||A=="browse"){return true}else{return false}},CheckCMIVocabularyEntry:function(A){if(A=="ab-initio"||A=="resume"||A==""){return true}else{return false}},CheckCMIVocabularyStatus:function(A,B){if(B=="passed"||B=="completed"||B=="failed"||B=="incomplete"||B=="unknown"||B=="not attempted"){return true}else{if(this.version12){return(B=="browsed")}return false}},CheckCMIVocabularyCredit:function(A){if(A=="credit"||A=="no-credit"){return true}else{return false}},CheckCMITimespan:function(H){if(this.version12){return this.Check12Timespan(H)}if(Ext.isEmpty(H)||!this.startsWith(H,"P")){return false}H=H.substr(1);var G=H.split("T");if(G.length<1||G.length>2){return false}var C=G[0];var E="";if(G.length>1){E=G[1];if(Ext.isEmpty(E)){return false}}var B="";var F;var D;D=C.indexOf("Y");if(D!=-1){B=C.substr(0,D);F=Number(B);if(Ext.isEmpty(B)||isNaN(F)||F<0){return false}C=C.substr(D+1)}D=C.indexOf("M");if(D!=-1){B=C.substr(0,D);F=Number(B);if(Ext.isEmpty(B)||isNaN(F)||F<0){return false}C=C.substr(D+1)}D=C.indexOf("D");if(D!=-1){B=C.substr(0,D);F=Number(B);if(Ext.isEmpty(B)||isNaN(F)||F<0){return false}C=C.substr(D+1)}if(!Ext.isEmpty(C)){return false}if(!Ext.isEmpty(E)){D=E.indexOf("H");if(D!=-1){B=E.substr(0,D);F=Number(B);if(Ext.isEmpty(B)||isNaN(F)||F<0){return false}E=E.substr(D+1)}D=E.indexOf("M");if(D!=-1){B=E.substr(0,D);F=Number(B);if(Ext.isEmpty(B)||isNaN(F)||F<0){return false}E=E.substr(D+1)}D=E.indexOf("S");if(D!=-1){B=E.substr(0,D);if(Ext.isEmpty(B)){return false}var A=B.split(".");if(A.length<1||A.length>2){return false}F=Number(A[0]);if(isNaN(F)||F<0){return false}if(A.length>1){F=Number(A[1]);if(isNaN(F)||F<0||A[1].length>2){return false}}}}return true},Check12Timespan:function(D){if(Ext.isEmpty(D)||!this.contains(D,":")){return false}var C=D.split(":");if(C.length!=3||Ext.isEmpty(C[0])||Ext.isEmpty(C[1])||Ext.isEmpty(C[2])){return false}var B;B=Number(C[0]);if(C[0].length>4||isNaN(B)||B<0){return false}B=Number(C[1]);if(C[1].length!=2||isNaN(B)||B<0||B>59){return false}var A=C[2].split(".");if(A.length<1||A.length>2){return false}B=Number(A[0]);if(A[0].length!=2||isNaN(B)||B<0||B>59){return false}if(A.length>1){B=Number(A[1]);if(A[1].length<1||A[1].length>2||isNaN(B)||B<0){return false}}return true},CheckCMITime:function(B){if(this.version12){return this.Check12Timespan(B)}if(Ext.isEmpty(B)){return false}var G=B.split("T");if(G.length>2){return false}var D=G[0];var C="";if(G.length>1){C=G[1];if(Ext.isEmpty(C)){return false}}var K=D.split("-");if(K.length<1||K.length>3){return false}var F;F=Number(K[0]);if(K[0].length!=4||isNaN(F)||F<1970||F>2038){return false}if(K.length>1){F=Number(K[1]);if(K[1].length!=2||isNaN(F)||F<1||F>12){return false}}if(K.length>2){F=Number(K[2]);if(K[2].length!=2||isNaN(F)||F<1||F>31){return false}}if(!Ext.isEmpty(C)){var J=C.split(":");if(J.length<1||J.length>4){return false}F=Number(J[0]);if(J[0].length!=2||isNaN(F)||F<0||F>23){return false}if(J.length>1){F=Number(J[1]);if(J[1].length!=2||isNaN(F)||F<0||F>59){return false}}if(J.length>2){var L=J[2].split(".");if(L.length<1||L.length>2){return false}F=Number(L[0]);if(L[0].length!=2||isNaN(F)||F<0||F>59){return false}if(L.length>1){var A=L[1];if(J.length>3){A+=":"+J[3]}if(this.endsWith(A,"Z")){A=A.substr(0,A.length-1)}var E="";var I=-1;if(this.contains(A,"+")){I=A.indexOf("+")}else{if(this.contains(A,"-")){I=A.indexOf("-")}}if(I!=-1){E=A.substr(I);A=A.substr(0,I)}F=Number(A);if(A.length<1||A.length>2||isNaN(F)){return false}if(!Ext.isEmpty(E)){if(!this.startsWith(E,"+")&&!this.startsWith(E,"-")){return false}E=E.substr(1);var H=E.split(":");if(H.length<1||H.length>2){return false}F=Number(H[0]);if(H[0].length!=2||isNaN(F)||F<0||F>23){return false}if(H.length>1){F=Number(H[1]);if(H[1].length!=2||isNaN(F)||F<0||F>59){return false}}}}}}return true},CheckCMIString4096:function(A){return true},CheckCMIString255:function(A){return true},CheckCMISInteger:function(B,C){var A=Number(C);if(isNaN(A)){return false}else{if(A>=-32768&&A<=32768){if(B=="cmi.student_preference.audio"){if(A<-1||A>100){return false}else{return true}}else{if(B=="cmi.student_preference.speed"){if(A<-100||A>100){return false}else{return true}}else{if(B=="cmi.student_preference.text"){if(A<-1||A>1){return false}else{return true}}else{return true}}}}else{return false}}},CheckCMIInteger:function(B){var A=Number(B);if(isNaN(A)){return false}else{if(A>=0&&A<=65536){return true}else{return false}}},CheckCMIIdentifier:function(F){var D=" ";var A="\t";var C="\r";var E="\n";if(this.startsWith(F,"urn:")){F=F.substr("urn:".length);var B=F.indexOf(":");if(B==-1){return false}F=F.substr(B+1)}if(F.indexOf(D)==-1&&F.indexOf(A)==-1&&F.indexOf(C)==-1&&F.indexOf(E)==-1){if(F.length>0&&F.length<4000){return true}else{return false}}else{return false}},CheckCMIFeedback:function(A,C){var I=A.split(".");var D=Number(I[2]);if(isNaN(D)){return false}var G=this.GetValue("cmi.interactions._count");var H=Number(G);if(isNaN(H)||D>=H){return false}var B="cmi.interactions."+D+".type";var E=this.GetValue(B);if(Ext.isEmpty(E)){return false}var F=this.endsWith(A,".pattern");switch(E){case"true-false":return this.CheckTrueFalse(C);case"choice":case"multiple-choice":return this.CheckChoice(C);case"fill-in":if(F){return this.CheckFillInPattern(C)}return this.CheckFillIn(C);case"long-fill-in":if(F){return this.CheckLongFillInPattern(C)}return this.CheckLongFillIn(C);case"numeric":if(F){return this.CheckNumericPattern(C)}return this.CheckCMIDecimal(C);case"likert":return this.CheckLikert(C);case"matching":return this.CheckMatching(C);case"performance":if(F){return this.CheckPerformancePattern(C)}return this.CheckPerformance(C);case"sequencing":return this.CheckSequencing(C);case"other":return this.CheckCMIString4096(C);default:return false}},CheckNumericPattern:function(D){if(Ext.isEmpty(D))