소스 검색

bug fix: upload new file format

Igor 2 년 전
부모
커밋
ade4b5887d
3개의 변경된 파일6개의 추가작업 그리고 5개의 파일을 삭제
  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();