CSC/ECE 517 Fall 2019 - E1982. Regulate changing of rubrics while projects are in progress

From Expertiza_Wiki
Jump to navigation Jump to search

The goal to this project:

  1. When a rubric is replaced or the items/questions attached to it are changed, all the active students’ responses object to that rubric will be deleted are created again, that means students need to redo the reviews if they have already done.
  2. The system will email the students who have done reviews to notify a redo request after deleting the response object and all associated answer objects.
  3. The “active” in the first goal means the replacement action happened during the task duration and the student responses have done in the task duration before the replacing rubric action. For example, a rubric starts from Sep.9th and ends at Sep.13th. An instructor replaces the rubric on Sep.12th, when 60 of 100 students have already finished their reviews. Then the response objects will be deleted and re-created to be new objects in the system, and students need to redo their reviews based on the new rubric.
  4. Write comprehensive tests for the above implementation to confidently prove they are correct.

Project Description

If the instructor does edit or change a rubric of the assignment while an assignment is in review progress, it will make previous review record make no sense. So it is supposed to delete previous response and notify all those students who have submitted review before to re-submit a response of new rubric.

The function classification change as two kinds: Minor change & Major change.

  • Minor Change defined as the change makes no difference to reviewings so that we could also use reviewing before change made.(e.g. Delete questions or clarify the statement).
  • Major Change include situation as below:
    • add a new question which not mentioned before, which make previous response lack of sone answer.
    • Any question is edited to a different question, which make previous response make no sense.
    • rubric is replaced by a different rubric, so everyone should re-submit a response on new rubric.

Since Minor Change still could be used to scoring so that we could also use reviewing before change made.(e.g. Delete questions or clarify the statement). And major change has some questions cant be found in previous rubric, system would delete all related reviewing records and email those reviewers to redone reviewing in such situations.

  • In Practice, after rubric is replaced or rubric is edited, doing such process:
    • give a confirmation to client to verify change
    • make sure it is a rubric of assignment which in reviewing period
    • sending e-mail to who has already submit review
    • deleting previous responses of such rubric
    • update the rubric formal in database

Design Diagrams

Use case Diagram

Data Flow Diagram

The main goal of the code is to edit the rubric. There are 3 types of action: edit, add, and delete questions. We classify these actions into two types: major change and minor change.

Note: Editing questions refers to editing only the text of the questions. Changing the type (multiple-choice, simple-text...) of a question is not allowed in Expertiza. You have to delete the old question and add a new one.

Minor change: Edit questions. In this case, we simply update the text of the questions. There’s no other actions needed.

Major change: Add/Delete questions. In this case, we have to check if there are any reviews done by students in the active period, i.e. the period of time when students can submit reviews. If there are any, we have to notify the affected students by email asking them to re-submit a review using the updated rubric, and delete their old reviews.


Proposed Solution

The solution has five parts:

  • Check the changes made by instructor. Major or minor?
  • Check if the change to the rubric is made during the task duration (or if there is any active response?).
  • Process updates when a major change is made.
  • E- mail notification is sent to request students to redo their reviews.
  • Test the implementation thoroughly.

Check if the change to the rubric is made during the task duration

After a change is made, the system will check if the date is during the task duration to determine whether it needs to update existing response objects. The function method will get params as the start time and expire time of the target rubric to proceed a checking. If the change is not during an active task duration, then nothing further needs to be done. If the change is during an active task duration, then the system will do the following work.

Check the changes made by instructor. Major or minor?

Changes are categorized to be major or minor. Minor changes affects only the wording of a particular rubric item. In this case, no action is necessary. Major changes involves rubric replacing and changing items/questions. In this case, all the reviews that have been done need to be redone. To tell a major change, the params passed to the controller includes a tag/identifier that indicates if a new question was added, hence a major change.

Process updates when a major change is made.

If the previous process returns that a major change has been made, the system deletes existing response objects and re-creates new updated object in database when a student press on “review”. As for minor changes, updates affects only the objects that created after the change.

E- mail notification is sent to request students to redo their reviews.

Once controller notice instructor makes a major change of the rubric, and some students have begun the peer review, email notification module is initiated. In this circumstance, the system will generate ActiveRecord and send it to those students. (Their email address could be found in user’s table.) After email successfully sent, record of this student in this assignment and period will be deleted from the database. When students receive the email and update their review, the questions now correspond to the new rubric. And students can see all the details of the old questionnaire in the email, so they won’t have to rewrite the same questions’ answer.

Test the implementation thoroughly.

Our test is designed to three parts: common cases, invalid cases and extreme cases. Details of test plan are included in the Test Plan section below.

Code Change

Firstly, we create in_active_period: Find the review period for a particular questionnaire. If an answer is specified, it checks whether the answer is written in the period. If not, it checks whether the current time is in that period.

And we add a confirmation base on "in_active_period" method performed like follow:

At back-end, when we determined that assignment is in active period, then call delete_existing_response to delete response and send email.

delete_existing_reponses: Find all the answers to the questions specified by question_ids. Then, delete the answers and send emails to affected student. In delete_answers, the response is set to "not submitted" to let the students who already submitted edit their responses.

Test Plan

The major changes we have made are in questionnaires_controller.rb, answer_helper.rb, and question_controller.rb. Each component of the system is tested in a dedicated test file in the spec directory, and the test file name is according to the function tested.

When a question is added or deleted, add_new_questions method of questionnaire_cotroller.rb will check if the current time is in active period before it makes future process. It asks AnswerHelper to check the condition via in_active_period method. The test cases of questionnaires controller expect the helping method in_active_period and delete_existing_responses are called using correct parameters and provide expected results back to the controller.

The answer_helper.rb helps questionnaire controller check period conditions, send email to the according reviewers, and delete existing responses. To test these methods, we pass corresponding parameters into the method and check the outputs. When the current time is not in the review active time period, this method returns false. When the current time is in the review active time period, the in_active_period returns true. And a bound case: when the round number is not recorded in database, the method will check all due dates in this assignments.

Delete existing responses test case expect AnswerHelper to receive user information, check if email is sent to reviewer, delete the corresponding responses and check the existence of the responses in database. So the review_mailer should be called and the existence check should return false.

To test the sending email function, the test case expects Mailer to receive a notify_review_rubric_change request once for an active user.

Deleting a question from a questionnaire is now considered a major change, so we added active period condition check in question_controller.rb. The corresponding test is below. It ensures the result message and expects call requests to in_active_period and delete_existing_responses.

Useful Link