CSC/ECE 517 Spring 2014/oss E1404 mnp

From Expertiza_Wiki
Revision as of 04:21, 30 March 2014 by Nvnaik (talk | contribs) (Created page with "'''Improvement to View Scores''' == Introduction == === Background === The scores are calculated for multiple views. This code is very slow because: * Separate db queries are us...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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.

Design and implementation

Objective 1: Get scores of all the assignments for a given user

Objective 2: Improve the speed of getting scores for a given assignment

Objective 3: Get scores of all the users for a given course