User:Mxu: Difference between revisions
Line 5: | Line 5: | ||
= Problem Statement = | = Problem Statement = | ||
The Expertiza quiz feature is in need of refactoring. Currently, quizzes are checked by questionnaires_controller#valid_quiz. This method is rather long, involved, and does not take advantage of object-oriented practices. We will refactor the method to construct a quiz question object and then call valid? to check if the question is valid. This is an improvement over the current code which checks all questions manually. | |||
In addition to this refactoring we will implement integration testing on the quiz feature to verify that the correct behavior is present. | |||
== Classes involved == | == Classes involved == | ||
* | * questionnaires_controller.rb | ||
* spec/features/quiz_spec.rb | |||
== What it does == | == What it does == | ||
The purpose of this assignment is to enhance readability, DRYness, and maintainability of Expertiza code through refactoring and functional testing. | |||
== What is wrong with it == | == What is wrong with it == | ||
Line 18: | Line 21: | ||
== What needs to be done == | == What needs to be done == | ||
Student-generated quizzes is the feature that students use for writing quizzes for the Wikipedia contribution assignment. In this project, you need to do refactoring and create functional tests for this feature: | Student-generated quizzes is the feature that students use for writing quizzes for the Wikipedia contribution assignment. In this project, you need to do refactoring and create functional tests for this feature: | ||
*Refactoring: | * Refactoring: | ||
**Refactor the valid_quiz method in questionnaires_controller. This method should not check the questions one by one, instead, it should create the quiz_question objects and quiz_choice objects, then call “quiz_question.valid?” to check whether the question is valid. | ** Refactor the valid_quiz method in questionnaires_controller. This method should not check the questions one by one, instead, it should create the quiz_question objects and quiz_choice objects, then call “quiz_question.valid?” to check whether the question is valid. | ||
*Testing: | * Testing: | ||
**The instructor can set up an assignment which supports quizzing feature by | ** The instructor can set up an assignment which supports quizzing feature by | ||
***Checking the “has quiz” box | *** Checking the “has quiz” box | ||
***Setting the # of question for each set of quiz | *** Setting the # of question for each set of quiz | ||
***Setting in which deadline can student reviewers take the quizzes | *** Setting in which deadline can student reviewers take the quizzes | ||
**Student authors can create quizzes and edit them: | ** Student authors can create quizzes and edit them: | ||
***They can create quizzes on the “Your work” page | *** They can create quizzes on the “Your work” page | ||
***They can edit the quiz questions. | *** They can edit the quiz questions. | ||
***They can view the quiz questions. | *** They can view the quiz questions. | ||
***If the quiz question has something missing, the system will flash an error message, either: | *** If the quiz question has something missing, the system will flash an error message, either: | ||
****The name of quiz is missing. | **** The name of quiz is missing. | ||
****The question text is missing for one or more questions. | **** The question text is missing for one or more questions. | ||
****The choices are missing for one or more questions. | **** The choices are missing for one or more questions. | ||
****The correct answer(s) have not been provided. | **** The correct answer(s) have not been provided. | ||
**Student reviewers can take the quizzes on the work they have reviewed/they need to review | ** Student reviewers can take the quizzes on the work they have reviewed/they need to review | ||
***They need to request the artifact to review first. If this artifact has a quiz associated, they can take the quiz in the round which quiz-taking is allowed. | *** They need to request the artifact to review first. If this artifact has a quiz associated, they can take the quiz in the round which quiz-taking is allowed. | ||
***They can click “take quiz” then request quizzes to take. | *** They can click “take quiz” then request quizzes to take. | ||
***They can fill in their choices on the quizzes. | *** They can fill in their choices on the quizzes. | ||
***After taking the quizzes, and submitting, they will see their grade on the “Take quizzes” page | *** After taking the quizzes, and submitting, they will see their grade on the “Take quizzes” page | ||
***On the “take quizzes” page, they can see their question-by-question scores for finished quizzes by clicking “view” | *** On the “take quizzes” page, they can see their question-by-question scores for finished quizzes by clicking “view” | ||
**Instructor can view the quiz questions and quiz scores on the tree display by clicking “view quiz questions” icon. | ** Instructor can view the quiz questions and quiz scores on the tree display by clicking “view quiz questions” icon. | ||
= Scope = | = Scope = |
Revision as of 22:06, 28 March 2016
CSC/ECE 517 Spring 2016 E1621: Refactor and test the quizzing feature
Introduction to Expertiza
Expertiza<ref>https://github.com/expertiza/expertiza</ref> is a project developed using Ruby on Rails<ref>http://guides.rubyonrails.org/getting_started.html</ref>. It provides features like peer review, team assignments and submission of projects. This can be achieved by submitting code base, URL of hosted code on remote server and Wiki submissions. It is an open source application and the code can be cloned from GitHub. This application provides an efficient way to manage assignments, grades and reviews.
Problem Statement
The Expertiza quiz feature is in need of refactoring. Currently, quizzes are checked by questionnaires_controller#valid_quiz. This method is rather long, involved, and does not take advantage of object-oriented practices. We will refactor the method to construct a quiz question object and then call valid? to check if the question is valid. This is an improvement over the current code which checks all questions manually.
In addition to this refactoring we will implement integration testing on the quiz feature to verify that the correct behavior is present.
Classes involved
- questionnaires_controller.rb
- spec/features/quiz_spec.rb
What it does
The purpose of this assignment is to enhance readability, DRYness, and maintainability of Expertiza code through refactoring and functional testing.
What is wrong with it
The valid_quiz method in questionnaires_controller needs to be refactored. This method should not check the questions one by one, instead, it should create the quiz_question objects and quiz_choice objects, then call “quiz_question.valid?” to check whether the question is valid.
What needs to be done
Student-generated quizzes is the feature that students use for writing quizzes for the Wikipedia contribution assignment. In this project, you need to do refactoring and create functional tests for this feature:
- Refactoring:
- Refactor the valid_quiz method in questionnaires_controller. This method should not check the questions one by one, instead, it should create the quiz_question objects and quiz_choice objects, then call “quiz_question.valid?” to check whether the question is valid.
- Testing:
- The instructor can set up an assignment which supports quizzing feature by
- Checking the “has quiz” box
- Setting the # of question for each set of quiz
- Setting in which deadline can student reviewers take the quizzes
- Student authors can create quizzes and edit them:
- They can create quizzes on the “Your work” page
- They can edit the quiz questions.
- They can view the quiz questions.
- If the quiz question has something missing, the system will flash an error message, either:
- The name of quiz is missing.
- The question text is missing for one or more questions.
- The choices are missing for one or more questions.
- The correct answer(s) have not been provided.
- Student reviewers can take the quizzes on the work they have reviewed/they need to review
- They need to request the artifact to review first. If this artifact has a quiz associated, they can take the quiz in the round which quiz-taking is allowed.
- They can click “take quiz” then request quizzes to take.
- They can fill in their choices on the quizzes.
- After taking the quizzes, and submitting, they will see their grade on the “Take quizzes” page
- On the “take quizzes” page, they can see their question-by-question scores for finished quizzes by clicking “view”
- Instructor can view the quiz questions and quiz scores on the tree display by clicking “view quiz questions” icon.
- The instructor can set up an assignment which supports quizzing feature by
Scope
This project can be divided into major work items:
- thing 1
- thing 2
- thing 3
- thing 4
Implementation
implementation details
Design
design
Use Cases
use cases
Accomplishments
Video demo of our work can be found at https://www.youtube.com/
GitHub repository containing the refactoring changes can be found at https://github.com/
Link to the pull request to Expertiza is https://github.com/expertiza/expertiza/pull/
Future Work
things to do in the future
References
<references/>