|
@@ -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
|