Add output-only on UI

This commit is contained in:
cuom1999 2023-03-09 22:31:55 -06:00
parent bdae79eeda
commit 195450ebc3
15 changed files with 708 additions and 566 deletions

View file

@ -105,7 +105,7 @@
}
});
editor.getSession().setUseWrapMode(true);
editor.setFontSize(14);
editor.setFontSize(15);
editor.setShowPrintMargin(false);
// editor.setPrintMarginColumn(100);
editor.focus();
@ -143,10 +143,13 @@
});
}
$('#file-upload').on('click change', function(e) {
$('#id_source_file').on('click change', function(e) {
var file = $(this)[0].files[0];
if (file) {
if (file.name.endsWith('sb3')) {
if (file.name.endsWith('zip')) {
update_submit_area(file.name);
}
else if (file.name.endsWith('sb3')) {
get_source_scratch(file);
}
else {
@ -195,7 +198,7 @@
{% endif %}
{% endif %}
<form id="problem_submit" action="" method="post" class="form-area">
<form id="problem_submit" action="" method="post" class="form-area" enctype="multipart/form-data">
{% csrf_token %}
{{ form.non_field_errors() }}
<div id="submit-wrapper">
@ -225,7 +228,8 @@
{% if no_judges %}
<span style="color: red">{{ _('No judge is available for this problem.') }}</span>
{% else %}
<input type="file" id="file-upload">
{{ form.source_file.errors }}
{{ form.source_file }}
<div class="submit-bar">
{{ form.judge }}
<input type="submit" value="{{ _('Submit!') }}" class="button small"