CSC/ECE 517 Spring 2024 - E2417. Reimplement submitted content controller.rb (Phase 2): Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
Line 50: Line 50:
The following outlines the scenarios to be tested for the Submitted Content functionality within the system:
The following outlines the scenarios to be tested for the Submitted Content functionality within the system:
== Submit Hyperlink ==
== Submit Hyperlink ==
* Scenario: Ensure that submission record is created when user submits a valid hyperlink and hyperlink is added to the team.
== Remove Hyperlink ==  
== Remove Hyperlink ==  
== Submit File ==
== Submit File ==
== Folder Action ==
== Folder Action ==

Revision as of 00:40, 9 April 2024

E2417. Reimplement Submitted Content Controller

This page provides a description of the Expertiza based OSS Project E2417. Reimplement the SubmittedContentController for Phase 2

About Expertiza

Expertiza is an open-source web application facilitating peer feedback and assessment in educational courses. It enables students to submit work, review peers' submissions, and receive feedback. The platform supports anonymous peer reviews, grading rubrics, and discussion forums. Its goal is to enhance collaborative learning and improve the quality of student work through constructive criticism.

Objective

A submitted content controller should have the functionalities to manage the submitted content, for eg, the CRUD operations for submissions, different types of submissions, etc. The goal here is to implement this controller via API's and use principles of Object-Oriented Programming such as SOLID.

Problem Description

The reimplementation of SubmittedContentController in Expertiza needs to be done to enhance its functionality and maintainability. It should handle various tasks like file submissions and uploads, hyperlink submissions, and downloads, but the controller suffers from code redundancy and mixed responsibilities within methods. The reimplementation aims to ensure participants receive appropriate messages and HTTP status codes for actions like uploading files and deleting them, while also using SOLID principles, refactoring DRY code and minimizing excessive use of instance variables. The goal is to optimize the controller's design, adhering to best practices in readability and modularity.

Phase 1 implementation

Some operations of the SubmittedContentController in Expertiza were reimplemented in the phase 1 of the program, using SOLID and DRY principles. The following implementations were done in phase 1:

  1. Create, Show and Index methods for the controller
  2. SignedUpTeam, SignedUpTopic, SubmissionRecord, Participant, Assignment, Assignment Participant, SignUpSheet, Team, Team User, DutyLate Policy Models
  3. Submitted Content Helper

Error handling for file existence remains robust, ensuring reliable operation. Overall, the refactoring simplifies the codebase, improving its readability and facilitating future modifications.

Phase 2 implementation

  • The controller can further be more enhanced by reimplementing some more functionalities and refactoring the code by using SOLID and DRY principles. The following is the list of things that we are aiming to achieve in this phase.

submit_hyperlink

  • It handles the submission of a hyperlink for an assignment by a participant. Before submitting the hyperlink it checks if the current user is a participant and if the team has already submitted a hyperlink. At last we add the hyperlink to teams and create a submission record to track changes.
  • We will not be implementing the mailing feature as it is currently not a major requirement.

remove_hyperlink

  • For the remove hyperlink we remove the from the team table and also created a submission record for the delete action.

submit_file

  • This function is responsible for handling the submission of a file by a participant in an assignment. It performs various checks on the file size and type before saving the file to the appropriate directory. It also creates a submission record.

folder_action

  • This handles various folder-related actions for an assignment participant, such as deleting files, renaming files, moving files, copying files, and creating new folders based on request parameters.

download

  • This method is responsible for handling the download of files from a specified folder. It takes the folder name and file name as parameters and checks if they are valid. If the file exists, it sends the file to the user for download.

Dependency Diagram

Test Plan

For comprehensive testing of submitted_content_controller, the test plan given below will be taken into consideration:

  • Automated Tests: Test scenarios along with edge cases wherever applicable to ensure proper working of functions as intended.
  • Manual UI Tests: Testing functionalities like adding or removing hyperlinks/files to make sure any modifications don't damage the system's general functionality.

Automated Tests (using RSpec): The following outlines the scenarios to be tested for the Submitted Content functionality within the system:

Submit Hyperlink

  • Scenario: Ensure that submission record is created when user submits a valid hyperlink and hyperlink is added to the team.

Remove Hyperlink

Submit File

Folder Action