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

Lint views/autograders, fix help-block gap from input #1963

Merged
merged 3 commits into from
Oct 6, 2023
Merged
Changes from all 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
72 changes: 36 additions & 36 deletions app/views/autograders/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
<% content_for :javascripts do %>
<script>
$(function() {
$(document).on('change', ':file', function() {
var input = $(this),
numFiles = input.get(0).files ? input.get(0).files.length : 1,
label = input.val().replace(/\\/g, '/').replace(/.*\//, '');
input.trigger('fileselect', [numFiles, label]);
});
<script>
$(function() {
$(document).on('change', ':file', function() {
var input = $(this),
numFiles = input.get(0).files ? input.get(0).files.length : 1,
label = input.val().replace(/\\/g, '/').replace(/.*\//, '');
input.trigger('fileselect', [numFiles, label]);
});

$(document).ready( function() {
$('#autograder_makefile:file').on('fileselect', function(event, numFiles, label) {
$('#makefile_name').val(label);
});
$('#autograder_tar:file').on('fileselect', function(event, numFiles, label) {
$('#tar_name').val(label);
});
});
});
</script>
$(document).ready( function() {
$('#autograder_makefile:file').on('fileselect', function(event, numFiles, label) {
$('#makefile_name').val(label);
});
$('#autograder_tar:file').on('fileselect', function(event, numFiles, label) {
$('#tar_name').val(label);
});
});
});
</script>
<% end %>

<%= form_for [@course, @assessment, @autograder],
builder: FormBuilderWithDateTimeInput,
html: { multipart: true } do |f| %>
<%= form_for @autograder, url: course_assessment_autograder_path(@course, @assessment, @autograder),
builder: FormBuilderWithDateTimeInput,
html: { multipart: true } do |f| %>
<%= f.error_messages %>
<%= f.text_field :autograde_image, display_name: "VM Image",
help_text: "VM image for autograding (e.g. <kbd>rhel.img</kbd>). #{link_to 'Click here', tango_status_course_jobs_path} to view the list of VM images and pools currently being used.".html_safe %>

<%= f.text_field :autograde_image, display_name: "VM Image" %>
<p class="help-block">
VM image for autograding (e.g., "<kbd>rhel.img</kbd>"). <%= link_to "Click here", tango_status_course_jobs_path %> to view the list of VM images and pools currently being used.
</p>
<%= f.text_field :autograde_timeout, display_name: "Timeout",
help_text: "Timeout for autograding jobs (secs)" %>
<%= f.check_box :release_score, display_name: "Release Scores?",
help_text: "Check to release autograded scores to students immediately after autograding (strongly recommended)." %>
help_text: "Timeout for autograding jobs (secs)" %>
<%= f.check_box :release_score,
display_name: "Release Scores?",
help_text: "Check to release autograded scores to students immediately after autograding (strongly recommended)." %>

<%= f.file_field :makefile, label_text: "Autograder Makefile", action: :upload %>
<%= f.file_field :tar, label_text: "Autograder Tar", action: :upload %>
<p class="help-block">
Both of the above files will be renamed upon upload.
</p>
<%= f.file_field :makefile, label_text: "Autograder Makefile", action: :upload %>
<%= f.file_field :tar, label_text: "Autograder Tar", action: :upload %>
<p class="help-block">
Both of the above files will be renamed upon upload.
</p>

<%= f.submit "Save Settings" %>

<%= link_to "Delete Autograder", [@course, @assessment, :autograder], method: :delete, class: "btn danger",
data: {confirm: "Are you sure you want to delete the Autograder for this assesssment?"} %>

<%= link_to "Delete Autograder", course_assessment_autograder_path(@course, @assessment),
method: :delete, class: "btn danger",
data: { confirm: "Are you sure you want to delete the Autograder for this assesssment?" } %>
<% end %>