Browse Source

Merge branch 'improve-assessment' of LInE/ivprog into master

Lucas de Souza 5 years ago
parent
commit
c6398a0abc
2 changed files with 9 additions and 4 deletions
  1. 4 1
      js/iassign-integration-functions.js
  2. 5 3
      js/visualUI/functions.js

+ 4 - 1
js/iassign-integration-functions.js

@@ -117,7 +117,10 @@ function getEvaluation () {
     // Observe que a chamada parte do iLM para o iTarefa
     //parent.getEvaluationCallback(window.studentGrade);
 
-    runCodeAssessment();
+    var canRunAssessment = runCodeAssessment();
+    if(canRunAssessment === -1) {
+      parent.getEvaluationCallback(-1);
+    }
   }
 }
 

+ 5 - 3
js/visualUI/functions.js

@@ -898,7 +898,8 @@ function updateSequenceFunction (oldIndex, newIndex) {
 
 function runCodeAssessment () {
   if (isRunning) {
-    return;
+    // cannot run assessment or it's already running
+    return -1;
   }
   
   let strCode = null;
@@ -912,7 +913,8 @@ function runCodeAssessment () {
   }
 
   if (strCode == null) {
-    return;
+    // No code, so no assessment
+    return -1;
   }
 
   toggleConsole(true);
@@ -933,7 +935,7 @@ function runCodeAssessment () {
     console.log(err);
     isRunning = false;
   });
-  
+  return 0;
 }
 
 function runCode () {