iassign-integration-functions.js 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532
  1. // Função para ler parâmetros informados pelo iTarefa via URL
  2. // Apesar de não ser obrigatório, será muito útil para capturar os parâmetros
  3. function getParameterByName (name, defaultReturn = null) {
  4. var match = RegExp('[?&]' + name + '=([^&]*)').exec(window.location.search);
  5. return match ? decodeURIComponent(match[1].replace(/\+/g, ' ')) : defaultReturn;
  6. }
  7. // Criando um object com os parâmetros informados pelo iTarefa
  8. // Observe que para cada parâmetro, é realizada a chamada do método getParameterByName, implementado acima
  9. var iLMparameters = {
  10. iLM_PARAM_ServerToGetAnswerURL: getParameterByName("iLM_PARAM_ServerToGetAnswerURL"),
  11. iLM_PARAM_SendAnswer: getParameterByName("iLM_PARAM_SendAnswer"),
  12. iLM_PARAM_AssignmentURL: getParameterByName("iLM_PARAM_AssignmentURL"),
  13. iLM_PARAM_Assignment: getParameterByName("iLM_PARAM_Assignment"),
  14. iLM_PARAM_TeacherAutoEval: getParameterByName("iLM_PARAM_TeacherAutoEval"),
  15. lang: getParameterByName("lang", "pt")
  16. };
  17. // Set the lang parameter to the localStorage for easy access
  18. // and no dependency to the global scope, avoind future 'strict mode' problems
  19. //localStorage.setItem('ivprog.lang', iLMparameters.lang);
  20. // Função chamada pelo iTarefa quando o professor finaliza a criação da atividade
  21. // ou quando o aluno finaliza a resolução do exercício
  22. // O retorno é um JSON com os dados do exercício ou da resolução
  23. // Esse retorno será armazenado no banco de dados do Moodle, pelo iTarefa
  24. function getAnswer () {
  25. // Se o parâmetro "iLM_PARAM_SendAnswer" for false,
  26. // então trata-se de resolução de atividade
  27. if (iLMparameters.iLM_PARAM_SendAnswer == 'false') {
  28. // Montar o retorno com a resposta do aluno
  29. var contentToSend = previousContent.split("\n::algorithm::")[0];
  30. contentToSend += '\n::algorithm::\n';
  31. contentToSend += JSON.stringify(window.program_obj, function(key, value) {
  32. if (key == 'dom_object') {
  33. return;
  34. }
  35. return value;
  36. });
  37. contentToSend += '\n::logs::';
  38. contentToSend += getTrackingLogs();
  39. return contentToSend;
  40. } else {
  41. // Montar o retorno com a criação da atividade do professor
  42. var ret = ' { ' + prepareTestCases()
  43. + ',\n"settings_data_types": \n' + JSON.stringify($('form[name="settings_data_types"]').serializeArray())
  44. + ',\n"settings_commands": \n' + JSON.stringify($('form[name="settings_commands"]').serializeArray())
  45. + ',\n"settings_functions": \n' + JSON.stringify($('form[name="settings_functions"]').serializeArray())
  46. + ' } ';
  47. if ($("input[name='include_algo']").is(':checked')) {
  48. ret += '\n::algorithm::\n';
  49. ret += JSON.stringify(window.program_obj, function(key, value) {
  50. if (key == 'dom_object') {
  51. return;
  52. }
  53. return value;
  54. });
  55. }
  56. return ret;
  57. }
  58. }
  59. function prepareTestCases () {
  60. var ret = ' \n "testcases" : [ '
  61. var test_cases_array = $('form[name="test_cases"]').serializeArray();
  62. console.log(test_cases_array);
  63. for (var i = 0; i < test_cases_array.length; i = i + 2) {
  64. ret += '\n{ ';
  65. ret += '\n "input": [';
  66. var inps = test_cases_array[i].value.match(/[^\r\n]+/g);
  67. if (inps) {
  68. for (var j = 0; j < inps.length; j++) {
  69. ret += '"' + inps[j].trim() + '"';
  70. if ((j + 1) < inps.length) {
  71. ret += ', ';
  72. }
  73. }
  74. }
  75. ret += '], \n "output": [';
  76. var outs = test_cases_array[i+1].value.match(/[^\r\n]+/g);
  77. if (outs) {
  78. for (var j = 0; j < outs.length; j++) {
  79. ret += '"' + outs[j].trim() + '"';
  80. if ((j + 1) < outs.length) {
  81. ret += ', ';
  82. }
  83. }
  84. }
  85. ret += ']';
  86. ret += '\n}'
  87. if ((i + 2) < test_cases_array.length) {
  88. ret += ',';
  89. }
  90. }
  91. ret += '\n] ';
  92. return ret;
  93. }
  94. // Função chamada pelo iTarefa para receber a nota do aluno na atividade
  95. // O retorno é um valor entre 0.0 e 1.0
  96. function getEvaluation () {
  97. if (iLMparameters.iLM_PARAM_SendAnswer == 'false') {
  98. // A chamada do método abaixo é obrigatória!
  99. // Observe que a chamada parte do iLM para o iTarefa
  100. //parent.getEvaluationCallback(window.studentGrade);
  101. runCodeAssessment();
  102. }
  103. }
  104. //var testCases = null;
  105. var settingsDataTypes = null;
  106. var settingsCommands = null;
  107. var settingsFunctions = null;
  108. var algorithm_in_ilm = null;
  109. var previousContent = null;
  110. // Função para que o iMA leia os dados da atividade fornecidos pelo iTarefa
  111. function getiLMContent () {
  112. // O parâmetro "iLM_PARAM_Assignment" fornece o URL do endereço que deve ser
  113. // requisitado via AJAX para a captura dos dados da atividade
  114. $.get(iLMparameters.iLM_PARAM_Assignment, function (data) {
  115. //professor invocou a avaliação automática dos exercícios do bloco
  116. if (iLMparameters.iLM_PARAM_TeacherAutoEval != null) {
  117. teacherAutoEval(data);
  118. //não deve exibir nenhuma interface...
  119. return;
  120. } else if (iLMparameters.iLM_PARAM_SendAnswer == 'false') {
  121. // Aluno está trabalhando em alguma atividade:
  122. previousContent = data;
  123. prepareActivityToStudent(data);
  124. } else { // Professor está editando uma atividade:
  125. previousContent = data;
  126. prepareActivityToEdit(data);
  127. }
  128. window.block_render = false;
  129. renderAlgorithm();
  130. });
  131. }
  132. function prepareActivityToEdit (ilm_cont) {
  133. //var content = JSON.parse(ilm_cont.split('\n::algorithm::')[0]);
  134. // Ver arquivo js/util/iassignHelpers.js
  135. var content = ivprogCore.prepareActivityToStudentHelper(ilm_cont);
  136. var testCases = ivprogCore.getTestCases();
  137. settingsDataTypes = content.settingsDataTypes;
  138. settingsCommands = content.settingsCommands;
  139. settingsFunctions = content.settingsFunctions;
  140. for (var i = 0; i < testCases.length; i++) {
  141. addTestCase(testCases[i]);
  142. }
  143. if (content.algorithmInIlm != null) {
  144. algorithm_in_ilm = content.algorithmInIlm;
  145. $("input[name='include_algo']").prop('checked', true);
  146. includePreviousAlgorithm();
  147. renderAlgorithm();
  148. }
  149. }
  150. function parsePreviousAlgorithm () {
  151. window.program_obj.functions = JSON.parse(algorithm_in_ilm).functions;
  152. window.program_obj.globals = JSON.parse(algorithm_in_ilm).globals;
  153. }
  154. function includePreviousAlgorithm () {
  155. parsePreviousAlgorithm();
  156. window.watchW.watch(window.program_obj.globals, function(){
  157. if (window.insertContext) {
  158. setTimeout(function(){ renderAlgorithm(); }, 300);
  159. window.insertContext = false;
  160. } else {
  161. renderAlgorithm();
  162. }
  163. }, 1);
  164. for (var i = 0; i < window.program_obj.functions.length; i ++) {
  165. window.watchW.watch(window.program_obj.functions[i].parameters_list, function(){
  166. if (window.insertContext) {
  167. setTimeout(function(){ renderAlgorithm(); }, 300);
  168. window.insertContext = false;
  169. } else {
  170. renderAlgorithm();
  171. }
  172. }, 1);
  173. window.watchW.watch(window.program_obj.functions[i].variables_list, function(){
  174. if (window.insertContext) {
  175. setTimeout(function(){ renderAlgorithm(); }, 300);
  176. window.insertContext = false;
  177. } else {
  178. renderAlgorithm();
  179. }
  180. }, 1);
  181. if (window.program_obj.functions[i].is_main) {
  182. window.program_obj.functions[i].name = LocalizedStrings.getUI("start");
  183. }
  184. }
  185. window.watchW.watch(window.program_obj.functions, function(){
  186. if (window.insertContext) {
  187. setTimeout(function(){ renderAlgorithm(); }, 300);
  188. window.insertContext = false;
  189. } else {
  190. renderAlgorithm();
  191. }
  192. }, 1);
  193. }
  194. function prepareActivityToStudent (ilm_cont) {
  195. // Ver arquivo js/util/iassignHelpers.js
  196. var content = ivprogCore.prepareActivityToStudentHelper(ilm_cont);
  197. // Casos de testes agora são delegados ao tratamento apropriado pela função acima
  198. // var testCases = content.testcases;
  199. settingsDataTypes = content.settingsDataTypes;
  200. settingsCommands = content.settingsCommands;
  201. settingsFunctions = content.settingsFunctions;
  202. if (content.algorithmInIlm != null) {
  203. algorithm_in_ilm = content.algorithmInIlm;
  204. includePreviousAlgorithm();
  205. }
  206. $('.assessment_button').removeClass('disabled');
  207. renderAlgorithm();
  208. }
  209. // Função para organizar se para criação, visualização ou resolução de atividade
  210. function prepareEnvironment () {
  211. // Se iLM_PARAM_SendAnswer for false, então trata-se de resolução de atividade,
  212. // portanto, a "DIV" de resolução é liberada
  213. if (iLMparameters.iLM_PARAM_SendAnswer == 'false') {
  214. //$('.resolucao').css("display","block");
  215. getiLMContent();
  216. $('.div_to_body').mousemove(function(e) {
  217. trackingMatrix.push(adCoords(e, 0));
  218. });
  219. $('.div_to_body').click(function(e) {
  220. trackingMatrix.push(adCoords(e, 1));
  221. });
  222. } else if (iLMparameters.iLM_PARAM_Assignment) {
  223. // Caso não esteja em modo de resolução de atividade, a visualização no momento
  224. // é para a elaboração de atividade:
  225. //$('.elaboracao').css("display","block");
  226. // Se possuir o parâmetro iLMparameters.iLM_PARAM_Assignment, o professor
  227. // está editando uma atividade:
  228. getiLMContent();
  229. } else {
  230. renderAlgorithm();
  231. }
  232. if ((iLMparameters.iLM_PARAM_AssignmentURL == "true") && (iLMparameters.iLM_PARAM_SendAnswer == "true")) {
  233. prepareActivityCreation();
  234. }
  235. }
  236. function iassingIntegration () {
  237. // Disable by default...
  238. $('.assessment_button').addClass('disabled');
  239. prepareEnvironment();
  240. if (inIframe()) {
  241. orderIcons();
  242. orderWidth();
  243. }
  244. }
  245. // Função para preparar a interface para o professor criar atividade:
  246. function prepareActivityCreation () {
  247. $('.add_accordion').addClass('accordion');
  248. $('.default_visual_title').toggle();
  249. $('.default_visual_title').append('<span>'+LocalizedStrings.getUI('text_teacher_algorithm')+'</span>');
  250. $('.height_100').removeClass('height_100');
  251. $('.main_title').remove();
  252. $('.ui.accordion').addClass('styled');
  253. $('<div class="content_margin"></div>').insertBefore($('.add_accordion').find('.content').find('.div_to_body'));
  254. $('<div class="ui checkbox"><input type="checkbox" name="include_algo" class="include_algo" tabindex="0" class="hidden"><label>'+LocalizedStrings.getUI('text_teacher_algorithm_include')+'</label></div>').insertAfter('.content_margin');
  255. var cases_test_div = $('<div class="ui accordion styled"><div class="active title"><i class="dropdown icon"></i>'+LocalizedStrings.getUI('text_teacher_test_case')+'</div><div class="active content"></div></div>');
  256. cases_test_div.insertBefore('.accordion');
  257. var config_div = $('<div class="ui accordion styled"><div class="title"><i class="dropdown icon"></i>'+LocalizedStrings.getUI('text_teacher_config')+'</div><div class="content"></div></div>');
  258. config_div.insertAfter(cases_test_div);
  259. $('.ui.accordion').accordion();
  260. $('.ui.checkbox').checkbox();
  261. prepareTableSettings(config_div.find('.content'));
  262. prepareTableTestCases(cases_test_div.find('.content'));
  263. if (inIframe()) {
  264. $('.ui.styled.accordion').css('width', '96%');
  265. }
  266. }
  267. function prepareTableTestCases (div_el) {
  268. var table_el = '<form name="test_cases"><table class="ui blue table"><thead><tr><th width="30px">#</th><th>'+LocalizedStrings.getUI('text_teacher_test_case_input')+'</th><th>'+LocalizedStrings.getUI('text_teacher_test_case_output')+'</th><th width="80px">'+LocalizedStrings.getUI('text_teacher_test_case_actions')+'</th></tr></thead>'
  269. + '<tbody class="content_cases"></tbody></table></form>';
  270. div_el.append(table_el);
  271. div_el.append('<button class="ui teal labeled icon button button_add_case"><i class="plus icon"></i>'+LocalizedStrings.getUI('text_teacher_test_case_add')+'</button>');
  272. $('.button_add_case').on('click', function(e) {
  273. addTestCase();
  274. });
  275. }
  276. var hist = false;
  277. function addTestCase (test_case = null) {
  278. var new_row = null;
  279. if (test_case) {
  280. var text_row = '';
  281. text_row += '<tr><td class="counter"></td><td class="expandingArea"><textarea rows="'+test_case.input.length+'" name="input" class="text_area_input">';
  282. for (var i = 0; i < test_case.input.length; i ++) {
  283. text_row += test_case.input[i];
  284. if ((i + 1) < test_case.input.length) {
  285. text_row += '\n';
  286. }
  287. }
  288. text_row += '</textarea></td><td class="expandingArea"><textarea rows="'+test_case.output.length+'" name="output" class="text_area_output">';
  289. for (var i = 0; i < test_case.output.length; i ++) {
  290. text_row += test_case.output[i];
  291. if ((i + 1) < test_case.output.length) {
  292. text_row += '\n';
  293. }
  294. }
  295. text_row += '</textarea></td><td class="btn_actions"><div class="ui button_remove_case"><i class="red icon times large"></i></div></td></tr>';
  296. new_row = $(text_row);
  297. } else {
  298. new_row = $('<tr><td class="counter"></td><td class="expandingArea"><textarea rows="1" name="input" class="text_area_input"></textarea></td><td class="expandingArea"><textarea rows="1" name="output" class="text_area_output"></textarea></td><td class="btn_actions"><div class="ui button_remove_case"><i class="red icon times large"></i></div></td></tr>');
  299. }
  300. $('.content_cases').append(new_row);
  301. new_row.find('.button_remove_case').click(function(e) {
  302. new_row.remove();
  303. updateTestCaseCounter();
  304. });
  305. new_row.find('textarea').on('input', function(e) {
  306. var lines = $(this).val().split('\n').length;
  307. $(this).attr('rows', lines);
  308. });
  309. updateTestCaseCounter();
  310. $('.text_area_output').keydown(function(e) {
  311. var code = e.keyCode || e.which;
  312. if (code == 9 && $(this).closest("tr").is(":last-child")) {
  313. hist = true;
  314. addTestCase();
  315. }
  316. });
  317. if (test_case == null) {
  318. if (!hist) {
  319. $( ".content_cases tr:last" ).find('.text_area_input').focus();
  320. } else {
  321. hist = false;
  322. }
  323. }
  324. }
  325. function updateTestCaseCounter () {
  326. var i = 1;
  327. $( ".content_cases" ).find('tr').each(function() {
  328. $( this ).find('.counter').text(i);
  329. ++i;
  330. });
  331. }
  332. function prepareTableSettings (div_el) {
  333. div_el.append('<h4 class="ui header">'+LocalizedStrings.getUI('text_teacher_data_types')+'</h4>');
  334. div_el.append('<form name="settings_data_types"><div class="ui stackable five column grid">'
  335. +'<div class="column"><div class="ui checkbox"><input type="checkbox" name="integer_data_type" checked tabindex="0" class="hidden small"><label>'+LocalizedStrings.getUI('integer')+'</label></div></div>'
  336. +'<div class="column"><div class="ui checkbox"><input type="checkbox" name="real_data_type" checked tabindex="0" class="hidden small"><label>'+LocalizedStrings.getUI('real')+'</label></div></div>'
  337. +'<div class="column"><div class="ui checkbox"><input type="checkbox" name="text_data_type" checked tabindex="0" class="hidden small"><label>'+LocalizedStrings.getUI('text')+'</label></div></div>'
  338. +'<div class="column"><div class="ui checkbox"><input type="checkbox" name="boolean_data_type" checked tabindex="0" class="hidden small"><label>'+LocalizedStrings.getUI('boolean')+'</label></div></div>'
  339. +'<div class="column"><div class="ui checkbox"><input type="checkbox" name="void_data_type" checked tabindex="0" class="hidden small"><label>'+LocalizedStrings.getUI('void')+'</label></div></div>'
  340. +'</div></form>');
  341. div_el.append('<h4 class="ui header">'+LocalizedStrings.getUI('text_teacher_commands')+'</h4>');
  342. div_el.append('<form name="settings_commands"><div class="ui stackable three column grid">'
  343. +'<div class="column"><div class="ui checkbox"><input type="checkbox" name="commands_read" checked tabindex="0" class="hidden small"><label>'+LocalizedStrings.getUI('text_read_var')+'</label></div></div>'
  344. +'<div class="column"><div class="ui checkbox"><input type="checkbox" name="commands_write" checked tabindex="0" class="hidden small"><label>'+LocalizedStrings.getUI('text_write_var')+'</label></div></div>'
  345. +'<div class="column"><div class="ui checkbox"><input type="checkbox" name="commands_comment" checked tabindex="0" class="hidden small"><label>'+LocalizedStrings.getUI('text_comment')+'</label></div></div>'
  346. +'<div class="column"><div class="ui checkbox"><input type="checkbox" name="commands_attribution" checked tabindex="0" class="hidden small"><label>'+LocalizedStrings.getUI('text_attribution')+'</label></div></div>'
  347. +'<div class="column"><div class="ui checkbox"><input type="checkbox" name="commands_functioncall" checked tabindex="0" class="hidden small"><label>'+LocalizedStrings.getUI('text_functioncall')+'</label></div></div>'
  348. +'<div class="column"><div class="ui checkbox"><input type="checkbox" name="commands_iftrue" checked tabindex="0" class="hidden small"><label>'+LocalizedStrings.getUI('text_iftrue')+'</label></div></div>'
  349. +'<div class="column"><div class="ui checkbox"><input type="checkbox" name="commands_repeatNtimes" checked tabindex="0" class="hidden small"><label>'+LocalizedStrings.getUI('text_repeatNtimes')+'</label></div></div>'
  350. +'<div class="column"><div class="ui checkbox"><input type="checkbox" name="commands_while" checked tabindex="0" class="hidden small"><label>'+LocalizedStrings.getUI('text_whiletrue')+'</label></div></div>'
  351. +'<div class="column"><div class="ui checkbox"><input type="checkbox" name="commands_dowhile" checked tabindex="0" class="hidden small"><label>'+LocalizedStrings.getUI('text_dowhiletrue')+'</label></div></div>'
  352. +'<div class="column"><div class="ui checkbox"><input type="checkbox" name="commands_switch" checked tabindex="0" class="hidden small"><label>'+LocalizedStrings.getUI('text_switch')+'</label></div></div>'
  353. +'</div></form>');
  354. div_el.append('<h4 class="ui header">'+LocalizedStrings.getUI('text_teacher_functions')+'</h4>');
  355. div_el.append('<form name="settings_functions"><div class="ui stackable one column grid">'
  356. +'<div class="column"><div class="ui checkbox"><input type="checkbox" name="functions_creation" checked tabindex="0" class="hidden small"><label>'+LocalizedStrings.getUI('text_teacher_create_functions')+'</label></div></div>'
  357. +'<div class="column"><div class="ui checkbox"><input type="checkbox" name="functions_move" checked tabindex="0" class="hidden small"><label>'+LocalizedStrings.getUI('text_teacher_create_movement_functions')+'</label></div></div>'
  358. +'</div></form>');
  359. $('.ui.checkbox').checkbox();
  360. }
  361. function getTrackingLogs () {
  362. var ret = "";
  363. for (var i = 0; i < trackingMatrix.length; ++i) {
  364. ret += "\n" + trackingMatrix[i][0] + "," + trackingMatrix[i][1] + "," + trackingMatrix[i][2];
  365. if (trackingMatrix[i][3] === 1) {
  366. ret += ',' + trackingMatrix[i][3] + ',"' + trackingMatrix[i][4] + '"';
  367. }
  368. }
  369. return ret;
  370. }
  371. // Tracking mouse movements
  372. var trackingMatrix = [];
  373. function adCoords(e, code){
  374. var x = e.pageX;
  375. var y = e.pageY;
  376. if (code === 1) {
  377. return [new Date().getTime(), x, y, code, e.target.classList['value']];
  378. } else {
  379. return [x, y, code];
  380. }
  381. }
  382. // $( document ).ready(function() {
  383. // if (inIframe()) {
  384. // orderIcons();
  385. // orderWidth();
  386. // }
  387. // renderAlgorithm();
  388. // });
  389. function orderWidth() {
  390. $('.ui.raised.container.segment.div_to_body').css('width', '100%');
  391. $('.ui.one.column.container.segment.ivprog_visual_panel').css('width', '100%');
  392. }
  393. function orderIcons() {
  394. $('.ui.one.column.doubling.stackable.grid.container').css('display', 'none');
  395. $('.only_in_frame').css('display', 'block');
  396. }
  397. function inIframe () {
  398. try {
  399. return window.self !== window.top;
  400. } catch (e) {
  401. return true;
  402. }
  403. }
  404. function full_screen() {
  405. // check if user allows full screen of elements. This can be enabled or disabled in browser config. By default its enabled.
  406. //its also used to check if browser supports full screen api.
  407. if("fullscreenEnabled" in document || "webkitFullscreenEnabled" in document || "mozFullScreenEnabled" in document || "msFullscreenEnabled" in document) {
  408. if(document.fullscreenEnabled || document.webkitFullscreenEnabled || document.mozFullScreenEnabled || document.msFullscreenEnabled) {
  409. var element = document.getElementById("ui_main_div");
  410. //requestFullscreen is used to display an element in full screen mode.
  411. if("requestFullscreen" in element) {
  412. element.requestFullscreen();
  413. }
  414. else if ("webkitRequestFullscreen" in element) {
  415. element.webkitRequestFullscreen();
  416. }
  417. else if ("mozRequestFullScreen" in element) {
  418. element.mozRequestFullScreen();
  419. }
  420. else if ("msRequestFullscreen" in element) {
  421. element.msRequestFullscreen();
  422. }
  423. }
  424. } else {
  425. $('.expand_button').addClass('disabled');
  426. }
  427. }
  428. function teacherAutoEval (data) {
  429. $.get(iLMparameters.iLM_PARAM_TeacherAutoEval, function (originalData) {
  430. // Ver arquivo js/util/iassignHelpers.js
  431. var content = ivprogCore.prepareActivityToStudentHelper(data);
  432. // Casos de testes agora são delegados ao tratamento apropriado pela função acima
  433. // var testCases = content.testcases;
  434. settingsDataTypes = content.settingsDataTypes;
  435. settingsCommands = content.settingsCommands;
  436. settingsFunctions = content.settingsFunctions;
  437. if (content.algorithmInIlm != null) {
  438. algorithm_in_ilm = content.algorithmInIlm;
  439. parsePreviousAlgorithm();
  440. ivprogCore.autoEval(originalData, parent.getEvaluationCallback);
  441. }
  442. });
  443. }