CSC/ECE 517 Fall 2025 - E2552. ProjectTopic and SignedUpTeam

From Expertiza_Wiki
Jump to navigation Jump to search

This wiki page describes the changes made for the E2552 OSS assignment in Fall 2025 for CSC/ECE 517.

Peer Review Information

For users intending to view the deployed Expertiza associated with this assignment, the credentials are below:

  • Instructor login: username -> admin, password -> password123
  • Student login: username -> teststudent, password -> password123
  • (Add other relevant student logins if needed)

About Expertiza

Expertiza is an educational web application created and maintained by the joint efforts of the students and the faculty at NCSU. It’s an open source project developed on Ruby on Rails platform and its code is available on Github. It allows students to review each other’s work and improve their work upon this feedback. The current effort involves reimplementing the application with a Ruby on Rails API backend and a React/Typescript frontend.

Description of the current project (E2552)

This project focuses on the reimplementation of the Project Topic and Signed Up Team functionalities within Expertiza. In Expertiza, assignments can require students or teams to choose a topic. The ProjectTopic class (originally SignUpTopic) manages these topics, and when a team selects one, a SignedUpTeam object is created to link the team and the topic.

This project involved integrating and refining backend code previously developed (but not merged) in project E2513 and implementing the corresponding frontend interface for both instructors and students. The backend work included renaming classes and methods based on prior feedback, improving code structure using ActiveRecord features, optimizing logic, and adding validations. The frontend work involved creating new UI components in React/Typescript to manage and display topics, handle topic selection/signup, and provide distinct views for instructors and students, closely mirroring the existing Expertiza interface.

Files modified/created in current project

Backend (Ruby on Rails API):

  • Models:
    • app/models/project_topic.rb (Created, replacing sign_up_topic.rb)
    • app/models/signed_up_team.rb (Modified extensively)
    • app/models/assignment.rb (Modified associations)
    • app/models/bookmark.rb (Modified association comment)
    • app/models/user.rb (Modified associations)
    • app/models/sign_up_topic.rb (Deleted)
  • Controllers:
    • app/controllers/project_topics_controller.rb (Created, replacing sign_up_topics_controller.rb)
    • app/controllers/signed_up_teams_controller.rb (Modified extensively)
    • app/controllers/assignments_controller.rb (Modified assignment_params, comment)
    • app/controllers/sign_up_topics_controller.rb (Deleted)
  • Database:
    • Migrations created/modified for renaming tables/columns (sign_up_topic -> project_topic) and adding allow_bookmarks to assignments.
    • db/schema.rb (Updated)
    • db/seeds.rb (Updated to use ProjectTopic, added test student)
  • Configuration:
    • config/routes.rb (Updated for project_topics and signed_up_teams endpoints)
  • Tests (RSpec):
    • spec/models/project_topic_spec.rb (Created)
    • spec/models/signed_up_team_spec.rb (Created)
    • spec/models/due_date_spec.rb (Modified)
    • spec/routing/project_topics_routing_spec.rb (Created)
    • spec/factories/project_topics.rb (Created)
    • spec/rails_helper.rb (Minor configuration change)
    • spec/routing/sign_up_topics_routing_spec.rb (Deleted)
  • Dependencies: Gemfile, Gemfile.lock (Updated versions, added/removed gems)
  • Swagger Documentation: swagger/v1/swagger.yaml (Updated paths and definitions)
  • Docker: docker-compose.yml (Updated command)

Frontend (React/Typescript):

  • Pages:
    • src/pages/Assignments/AssignmentEditPage.tsx (Created - Main page for editing assignments with tabs)
    • src/pages/Assignments/tabs/TopicsTab.tsx (Created - Instructor view for managing topics)
    • src/pages/Assignments/tabs/RubricsTab.tsx, ReviewStrategyTab.tsx, DueDatesTab.tsx, EtcTab.tsx, GeneralTab.tsx (Created - Placeholder tabs)
    • src/pages/StudentTasks/StudentTasks.tsx (Created - Student view for signing up for topics)
    • src/pages/Assignments/Assignment.tsx (Modified - Integrated new edit page link)
    • src/pages/Assignments/AssignmentEditor.tsx (Modified - Simplified, as detailed editing moved to AssignmentEditPage)
  • Components:
    • src/components/Table/Table.tsx (Modified - Added row highlighting for selected topics)
    • src/pages/Assignments/components/TopicsTable.tsx (Created - Reusable table component for displaying topics)
  • Routing:
    • src/App.tsx (Modified - Added routes for AssignmentEditPage and StudentTasks)
  • Layout:
    • src/layout/Header.tsx (Modified - Conditionally show Assignments link for students)
  • Hooks:
    • src/hooks/useAPI.ts (Modified - Minor change in then block)
  • Assets:
    • public/assets/icons/Check-icon.png (Added)

List of changes / Features Implemented

