Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify Disable Autolab Submissions Option #2224

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 25 additions & 7 deletions app/views/assessments/_edit_handin.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
<% content_for :javascripts do %>
<%= javascript_include_tag "init_handin_datetimepickers" %>
<script>
function toggleHandinAutolab(disable_button) {
var handinField = document.querySelector('.handin-filename-field');
handinField.disabled = disable_button.checked;
if (!handinField.disabled) {
handinField.value = 'handin.c';
}
}

document.addEventListener('DOMContentLoaded', function() {
var disableHandinsCheckbox = document.querySelector('.disable-handins-toggle');
toggleHandinAutolab(disableHandinsCheckbox);
});
</script>
<% end %>
<%# Initialize datepickers by defining linked relationships (using IDs) %>
<%= f.datetime_select :start_at,
Expand Down Expand Up @@ -29,14 +43,18 @@
help_text: "Autolab has not been configured to use Github integration. Please contact your
Autolab admin to perform the necessary setup and configuration based on the instructions on our docs." %>
<% end %>
<% unless f.object.disable_handins %>
<%= f.text_field :handin_filename, help_text: "The suffix that is appended to student submission files.
Autolab stores submission files in the handin directory as email/version_fname", placeholder: "E.g. mm.c" %>
<% end %>
<%= f.text_field :max_size, help_text: "The maximum size that a handin file can have in megabytes (MB)." %>
<%= f.check_box :disable_handins,
help_text: "Check this to disallow handins through Autolab. This option can be used to track scores
for assignments that are not submitted through Autolab such as midterms and written assignments." %>
display_name: "Disable Autolab submissions",
help_text: "Check this to disallow handins through Autolab. This option can be used to track scores for assignments that are not submitted through Autolab such as midterms and written assignments.",
class: "disable-handins-toggle",
onchange: "toggleHandinAutolab(this)" %>
<%= f.text_field :handin_filename,
value: "handin.c",
disabled: true,
help_text: "The suffix that is appended to student submission files. Autolab stores submission files in the handin directory as email/version_fname",
placeholder: "E.g. mm.c",
class: "handin-filename-field" %>
<%= f.text_field :max_size, help_text: "The maximum size that a handin file can have in megabytes (MB)." %>

<div class="action_buttons">
<%= f.submit "Save", name: "handin" %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/assessments/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
<div class="card-content">
<p class="valign-wrapper">
<i class="material-icons valign">file_upload_off</i>
<b class="red-text">&nbsp;Handins are disabled for this assessment.</b>
<b class="red-text">&nbsp;Autolab handins are disabled for this assessment.</b>
</p>
</div>
</div>
Expand Down