|
@@ -108,9 +108,19 @@ function printCommandText (code) {
|
|
|
// @calledby Recursive, "parserCodeVisual(.)": preparedFunction.commands = parseCommands(rawFunction.commands, preparedFunction);
|
|
|
// @calledby Generic parser, "parseCommands(.)": temp.push(parseCommands(command, function_obj));
|
|
|
// @calledby Each parser command as "function parseIfTrue(command,function_obj)": "ifTrueBlock=parseCommands(command.ifTrue,function_obj)" and "ifFalseBlock=parseCommands(command.ifFalse,function_obj)"
|
|
|
+// Sequence calls:
|
|
|
+// parserCodeVisual here
|
|
|
+// js/util/iassignHelpers.js!setPreviousAlgorithm(code): var result = parserCodeVisual(code_obj);
|
|
|
+// js/iassign-integration-functions.js!prepareActivityToStudent(ilm_cont, ignore_logs = false): var result = ivprogCore.setPreviousAlgorithm(ilm_cont);
|
|
|
+// js/iassign-integration-functions.js!getiLMContent(): prepareActivityToStudent(data);
|
|
|
export function parserCodeVisual (code_obj = null) {
|
|
|
- console.log("codeParser.js!parserCodeVisual(.): code_obj has " + printCommandText(code_obj)); // JSON.stringify(code_obj));
|
|
|
- //D console.trace();
|
|
|
+ console.log("js/util/codeParser.js!parserCodeVisual(.): code_obj has " + printCommandText(code_obj)); // JSON.stringify(code_obj));
|
|
|
+ if (!code_obj || code_obj===null) { // Avoid severe error! parserCodeVisual@http://localhost/ivprog/ivprogh/js/main.ecdd914f315cb1bf2925.js:11054:5...
|
|
|
+ console.log("js/util/codeParser.js!parserCodeVisual(.): code_obj is empty: " + code_obj); // JSON.stringify(code_obj));
|
|
|
+ //D console.trace();
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ // console.trace();
|
|
|
window.conteudo = code_obj
|
|
|
|
|
|
// Globals:
|
|
@@ -129,6 +139,8 @@ export function parserCodeVisual (code_obj = null) {
|
|
|
}
|
|
|
})
|
|
|
});
|
|
|
+ console.log("codeParser.js!parserCodeVisual(.): finished!");
|
|
|
+ return true; // set to js/util/iassignHelpers.js!setPreviousAlgorithm(code) success
|
|
|
}
|
|
|
|
|
|
|
|
@@ -231,6 +243,10 @@ function parseAttribution (command, function_obj) {
|
|
|
function parseComment (command, function_obj) {
|
|
|
// return new Models.Comment(null);
|
|
|
var comment_text = new Models.VariableValueMenu(VariableValueMenuManagement.VAR_OR_VALUE_TYPES.only_value, command.comment_text, null, null, false);
|
|
|
+ console.log("js/util/codeParser.js!parseComment(.): comment_text=" + comment_text);
|
|
|
+ if (!comment_text || comment_text === null) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
return new Models.Comment(comment_text);
|
|
|
}
|
|
|
|