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

From Expertiza_Wiki
Revision as of 02:43, 21 October 2021 by Snadend2 (talk | contribs) (Created page with "__TOC__ ==Introduction== ===About Expertiza=== [http://expertiza.ncsu.edu/ Expertiza] is an open source project developed using a [http://rubyonrails.org/ Ruby on Rails] fra...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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

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

Changes made