|
From: <luc...@us...> - 2013-10-21 14:12:04
|
Revision: 4432
http://openutils.svn.sourceforge.net/openutils/?rev=4432&view=rev
Author: lucaboati
Date: 2013-10-21 14:12:00 +0000 (Mon, 21 Oct 2013)
Log Message:
-----------
fix rules, fix js, IE compatible
Modified Paths:
--------------
magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/ActivityTree.js
magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/AuxClass.js
magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/GlobalSharedObjective.js
magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/IScorm.js
magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/Objective.js
magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/RollupProcess.js
magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/TrackingModel.js
magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/api_scorm.js
magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/store.js
magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/validator.js
Modified: magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/ActivityTree.js
===================================================================
--- magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/ActivityTree.js 2013-10-21 13:58:10 UTC (rev 4431)
+++ magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/ActivityTree.js 2013-10-21 14:12:00 UTC (rev 4432)
@@ -45,6 +45,7 @@
*/
start: function(){
var req = this.suspendedActivity ? "resumeall" : !this.current ? "start" :"";
+ this.recHideAndDisable()
this.overallSequencingProcess(req);
},
@@ -63,7 +64,7 @@
var toEncode = new Hash({
objectives: new Hash(),
tracks: new Hash(),
- suspendedActivity: this.suspendedActivity ? this.suspendedActivity.getName() : "",
+ suspendedActivity: this.suspendedActivity ? this.suspendedActivity.getName() : ""
});
function recExplo(node,i){
@@ -206,12 +207,12 @@
return{
activity: null,
endSs: fs.endSs,
- exception: fs.exception,
+ exception: fs.exception
}
}else{
return{
activity: fs.activity,
- exception: null,
+ exception: null
}
}
}
@@ -526,7 +527,7 @@
activity: fats.activity,
deliverable: fats.deliverable,
endSs: fats.endSs,
- exception: fats.exception,
+ exception: fats.exception
};
}
},
@@ -595,7 +596,7 @@
return {
activity: node,
deliverable: false,
- exception: "SB.2.2-1",
+ exception: "SB.2.2-1"
};
}
/*
@@ -612,7 +613,7 @@
activity: node,
deliverable: false,
endSs: ftts.endSs,
- exception: ftts.exception,
+ exception: ftts.exception
};
/* 3.3 */
}else{
@@ -640,7 +641,7 @@
return {
deliverable: false,
activity: node,
- exception: "SB.2.2-2",
+ exception: "SB.2.2-2"
};
}
/* 6 */
@@ -999,7 +1000,7 @@
});
this.current = this.root;
temp.valid = true;
- temp. sequencingRequest = 'exit';
+ temp.sequencingRequest = 'exit';
return temp;
break;
}
@@ -1015,7 +1016,7 @@
if(node.options.data.item.sequencing.deliveryControls.tracked == true){
if (node.options.data.item.sequencing.deliveryControls.completionSetByContent==false
&& node.options.data.track.getAttemptProgressStatus()==false){
- node.options.data.track.getAttemptProgressStatus()==true;
+ node.options.data.track.setAttemptProgressStatus(true);
node.options.data.track.setAttemptCompletionStatus(true);
}
if (node.options.data.item.sequencing.deliveryControls.objectiveSetByContent==false){
@@ -1046,9 +1047,14 @@
new RollupProcess(node,this).overallRollupProcess();
node.deselectNode();
- console.debug("Attempt end: " + node.options.label);
+ this.recHideAndDisable()
if (!node.options.enabled && !node.options.data.track.activityIsActive){
- node.disable();
+ try{
+ node.disable();
+ }catch(e){
+ //non facciamo niente, potrebbe esserci un errore di mootools
+ //facendo il fade del nodo
+ }
}
// API_1484_11 = null;
$('scormFrame').src = null;
@@ -1078,7 +1084,7 @@
/* Overall Sequencing Process [OP.1] */
overallSequencingProcess: function(request,target){
- at.clearDebounce.delay(1000);
+ at.clearDebounce.delay(1000,at);
var pendingRequest;
@@ -1094,7 +1100,7 @@
if (nr.valid==false){
/* handle exception */
- console.error('Sequencing request process exception: ',nr.exception);
+// console.error('Sequencing request process exception: ',nr.exception);
return;
}
target=nr.target;
@@ -1102,7 +1108,7 @@
var tr = this.terminationRequestProcess(nr.terminationRequest.toLowerCase());
if (!tr.valid){
/* handle exception */
- console.error('Sequencing request process exception: ',tr.exception);
+// console.error('Sequencing request process exception: ',tr.exception);
return;
}
if (tr.sequencingRequest){
@@ -1115,7 +1121,7 @@
var sr = this.sequencingRequestProcess(nr.sequencingRequest.toLowerCase(),target);
if (!sr.valid){
/* handle exception */
- console.error('Sequencing request process exception: ',sr.exception);
+// console.error('Sequencing request process exception: ',sr.exception);
return;
}
/* 1.4.3 */
@@ -1130,7 +1136,7 @@
// }else{
// location.reload();
// }
- console.info("End sequencing session");
+// console.info("End sequencing session");
return;
/*
* Exit Overall Sequencing Process - the sequencing session has
@@ -1147,7 +1153,7 @@
if (delivery){
var drp = this.deliveryRequestProcess(delivery);
if (false == drp.valid){
- console.log(drp);
+// console.log(drp);
return;
}
this.contentDeliveryEnvironmentProcess(delivery);
@@ -1228,64 +1234,8 @@
this.scormPlayer.layout.buttons.previousBtn.setEnabled(false);
}
- function recHideAndDisable(node,at,rec,rec2){
- node.enable()
- var descend = false;
- var descend2 = false;
- var rp = new RollupProcess(node,at);
-// var nr = navigationRequest["choice"].bind(at)(node);
-// var nr = at.choiceSequencingRequestProcess(delivery);
- var current = at.current;
- var nr = at.sequencingRequestProcess('choice',node,true);
- at.current = current;
-
- if(nr.valid==false ){
-// if(nr.exception!=null){
- node.disable();
- }
-
- if (rp.sequencingRulesCheckProcess(node,['disabled'])|| rec){
- node.disable();
- descend = true
- }
-
- if (node != delivery
- && !!node.options.data.item.sequencing.limitConditions
- && !!node.options.data.item.sequencing.limitConditions.attemptLimit
- && node.options.data.track.activityAttemptCount >= node.options.data.item.sequencing.limitConditions.attemptLimit || rec2){
- node.disable();
- descend2 = true;
- }
-
- if (node.nodes){
- node.nodes.each(function(n){
- recHideAndDisable(n, at, descend, descend2);
- })
- }
- var f = new Fx.Slide(node.domObj);
- f.show();
-
- if (rp.sequencingRulesCheckProcess(node,['hiddenfromchoice'])){
- new Fx.Slide(node.domObj).hide();
- }
- /*
- * isvisible (optional): The isvisible attribute indicates whether
- * or not this item is displayed when the structure of the package
- * is displayed or rendered. If not present, value is defaulted to
- * be true [3]. The value only affects the item for which it is
- * defined and not the children of the item or a resource associated
- * with an item. XML Data Type: xs:boolean.
- */
- if (node.options.data.item.isvisible == false){
- new Fx.Slide(node.domLabel.getParent()).hide();
- }
- }
+ this.recHideAndDisable();
-
-
-
- recHideAndDisable(this.root,this);
-
var path = delivery.pathFromRoot().reverse();
path.each(function(n){
if (n.getControlMode().choiceExit==false){
@@ -1346,7 +1296,7 @@
if (delivery.nodes){
return {
valid: false,
- exception: "DB.1.1-1",
+ exception: "DB.1.1-1"
};
}
var actPath = delivery.pathFromRoot();
@@ -1354,7 +1304,7 @@
if (actPath.length == 0){
return {
valid: false,
- exception: "DB.1.1-2",
+ exception: "DB.1.1-2"
};
}
var toReturn = {valid: true, exception: null};
@@ -1447,7 +1397,7 @@
this.debounce = true;
this.overallSequencingProcess('exitall');
this.debounce = false;
- window.close();
+ //window.close();
}
},
@@ -1510,8 +1460,8 @@
}),
pause: new Element('img',{
src: contextPath + ".resources/mgnllms/icons/pause.png"
- }),
- },
+ })
+ }
};
node.setOptions(options);
@@ -1566,5 +1516,61 @@
this.objectives[obj.id].update(obj,this);
},this);
this.current.options.data.track.update(s);
+ },
+ /**
+ * rec e rec2 servono per disabilitare tutto un ramo una volta che trovo un nodo da disabilitare
+ */
+ recHideAndDisable: function (node,rec,rec2){
+ if (!node){
+ node = this.root
+ }
+ node.enable()
+ var descend = false
+ ,descend2 = false
+ ,rp = new RollupProcess(node,this)
+ ,current = this.current
+ ,nr = this.sequencingRequestProcess('choice',node,true);
+
+ this.current = current;
+
+ if(nr.valid==false ){
+ node.disable();
+ }
+
+ if (rp.sequencingRulesCheckProcess(node,['disabled'])|| rec){
+ node.disable();
+ descend = true
+ }
+
+ if (node
+ && !!node.options.data.item.sequencing.limitConditions
+ && !!node.options.data.item.sequencing.limitConditions.attemptLimit
+ && node.options.data.track.activityAttemptCount >= node.options.data.item.sequencing.limitConditions.attemptLimit || rec2){
+ node.disable();
+ descend2 = true;
+ }
+
+ if (node.nodes){
+ node.nodes.each(function(n){
+ this.recHideAndDisable(n, descend, descend2);
+ },this)
+ }
+ var f = new Fx.Slide(node.domObj);
+ f.show();
+
+ if (rp.sequencingRulesCheckProcess(node,['hiddenfromchoice'])){
+ new Fx.Slide(node.domObj).hide();
+ }
+ /*
+ * isvisible (optional): The isvisible attribute indicates whether
+ * or not this item is displayed when the structure of the package
+ * is displayed or rendered. If not present, value is defaulted to
+ * be true [3]. The value only affects the item for which it is
+ * defined and not the children of the item or a resource associated
+ * with an item. XML Data Type: xs:boolean.
+ */
+ if (node.options.data.item.isvisible == false){
+ new Fx.Slide(node.domLabel.getParent()).hide();
+ }
}
});
\ No newline at end of file
Modified: magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/AuxClass.js
===================================================================
--- magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/AuxClass.js 2013-10-21 13:58:10 UTC (rev 4431)
+++ magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/AuxClass.js 2013-10-21 14:12:00 UTC (rev 4432)
@@ -204,6 +204,7 @@
COMPLETED: function(rc) {
var res =scormAND(this.tm.getAttemptProgressStatus(),this.tm.getAttemptCompletionStatus());
+ //var res =this.tm.getAttemptCompletionStatus();
return res;
},
ACTIVITYPROGRESSKNOWN: function(rc) {
@@ -256,7 +257,7 @@
terminationRequest: null,
sequencingRequest: 'start',
targetActivity: null,
- exception: null,
+ exception: null
};
}else{
return {
@@ -264,7 +265,7 @@
terminationRequest: null,
sequencingRequest: null,
targetActivity: null,
- exception: "NB.2.1-1",
+ exception: "NB.2.1-1"
};
}
},
@@ -607,5 +608,5 @@
temp.exception = 'NB.2.1-2';
return temp;
}
- },
+ }
});
\ No newline at end of file
Modified: magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/GlobalSharedObjective.js
===================================================================
--- magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/GlobalSharedObjective.js 2013-10-21 13:58:10 UTC (rev 4431)
+++ magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/GlobalSharedObjective.js 2013-10-21 14:12:00 UTC (rev 4432)
@@ -20,5 +20,5 @@
this.toJSON = _toJSON(/^(_current|id|caller)$/,
this);
this.fromJSON = _fromJSON.bind(this);
- },
+ }
});
\ No newline at end of file
Modified: magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/IScorm.js
===================================================================
--- magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/IScorm.js 2013-10-21 13:58:10 UTC (rev 4431)
+++ magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/IScorm.js 2013-10-21 14:12:00 UTC (rev 4432)
@@ -75,8 +75,8 @@
}),
pause: new Element('img',{
src: contextPath + ".resources/mgnllms/icons/pause.png"
- }),
- },
+ })
+ }
};
node.setOptions(options);
@@ -125,7 +125,7 @@
found = this.owner.nodes[this.options.data.index-i];
}while(!found && this.options.data.index-i == 0);
return found;
- },
+ }
});
var ScormTreeItem = new Class({
@@ -178,7 +178,7 @@
var ScormTree = new Class({
Extends: Jx.Tree,
- Implements: IScorm,
+ Implements: IScorm
});
function defaulter (item,seqCollection){
@@ -210,7 +210,7 @@
completionSetByContent: item.sequencing.deliveryControls.completionSetByContent ==
null ? false: item.sequencing.deliveryControls.completionSetByContent,
objectiveSetByContent: item.sequencing.deliveryControls.objectiveSetByContent ==
- null ? false: item.sequencing.deliveryControls.objectiveSetByContent,
+ null ? false: item.sequencing.deliveryControls.objectiveSetByContent
};
/*
@@ -220,14 +220,14 @@
item.completionThreshold = {
completedByMeasure: !item.completionThreshold.completedByMeasure ? false : item.completionThreshold.completedByMeasure,
minProgressMeasure: !item.completionThreshold.minProgressMeasure ? 1.0 : item.completionThreshold.minProgressMeasure,
- progressWeight: !item.completionThreshold.progressWeight ? 1.0 : item.completionThreshold.progressWeight,
+ progressWeight: !item.completionThreshold.progressWeight ? 1.0 : item.completionThreshold.progressWeight
};
if (!item.sequencing.constrainedChoiceConsiderations) item.sequencing.constrainedChoiceConsiderations = {};
item.sequencing.constrainedChoiceConsiderations = {
preventActivation : !item.sequencing.constrainedChoiceConsiderations.preventActivation ? false : item.sequencing.constrainedChoiceConsiderations.preventActivation,
- constrainChoice : !item.sequencing.constrainedChoiceConsiderations.constrainChoice ? false : item.sequencing.constrainedChoiceConsiderations.constrainChoice,
+ constrainChoice : !item.sequencing.constrainedChoiceConsiderations.constrainChoice ? false : item.sequencing.constrainedChoiceConsiderations.constrainChoice
};
if (!item.sequencing.rollupRules) item.sequencing.rollupRules ={};
@@ -235,7 +235,7 @@
rollupObjectiveSatisfied: !item.sequencing.rollupRules.rollupObjectiveSatisfied ? true: item.sequencing.rollupRules.rollupObjectiveSatisfied,
rollupProgressCompletion: !item.sequencing.rollupRules.rollupProgressCompletion ? true: item.sequencing.rollupRules.rollupProgressCompletion,
objectiveMeasureWeight: !item.sequencing.rollupRules.objectiveMeasureWeight ? 1.0000: item.sequencing.rollupRules.objectiveMeasureWeight,
- rollupRule: !item.sequencing.rollupRules.rollupRule ? [] : item.sequencing.rollupRules.rollupRule,
+ rollupRule: !item.sequencing.rollupRules.rollupRule ? [] : item.sequencing.rollupRules.rollupRule
};
if (!item.sequencing.rollupConsiderations) item.sequencing.rollupConsiderations = {};
Modified: magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/Objective.js
===================================================================
--- magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/Objective.js 2013-10-21 13:58:10 UTC (rev 4431)
+++ magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/Objective.js 2013-10-21 14:12:00 UTC (rev 4432)
@@ -3,6 +3,9 @@
// se vengono cambiati i nomi delle variabili che persistono i
// dati nel jcr, cambiare i corrispondenti campi in
// MagnoliaLearnerActivitiesManager.java
+
+//PATCH aggiunto ai setter degli attribuiti degli obiettivi la propagazione utilizzando le mapInfo
+
var Objective = new Class(
{
initialize : function(objective, node, at) {
@@ -218,18 +221,22 @@
setObjectiveProgressStatus : function(v) {
this._objectiveProgressStatus = v
+ this.writeObjectiveMaps()
},
setObjectiveNormalizedMeasure : function(v) {
this._objectiveNormalizedMeasure = parseFloat(v);
+ this.writeObjectiveMaps()
},
setObjectiveSatisfiedStatus : function(v) {
this._objectiveSatisfiedStatus = v;
+ this.writeObjectiveMaps()
},
setObjectiveMeasureStatus : function(v) {
this._objectiveMeasureStatus = v
+ this.writeObjectiveMaps()
}
});
\ No newline at end of file
Modified: magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/RollupProcess.js
===================================================================
--- magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/RollupProcess.js 2013-10-21 13:58:10 UTC (rev 4431)
+++ magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/RollupProcess.js 2013-10-21 14:12:00 UTC (rev 4432)
@@ -116,7 +116,7 @@
target.setObjectiveSatisfiedStatus(false);
}
}else{
- target.setObjectiveProgressStatus(false);
+ //target.setObjectiveProgressStatus(false);
}
}
}
@@ -145,11 +145,11 @@
rollupCondition: [{
condition: 'satisfied',
operator: 'noop'
- }],
+ }]
}),
rollupAction: new Hash({
action: 'satisfied'
- }),
+ })
});
/*
@@ -184,9 +184,11 @@
/* Activity Progress Rollup Using Measure Process [RB.1.3 a] */
activityRollupUsingMeasureProcess: function(node){
var tm = node.options.data.track;
- tm.setAttemptProgressStatus(false);
- tm.setAttemptCompletionStatus(false);
if (node.options.data.item.completionThreshold.completedByMeasure == true){
+
+ tm.setAttemptProgressStatus(false);
+ tm.setAttemptCompletionStatus(false);
+
if (tm.attemptCompletionAmount == 0){
tm.setAttemptCompletionStatus(false);
}else{
@@ -199,7 +201,7 @@
}
}
}else{
- tm.setAttemptProgressStatus(false);
+ //tm.setAttemptProgressStatus(false);
}
},
@@ -225,11 +227,11 @@
rollupCondition: [{
condition: 'completed',
operator: 'noop'
- }],
+ }]
}),
rollupAction: new Hash({
action: 'completed'
- }),
+ })
});
/*
@@ -391,8 +393,19 @@
}
},this);
}
- return !!contributingChildren.length
- && contributingChildren[rr.childActivitySet.toLowerCase()](function(i){return i && i!='unknown'},rr.minimumCount ? rr.minimumCount : rr.minimumPercent);
+
+ var child = contributingChildren[rr.childActivitySet.toLowerCase()](
+ function(i){
+ return i && i!='unknown'
+ },
+ rr.minimumCount ? rr.minimumCount : rr.minimumPercent
+ );
+
+ // vecchia funzione
+ // && contributingChildren[rr.childActivitySet.toLowerCase()](function(i){return i && i!='unknown'},rr.minimumCount ? rr.minimumCount : rr.minimumPercent);
+ var check = !!contributingChildren.length && child ;
+
+ return check;
},this);
},
Modified: magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/TrackingModel.js
===================================================================
--- magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/TrackingModel.js 2013-10-21 13:58:10 UTC (rev 4431)
+++ magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/TrackingModel.js 2013-10-21 14:12:00 UTC (rev 4432)
@@ -165,7 +165,7 @@
}else{
/*No objective defined for the activity, create artificial objective for tracking purpose*/
- this.primaryObjective = new Objective({objectiveID:"artificialObjective-"+this.node.options.data.item.identifier,mapInfo: new Hash()},this.node,node.at);
+ this.primaryObjective = new Objective({objectiveID:"artificialObjective-"+this.node.options.data.item.identifier,mapInfo: new Hash()},this.node,this.node.at);
this.primaryObjective.setPrimary();
this.at.objectives.set(this.primaryObjective.id,this.primaryObjective);
this.objectives.push(this.primaryObjective.id);
@@ -224,7 +224,7 @@
} else {
return this._attemptCompletionAmount;
}
- },
+ }
});
Modified: magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/api_scorm.js
===================================================================
--- magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/api_scorm.js 2013-10-21 13:58:10 UTC (rev 4431)
+++ magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/api_scorm.js 2013-10-21 14:12:00 UTC (rev 4432)
@@ -12,12 +12,16 @@
GetValue : function(cmiKey) {
try {
validatorGetValueStatus(this.status);
- r = this.s.get(cmiKey);
+ var r = this.s.get(cmiKey);
+ if(cmiKey.indexOf("_children") > 0 && $type(r)=="array" ){
+ r = r.join(',');
+ }
+ //console.info("GetValue",cmiKey," -> ",r)
this.lastError = 0;
return r;
} catch (e) {
this.lastError = e.errorNumber;
- console.error(e.message);
+ //console.error(e.message);
return "";
}
},
@@ -25,24 +29,26 @@
SetValue : function(cmiKey, value) {
try {
validatorSetValueStatus(this.status);
- console.info("SetValue",cmiKey,value)
+ //console.info("SetValue",cmiKey,value)
this.s.set(cmiKey, value);
this.lastError = 0;
return "true";
} catch (e) {
this.lastError = e.errorNumber;
- console.error(e.message);
+ //console.error(e.message);
return "false"
}
},
GetLastError : function() {
- console.info("GetLastError: " + this.lastError);
+ if(this.lastError){
+ //console.info("GetLastError: " + this.lastError);
+ }
return this.lastError;
},
GetErrorString : function(input) {
- console.info("GetErrorString ", input, " ", ErrorMessages[input]);
+ //console.info("GetErrorString ", input, " ", ErrorMessages[input]);
return ErrorMessages[input]?ErrorMessages[input]:"";
},
@@ -52,7 +58,7 @@
Initialize : function(input) {
try {
- console.group("Initialize");
+ //console.group("Initialize");
validatorEmptyStringInput(input);
validatorInitializeStatus(this.status);
new Request({
@@ -60,7 +66,7 @@
url: this.at.context+urlPersistence,
async : false,
onSuccess:function(response){
- var decodedJson = JSON.decode(response)
+ var decodedJson = JSON.decode(response);
new Hash(decodedJson.cmi).each(function(v,k){
if (v.array){
if (k=="interactions"){
@@ -83,14 +89,17 @@
}
},this);
+ if(decodedJson != null && decodedJson.adl!=null)
+ {
decodedJson.adl.each(function(v,i){
this.s.adl.data.array.push(new Hash({
id : v.id,
store : v.store,
readSharedData: v.readSharedData,
- writeSharedData: v.writeSharedData,
+ writeSharedData: v.writeSharedData
}));
},this);
+ }
if (this.s.cmi.entry != "ab-initio"){
switch (this.s.cmi.exit){
case "suspend":
@@ -108,7 +117,7 @@
command: 'initialize',
mgnlPath: path,
mgnlRepository: 'lms',
- activityId : this.node.getName(),
+ activityId : this.node.getName()
});
this.lastError = 0;
this.status = RUNNING;
@@ -116,7 +125,7 @@
return "true";
} catch (e) {
this.lastError = e.errorNumber?e.errorNumber:1000;
- console.error(e.message?e.message:"Module error",e);
+ //console.error(e.message?e.message:"Module error",e);
this.at.debounce = false;
return "false"
}
@@ -129,8 +138,8 @@
if (this.s.cmi.total_time && this.s.cmi.session_time){
this.s.cmi.total_time = new ScormTime(this.s.cmi.total_time).add(new ScormTime(this.s.cmi.session_time)).time;
}
- console.info("Terminate", this.node.options.label);
- console.groupEnd()
+ //console.info("Terminate", this.node.options.label);
+ //console.groupEnd()
validatorEmptyStringInput(input);
validatorTerminateStatus(this.status);
this.lastError = 0;
@@ -143,35 +152,60 @@
url: this.at.context+urlPersistence,
async : false,
onSuccess: function(response){
- console.log(response);
+ //console.log(response);
}.bind(this),
onFailure: function(){
throw new ScormError(391)
}
}).post({
command: 'terminate',
- values: this.s.cmi.exit == "suspend" ? JSON.encode(new Hash(this.s.cmi).filter(function(item,key){
+ values: JSON.encode(new Hash(this.s.cmi).filter(function(item,key){
return !/^(completion_threshold|launch_data|max_time_allowed|scaled_passing_score|time_limit_action|version)$/.test(key);
- })).slice(1,-1): "",
+ })).slice(1,-1),
adldata: JSON.encode(this.s.adl.data.array),
+ 'cmi.exit': this.s.cmi.exit,
mgnlPath: path,
mgnlRepository: 'lms',
- activityId : this.node.getName(),
+ activityId : this.node.getName()
});
+
if (this.s.adl.nav.request!='_none_'){
this.at.overallSequencingProcess(this.s.adl.nav.request);
}
+
+ //LB questa chiamata richiama il processo di exitall per far parsare correttamente gli stati success e satistied
+ // l'alberatura si chiuederà ma va bene cosi.
+ this.at.endAttemptProcess(this.at.current);
+
+ //LB richiamo il setStatus per memorizzare i dati.
+ var current = this.at;
+ var json = current.toJSON();
+
+ new Request({
+ method: 'post',
+ url: this.at.context+urlPersistence,
+ async: false,
+ onSuccess: function(response){
+ //console.log(response);
+ }.bind(this)
+ }).post({
+ courseStatus: json,
+ mgnlPath: path,
+ mgnlRepository: 'lms',
+ command: 'setStatus'
+ });
+
return "true";
} catch (e) {
this.lastError = e.errorNumber;
- console.error(e.message);
+ //console.error(e.message);
return "false"
}
},
Commit : function(input) {
try {
- console.info("Commit");
+ //console.info("Commit");
validatorEmptyStringInput(input);
validatorCommitStatus(this.status);
new Request({
@@ -179,7 +213,7 @@
url: this.at.context+urlPersistence,
async : false,
onSuccess: function(response){
- console.log(response);
+ //console.log(response);
}.bind(this),
onFailure: function(){
throw new ScormError(391)
@@ -192,13 +226,13 @@
adldata: JSON.encode(this.s.adl.data.array),
mgnlPath: path,
mgnlRepository: 'lms',
- activityId : this.node.getName(),
+ activityId : this.node.getName()
});
this.lastError = 0;
return "true";
} catch (e) {
this.lastError = e.errorNumber;
- console.error(e.message);
+ //console.error(e.message);
return "false"
}
},
@@ -209,5 +243,5 @@
_getStore: function(){
return this.s;
- },
+ }
});
\ No newline at end of file
Modified: magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/store.js
===================================================================
--- magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/store.js 2013-10-21 13:58:10 UTC (rev 4431)
+++ magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/store.js 2013-10-21 14:12:00 UTC (rev 4432)
@@ -20,7 +20,7 @@
406 : "Data Model Element Type Mismatch",
407 : "Data Model Element Value Out Of Range",
408 : "Data Model Dependency Not Established",
- 1000: "Module error",
+ 1000: "Module error"
});
NOT_INITIALIZED = 0;
@@ -35,7 +35,7 @@
+ ErrorMessages.get(this.errorNumber);
if (info) {
this.info = info;
- console.error(errorNumber,this.info)
+// console.error(errorNumber,this.info)
}
}
});
@@ -53,16 +53,16 @@
audio_level : 1,
language: "",
delivery_speed : 1,
- audio_captioning: 0,
+ audio_captioning: 0
}),
completion_status: "unknown",
success_status: "unknown",
- completion_threshold: "",
+ completion_threshold: ""
},
adl : {
nav: $empty(),
- data: $empty(),
+ data: $empty()
},
initialize : function(at) {
Modified: magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/validator.js
===================================================================
--- magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/validator.js 2013-10-21 13:58:10 UTC (rev 4431)
+++ magnoliamodules/trunk/openutils-mgnllms/src/main/resources/mgnl-resources/mgnllms/js/validator.js 2013-10-21 14:12:00 UTC (rev 4432)
@@ -131,6 +131,11 @@
var splitted = value.split("[,]");
var splittedHash = new Hash();
+ /*
+ * Chissà a cosa sarebbe dovuto servire. Commentato il codice perchè altrimenti non è possibile
+ * inserire due pattern uguali in diverse interaction
+ * RTE REQ_64.7.2.7.1 (verificato anche nella versione più attuale della documentazione)
+ * commentiamo comunque questa verifica
for ( var i = 0; i < this.cmi.interactions.array.length; i++) {
for (j = 0; j < this.cmi.interactions.array[i].correct_responses.array.length; j++) {
if (this.cmi.interactions.array[i].correct_responses.array[j].pattern == value) {
@@ -138,6 +143,7 @@
}
}
}
+ */
if (value != "") {
for ( var i = 0; i < splitted.length; i++) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|