User:Vchheda: Difference between revisions
No edit summary |
No edit summary |
||
Line 12: | Line 12: | ||
*Separating the responsibilities of the Questionnaire Controller and Questions Controller: | *Separating the responsibilities of the Questionnaire Controller and Questions Controller: | ||
The first step is to write controllers for the Questionnaires and Questions, which will be responsible for creating, modifying, and deleting questions. The Questionnaire Controller will only be responsible for CRUD operations related to questionnaires. | The first step is to write controllers for the Questionnaires and Questions, which will be responsible for creating, modifying, and deleting questions. The Questionnaire Controller will only be responsible for CRUD operations related to questionnaires. | ||
*Fix bugs in the existing functionality: | |||
Delete questionnaire option not working, redirect to the view page after creation of a questionnaire, Update questionnaire not working for updating parameters of the questionnaire. | |||
*Implementing CRUD operations for each controller: | *Implementing CRUD operations for each controller: | ||
Each controller should have only CRUD operations as far as possible. The Questionnaire Controller should have methods for creating, updating, deleting, and viewing questionnaires. Similarly, the Questions Controller should have methods for creating, updating, deleting, and viewing questions. | Each controller should have only CRUD operations as far as possible. The Questionnaire Controller should have methods for creating, updating, deleting, and viewing questionnaires. Similarly, the Questions Controller should have methods for creating, updating, deleting, and viewing questions. |
Revision as of 20:55, 19 March 2023
E2321. Reimplement QuestionnairesController and QuestionsController
Problem Statement
The questionnaire is the superclass for all kinds of questionnaires and rubrics. Rubrics are used for evaluating submissions and teammate contributions, as well as taking quizzes and surveys, and all of these are subclasses of the Questionnaire class. In Expertiza, various types of questionnaires can be created, such as the Survey Questionnaire, Author Feedback Questionnaire, Bookmark Rating Questionnaire, Metareview Questionnaire, Quiz Questionnaire, Review Questionnaire, and Teammate Review Questionnaire. Each of these questionnaires can have zero or more questions, which are represented by the Question class. Typically, a questionnaire is associated with an assignment using the Assignment class.
The Questionnaire Controller is responsible for performing CRUD (Create, Read, Update, Delete) operations, such as copying and viewing questionnaires. On the other hand, the Questions Controller is responsible for creating, modifying, and deleting individual questions within a questionnaire. Questions can come in various types, such as checkboxes, multiple choice, text boxes, and more. However, each question object will always belong to a particular questionnaire. However, the current implementation suffers from several issues, such as mixing the responsibilities of the two controllers, using methods with identical names for different functionalities, and unclear or unused functionalities. Therefore, to improve the code quality and functionality, the two controllers should be implemented separately and adhere to the CRUD operations as much as possible. Additionally, the code needs to be refactored and optimized for better performance, and unused or unclear methods should be discarded. Finally, comprehensive tests should be written to ensure that the code is functioning correctly and free of code smells.
Goals of this Project
The goals of this Project are:
- Separating the responsibilities of the Questionnaire Controller and Questions Controller:
The first step is to write controllers for the Questionnaires and Questions, which will be responsible for creating, modifying, and deleting questions. The Questionnaire Controller will only be responsible for CRUD operations related to questionnaires.
- Fix bugs in the existing functionality:
Delete questionnaire option not working, redirect to the view page after creation of a questionnaire, Update questionnaire not working for updating parameters of the questionnaire.
- Implementing CRUD operations for each controller:
Each controller should have only CRUD operations as far as possible. The Questionnaire Controller should have methods for creating, updating, deleting, and viewing questionnaires. Similarly, the Questions Controller should have methods for creating, updating, deleting, and viewing questions.
- Improving the clarity and conciseness of code:
The code should be written in a clean and concise manner. Methods with identical names that perform different functionalities should be renamed for clarity. Functions or functionality that are not clear should be commented on or removed. Any loops or methods that can be refactored for better performance should be addressed e.g. delete all questions that belong to a questionnaire
- Discarding unused or unclear functionality:
Any unused or unclear functionality should be removed from the controllers. This will help to reduce complexity and make the code easier to maintain.-
- Writing tests for the two controllers:
Tests should be written for both the Questionnaire Controller and the Questions Controller. The tests should cover at least 80% of the code, and tools like Rubocop and Code Climate should be used to verify code smells.
By achieving these goals, both the controllers can have their basic CRUD functionalities as well as it will also ensure that the code readability and functionality of the code for the two controllers is increased. It will also help in resolving the existing bugs which will increase correctness of the code.
Relevant Links
- Github Repository:
- Pull Request:
- VCL Server:
Contributors
This feature was created as part of Dr. Edward Gehringer's "CSC/ECE 517: Object-Oriented Design and Development" class, Spring 2023. The contributors were: Vineet Vimal Chheda, Rohan Shah, and Aditya Srivastava. Our project mentor was Ankur Mundra (amundra@ncsu.edu)