Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ## controller
- def dan2
- # Last CPP Course Term (Format "200510") fall 2005
- last_cpp_course_term = "200510"
- # First Java Course Term (Format "200610") fall 2006
- first_java_course_term = "200520"
- # CPP Courses
- courses_152_cpp = Course.find(:all, :conditions => "section LIKE 'CSC 152%' AND term_code <= '#{last_cpp_course_term}'").collect { |course| course.class_id }
- # CPP Grades
- @grades_152_cpp = Grade.count(:group => :final_grade, :conditions => {:class_id => courses_152_cpp})
- # Java Courses
- courses_152_java = Course.find(:all, :conditions => "section LIKE 'CSC 152%' AND term_code >= '#{first_java_course_term}'").collect { |course| course.class_id }
- # Java Grades
- @grades_152_java = Grade.count(:group => :final_grade, :conditions => {:class_id => courses_152_java})
- end
- #### dan2
- <h1>How did CSC152 Students Compare C++ VS Java</h1>
- <h2>152 with java</h2>
- <table>
- <tr>
- <th>Grade</th><th>Count</th>
- </tr>
- <% for grade in @grades_152_java %>
- <tr>
- <td><%= grade[0] %></td>
- <td><%= grade[1] %></td>
- </tr>
- <% end %>
- </table>
- <h2>152 without java</h2>
- <table>
- <tr>
- <th>Grade</th><th>Count</th>
- </tr>
- <% for grade in @grades_152_cpp %>
- <tr>
- <td><%= grade[0] %></td>
- <td><%= grade[1] %></td>
- </tr>
- <% end %>
- </table>
Add Comment
Please, Sign In to add comment