Pārlūkot izejas kodu

Added the necessary fields for the Assistant

victor_passos 2 gadi atpakaļ
vecāks
revīzija
f30848dace
1 mainītis faili ar 12 papildinājumiem un 1 dzēšanām
  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);