Skip to content

Commit

Permalink
Grading queue (quick and dirty)
Browse files Browse the repository at this point in the history
  • Loading branch information
qrohlf committed Nov 5, 2014
1 parent 65c07a6 commit 0043049
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.1.4
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ruby "2.1.3"
ruby "2.1.4"
source 'https://rubygems.org'
source 'https://rails-assets.org'

Expand Down
5 changes: 3 additions & 2 deletions app/controllers/submissions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ class SubmissionsController < ApplicationController
# GET /submissions.json
def index
# this is such an awful hack
last_submissions = Student.all.map{|student| student.submissions.not_graded.order(:created_at).last }.compact
@submissions = last_submissions.sort{|x, y| x.created_at <=> y.created_at}
last_submissions = Student.all.map{|student| student.submissions.order(:created_at).last }.compact
last_not_graded_submissions = last_submissions.select{|s| s.status == "not_graded"}
@submissions = last_not_graded_submissions.sort{|x, y| x.created_at <=> y.created_at}
# @submissions.select!{|s| s.status == :not_graded}
end

Expand Down

0 comments on commit 0043049

Please sign in to comment.