CSC/ECE 517 Spring 2024 - E2404 Refactor student teams functionality: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
This page provides details about Expertiza Issue E2404. "Refactor student_teams functionality" which is an OSS project in CSC517 Spring 2024.
This page provides details about Expertiza Issue E2404. "Refactor student_teams functionality" which is an OSS project in CSC517 Spring 2024.
== Background ==
The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages.
Users & Participants: Everyone who took the OODD class is a user in expertiza, and instructors can add users as participants in an assignment so that they can access it.
Almost everything within Assignments is done by participants, not users. That is, everything except teams_users. In the documentation, it can be noted that the team_users table references users instead of participants.
This anomaly causes problems with how student teams are rendered in the UI, and it doesn’t go well with the new functionality that was recently introduced.
== Requirements ==
=== Changing the schema ===
* Rename the table table teams_users to teams_participants
* Create a column that would be called “participant_id”, which will be a foreign key that references participants table
* Create a migration that fetches the assignment_id for each tuple from the teams table.
* Find out all the places where user_id is being used, refactor those so that participant_id is used.
=== Refactoring the teams rendering (/views/student_teams/view.html.erb) ===
* The logic in the team's view that iterates and fetches information of all the team members and displays them would be refactored so that it matches our new design.
* The new changes should not break the view that works for data where things are populated with user_id. Hence best approach is separate the older functionality into a separate partial and code the new functionality into a separate partial.
* All the teams are being formed with participant_id instead of user_id
=== Other Changes ===
* Update logic for all the crud functionalities in teams_users controller
* Rename the teams_users_controller to teams_participants_controller
* Some code where sql queries are written to fetch data, should be replaced with fetching data from rails ActiveRecord methods.
* The html.erb files have extensive ruby code written for fetching data from the database. This code should be removed from the view files and placed into helper classes.
* Extensive test cases should be present for all the code that is written.

Revision as of 23:29, 19 March 2024

This page provides details about Expertiza Issue E2404. "Refactor student_teams functionality" which is an OSS project in CSC517 Spring 2024.

Background

The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages. Users & Participants: Everyone who took the OODD class is a user in expertiza, and instructors can add users as participants in an assignment so that they can access it. Almost everything within Assignments is done by participants, not users. That is, everything except teams_users. In the documentation, it can be noted that the team_users table references users instead of participants. This anomaly causes problems with how student teams are rendered in the UI, and it doesn’t go well with the new functionality that was recently introduced.

Requirements

Changing the schema

  • Rename the table table teams_users to teams_participants
  • Create a column that would be called “participant_id”, which will be a foreign key that references participants table
  • Create a migration that fetches the assignment_id for each tuple from the teams table.
  • Find out all the places where user_id is being used, refactor those so that participant_id is used.

Refactoring the teams rendering (/views/student_teams/view.html.erb)

  • The logic in the team's view that iterates and fetches information of all the team members and displays them would be refactored so that it matches our new design.
  • The new changes should not break the view that works for data where things are populated with user_id. Hence best approach is separate the older functionality into a separate partial and code the new functionality into a separate partial.
  • All the teams are being formed with participant_id instead of user_id

Other Changes

  • Update logic for all the crud functionalities in teams_users controller
  • Rename the teams_users_controller to teams_participants_controller
  • Some code where sql queries are written to fetch data, should be replaced with fetching data from rails ActiveRecord methods.
  • The html.erb files have extensive ruby code written for fetching data from the database. This code should be removed from the view files and placed into helper classes.
  • Extensive test cases should be present for all the code that is written.