CSC/ECE 517 Fall 2014/oss E1460 aua

From Expertiza_Wiki
Jump to navigation Jump to search

Expertiza - Refactoring StudentQuizController

Introduction

Expertiza<ref name="expertiza>Expertiza http://wikis.lib.ncsu.edu/index.php/Expertiza</ref> is a web application available to both students and professors. The Expertiza project is a system to create reusable learning objects through peer review. Expertiza supports team projects, and the submission of almost any document type, including URLs and wiki pages. Students can keep a track of their assignments, teammates and can conduct peer reviews on diverse topics and projects. It is an open source project developed on Ruby on Rails platform. More information on Expertiza can be found here. The source code can be forked and cloned for making modifications. ertiza with main focus of Refactoring the Users Controller.

Project Description

Classes : student_quiz_controller.rb
What it does : This class records the quizzes that the student has attempted and its progress and also submits grades for the essays in the quizzes attempted by the student.
What has to be changed :

  • change list to index (and others in the RESTful style)
  • Pluralize the class (StudentQuizzesController)
  • only set one instance variable (use a form object if necessary)
  • graded? - review boolean zen
  • Modify methods to conform to RESTful style
  • Reducing the number of instance variables per action to one
  • Code cleanup by using string interpolation instead of concatenation, replacing '==' with eql? and :key =>'value' with key: 'value', modifying declarations of Arrays and Hashes,removing commented out code
  • Replace find_by with where to follow Rails 4.0 conventions

Modification to Existing Code

RESTful style implementation

  • Modifications to student_quiz_controller.rb :

The purpose of the list method in StudentQuizzes Controller is to list all registered users. This implementation did not conform to RESTful guidelines. The list method was renamed to index and cleaned up to remove unnecessary business logic. Further, we refactored all the references of list method in StudentQuizControllers, StudentQuiz views, StudentQuiz tests index method.


References

<references/>