Jelajahi Sumber

iVProg: included

Igor 2 tahun lalu
induk
melakukan
80af053478

+ 6 - 1
ilm/iVProg/1.0.20211130/ivprog/index.html

@@ -19,7 +19,7 @@
     <script src="js/filesaver.min.js"></script>
     <script src="js/iassign-integration-functions.js"></script>
 
-  <script defer src="js/vendors-node_modules_babel_runtime_helpers_asyncToGenerator_js-node_modules_babel_runtime_hel-72ab78.b1705086fd0a8b295b42.js"></script><script defer src="js/main.351fa5be475052d189cc.js"></script></head>
+  <script defer src="js/vendors-node_modules_babel_runtime_helpers_asyncToGenerator_js-node_modules_babel_runtime_hel-72ab78.b1705086fd0a8b295b42.js"></script><script defer src="js/main.1f2ec643885ac2dda183.js"></script></head>
   <body>
 
     <input type="file" name="ivph_file" id="ivph_file" style="position:absolute;margin-top: -500px !important;">
@@ -161,6 +161,11 @@
       if (iLMparameters.iLM_PARAM_TeacherAutoEval == null) {
         ivprogCore.initVisualUI();
       }
+
+      setTimeout(function() {
+        $('.ivprog_visual_panel').removeClass("loading");
+      },
+      10000)
     });
   </script>
 </html>

+ 2 - 2
ilm/iVProg/1.0.20211130/ivprog/js/iassign-integration-functions.js

@@ -291,7 +291,7 @@ function includePreviousAlgorithm () {
   }, 1);
 }
 
