CSC/ECE 517 Fall 2014/OSS E1464 vnn

From Expertiza_Wiki
Jump to navigation Jump to search

E1464: Refactoring User model

The requirements provided for the Open Source System project of Expertiza were as follows :
Classes:
user.rb (295 lines)

What they do:
This model helps the user log in and checks whether the user is a student, admin or a super admin. It also helps reset passwords and assign instrcutors to the user.

What is needed:

  • Writing proper getters/setters if necessary, otherwise remove getters/setters
  • Replacing inefficient boolean logic (`if true` is not conditional)
  • Replacing old-style ActiveRecord queries
  • Using {} and [] instead of Hash.new and Array.new
  • Not instantiating more than 1 instance variable per action

Introduction to Expertiza

Expertiza is a project developed using Ruby on Rails platform. It provides features like peer review, team assignments and submission of projects. This can be achieved by submitting code base, URL of hosted code on remote server and Wiki submissions. It is open source application and the code can be cloned from github. This application provides an efficient way to manage assignments, grades and reviews. This makes the process easier and faster when the class strength is large.

Expertiza is supported by National Science Foundation under Grant No. 0536558. Additional funding from the NCSU Learning in a Technology-Rich Environment (LITRE) program, the NCSU Faculty Center for Teaching and Learning, the NCSU STEM Initiative, and the Center for Advanced Computing and Communication.

Project Resources

GitHub Project Repository

VCL IP Address

Expertiza Wiki


Background

Any website that wants to provide content or features based on user preferences/roles needs to handle users. A website can do this by authenticating its users by a login/verification process.

Expertiza does this with the help of the User Model(user.rb). Expertiza has multiple user roles like Student, Instructor, Admin, Super Admin and TA. User Model helps the user login and verify to access privileges for each user.

The User Model(user.rb) also handle various other features like user access management (for example, Setting Instructors, TAs for a set of Students), user password management (for example, forgot password feature, generating random password) etc.