Based on the project description and feedback from E2513:
Backend:

  1. Renamed SignUpTopic to ProjectTopic: Refactored the model, controller, routes, database table, associations, and tests to use the new naming convention consistently.
  2. Refactored SignedUpTeam Logic: Moved business logic from the controller into the SignedUpTeam and ProjectTopic models, utilizing ActiveRecord features like transactions and scopes. Implemented methods for signing up students/teams, dropping topics, finding participants, and handling waitlists.
  3. Addressed E2513 Feedback:
    • Renamed signup_team method to sign_team_up in ProjectTopic.
    • Renamed signup_for_topic method to sign_up_for_topic in SignedUpTeam.
    • Addressed DRY violation between find_team_participants and find_project_topic_team_users.
    • Ensured files terminate with a newline.
  4. Updated Assignment Model: Added allow_bookmarks attribute and updated associations related to topics.
  5. API Endpoints: Created/updated API endpoints for CRUD operations on ProjectTopic and actions related to SignedUpTeam (signup, drop topic).
  6. Testing: Added comprehensive RSpec tests for ProjectTopic and SignedUpTeam models. Updated existing tests (due_date_spec.rb). Added routing specs.

Frontend:

  1. New Assignment Edit Page: Created AssignmentEditPage with a tabbed interface for editing assignments.
  2. Instructor Topics Tab: Implemented TopicsTab component allowing instructors to:
    • View/manage topics via TopicsTable.
    • Configure topic settings (e.g., allow bookmarks).
    • View assigned/waitlisted teams and drop teams.
    • Toggle display of user names/IDs.
    • Create, import, edit, delete topics via modals.
    • View bookmark counts.
    • Access Partner Ad functionality (UI added).
  3. Student Task/Signup Page: Created StudentTasks page allowing students to:
    • View available topics via TopicsTable.
    • See available slots and waitlist numbers.
    • View their selected topic.
    • Select/deselect (drop) a topic.
    • Bookmark topics (if enabled).
  4. Reusable TopicsTable Component: Developed adaptable table for student/instructor views with row expansion, selection, and custom actions.
  5. API Integration: Connected frontend components to backend API for fetching/updating topics, assignment settings, and handling signups/drops.
  6. UI Enhancements: Added selected topic highlighting, action icons, and modals for various operations.

Testing Details

Backend (RSpec)

New spec files (project_topic_spec.rb, signed_up_team_spec.rb) were created with extensive test coverage for the core models, including various scenarios like signup, waitlisting, dropping teams, and validations. Existing specs (due_date_spec.rb) were updated. Routing specs were added. Tests confirmed the refactored code integrates correctly.

UI Testing

Manual testing was performed following scenarios for instructors and students:

Instructor UI:

  1. Login as instructor6.
  2. Navigate to an assignment (e.g., "OSS project & documentation") and click 'Edit'.
  3. Go to the 'Topics' tab.
  4. Verify topic list display: Check columns (Checkbox, ID, Name, Questionnaire, Slots, Available, Waitlist, Bookmarks, Actions).
  5. Verify topic settings: Test checkboxes, especially 'Allow participants to create bookmarks?'. Backend save confirmed via API call.
  6. Test topic actions:
    • Create a new topic via 'New topic' button/modal.
    • Edit an existing topic via edit icon/modal.
    • Delete topic(s) via delete icon or selecting checkboxes and using 'Delete selected topics'.
    • Import topics via 'Import topics' button/modal.
  7. Expand a topic row to view assigned/waitlisted teams. Test dropping a team via 'X' icon.
  8. Test 'Display User Names' toggle.

Student UI:

  1. Login as teststudent.
  2. Navigate to 'Assignments' via header link.
  3. Verify signup sheet loads.
  4. Verify topic list display: Check columns (ID, Name, Available Slots, Num. on Waitlist, Bookmarks [if enabled], Actions).
  5. Test topic selection: Click checkmark icon. Verify 'Your topic(s)' updates, row highlights yellow, slots update optimistically, and API call is made.
  6. Test topic deselection (drop): Click 'X' icon on selected topic row. Verify topic is dropped, highlighting removed, slots update, and API call is made.
  7. Test bookmarking (if enabled): Click bookmark icon to toggle status.
  8. Verify actions are disabled for full topics (0 available slots).

Scope for future improvement

  1. Complete Placeholder Tabs: Implement functionality for 'Rubrics', 'Review Strategy', 'Due Dates', and 'Etc.' tabs in instructor view.
  2. Partner Ad Backend: Implement backend logic for partner ads and applications.
  3. Bookmark Implementation: Fully implement bookmark creation/viewing functionality.
  4. Topic Suggestions: Implement student topic suggestion feature.
  5. Bidding Features: Implement topic/reviewer bidding.
  6. Refined UI/UX: Enhance UI based on feedback, e.g., team display within rows.
  7. Automated Frontend Testing: Add