From 614f928b394e9d58202991c37bc36663ce870ef0 Mon Sep 17 00:00:00 2001 From: Aatish Nayak Date: Mon, 6 Mar 2017 21:22:04 -0500 Subject: [PATCH] Patches for release v2.0.3 (#806) * Fix Manage Submissions Page functionality (#805) * use $? instead of $CHILD_STATUS in Moss (#804) --- app/assets/javascripts/manage_submissions.js | 13 +- app/controllers/courses_controller.rb | 2 +- app/views/submissions/edit.html.erb | 4 +- app/views/submissions/index.html.erb | 124 +++++++++++-------- app/views/submissions/new.html.erb | 4 +- 5 files changed, 80 insertions(+), 67 deletions(-) diff --git a/app/assets/javascripts/manage_submissions.js b/app/assets/javascripts/manage_submissions.js index 741897d6c..4dcc93735 100644 --- a/app/assets/javascripts/manage_submissions.js +++ b/app/assets/javascripts/manage_submissions.js @@ -35,15 +35,8 @@ jQuery(function($) { 'sPaginationType': 'full_numbers', 'iDisplayLength': 100, 'oLanguage': { - 'sLengthMenu': 'Display records ยท ' + - '
' + - '
' + 'sLengthMenu':'' + + '' }, "columnDefs": [{ "targets": [7], @@ -60,7 +53,7 @@ jQuery(function($) { }); var ids = []; - $("input.checkbox:checked").each(function() { + $("input[type='checkbox']:checked").each(function() { ids.push($(this).val()); }); diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 688066ed5..fd2b1f8a1 100755 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -419,7 +419,7 @@ def runMoss `~/Autolab/script/cleanMoss #{tmp_dir}` # Now run the Moss command @mossCmdString = @mossCmd.join(" ") - @mossExit = $CHILD_STATUS + @mossExit = $?.exitstatus @mossOutput = `#{@mossCmdString} 2>&1` # Clean up after ourselves (droh: leave for dsebugging) diff --git a/app/views/submissions/edit.html.erb b/app/views/submissions/edit.html.erb index 8a35cb8fc..e017ce176 100755 --- a/app/views/submissions/edit.html.erb +++ b/app/views/submissions/edit.html.erb @@ -29,13 +29,13 @@ Notes: - <%= f.text_area :notes, :rows=>5 %> + <%= f.text_area :notes, :rows=>5, class: 'materialize-textarea', placeholder: "Notes on submission"%> Tweak: <%= f.fields_for :tweak, @submission.tweak do |t| %> - <%= t.text_field :value %> + <%= t.text_field :value, placeholder: "Number of points or percentage" %> <%= t.select :kind, options_for_select({"points" => "points", "%" => "percent"}, :selected => (@submission.tweak ? @submission.tweak.kind : "points")) %> <% end %> diff --git a/app/views/submissions/index.html.erb b/app/views/submissions/index.html.erb index 8d346d318..6bb251ea4 100755 --- a/app/views/submissions/index.html.erb +++ b/app/views/submissions/index.html.erb @@ -2,58 +2,74 @@ <% content_for :stylesheets do %> <%= stylesheet_link_tag "datatable.adapter" %> + + <% end %> <% content_for :javascripts do %> <%= external_javascript_include_tag "lodash", "3.3.1" %> <%= javascript_include_tag "sorttable" %> - <%= external_javascript_include_tag "jquery.dataTables", "1.10.5" %> + <%= external_javascript_include_tag "jquery.dataTables", "1.10.9" %> <%= javascript_include_tag "table_floating_header" %> <%= javascript_include_tag "manage_submissions" %> <% end %> - +

Manage Submissions


-

-<%= link_to "Create New Submission", new_course_assessment_submission_path(@course, @assessment), - {:title=>"Create a new submission for a student, with an option to submit a handin file on their behalf", - :class=>"btn"} %> -<%= link_to "Download All Submissions", - downloadAll_course_assessment_submissions_path(@course, @assessment), - {:title=>"Down all submissions from each student", - :class=>"btn"} %> -<%= link_to "Download Final Submissions", - downloadAll_course_assessment_submissions_path(@course, @assessment, final: true), - {:title=>"Download the most recent submission from each student", - :class=>"btn"} %> -<%= link_to "Missing Submissions", - missing_course_assessment_submissions_path(@course, @assessment), - {:title=>"List the students who have not submitted anything. You'll be given the option to create new submissions for the missing students", - :class=>"btn"} %> -

-

-<% if @autograded then %> -<%= link_to "Regrade All", - [:regradeAll, @course, @assessment], - { method: :post, - :title=>"Regrade the most recent submission from each student", - :confirm=>"Are you sure you want to do this? It will regrade the most recent submission from each student, which might take a while.", - :class=>"btn"} %> -<%= link_to "Regrade 0 Submissions", - [:regradeBatch, @course, @assessment], - { method: :post, - :title=>"Regrade the most recent submission from each student", - :class=>"btn", - :id => "batch-regrade", - :style => "display:none;"} %> +

+ <%= link_to "Create New Submission".html_safe, new_course_assessment_submission_path(@course, @assessment), + {:title=>"Create a new submission for a student, with an option to submit a handin file on their behalf", + :class=>""} %> + | + <%= link_to "Download All Submissions".html_safe, + downloadAll_course_assessment_submissions_path(@course, @assessment), + {:title=>"Down all submissions from each student", + :class=>""} %> + | + <%= link_to "Download Final Submissions".html_safe, + downloadAll_course_assessment_submissions_path(@course, @assessment, final: true), + {:title=>"Download the most recent submission from each student", + :class=>""} %> + | + <%= link_to "Missing Submissions".html_safe, + missing_course_assessment_submissions_path(@course, @assessment), + {:title=>"List the students who have not submitted anything. You'll be given the option to create new submissions for the missing students", + :class=>""} %> -<% end %>

-
+
+ <% if @autograded then %> +
+ <%= link_to "Regrade All", + [:regradeAll, @course, @assessment], + { method: :post, + :title=>"Regrade the most recent submission from each student", + :confirm=>"Are you sure you want to do this? It will regrade the most recent submission from each student, which might take a while.", + :class=>"btn"} %> +
+
-

+ <%= link_to "Regrade 0", + [:regradeBatch, @course, @assessment], + { method: :post, + :title=>"Regrade the most recent submission from each student", + :class=>"btn float-right", + :id => "batch-regrade", + :style => "display:none;"} %> +

+ <% end %> +
<% headers = ["Submitted By", "Version", "Submission Date (YYYY-MM-DD)", "File", "IP Address", "Actions", "isLatest"] %> <% if @assessment.has_custom_form then %> @@ -66,7 +82,7 @@ <% end %> - + <% for header in headers %> <% end %> @@ -75,7 +91,10 @@ <% for submission in @submissions %> - + - diff --git a/app/views/submissions/new.html.erb b/app/views/submissions/new.html.erb index 589fb2f7e..da1d83890 100755 --- a/app/views/submissions/new.html.erb +++ b/app/views/submissions/new.html.erb @@ -62,13 +62,13 @@ - +
<%= header %>
+ + + <%= "#{submission.course_user_datum.last_name}, #{submission.course_user_datum.first_name}" %> <%= link_to submission.course_user_datum.email, history_course_assessment_path(@course, @assessment, cud_id: submission.course_user_datum_id, partial: true), @@ -97,19 +116,20 @@ <%= submission.submitter_ip %> <% if @autograded and submission.version > 0 then %> - <%= link_to "Regrade", - [:regrade, @course, @assessment, submission_id: submission.id], - { method: :post, - :title=>"Rerun the autograder on this submission", - :class=>"waves-effect waves-light btn small regrade-override"} %> - <% end %> - <%= link_to "Edit", [:edit, @course, @assessment, submission], - {:title=>"Edit the grading properties of this submission", - :class=>"btn small"} %> - <%= link_to "Destroy", destroyConfirm_course_assessment_submission_path(@course, @assessment, submission), - {:title=>"Destroy this submission forever", - :class=>"btn small"} %> + + <% if @autograded and submission.version > 0 then %> + <%= link_to "autorenew".html_safe, + [:regrade, @course, @assessment, submission_id: submission.id], + { method: :post, + :title=>"Rerun the autograder on this submission", + :class=>"btn small regrade-override"} %> + <% end %> + <%= link_to "edit".html_safe, [:edit, @course, @assessment, submission], + {:title=>"Edit the grading properties of this submission", + :class=>"btn small"} %> + <%= link_to "delete".html_safe, destroyConfirm_course_assessment_submission_path(@course, @assessment, submission), + {:title=>"Destroy this submission forever", + :class=>"btn small"} %> <%= submission.latest? %> File:<%= f.file_field :file %>
Notes:<%= f.text_area :notes %>Notes:<%= f.text_area :notes, class: 'materialize-textarea', placeholder: "Notes on submission"%>
Tweak: <%= f.fields_for :tweak, @submission.tweak do |t| %> - <%= t.text_field :value %> + <%= t.text_field :value, placeholder: "Number of points or percentage" %> <%= t.select :kind, options_for_select({"points" => "points", "%" => "percent"}, :selected => (@submission.tweak ? @submission.tweak.kind : "points")) %> <% end %>