CSC/ECE 517 Spring 2023 - E2320. Reimplement the Question Hierarchy

From Expertiza_Wiki
Jump to navigation Jump to search

Design Doc

Problem Statement

The current implementation of the question hierarchy is not very clean and contains confusing variable and method names. Also, many methods return long HTML strings which are difficult to read. The goal of this project is to reimplement this part of the application to make it more readable, understandable and maintainable.

Explanation of Feature - Question Hierarchy

The Question class and its sub-classes are used to implement all rubric items, quiz questions, and survey questions in Expertiza. For example, a professor could use this feature to make up a review quiz for their class. There are 3 main types of questions in Experitza: scored, unscored, and upload file.

Here is the hierarchy:

1. Choice question

  • Scored question
    • Scale
    • Criterion
  • Unscored question
    • Dropdown
    • Multiple Choice
    • Check Box

2. Text Response

  • Text Area
  • Text Field

3. Upload File

Choice questions are types of questions that give the quiz taker a list of answers to choose from. It is broken into two subcategories scored and unscored. Scored question will give a number value depending upon if a user clicks on a particular answer. The unscored questions don't have a score associated with them and come in a few different styles. The answers could be presented in a dropdown menu which only shows the answer choices after the user clicks on the dropdown arrow and clicks on an answer. Multiple choice questions present all the answers choices with a selectable bubble beside them and allow the user to click on the bubble to indicate their answer. Checkboxes are similar to multiple choice in that they present all of the answer choices at once however, the user must click on a certain number of boxes beside the answers they think are correct.


Text response questions are different in that they allow the user to actually type in their answer instead of just being provided answers. A text area question has a height and width associated with it that can be adjusted while a text field question is just 1 input line that does not change shape.


The last type of question is upload file which allows the user to upload a file to use as a quiz (as the name suggests). This option allows a person to upload a pre-made quiz document to be which will be converted into a quiz. So, a professor could type up their quiz questions and answers in a text file then choose upload and have Expertiza convert it into a quiz for them.

List of Work Done so Far

The following list describes tasks that were accomplished in Program 3:

  • Improved naming of variables and methods
  • Included comments for further clarification
  • Implemented partials to deal with the HTML strings
  • Added RSpec test cases

Plan of work

Based on the feedback provided to us by both our mentors and also peer reviews our team has decided upon a few key design goals to work on for the continuation of our work into Program 4. These goals are outlined below.

Design Goals

  • Update code comments - Some methods and classes currently do not have any code comments, while other comments are not in depth enough to give proper context for functionality. One of our design goals will be to write more in depth comments that better explain functionality for the code. The below files are the ones which we plan too add more comments to:
    • questionnaires_controller.rb
    • checkbox.rb
    • question.rb
    • text_area.rb
    • text_response.rb
  • DRY out code with partials - Implement additional partials for certain classes. In program 3 our team had started to create partials for the 3 major types of questions. As we continue with program 4 we are going to continue to add more partials by looking at the similarities between all three types and pull out the similarities into a new class
    • Ex: Question_Controller - Since all of the sub-categories inherit from the Question class we plan to make a question controller to hold all of the common functionality. One example of this can be seen with the method call 'edit' which exists in many of the subclasses like text_response.rb, text_area.rb, scale.rb, and criterion.rb. The partials will be moved into the question controller.

Tests

In program 3 tests were created for all of the question types (Ex: criterion_spec.rb, text_area.rb and upload_file.rb to name a few).The only new tests we plan to write for program 4 will be for the new question controller we plan to create. If any additional tests will need to be added this section will be updated to reflect that

Conclusions / Future Work

Specific Tasks Completed

[Will be updated near final submission deadline]

Team

Mentor
  • Prof. Edward F. Gehringer
  • Priyam Garg
Members
  • Colleen Britt
  • Kimberly Jones
  • Priyanka Arghode

References

  1. Expertiza
  2. Organizing Partials
  3. Render Views and Partials Outside Controllers
  4. Github Repo
  5. Link to initial pull request
  6. GitHub Project Board