CSC/ECE 517 Fall 2024 - E2454. Refactor student task.rb

From Expertiza_Wiki
Revision as of 00:47, 30 October 2024 by Akoul2 (talk | contribs) (→‎References)
Jump to navigation Jump to search

Expertiza

Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc). The National Science Foundation supports the Expertiza project. It is used in select courses at NC State and by professors at several other colleges and universities.

[Expertiza](http://expertiza.ncsu.edu/) is a [Ruby on Rails](http://rubyonrails.org/) based open source project.

Problem Statement

Background

This project focuses on refactoring the StudentTask class to improve the organization, functionality, and separation of concerns. Currently, the class contains a mix of utility and class methods, many of which are static and should be moved into helper modules or relevant model classes, or broken down into separate, more maintainable methods. The goal is to make the class more efficient and follow best practices in object-oriented programming.

The StudentTask model is a significant part of the Expertiza website which maintains and handles student data who are participants under an assignment. Each assignment has a team, individual user participant and submission deadlines. The motive here is to refactor static methods called in the student_task.rb file and move them to helper classes for better object-oriented code design.

Refactor

The StudentTask model do not strictly follow the SRP and DRY principles and needed a lot of refactoring to make them more manageable in following Object-Oriented design and development.

Files modified:

  • student_task.rb
  • student_task_controller.rb
  • student_task_helper.rb
  • student_task_spec.rb

New files added:

  • student_task_helper_spec.rb

Refactoring

from_participant()

before:

after:

from_participantid()

before:

after:

removed it 

from_user()

before:

after:

get_author_feedback_data()

before:

after:

get_due_date_data()

before:

after:

peer_review_data()

before:

after:

get_submission_data()

before:

after:

deleted the method

get_timeline_data()

before:

after:

teamed_student()

before:

after:


Additional methods added :

Test Cases for StudentTask Model, Controller and helper classes

Next Steps

We are yet to discuss the scope of this project and whether it can be extended to other functionalities in Expertiza.

Team

Mentor

  • Ammana, Sahithi

Members

  • Eathamukkala, Akarsh Reddy
  • Koul, Anmol
  • More, Harsh

References

  1. Expertiza
  2. OSS Projects on Expertiza
  3. Github
  4. Pull Request
  5. Expertiza VCL Server