Browse Source

bug fix: upload new file format

Igor 2 years ago
parent
commit
ade4b5887d
3 changed files with 6 additions and 5 deletions
  1. 3 1
      js/main.js
  2. 1 1
      js/util/iassignHelpers.js
  3. 2 3
      js/visualUI/functions.js

+ 3 - 1
js/main.js

@@ -21,6 +21,7 @@ import {
   prepareActivityToStudentHelper,
   prepareActivityToStudentHelperJSON,
   autoEval,
+  setPreviousAlgorithm
 } from "./util/iassignHelpers";
 import { openAssessmentDetail, levenshteinDistance } from "./util/utils";
 import { Config } from "./util/config";
@@ -77,5 +78,6 @@ export {
   generate as generateCode,
   levenshteinDistance,
   processData,
-  Settings
+  Settings,
+  setPreviousAlgorithm
 };

+ 1 - 1
js/util/iassignHelpers.js

@@ -48,7 +48,7 @@ function setActivityConfig (config_json) {
 
 }
 
-function setPreviousAlgorithm (code) {
+export function setPreviousAlgorithm (code) {
   
   var code_obj = null;
   try {

+ 2 - 3
js/visualUI/functions.js

@@ -1698,10 +1698,9 @@ function uploadFile (evt) {
       var txt = oFREvent.target.result;
       try {
 
-        previousContent = txt;
-        prepareActivityToStudent(txt);
+        ivprogCore.setPreviousAlgorithm(txt);
         window.renderAlgorithm();
-        $('.assessment_button').addClass('disabled');
+
       }
       catch (e) {
         showInvalidFile();