|
@@ -13569,13 +13569,14 @@ __webpack_require__.r(__webpack_exports__);
|
|
|
|
|
|
|
|
|
|
function parseActivityData(data) {
|
|
function parseActivityData(data) {
|
|
|
|
+ var ignore_logs = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
var algorithm_in_ilm = null;
|
|
var algorithm_in_ilm = null;
|
|
|
|
|
|
if (data.split("\n::algorithm::")[1]) {
|
|
if (data.split("\n::algorithm::")[1]) {
|
|
algorithm_in_ilm = data.split("\n::algorithm::")[1].split("\n::logs::")[0];
|
|
algorithm_in_ilm = data.split("\n::algorithm::")[1].split("\n::logs::")[0];
|
|
var logs = data.split("\n::algorithm::")[1].split("\n::logs::")[1];
|
|
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);
|
|
(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);
|
|
if (ilm_cont.code) setPreviousAlgorithm(ilm_cont.code);else if (ilm_cont.algorithm) setPreviousAlgorithm(ilm_cont.algorithm);
|
|
}
|
|
}
|
|
function prepareActivityToStudentHelper(ilm_cont) {
|
|
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) {
|
|
return maybe_content.map(function (content) {
|
|
var testCases = content.testcases;
|
|
var testCases = content.testcases;
|
|
(0,_visualUI_functions__WEBPACK_IMPORTED_MODULE_0__.setTestCases)(testCases);
|
|
(0,_visualUI_functions__WEBPACK_IMPORTED_MODULE_0__.setTestCases)(testCases);
|
|
@@ -15691,7 +15693,7 @@ function fillCache() {
|
|
for (var key = 0; key < mainList.length; ++key) {
|
|
for (var key = 0; key < mainList.length; ++key) {
|
|
var word = mainList[key];
|
|
var word = mainList[key];
|
|
var keyword = names[word];
|
|
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) {
|
|
blockList.forEach(function (v) {
|
|
var keyword = names[v];
|
|
var keyword = names[v];
|
|
- var value = keyword.substring(1, keyword.length - 1);
|
|
|
|
|
|
+ var value = keyword;
|
|
cacheMainList.push(value);
|
|
cacheMainList.push(value);
|
|
keywords.push(value);
|
|
keywords.push(value);
|
|
blocks.push(value);
|
|
blocks.push(value);
|
|
@@ -15767,19 +15769,19 @@ function getCodeEditorModeConfig() {
|
|
});
|
|
});
|
|
keywordsList.forEach(function (v) {
|
|
keywordsList.forEach(function (v) {
|
|
var keyword = names[v];
|
|
var keyword = names[v];
|
|
- var value = keyword.substring(1, keyword.length - 1);
|
|
|
|
|
|
+ var value = keyword;
|
|
cacheMainList.push(value);
|
|
cacheMainList.push(value);
|
|
keywords.push(value);
|
|
keywords.push(value);
|
|
});
|
|
});
|
|
typeList.forEach(function (v) {
|
|
typeList.forEach(function (v) {
|
|
var keyword = names[v];
|
|
var keyword = names[v];
|
|
- var value = keyword.substring(1, keyword.length - 1);
|
|
|
|
|
|
+ var value = keyword;
|
|
cacheMainList.push(value);
|
|
cacheMainList.push(value);
|
|
types.push(value);
|
|
types.push(value);
|
|
});
|
|
});
|
|
atomList.forEach(function (v) {
|
|
atomList.forEach(function (v) {
|
|
var keyword = names[v];
|
|
var keyword = names[v];
|
|
- var value = keyword.substring(1, keyword.length - 1);
|
|
|
|
|
|
+ var value = keyword;
|
|
cacheMainList.push(value);
|
|
cacheMainList.push(value);
|
|
atoms.push(value);
|
|
atoms.push(value);
|
|
});
|
|
});
|
|
@@ -15787,10 +15789,11 @@ function getCodeEditorModeConfig() {
|
|
var logicOpList = ["NOT_OPERATOR", "OR_OPERATOR", "AND_OPERATOR"];
|
|
var logicOpList = ["NOT_OPERATOR", "OR_OPERATOR", "AND_OPERATOR"];
|
|
logicOpList.forEach(function (v) {
|
|
logicOpList.forEach(function (v) {
|
|
var keyword = names[v];
|
|
var keyword = names[v];
|
|
- var value = keyword.substring(1, keyword.length - 1);
|
|
|
|
|
|
+ var value = keyword;
|
|
cacheOp.push(value);
|
|
cacheOp.push(value);
|
|
keywords.push(value);
|
|
keywords.push(value);
|
|
});
|
|
});
|
|
|
|
+ cacheMainList.push(lexer.getLangFuncs().main_function);
|
|
return {
|
|
return {
|
|
case_default: case_default,
|
|
case_default: case_default,
|
|
atoms: atoms,
|
|
atoms: atoms,
|
|
@@ -24942,10 +24945,14 @@ function uploadFile(evt) {
|
|
var txt = oFREvent.target.result;
|
|
var txt = oFREvent.target.result;
|
|
|
|
|
|
try {
|
|
try {
|
|
- ivprogCore.setPreviousAlgorithm(txt);
|
|
|
|
- window.renderAlgorithm();
|
|
|
|
|
|
+ if (txt.indexOf("::algorithm::") >= 0) {
|
|
|
|
+ prepareActivityToStudent(txt, true);
|
|
|
|
+ } else {
|
|
|
|
+ ivprogCore.setPreviousAlgorithm(txt);
|
|
|
|
+ window.renderAlgorithm();
|
|
|
|
+ }
|
|
} catch (e) {
|
|
} 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 _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 _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 _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;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|
|
- if (isValidIdentifier(new_name)) {
|
|
|
|
|
|
+ if ((0,_util_utils__WEBPACK_IMPORTED_MODULE_5__.isValidIdentifier)(new_name)) {
|
|
if (globalNameAlreadyExists(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'));
|
|
_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 {
|
|
} else {
|
|
@@ -25024,7 +25033,7 @@ function updateName(global_var, new_name, global_obj_dom) {
|
|
global_var.name = new_name;
|
|
global_var.name = new_name;
|
|
}
|
|
}
|
|
} else {
|
|
} 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;
|
|
return false;
|
|
}
|
|
}
|
|
|
|
|
|
-function isValidIdentifier(identifier_str) {
|
|
|
|
- return /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(identifier_str);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
function updateType(global_var, new_type) {
|
|
function updateType(global_var, new_type) {
|
|
var new_dimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
var new_dimensions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
global_var.type = new_type;
|
|
global_var.type = new_type;
|
|
@@ -29644,7 +29649,7 @@ exports.Maybe = Maybe;
|
|
/***/ ((module) => {
|
|
/***/ ((module) => {
|
|
|
|
|
|
"use strict";
|
|
"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
|