Browse Source

finished changes

Igor 2 years ago
parent
commit
ae9922c06e
4 changed files with 14 additions and 6 deletions
  1. BIN
      ivprog_2022_01_13_14_00.zip
  2. 4 1
      js/util/iassignHelpers.js
  3. 4 5
      js/util/utils.js
  4. 6 0
      templates/index.html

BIN
ivprog_2022_01_13_14_00.zip


+ 4 - 1
js/util/iassignHelpers.js

@@ -13,7 +13,10 @@ function parseActivityData (data, ignore_logs=false) {
     algorithm_in_ilm = data.split("\n::algorithm::")[1].split("\n::logs::")[0];
     const logs = data.split("\n::algorithm::")[1].split("\n::logs::")[1];
     if (logs != null && ignore_logs == false) {
-      parseLogs(logs);
+      try {
+        parseLogs(logs);
+      }
+      catch (e) {}
     }
   }
   let content;

+ 4 - 5
js/util/utils.js

@@ -194,11 +194,10 @@ export function isKeyword (text) {
 
 export function isValidIdentifier (identifier_str) {
   const validRegex = /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(identifier_str);
-  return validRegex;
-  // if (!validRegex) {
-  //   return false;
-  // }
-  // return !isKeyword(identifier_str);
+  if (!validRegex) {
+    return false;
+  }
+  return !isKeyword(identifier_str);
 }
 
 export function getCodeEditorModeConfig () {

+ 6 - 0
templates/index.html

@@ -161,6 +161,12 @@
       if (iLMparameters.iLM_PARAM_TeacherAutoEval == null) {
         ivprogCore.initVisualUI();
       }
+
+      setTimeout(function() {
+        $('.ivprog_visual_panel').removeClass("loading");
+        renderAlgorithm();
+      },
+      8000)
     });
   </script>
 </html>