From c3ae54595fee57f9fe90cd0333ef1dc6a6634a9e Mon Sep 17 00:00:00 2001 From: David Schuster Date: Mon, 20 Mar 2017 12:51:30 -0400 Subject: [PATCH 01/26] Fixed Date time picker always displaying 12AM --- app/assets/javascripts/initialize_datetimepickers.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/initialize_datetimepickers.js b/app/assets/javascripts/initialize_datetimepickers.js index da6562636..06f2a2779 100644 --- a/app/assets/javascripts/initialize_datetimepickers.js +++ b/app/assets/javascripts/initialize_datetimepickers.js @@ -7,7 +7,7 @@ $(datetimeElts[i]).flatpickr({ enableTime: true, altInput: true, - defaultDate: moment($(datetimeElts[i]).val()).format("MMMM D YYYY, h:mm A") + defaultDate: new Date(datetimeElts[i].getAttribute("value")) }) } From 0550cf633451cf086c107c5fccb65972d31bd7dd Mon Sep 17 00:00:00 2001 From: Billy Zhu Date: Wed, 29 Mar 2017 10:32:45 -0400 Subject: [PATCH 02/26] move get child status to after moss command (#817) --- app/controllers/courses_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index fd2b1f8a1..0ff72a76e 100755 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -419,8 +419,8 @@ def runMoss `~/Autolab/script/cleanMoss #{tmp_dir}` # Now run the Moss command @mossCmdString = @mossCmd.join(" ") - @mossExit = $?.exitstatus @mossOutput = `#{@mossCmdString} 2>&1` + @mossExit = $?.exitstatus # Clean up after ourselves (droh: leave for dsebugging) `rm -rf #{tmp_dir}` From 883cf33fd37074f3aa9ab11827b93dba62560bc8 Mon Sep 17 00:00:00 2001 From: Devansh Kukreja Date: Wed, 29 Mar 2017 18:50:15 -0400 Subject: [PATCH 03/26] Update .gitignore to ignore .vscode configs Namely address launch.json but also removes any additional vscode IDE-specific configurations --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 9f21d13b9..0c326f361 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ app/views/home/_topannounce.html.erb attachments/ doc/ out.txt +.vscode/ From 75c8a6ba85563293a4f8cb9292a61d8ec4f904a3 Mon Sep 17 00:00:00 2001 From: Devansh Kukreja Date: Wed, 29 Mar 2017 19:08:33 -0400 Subject: [PATCH 04/26] Hotfix tabs redirect (#824) * fixed problems page redirect * set up tab redirects by including a tag with each submit button * Fixed basic bug and commented code * removed vscode --- Gemfile.lock | 3 --- app/controllers/assessments_controller.rb | 15 ++++++++++++++- app/controllers/problems_controller.rb | 2 +- app/views/assessments/_edit_handin.html.erb | 2 +- app/views/assessments/_edit_penalties.html.erb | 2 +- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 9b7473499..8b05dd122 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -338,6 +338,3 @@ DEPENDENCIES turbolinks uglifier (>= 1.3.0) yard - -BUNDLED WITH - 1.13.7 diff --git a/app/controllers/assessments_controller.rb b/app/controllers/assessments_controller.rb index 985275e0c..dcacc15e7 100755 --- a/app/controllers/assessments_controller.rb +++ b/app/controllers/assessments_controller.rb @@ -537,7 +537,7 @@ def update flash[:success] = "Saved!" if @assessment.update!(edit_assessment_params) - redirect_to(action: :edit) && return + redirect_to(tab_index) && return end action_auth_level :releaseAllGrades, :instructor @@ -704,4 +704,17 @@ def valid_asmt_tar(tar_extract) end [asmt_rb_exists && asmt_yml_exists && (!asmt_name.nil?), asmt_name] end + + def tab_index + # Get the current tab's redirect path by checking the submit tag which tells us which submit button in the edit form was clicked + tab_name = "basic" + if params[:handin] + tab_name = "handin" + elsif params[:penalties] + tab_name = "penalties" + end + + edit_course_assessment_path(@course, @assessment) + "/#tab_"+tab_name + end + end diff --git a/app/controllers/problems_controller.rb b/app/controllers/problems_controller.rb index f2b38a65a..7c639ac26 100755 --- a/app/controllers/problems_controller.rb +++ b/app/controllers/problems_controller.rb @@ -57,7 +57,7 @@ def set_problem # creates a link to the problems page, which is a tab on assessments#edit # def problems_index - edit_course_assessment_path(@course, @assessment) + "/problems" + edit_course_assessment_path(@course, @assessment) + "/#tab_problems" end # this function says which problem attributes can be mass-assigned to, and which cannot diff --git a/app/views/assessments/_edit_handin.html.erb b/app/views/assessments/_edit_handin.html.erb index 8de615680..5b286dfc8 100755 --- a/app/views/assessments/_edit_handin.html.erb +++ b/app/views/assessments/_edit_handin.html.erb @@ -47,5 +47,5 @@ <%= f.text_field :max_size, help_text: "The maximum size that a handin file can have, in megabytes (MB)." %>
- <%= f.submit "Save" , {:class=>"waves-effect waves-light btn primary"} %> + <%= submit_tag "Save" , {:class=>"waves-effect waves-light btn primary", :name=>"handin", } %>
diff --git a/app/views/assessments/_edit_penalties.html.erb b/app/views/assessments/_edit_penalties.html.erb index e9265efaf..891c3e40e 100755 --- a/app/views/assessments/_edit_penalties.html.erb +++ b/app/views/assessments/_edit_penalties.html.erb @@ -10,5 +10,5 @@ <%= f.score_adjustment_input :version_penalty, optional: true, help_text: "The penalty applied to submissions with version greater than the version threshold. It represents the number of points or the percentage of the total score removed per version above the threshold, and must be a non-negative number. For example, if this is set to 1 point and the version threshold to 3, the fifth version of a student's submissions would be docked 2 points. If left blank, the course default is used." %>
- <%= f.submit "Save" , {:class=>"waves-effect waves-light btn primary"} %> + <%= submit_tag "Save" , {:class=>"waves-effect waves-light btn primary", :name=>"penalties", } %>
From 0f5f49cedb1ea928bb500c78005bfb521630fe4a Mon Sep 17 00:00:00 2001 From: Aatish Nayak Date: Thu, 30 Mar 2017 12:29:15 -0400 Subject: [PATCH 05/26] Removed production devise config from .travis.yml (#834) --- .travis.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index b27a05b23..414c27be2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,17 +7,8 @@ env: - secure: Z6YE6NuDeuraasd5gFG+x7PU3rKxhLjL6VZ7HJfZJEVyxFucRz8Hv4xlxkQV3P61w6S0uyp/reXwKy8meYAQLzVZ4pBpK7sEeSZ5w00WRH8NCGeMJmwdQi2JLCYRZ/KdOc0o5l5bbND+JG1o/U9HtG2cHO2G8M6hVGbARn+ywLg= before_script: - AUTOLAB=`pwd`; echo $AUTOLAB; -- cd ~ -- curl -L -o id_ci_github.enc "$CI_GITHUB_USER_PRIVATE_KEY_URL" -- openssl aes-256-cbc -k "$CI_GITHUB_USER_PRIVATE_KEY_SECRET" -in id_ci_github.enc - -d -a -out id_ci_github -- eval `ssh-agent` -- ssh-add -D -- chmod 600 id_ci_github -- ssh-add ./id_ci_github -- git clone git@github.com:autolab/cmu-prod.git -- cp cmu-prod/frontend-configs/initializers/devise.rb $AUTOLAB/config/initializers/devise.rb - cd $AUTOLAB +- cp config/initializers/devise.rb.template config/initializers/devise.rb - cp config/database.travis.yml config/database.yml - cp config/school.yml.template config/school.yml - cp config/autogradeConfig.rb.template config/autogradeConfig.rb From 6910e8e4d70ecaa5d9c1e0e0dfc6ae310c82772c Mon Sep 17 00:00:00 2001 From: Billy Zhu Date: Fri, 31 Mar 2017 22:05:25 -0400 Subject: [PATCH 06/26] set z-index for annotation forms (#813) --- app/assets/stylesheets/annotations.css | 1 + 1 file changed, 1 insertion(+) diff --git a/app/assets/stylesheets/annotations.css b/app/assets/stylesheets/annotations.css index b60e51894..cbf3f7817 100755 --- a/app/assets/stylesheets/annotations.css +++ b/app/assets/stylesheets/annotations.css @@ -146,6 +146,7 @@ pre code { padding: 6px; background-color: #fff; margin-top: 6px; + z-index: 5; } .annotation-edit-form { From e52eb87553876d5e3e5a5f89c3c600c238fc840d Mon Sep 17 00:00:00 2001 From: Jacob Buckheit Date: Mon, 3 Apr 2017 23:02:33 -0400 Subject: [PATCH 07/26] Fix submit buttons on penalties and handin page. (#829) --- app/views/assessments/_edit_handin.html.erb | 2 +- app/views/assessments/_edit_penalties.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/assessments/_edit_handin.html.erb b/app/views/assessments/_edit_handin.html.erb index 5b286dfc8..e262e0058 100755 --- a/app/views/assessments/_edit_handin.html.erb +++ b/app/views/assessments/_edit_handin.html.erb @@ -47,5 +47,5 @@ <%= f.text_field :max_size, help_text: "The maximum size that a handin file can have, in megabytes (MB)." %>
- <%= submit_tag "Save" , {:class=>"waves-effect waves-light btn primary", :name=>"handin", } %> + <%= f.submit "Save", :name=>"handin" %>
diff --git a/app/views/assessments/_edit_penalties.html.erb b/app/views/assessments/_edit_penalties.html.erb index 891c3e40e..cd94231da 100755 --- a/app/views/assessments/_edit_penalties.html.erb +++ b/app/views/assessments/_edit_penalties.html.erb @@ -10,5 +10,5 @@ <%= f.score_adjustment_input :version_penalty, optional: true, help_text: "The penalty applied to submissions with version greater than the version threshold. It represents the number of points or the percentage of the total score removed per version above the threshold, and must be a non-negative number. For example, if this is set to 1 point and the version threshold to 3, the fifth version of a student's submissions would be docked 2 points. If left blank, the course default is used." %>
- <%= submit_tag "Save" , {:class=>"waves-effect waves-light btn primary", :name=>"penalties", } %> + <%= f.submit "Save", :name=>"penalties" %>
From ec0ead00cfcf8d61c2b3ac2abd7752d2d9eb72c0 Mon Sep 17 00:00:00 2001 From: Billy Zhu Date: Mon, 3 Apr 2017 23:12:47 -0400 Subject: [PATCH 08/26] update gradesheet sorting function to better handle NaN (#833) --- app/assets/javascripts/gradesheet.js.erb | 28 ++++++------------------ 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/app/assets/javascripts/gradesheet.js.erb b/app/assets/javascripts/gradesheet.js.erb index 667cb7c49..cc2122737 100755 --- a/app/assets/javascripts/gradesheet.js.erb +++ b/app/assets/javascripts/gradesheet.js.erb @@ -22,36 +22,22 @@ jQuery(function() { 'X-CSRF-Token' : $('meta[name="csrf-token"]').attr('content') }, }); - // fast numeric-html sorts (but --'s aren't sorted correctly) + + // fast numeric-html sorts, NaN treated as negative infinity jQuery.extend(jQuery.fn.dataTableExt.oSort, { "num-html-pre": function (a) { - return parseFloat(String(a).replace(/<[\s\S]*?>/g, "")); + var num = parseFloat(String(a).replace(/<[\s\S]*?>/g, "")); + return isNaN(num) ? Number.NEGATIVE_INFINITY : num }, "num-html-asc": function ( a, b ) { - a_nan = isNaN(a); - b_nan = isNaN(b); - if (a_nan) { - if (b_nan) { return 0; } else { return -1; } - } else { - if (b_nan) { return 1; } else { - return ((a < b) ? -1 : ((a > b) ? 1 : 0)); - } - } + return ((a < b) ? -1 : ((a > b) ? 1 : 0)); }, "num-html-desc": function ( a, b ) { - a_nan = isNaN(a); - b_nan = isNaN(b); - if (a_nan) { - if (b_nan) { return 0; } else { return 1; } - } else { - if (b_nan) { return -1; } else { - return ((a > b) ? -1 : ((a < b) ? 1 : 0)); - } - } + return ((a > b) ? -1 : ((a < b) ? 1 : 0)); } - } ); + }); // from http://www.datatables.net/plug-ins/api. ugly, but for now... jQuery.fn.dataTableExt.oApi.fnSetFilteringDelay = function ( oSettings, iDelay ) { From a0de42f53f2ad4510763a4f8fe1d0b2974daf2c6 Mon Sep 17 00:00:00 2001 From: Billy Zhu Date: Mon, 3 Apr 2017 23:18:53 -0400 Subject: [PATCH 09/26] disable browser autocomplete for username in extensions (#832) --- app/views/extensions/index.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/extensions/index.html.erb b/app/views/extensions/index.html.erb index 7573091f8..c7251aa8a 100755 --- a/app/views/extensions/index.html.erb +++ b/app/views/extensions/index.html.erb @@ -119,7 +119,7 @@ <% end %>
- +

Select a new due date

From 304242849d4660a353d790932b8f9d9c4da07a93 Mon Sep 17 00:00:00 2001 From: Aatish Nayak Date: Wed, 12 Apr 2017 16:24:57 -0400 Subject: [PATCH 10/26] change how datepickers get default date (#846) --- app/assets/javascripts/initialize_datetimepickers.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/initialize_datetimepickers.js b/app/assets/javascripts/initialize_datetimepickers.js index 06f2a2779..98de04dff 100644 --- a/app/assets/javascripts/initialize_datetimepickers.js +++ b/app/assets/javascripts/initialize_datetimepickers.js @@ -1,4 +1,4 @@ -// Initialize all Bootstrap 3 Datetime Pickers on the page +// Initialize all Flatpicker Datetime Pickers on the page ;(function() { $(document).ready(function() { @@ -7,7 +7,7 @@ $(datetimeElts[i]).flatpickr({ enableTime: true, altInput: true, - defaultDate: new Date(datetimeElts[i].getAttribute("value")) + defaultDate: new Date(moment($(datetimeElts[i]).val())) }) } @@ -16,7 +16,7 @@ for (var i = 0; i < dateElts.length; i++) { $(dateElts[i]).flatpickr({ altInput: true, - defaultDate: moment($(dateElts[i]).val()).format("MMMM D YYYY") + defaultDate: new Date(moment($(dateElts[i]).val()).format("MMMM D YYYY")) }) } }); From f3d22653ed8adb24551138628f2eaa5a42e0a815 Mon Sep 17 00:00:00 2001 From: Jacob Buckheit Date: Thu, 13 Apr 2017 15:02:48 -0400 Subject: [PATCH 11/26] Remove 'waves' effect from buttons. (#837) --- app/views/announcements/_announcement.html.erb | 4 ++-- app/views/assessment_user_data/edit.html.erb | 2 +- app/views/assessments/_edit_basic.html.erb | 2 +- app/views/assessments/_gradesheet.html.erb | 2 +- app/views/assessments/_submission_summary_row.html.erb | 6 +++--- app/views/assessments/confirmInstall.html.erb | 2 +- app/views/assessments/index.html.erb | 2 +- app/views/autograders/_form.html.erb | 6 +++--- app/views/course_user_data/new.html.erb | 2 +- app/views/course_user_data/show.html.erb | 2 +- app/views/course_user_data/user.html.erb | 2 +- app/views/courses/confirmInstall.html.erb | 2 +- app/views/courses/createUser.html.erb | 2 +- app/views/courses/report_bug.html.erb | 2 +- app/views/courses/uploadRoster.html.erb | 2 +- app/views/devise/confirmations/new.html.erb | 2 +- app/views/devise/unlocks/new.html.erb | 2 +- app/views/groups/_new_form.html.erb | 2 +- app/views/groups/index.html.erb | 2 +- app/views/groups/show.html.erb | 2 +- app/views/jobs/tango_status.html.erb | 4 ++-- app/views/problems/_fields.html.erb | 4 ++-- app/views/schedulers/edit.html.erb | 2 +- app/views/schedulers/new.html.erb | 2 +- app/views/scoreboards/_form.html.erb | 4 ++-- app/views/submissions/new.html.erb | 2 +- app/views/users/edit.html.erb | 2 +- app/views/users/show.html.erb | 2 +- 28 files changed, 36 insertions(+), 36 deletions(-) diff --git a/app/views/announcements/_announcement.html.erb b/app/views/announcements/_announcement.html.erb index f27068d66..60bf44dd0 100755 --- a/app/views/announcements/_announcement.html.erb +++ b/app/views/announcements/_announcement.html.erb @@ -3,11 +3,11 @@ <%= announcement.description %>
<% if (@cud.instructor? && @cud.course_id == announcement.course_id) || @cud.administrator? then %> <%= link_to [:edit, @course, announcement] do %> - Edit + Edit <% end %> <%= link_to [@course, announcement], method: :delete, data: {confirm: "Are you sure you want to delete this announcement?"} do %> - Delete + Delete <% end %> <% end %> diff --git a/app/views/assessment_user_data/edit.html.erb b/app/views/assessment_user_data/edit.html.erb index a5baaff02..188d2d30f 100755 --- a/app/views/assessment_user_data/edit.html.erb +++ b/app/views/assessment_user_data/edit.html.erb @@ -22,6 +22,6 @@ - <%= f.submit "Save" , {:class=>"waves-effect waves-light btn primary"} %> + <%= f.submit "Save" , {:class=>"btn primary"} %> <% end %> diff --git a/app/views/assessments/_edit_basic.html.erb b/app/views/assessments/_edit_basic.html.erb index bdc8aba2a..98a92512f 100755 --- a/app/views/assessments/_edit_basic.html.erb +++ b/app/views/assessments/_edit_basic.html.erb @@ -93,5 +93,5 @@
<%= f.submit "Save" %> - <%= link_to "Delete Assessment", course_assessment_path(@course, @assessment), method: :delete, class: 'waves-effect waves-light btn btn-danger', data: { confirm: " Deleting will delete all associated assessment data and cannot be undone. Are you sure you want to delete this assessment?" } %> + <%= link_to "Delete Assessment", course_assessment_path(@course, @assessment), method: :delete, class: 'btn btn-danger', data: { confirm: " Deleting will delete all associated assessment data and cannot be undone. Are you sure you want to delete this assessment?" } %>
diff --git a/app/views/assessments/_gradesheet.html.erb b/app/views/assessments/_gradesheet.html.erb index 5889d05de..ea52668f8 100755 --- a/app/views/assessments/_gradesheet.html.erb +++ b/app/views/assessments/_gradesheet.html.erb @@ -226,7 +226,7 @@ Saving... - Save + Save Try again? diff --git a/app/views/assessments/_submission_summary_row.html.erb b/app/views/assessments/_submission_summary_row.html.erb index 59d6afcd3..bf73d7734 100644 --- a/app/views/assessments/_submission_summary_row.html.erb +++ b/app/views/assessments/_submission_summary_row.html.erb @@ -122,10 +122,10 @@
<% if @cud.instructor? then %> <% if @assessment.has_autograder? and submission.version > 0 then %> - <%= link_to 'Regrade', [:regrade, @course, @assessment, submission_id: submission], {method: :post, class:"waves-effect waves-light btn small"} %> + <%= link_to 'Regrade', [:regrade, @course, @assessment, submission_id: submission], {method: :post, class:"btn small"} %> <% end %> - <%= link_to 'Destroy', [:destroyConfirm, @course, @assessment, submission], {:class=>"waves-effect waves-light btn small"} %> - <%= link_to 'Edit', [:edit, @course, @assessment, submission], {:class=>"waves-effect waves-light btn small"} %> + <%= link_to 'Destroy', [:destroyConfirm, @course, @assessment, submission], {:class=>"btn small"} %> + <%= link_to 'Edit', [:edit, @course, @assessment, submission], {:class=>"btn small"} %> <% end %> <% if @cud.instructor? %> diff --git a/app/views/assessments/confirmInstall.html.erb b/app/views/assessments/confirmInstall.html.erb index 0864d4b39..e152b8542 100755 --- a/app/views/assessments/confirmInstall.html.erb +++ b/app/views/assessments/confirmInstall.html.erb @@ -44,6 +44,6 @@ Description: <%= f.text_area :description,:cols=>60,:rows=>8%> - <%= f.submit "Create" , {:class=>"waves-effect waves-light btn primary"} %> + <%= f.submit "Create" , {:class=>"btn primary"} %> <% end %> <% end %> diff --git a/app/views/assessments/index.html.erb b/app/views/assessments/index.html.erb index af3f3d678..c2ffc3efc 100755 --- a/app/views/assessments/index.html.erb +++ b/app/views/assessments/index.html.erb @@ -24,7 +24,7 @@

Instructor Actions

<%= link_to 'Install Assessment', {:action=>"installAssessment"}, - {:title=>"Install Assessment", :class => "waves-effect waves-light btn btn-large red darken-3" } %> + {:title=>"Install Assessment", :class => "btn btn-large red darken-3" } %> <% end %> diff --git a/app/views/autograders/_form.html.erb b/app/views/autograders/_form.html.erb index fcd077977..3bc9d1c7f 100755 --- a/app/views/autograders/_form.html.erb +++ b/app/views/autograders/_form.html.erb @@ -35,7 +35,7 @@ help_text: "Check to release autograded scores to students immediately after autograding (strongly recommended)." %>
-