-function prepareActivityToStudent (ilm_cont) {
+function prepareActivityToStudent (ilm_cont, ignore_logs = false) {
 
     // File version (1.0):
     try {
@@ -313,7 +313,7 @@ function prepareActivityToStudent (ilm_cont) {
 
     // Previous file format:
     // Ver arquivo js/util/iassignHelpers.js
-    var content = ivprogCore.prepareActivityToStudentHelper(ilm_cont).getOrElse(null);
+    var content = ivprogCore.prepareActivityToStudentHelper(ilm_cont, ignore_logs).getOrElse(null);
     if(!content) {
       $('.ivprog_visual_panel').removeClass("loading");
       showInvalidData();

+ 24 - 19
ilm/iVProg/1.0.20211130/ivprog/js/main.351fa5be475052d189cc.js

@@ -13569,13 +13569,14 @@ __webpack_require__.r(__webpack_exports__);
 
 
 function parseActivityData(data) {
+  var ignore_logs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
   var algorithm_in_ilm = null;
 
   if (data.split("\n::algorithm::")[1]) {
     algorithm_in_ilm = data.split("\n::algorithm::")[1].split("\n::logs::")[0];
     var logs = data.split("\n::algorithm::")[1].split("\n::logs::")[1];
 
-    if (logs != null) {
+    if (logs != null && ignore_logs == false) {
       (0,_services_userLog__WEBPACK_IMPORTED_MODULE_4__.parseLogs)(logs);
     }
   }
@@ -13625,7 +13626,8 @@ function prepareActivityToStudentHelperJSON(ilm_cont) {
   if (ilm_cont.code) setPreviousAlgorithm(ilm_cont.code);else if (ilm_cont.algorithm) setPreviousAlgorithm(ilm_cont.algorithm);
 }
 function prepareActivityToStudentHelper(ilm_cont) {
-  var maybe_content = parseActivityData(ilm_cont);
+  var ignore_logs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
+  var maybe_content = parseActivityData(ilm_cont, ignore_logs);
   return maybe_content.map(function (content) {
     var testCases = content.testcases;
     (0,_visualUI_functions__WEBPACK_IMPORTED_MODULE_0__.setTestCases)(testCases);
@@ -15691,7 +15693,7 @@ function fillCache() {
     for (var key = 0; key < mainList.length; ++key) {
       var word = mainList[key];
       var keyword = names[word];
-      cacheMainList.push(keyword.substring(1, keyword.length - 1));
+      cacheMainList.push(keyword);
     }
   }
 
@@ -15754,7 +15756,7 @@ function getCodeEditorModeConfig() {
 
   blockList.forEach(function (v) {
     var keyword = names[v];
-    var value = keyword.substring(1, keyword.length - 1);
+    var value = keyword;
     cacheMainList.push(value);
     keywords.push(value);
     blocks.push(value);
@@ -15767,19 +15769,19 @@ function getCodeEditorModeConfig() {
   });
   keywordsList.forEach(function (v) {
     var keyword = names[v];
-    var value = keyword.substring(1, keyword.length - 1);
+    var value = keyword;
     cacheMainList.push(value);
     keywords.push(value);
   });
   typeList.forEach(function (v) {
     var keyword = names[v];
-    var value = keyword.substring(1, keyword.length - 1);
+    var value = keyword;
     cacheMainList.push(value);
     types.push(value);
   });
   atomList.forEach(function (v) {
     var keyword = names[v];
-    var value = keyword.substring(1, keyword.length - 1);
+    var value = keyword;
     cacheMainList.push(value);
     atoms.push(value);
   });
@@ -15787,10 +15789,11 @@ function getCodeEditorModeConfig() {
   var logicOpList = ["NOT_OPERATOR", "OR_OPERATOR", "AND_OPERATOR"];
   logicOpList.forEach(function (v) {
     var keyword = names[v];
-    var value = keyword.substring(1, keyword.length - 1);
+    var value = keyword;
     cacheOp.push(value);
     keywords.push(value);
   });
+  cacheMainList.push(lexer.getLangFuncs().main_function);
   return {
     case_default: case_default,
     atoms: atoms,
@@ -24942,10 +24945,14 @@ function uploadFile(evt) {
     var txt = oFREvent.target.result;
 
     try {
-      ivprogCore.setPreviousAlgorithm(txt);
-      window.renderAlgorithm();
+      if (txt.indexOf("::algorithm::") >= 0) {
+        prepareActivityToStudent(txt, true);
+      } else {
+        ivprogCore.setPreviousAlgorithm(txt);
+        window.renderAlgorithm();
+      }
     } catch (e) {
-      showInvalidFile();
+      console.log(e);
     }
   };
 }
@@ -24969,6 +24976,8 @@ __webpack_require__.r(__webpack_exports__);
 /* harmony import */ var _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./../services/localizedStringsService */ "./js/services/localizedStringsService.js");
 /* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils */ "./js/visualUI/utils.js");
 /* harmony import */ var _services_userLog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./../services/userLog */ "./js/services/userLog.js");
+/* harmony import */ var _util_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./../util/utils */ "./js/util/utils.js");
+
 
 
 
@@ -25016,7 +25025,7 @@ function updateName(global_var, new_name, global_obj_dom) {
     return;
   }
 
-  if (isValidIdentifier(new_name)) {
+  if ((0,_util_utils__WEBPACK_IMPORTED_MODULE_5__.isValidIdentifier)(new_name)) {
     if (globalNameAlreadyExists(new_name)) {
       _utils__WEBPACK_IMPORTED_MODULE_3__.renderErrorMessage(global_obj_dom.find('.editing_name_var'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__.LocalizedStrings.getUI('inform_valid_global_duplicated'));
     } else {
@@ -25024,7 +25033,7 @@ function updateName(global_var, new_name, global_obj_dom) {
       global_var.name = new_name;
     }
   } else {
-    _utils__WEBPACK_IMPORTED_MODULE_3__.renderErrorMessage(global_obj_dom.find('.editing_name_var'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__.LocalizedStrings.getUI('inform_valid_name'));
+    _utils__WEBPACK_IMPORTED_MODULE_3__.renderErrorMessage(global_obj_dom.find('.editing_name_var'), _services_localizedStringsService__WEBPACK_IMPORTED_MODULE_2__.LocalizedStrings.getError('inform_valid_identifier'));
   }
 }
 
@@ -25038,10 +25047,6 @@ function globalNameAlreadyExists(global_name) {
   return false;
 }
 
-function isValidIdentifier(identifier_str) {
-  return /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(identifier_str);
-}
-
 function updateType(global_var, new_type) {
   var new_dimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
   global_var.type = new_type;
@@ -29644,7 +29649,7 @@ exports.Maybe = Maybe;
 /***/ ((module) => {
 
 "use strict";
-module.exports = JSON.parse('{"version":"2022_01_07 17_52"}');
+module.exports = JSON.parse('{"version":"2022_01_13 11_33"}');
 
 /***/ })
 
@@ -29815,4 +29820,4 @@ module.exports = JSON.parse('{"version":"2022_01_07 17_52"}');
 /******/ })()
 ;
 });
-//# sourceMappingURL=main.351fa5be475052d189cc.js.map
+//# sourceMappingURL=main.1f2ec643885ac2dda183.js.map

File diff ditekan karena terlalu besar
+ 1 - 0
ilm/iVProg/1.0.20211130/ivprog/js/main.1f2ec643885ac2dda183.js.map


File diff ditekan karena terlalu besar
+ 0 - 1
ilm/iVProg/1.0.20211130/ivprog/js/main.351fa5be475052d189cc.js.map


+ 1 - 1
ilm/iVProg/1.0.20211130/ivprog/process.html

@@ -12,7 +12,7 @@
     <script src="js/jquery-ui.min.js"></script>
     <script src="js/semantic.min.js"></script>
     <script type="text/javascript" src="js/jquery.json-editor.min.js"></script>
-  <script defer src="js/vendors-node_modules_babel_runtime_helpers_asyncToGenerator_js-node_modules_babel_runtime_hel-72ab78.b1705086fd0a8b295b42.js"></script><script defer src="js/main.351fa5be475052d189cc.js"></script></head>
+  <script defer src="js/vendors-node_modules_babel_runtime_helpers_asyncToGenerator_js-node_modules_babel_runtime_hel-72ab78.b1705086fd0a8b295b42.js"></script><script defer src="js/main.1f2ec643885ac2dda183.js"></script></head>
   <body>
     <div style="padding-top: 50px; content: '';"></div>
     <div class="ui container grid">

+ 1 - 1
ilm/iVProg/1.0.20211130/ivprog/runner.html

@@ -12,7 +12,7 @@
   <script src="js/jquery-ui.min.js"></script>
   <script src="js/semantic.min.js"></script>
   <script type="text/javascript" src="js/jquery.json-editor.min.js"></script>
-<script defer src="js/vendors-node_modules_babel_runtime_helpers_asyncToGenerator_js-node_modules_babel_runtime_hel-72ab78.b1705086fd0a8b295b42.js"></script><script defer src="js/main.351fa5be475052d189cc.js"></script></head>
+<script defer src="js/vendors-node_modules_babel_runtime_helpers_asyncToGenerator_js-node_modules_babel_runtime_hel-72ab78.b1705086fd0a8b295b42.js"></script><script defer src="js/main.1f2ec643885ac2dda183.js"></script></head>
 <body>
     <div style="padding-top: 50px;content: ''"></div>
   <div class="ui container grid">