CSC/ECE 517 Spring 2014/oss E1404 mnp
Improvement to View Scores
Introduction
Background
The scores are calculated for multiple views. This code is very slow because:
- Separate db queries are used for each rubric that has been filled out by anyone associated with the assignment; these queries are made sequentially while the HTML page is being written
- HTML for the whole page is generated, largely by controller methods, before anything is displayed.
This code needs to be made faster.
What needs to be done
Classes
models/score.rb controllers/grades_controller.rb
Objectives
- Participant.find(user id).scores # should return a Hash or new object, with a single database query. This method should return the scores of a participant from all the assignments in which the participant has submitted.
- assignment.scores # should return a Hash or new object, with a single database query. This method should return scores of all the participants in an assignment.
- course.scores # should return a Hash. This method should return scores of all the participants enrolled in a course.