Permalink
Browse files

Corrected several small bugs

* reversed a change for Ruby 1.9
* fixed a rounding bug in the My Grades view
* changed the sort order of the School Year so that the most current year is the default
  • Loading branch information...
1 parent 9ed07f5 commit b918c4be9454e932389b6aebd0a71853175c9b42 @rnhurt committed Nov 7, 2010
@@ -95,12 +95,12 @@ def my_grades_detail_table(course_term)
<td>
}
if assignment_evaluation
- body += assignment_evaluation.points_earned.to_f.round.to_s
+ body += assignment_evaluation.points_earned
else
body += '-'
end
body += %{
- / #{assignment.possible_points.round}</td>
+ / #{assignment.possible_points}</td>
<td>#{score}</td>
</tr>
}
@@ -36,7 +36,8 @@
<% end %>
<tr><td colspan="3">
- <%= "Final: #{@course_term.course.grading_scale.calculate_letter_grade(final_score/terms_complete)} (#{(final_score / terms_complete).round}%)" %>
+ Final: <%= terms_complete > 0 ?
+ "#{@course_term.course.grading_scale.calculate_letter_grade(final_score/terms_complete)} (#{(final_score / terms_complete).round}%)" : 'n/a'%>
<hr />
</td></tr>
<% end %>
@@ -14,7 +14,7 @@ def self.get_params()
# Allow the user to select a single student or multiple students.
students = Student.active.sorted
homerooms = Student.homerooms
- years = SchoolYear.all(:order => "end_date DESC")
+ years = SchoolYear.all.sort{|a,b| b.end_date <=> a.end_date}
params = <<-EOS
<form action="/reports/progress_report.pdf" method="get">
@@ -8,14 +8,14 @@ class ReportCard
HEADER_HEIGHT = 50 # The size of the page header
GUTTER_SIZE = 5 # The size of the buffer between elements
- CHECKBOX = "\xE2\x98\x90".force_encoding('utf-8') # "☐"
+ CHECKBOX = "\xE2\x98\x90" #.force_encoding('utf-8') # "☐" force_encoding is for Ruby 1.9
# Build the parameter window to be shown to the user.
def self.get_params()
# Allow the user to select a single student or multiple students.
students = Student.active.sorted
homerooms = Student.homerooms
- years = SchoolYear.all(:order => "end_date DESC")
+ years = SchoolYear.all.sort{|a,b| b.end_date <=> a.end_date}
params = <<-EOS
<form action="/reports/report_card.pdf" method="get">
@@ -42,7 +42,7 @@ def self.get_params()
# List each homeroom
homerooms.each do |h|
- params += "<option value='#{h.name}'>#{h.name}</option>"
+ params += "<option value='#{h.homeroom}'>#{h.homeroom}</option>"
end
params += <<-EOS

0 comments on commit b918c4b

Please sign in to comment.