E1502: Questionnaire Controller Refactoring
Introduction to Expertiza
Project Description
What it does:
Used on the admin side of Expertiza for creating/ editing questionnaires (rubrics, surveys and quizzes). It helps in add/removing questions, options, etc for a questionnaire.
Very big controller that handles a lot more than the name suggests. Functionalities need to be moved to appropriate controllers.
Quiz methods are should be treated the same as any other type of questionnaire; differences between quiz questionnaires and other questionnaires should be implemented in the model class, quiz_questionnaire
Turn the questionnaire into a “form object.” The ..._questions methods: save_new_questions, delete_questions, save_questions should be in a separate class.
Other classes involved:
questionnaire.rb
quiz_questionnaire.rb
questions_controller.rb
What needs to be done:
Move quiz related functions to quiz_questionnaire.rb.
copy, update_quiz, valid_quiz methods, clone_questionnaire_details is too long.
Debug output (print statements) should be removed.
Understand the functions in the controller and comment them. Ensure that the code is understandable to the next programmer who works on it.