|
@@ -80,13 +80,24 @@ function getAnswer () {
|
|
|
objAnswer.code = generator();
|
|
|
objAnswer.test_cases = ivprogCore.getTestCases();
|
|
|
objAnswer.logs = ivprogCore.getLogs();
|
|
|
- objAnswer.settings = {
|
|
|
- "programming": ivprogCore.Config.activity_programming_type,
|
|
|
- "functions": ivprogCore.Config.activity_functions,
|
|
|
- "datatypes": ivprogCore.Config.activity_datatypes,
|
|
|
- "commands": ivprogCore.Config.activity_commands,
|
|
|
- "filter": ivprogCore.Config.activity_filter
|
|
|
- };
|
|
|
+ try {
|
|
|
+ objAnswer.settings = {
|
|
|
+ "programming": Object.fromEntries(ivprogCore.Config.activity_programming_type),
|
|
|
+ "functions": Object.fromEntries(ivprogCore.Config.activity_functions),
|
|
|
+ "datatypes": Object.fromEntries(ivprogCore.Config.activity_datatypes),
|
|
|
+ "commands": Object.fromEntries(ivprogCore.Config.activity_commands),
|
|
|
+ "filter": Object.fromEntries(ivprogCore.Config.activity_filter)
|
|
|
+ };
|
|
|
+ }
|
|
|
+ catch(e) {
|
|
|
+ objAnswer.settings = {
|
|
|
+ "programming": [],
|
|
|
+ "functions": [],
|
|
|
+ "datatypes": [],
|
|
|
+ "commands": [],
|
|
|
+ "filter": []
|
|
|
+ };
|
|
|
+ }
|
|
|
|
|
|
return JSON.stringify(objAnswer, null, 4);
|
|
|
|
|
@@ -812,6 +823,19 @@ function showInvalidData () {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+function showMessageDialog (msg = "") {
|
|
|
+ $('.ui.height_100.add_accordion').dimmer({
|
|
|
+ closable: false
|
|
|
+ });
|
|
|
+ $('.dimmer_content_message h3').html(msg);
|
|
|
+ $('.dimmer_content_message button').text("OK");
|
|
|
+ $('.dimmer_content_message').css('display', 'block');
|
|
|
+ $('.ui.height_100.add_accordion').dimmer('add content', '.dimmer_content_message');
|
|
|
+ $('.ui.height_100.add_accordion').dimmer('show');
|
|
|
+ $('.dimmer_content_message button').on('click', function(e) {
|
|
|
+ $('.ui.height_100.add_accordion').dimmer('hide');
|
|
|
+ })
|
|
|
+}
|
|
|
|
|
|
function showInvalidFile () {
|
|
|
$('.ui.height_100.add_accordion').dimmer({
|