diff --git a/app/models/assignment.rb b/app/models/assignment.rb index f4e0e6e..d82c8e5 100644 --- a/app/models/assignment.rb +++ b/app/models/assignment.rb @@ -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 diff --git a/app/models/student.rb b/app/models/student.rb index 0ba4240..569b545 100644 --- a/app/models/student.rb +++ b/app/models/student.rb @@ -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(", ") diff --git a/app/views/students/show.html.haml b/app/views/students/show.html.haml index 55c4f84..2e8b72e 100644 --- a/app/views/students/show.html.haml +++ b/app/views/students/show.html.haml @@ -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)