CSC/ECE 517 Fall 2021 - E2117. Refactor questionaires controller.rb

From Expertiza_Wiki
Jump to navigation Jump to search

Introduction

About Expertiza

Expertiza is an open source project developed using a Ruby on Rails framework. In Expertiza, an instructor can create, delete or edit new and existing assignments and also create topics for the students to sign up for or assign them to particular groups or individual students. A student can create teams to work on projects and assignments, and also peer review other's work. The website allows submission of various file type and also URL's.

About questionnaire_controller.rb

Questionnaire is the superclass for all kinds of [1] and rubrics—rubrics for evaluating submissions and teammate contributions, and taking quizzes and surveys. All of these are subclasses of Questionnaire. questionnaires_controller.rb is charged with creating, displaying, and managing Questionnaires. Since it is used so widely, malfunctions could cause bugs in many parts of the system; hence it is especially important that the code be clear.

Issues to be addressed

1.Investigate the need and usage of the method create_questionnaire 2.Refactor the create method into different methods with self-descriptive names for easier understanding 3.Investigate the usage of checks for whether a questionnaire is QuizQuestionnaire 4.Replace hard-coded rubric criteria scoring 5.Investigate usage of questionnaire_id parameter 6.Bad if statements 7.Refactor save_all_questions method - Cognitive Complexity and Assignment Branch Condition exceed allowed limit. 8.Refactor copy method - Assignment Branch Condition is too high.

Changes made

1. In none of the files was the create_questionaire method being called so it was deleted.

Team Members

  • Isha Gupta
  • John Marsden
  • Sai Harsha Nadendla