CSC/ECE 517 Fall 2022 - E2283 Refactor student teams functionality

From Expertiza_Wiki
Revision as of 22:42, 11 November 2022 by Sammana (talk | contribs)
Jump to navigation Jump to search

Introduction and prior work

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 CSC517 OODD class at NC State is a user in Expertiza, and instructors can add users as participants in an assignment so that they can access it to contribute, make changes and submit their work to be graded.

Almost all of the work within Assignments is done by participants, not users. All the tables use participant_id to track contributions to assignments, except teams_users. The team_users table references users instead of participants. This anomaly in the teams_users relation causes problems with how student teams are rendered in the UI, and it doesn’t mix well with the new functionality that was recently introduced. The participant_id field should be added to the model, and references that use user_id should also incorporate participant_id. Ideally, the application should use only participant_id, but to handle the existing data in the database without running a massive migration, the application should be able to handle both old records that use user_id and new ones that shall, from after this project is completed, use participant_id instead.

E2263 contains detailed information on the previous team's work on this feature.

Tasks

  • Find out all the places where user_id is being used, and refactor those so that participant_id is used.
  • Replace sql queries written to fetch data (Line 16 & 17 on app/models/signed_up_team.rb) with fetching data from rails ActiveRecord methods.
  • Remove the code in html.erb files for fetching data from the database and placing it in helper classes.
  • Add test cases for the changes made.
  • Resolve bug in the Team information page (“Your team” tab where you can view and manage your team), which allows the same user to be added twice (or many times).

Design

Changed Files

  • signed_up_team.rb (expertiza/app/models/signed_up_team.rb)

The model will be updated to fetch data from rails ActiveRecord methods instead of sql queries.

  • Remove code for fetching data from the following files:
    • app/views/advertise_for_partner/show.html.erb
    • app/views/assignments/edit/_badges.html.erb
    • app/views/assignments/edit/_calibration.html.erb
    • app/views/assignments/edit/_late_policy.html.erb
    • app/views/bookmarks/list.html.erb
    • app/views/duties/_add_duties.html.erb
    • app/views/grades/_author_feedback_tab.html.erb
    • app/views/grades/_questionnaire.html.erb
    • app/views/grades/_reviews.html.erb
    • app/views/grades/_tabbed_reviews.html.erb
    • app/views/grades/view_team.html.erb
    • app/views/join_team_requests/_list_received.html.erb
    • app/views/join_team_requests/_list_sent.html.erb
    • app/views/popup/participants_popup.html.erb
    • app/views/popup/view_review_scores_popup.html.erb
    • app/views/questionnaires/_quiz_questionnaire.html.erb
    • app/views/reports/_bookmark_rating_report.html.erb
    • app/views/reports/_calibration_report.html.erb
    • app/views/reports/_feedback_report.html.erb
    • app/views/reports/_review_report.html.erb
    • app/views/reports/_teammate_review_report.html.erb
    • app/views/response/response.html.erb
    • app/views/response/show_calibration_results_for_student.html.erb
    • app/views/response/view.html.erb
    • app/views/review_mapping/_list_review_mappings.html.erb
    • app/views/shared/_flash_notifications.html.erb
    • app/views/shared/responses/_response_actions.html.erb
    • app/views/sign_up_sheet/_actions.html.erb
    • app/views/sign_up_sheet/_add_signup_topics_staggered.html.erb
    • app/views/sign_up_sheet/_add_signup_topics.html.erb
    • app/views/sign_up_sheet/_topic_names.html.erb
    • app/views/sign_up_sheet/_total_1_2_bids.html.erb
    • app/views/sign_up_sheet/_total_bids.html.erb
    • app/views/sign_up_sheet/review_bids_others_work.html.erb
    • app/views/sign_up_sheet/show_team.html.erb
    • app/views/student_quizzes/finished_quiz.html.erb
    • app/views/student_quizzes/review_questions.html.erb
    • app/views/student_quizzes/take_quiz.html.erb
    • app/views/student_review/_responses.html.erb
    • app/views/student_teams/_received_invitations.html.erb
    • app/views/student_teams/_select_duty_form.html.erb
    • app/views/student_teams/view.html.erb
    • app/views/submitted_content/_main.html.erb
    • app/views/submitted_content/_self_review.html.erb
    • app/views/submitted_content/_submitted_files.html.erb
    • app/views/versions/search.html.erb
  • Add code to fetch data in the helpers files of the corresponding files above.
  • teams_controller.rb

Resolve a bug in the teams information view page

Proposed Implementation

Test Plan

RSpec Unit Tests Test cases provided here will add RSpec code blocks for the final submission Case 1: Scenario: The participant is adding a new team member to the team Given: Logged in as a student or instructor When: The participant adds a new team member under the "Invite people" section on the "Your team" page Then: The participant is able to add the member to the team

Case 2: Scenario: The participant is adding an already existing team member to the team Given: Logged in as a student or instructor When: The participant adds an already existing team member under the "Invite people" section on the "Your team" page Then: The participant is not able to add the team member

Manual Testing

When logged in as an instructor:

  • Impersonate a student
  • Navigate to the "Your team" page in project details.
  • Add a team member by entering their UnityID in the text box under "Invite people" section.
  • Click "Invite".
  • An invitation is sent to the member, accept it by impersonation receiving user.
  • Once the team member is added, impersonate the sender again.
  • Enter the already existing team member's UnityID and click on "Invite"
  • A message saying "The user "student2" is already a member of the team." should appear and text box should be cleared.

Team Information

Mentors: Naman Shrimali (nshrima@ncsu.edu), Neha Kotcherlakota (nkotche@ncsu.edu)
Sahithi Ammana (sammana@ncsu.edu)
Rithik Jain (rjain25@ncsu.edu)
Tyler Craine (tcraine@ncsu.edu)