Skip to content

Commit

Permalink
Add a hacky flag to hide final grades until I've finished grading
Browse files Browse the repository at this point in the history
  • Loading branch information
qrohlf committed Nov 11, 2014
1 parent 67a4e16 commit f203171
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions app/models/assignment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,8 @@ def students_whose_latest_assignment_is_this
def self.submission_deadline_past?
DateTime.new(2014, 11, 12, 0, 0, 0, '-8').past? # 00:00 Wednesday November 12 2014
end

def self.everything_is_graded?
false
end
end
1 change: 1 addition & 0 deletions app/models/student.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def sync_tags(force_update: false, tags: nil)
return unless github_username and github_repo #can't update a user's tags if their info isn't here
return unless force_update or last_sync.nil? or last_sync < DateTime.now - 5.minutes
tags ||= Octokit.tags(github_username+'/'+github_repo).map(&:name)
puts tags
Assignment.find_each do |assignment|
assignment_tags = tags.select{|t| t.start_with? assignment.tag_prefix} unless assignment.tag_prefix.nil?
puts assignment.to_s+" -> "+assignment_tags.join(", ")
Expand Down
9 changes: 6 additions & 3 deletions app/views/students/show.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@
- if Assignment.submission_deadline_past? or params[:show_grade_info]
.alert.alert-info
The deadline for submitting lab assignments has passed.
%br/
Your final grade for the lab section of the course is
=@student.assignment_progress.grade rescue nil
- if Assignment.everything_is_graded?
%br/
Your final grade for the lab section of the course is
=@student.assignment_progress.grade rescue nil
- else
Final lab grades will be posted shortly.

- Assignment.find_each do |assignment|
- submissions = Submission.where(assignment: assignment, student: @student).order(:tag)
Expand Down

0 comments on commit f203171

Please sign in to comment.