Ver Fonte

Added the necessary fields for the Assistant

victor_passos há 2 anos atrás
pai
commit
f30848dace
1 ficheiros alterados com 12 adições e 1 exclusões
  1. 12 1
      js/visualUI/functions.js

+ 12 - 1
js/visualUI/functions.js

@@ -28,6 +28,7 @@ const functionsChangeListeners = [];
 let proc = null;
 let domConsole = null;
 let _testCases = [];
+let _exerciseType = [];
 let isRunning = false;
 window.studentGrade = null;
 window.LocalizedStrings = LocalizedStrings;
@@ -875,12 +876,22 @@ export function setTestCases (testCases) {
   _testCases = testCases;
 }
 
+export function setExerciseType (exerciseType) {
+  _exerciseType = exerciseType;
+}
+
 export function getTestCases () {
   // Deep clone of test cases to avoid unauthorized modification
   // TODO: It may be not possible to use this once custom test are fully implemented 
   return JSON.parse(JSON.stringify(_testCases));
 }
 
+export function getExerciseType () {
+  // Deep clone of exercise type to avoid unauthorized modification
+  // TODO: It may be not possible to use this once custom test are fully implemented 
+  return _exerciseType;
+}
+
 var is_iassign = false;
 
 function updateSequenceParameters (oldIndex, newIndex, function_obj) {
@@ -927,7 +938,7 @@ function runCodeAssessment () {
   try {
     const data = SemanticAnalyser.analyseFromSource(strCode);
     isRunning = true;
-    const runner = new IVProgAssessment(data, _testCases, domConsole);
+    const runner = new IVProgAssessment(data, _exerciseType, _testCases, domConsole);
     runner.runTest().then(grade => {
       if (!is_iassign) {
         parent.getEvaluationCallback(grade);