Browse Source

In progress

Igor 5 năm trước cách đây
mục cha
commit
a809ac1d93
2 tập tin đã thay đổi với 9 bổ sung3 xóa
  1. 6 1
      js/iassign-integration-functions.js
  2. 3 2
      js/util/iassignHelpers.js

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

@@ -731,6 +731,7 @@ function full_screen() {
 }
 
 function teacherAutoEval (data) {
+  previousContent = data;
   $.get(iLMparameters.iLM_PARAM_TeacherAutoEval, function (originalData) {
     // Ver arquivo js/util/iassignHelpers.js
     var content = ivprogCore.prepareActivityToStudentHelper(data).getOrElse(null);
@@ -749,7 +750,7 @@ function teacherAutoEval (data) {
     if (content.algorithmInIlm != null) {
       algorithm_in_ilm = content.algorithmInIlm;
       parsePreviousAlgorithm();
-      ivprogCore.autoEval(originalData, parent.getEvaluationCallback);
+      ivprogCore.autoEval(originalData, displayGrade);
     }
 
     ivprogTextualOrVisual();
@@ -760,6 +761,10 @@ function teacherAutoEval (data) {
   });
 }
 
+function displayGrade(grade) {
+  alert(grade);
+}
+
 function showInvalidData () {
   $('.ui.height_100.add_accordion').dimmer({
     closable: false

+ 3 - 2
js/util/iassignHelpers.js

@@ -75,6 +75,7 @@ function compareTestcases (original, student) {
       return false;
     }
   }
+  return true;
 }
 
 export function autoEval (originalData, callback) {
@@ -85,10 +86,10 @@ export function autoEval (originalData, callback) {
     return callback(null);
   }
   if (code == null) {
-    return callback(-1);
+    return callback(-1); // @FeedbackConvention Casos de teste vazios
   } else {
     if (!compareTestcases(original.testcases, getTestCases())) {
-      return callback(-2);
+      return callback(-2); // @FeedbackConvention Casos de teste alterados pelo aluno
     }
     const ast_code = SemanticAnalyser.analyseFromSource(code);
     const autoAssessment = new IVProgAssessment(ast_code, getTestCases(), new TestConsole([]));