Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

E2372. Reimplement QuizQuestion and its child classes #2682

Closed
wants to merge 10 commits into from

Conversation

SuddyN
Copy link

@SuddyN SuddyN commented Oct 31, 2023

Note

Successor: #2687

Problem

There are four methods in QuizQuestion super class. edit, view_question_text, view_completed_question, and complete. These 4 (model) methods will return different html strings depends on the question type.

  • edit What to display` - if an instructor (etc.) is creating or editing a questionnaire (questionnaires_controller.rb)
  • view_question_text - What to display if an instructor (etc.) is viewing a questionnaire (questionnaires_controller.rb)
  • complete What to display - if a student is filling out a questionnaire (response_controller.rb)
  • view_completed_question - What to display if a student is viewing a filled-out questionnaire (response_controller.rb)

However, MultipleChoiceCheckbox, MultipleChoiceRadio, and TrueFalse classes all contain a method called isvalid method, which should be included in QuizQuestions class as well.

What you should do:

  • Please make a complete UML diagram for these classes with their attributes, methods, and class methods.
  • Check all implementations of instance methods, extract duplicated codes, and put them into the highest-level class.
  • Thoroughly test the QuizQuestion class.

Solution

  • adds isvalid() to QuizQuestion
  • implements edit() within QuizQuestion
  • Reimplements QuizQuestion class and child classes methods to use @html instead of html

UML Diagram

image

Review responsibilities

@SuddyN SuddyN marked this pull request as ready for review October 31, 2023 04:06
@SuddyN SuddyN closed this Nov 7, 2023
@SuddyN SuddyN deleted the Reimplement-QuizQuestion branch December 3, 2023 20:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants