|
@@ -30,13 +30,18 @@ function getAnswer () {
|
|
if (iLMparameters.iLM_PARAM_SendAnswer == 'false') {
|
|
if (iLMparameters.iLM_PARAM_SendAnswer == 'false') {
|
|
// Montar o retorno com a resposta do aluno
|
|
// Montar o retorno com a resposta do aluno
|
|
var contentToSend = previousContent.split("\n::algorithm::")[0];
|
|
var contentToSend = previousContent.split("\n::algorithm::")[0];
|
|
- contentToSend += '\n::algorithm::\n';
|
|
|
|
- contentToSend += JSON.stringify(window.program_obj, function(key, value) {
|
|
|
|
- if (key == 'dom_object') {
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- return value;
|
|
|
|
- });
|
|
|
|
|
|
+ contentToSend += '\n::algorithm::';
|
|
|
|
+
|
|
|
|
+ if (settingsProgrammingTypes == "textual") {
|
|
|
|
+ contentToSend += ivprogCore.CodeEditor.getCode();
|
|
|
|
+ } else {
|
|
|
|
+ contentToSend += JSON.stringify(window.program_obj, function(key, value) {
|
|
|
|
+ if (key == 'dom_object') {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ return value;
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
|
|
contentToSend += '\n::logs::';
|
|
contentToSend += '\n::logs::';
|
|
contentToSend += getTrackingLogs();
|
|
contentToSend += getTrackingLogs();
|
|
@@ -53,7 +58,7 @@ function getAnswer () {
|
|
+ ' } ';
|
|
+ ' } ';
|
|
|
|
|
|
if ($("input[name='include_algo']").is(':checked')) {
|
|
if ($("input[name='include_algo']").is(':checked')) {
|
|
- ret += '\n::algorithm::\n';
|
|
|
|
|
|
+ ret += '\n::algorithm::';
|
|
ret += JSON.stringify(window.program_obj, function(key, value) {
|
|
ret += JSON.stringify(window.program_obj, function(key, value) {
|
|
|
|
|
|
if (key == 'dom_object') {
|
|
if (key == 'dom_object') {
|
|
@@ -179,6 +184,10 @@ function parsePreviousAlgorithm () {
|
|
}
|
|
}
|
|
|
|
|
|
function includePreviousAlgorithm () {
|
|
function includePreviousAlgorithm () {
|
|
|
|
+ if (settingsProgrammingTypes == "textual") {
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
parsePreviousAlgorithm();
|
|
parsePreviousAlgorithm();
|
|
|
|
|
|
window.watchW.watch(window.program_obj.globals, function(){
|
|
window.watchW.watch(window.program_obj.globals, function(){
|
|
@@ -284,6 +293,7 @@ function prepareEnvironment () {
|
|
}
|
|
}
|
|
|
|
|
|
function ivprogTextualOrVisual () {
|
|
function ivprogTextualOrVisual () {
|
|
|
|
+
|
|
if (settingsProgrammingTypes) {
|
|
if (settingsProgrammingTypes) {
|
|
if (settingsProgrammingTypes == "textual") {
|
|
if (settingsProgrammingTypes == "textual") {
|
|
$('.ivprog_visual_panel').css('display', 'none');
|
|
$('.ivprog_visual_panel').css('display', 'none');
|
|
@@ -293,6 +303,9 @@ function ivprogTextualOrVisual () {
|
|
$('.visual_coding_button').removeClass('active');
|
|
$('.visual_coding_button').removeClass('active');
|
|
$('.textual_coding_button').addClass('active');
|
|
$('.textual_coding_button').addClass('active');
|
|
$('.visual_coding_button').addClass('disabled');
|
|
$('.visual_coding_button').addClass('disabled');
|
|
|
|
+
|
|
|
|
+ ivprogCore.CodeEditor.setCode(algorithm_in_ilm);
|
|
|
|
+ ivprogCore.CodeEditor.disable(false);
|
|
}
|
|
}
|
|
if (settingsProgrammingTypes == "visual") {
|
|
if (settingsProgrammingTypes == "visual") {
|
|
|
|
|