Disable ace editor for output-only problem

This commit is contained in:
cuom1999 2023-03-17 13:41:03 -05:00
parent 1af44ac9fa
commit 56c5b3dd3c
2 changed files with 19 additions and 14 deletions

View file

@ -1194,6 +1194,7 @@ def problem_submit(request, problem, submission=None):
"ACE_URL": settings.ACE_URL,
"default_lang": default_lang,
"problem_id": problem.id,
"output_only": problem.data_files.output_only,
},
)

View file

@ -21,6 +21,9 @@
}
function update_language_template() {
{% if output_only %}
window.ace_source.env.editor.setReadOnly(true);
{% else %}
var source = $('textarea#id_source');
if (source.val() == window.previous_template.replace(/\r/g, '') || source.val() == '') {
var lang_id = $('#id_language').val();
@ -37,6 +40,7 @@
});
}
}
{% endif %}
}
function makeDisplayData(data) {