<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tshi2</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tshi2"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Tshi2"/>
	<updated>2026-07-20T02:38:41Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114578</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114578"/>
		<updated>2017-12-06T22:54:44Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* How's the function working after implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:case.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the first round submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the current stage is in calibration review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student submitted his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works when the current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. By following the process of TDD we can ensure to maintain the minimum amount of code while writing that specific function, and the developer can gain an overview of the function.&lt;br /&gt;
&lt;br /&gt;
== What did we implement ==&lt;br /&gt;
&lt;br /&gt;
1. We created a file &amp;quot;calibration_spec.rb&amp;quot; in &amp;quot;spec/ features&amp;quot; and write feature tests for the calibration function.&lt;br /&gt;
&lt;br /&gt;
2. We created a migration file &amp;quot;_add_new_deadline_type.rb&amp;quot; to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
3. We added a calibration due date in due date tab if it's a calibration assignment &lt;br /&gt;
&lt;br /&gt;
4. We added calibration_review in deadline_right file (Modified file: app/models/deadline_right.rb)&lt;br /&gt;
 &lt;br /&gt;
5. We changed the function of finding next due date from find_by to where().order('due_at').first &lt;br /&gt;
 &lt;br /&gt;
6. We changed &amp;quot;app/controllers/student_review_controller.rb&amp;quot; file to exclude calibration reviews when counting the review number. We filtered the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
7. We changed the view for student review list in &amp;quot;app/views/student_review/list.html.erb&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
== How's the function working after implementation ==&lt;br /&gt;
You can refer to a youtube video to see how's calibration function working after our implementation: https://youtu.be/s4-Oh3pLN-E&lt;br /&gt;
&lt;br /&gt;
Below are the screenshots for the important parts:&lt;br /&gt;
&lt;br /&gt;
1. After enable calibration for training function, the instructor can see a calibration due date in &amp;quot;due date&amp;quot; tab and can assign a due date for this calibration training:&lt;br /&gt;
[[File:Capture1.GIF]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. When the current stage is in &amp;quot;Calibration Review&amp;quot; we can only do the calibration reviews and show calibration results after submitting.&lt;br /&gt;
[[File:cReview.png]]&lt;br /&gt;
&lt;br /&gt;
3. When the current stage is in &amp;quot;Review&amp;quot;, we can see the calibration reviews and do the regular reviews. &lt;br /&gt;
[[File:Review5.png]]&lt;br /&gt;
&lt;br /&gt;
== Tests ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
* This feature test check for when Calibration for training? is selected, the value of assignment is calibrated is set to be true so the calibration tab will show up on the top of the page to fill in the due dates for the calibration period.&lt;br /&gt;
 &lt;br /&gt;
 context 'in assignments#edit page' do&lt;br /&gt;
    it 'has a checkbox with title \'Calibration for training?\' on \'General\' tab' do&lt;br /&gt;
      assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
      instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
      visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'General'&lt;br /&gt;
      expect(page).to have_field('Calibration for training?')&lt;br /&gt;
    end&lt;br /&gt;
    context 'when clicking \'Calibration for training?\' checkbox and clicking \'save\' button' do&lt;br /&gt;
      context '\'Calibration\' due date' do&lt;br /&gt;
        it 'works correctly' do&lt;br /&gt;
          assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
          instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
          visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
          click_link 'General'&lt;br /&gt;
          expect(page).to have_content('Calibration for training?')&lt;br /&gt;
          find(:css, &amp;quot;#assignment_is_calibrated_field&amp;quot;).set(true)&lt;br /&gt;
          click_button 'Save'&lt;br /&gt;
          expect(page).to have_link('Calibration')&lt;br /&gt;
          click_link 'Due dates'&lt;br /&gt;
          fill_in 'datetimepicker_calibration_review', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
          click_button 'submit_btn'&lt;br /&gt;
          calibration_type_id = DeadlineType.where(name: 'calibration_review')[0].id&lt;br /&gt;
          calibration_due_date = DueDate.find(12)&lt;br /&gt;
          expect(calibration_due_date).to have_attributes(&lt;br /&gt;
                                              deadline_type_id: calibration_type_id,&lt;br /&gt;
                                              type: 'AssignmentDueDate'&lt;br /&gt;
                                          )&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
* Since the test contained duplicate code, we load the code in load_work method and set the stage of the current assignment as &amp;quot;calibration&amp;quot; state so the review contains Calibration Review 1, 2, 3 and student can view their calibration result when clicking on View link.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in calibration stage' do&lt;br /&gt;
    context 'calibration feature' do&lt;br /&gt;
      it 'works correctly' do&lt;br /&gt;
        load_work(DateTime.now.in_time_zone + 10, DateTime.now.in_time_zone + 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                  DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                  DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50,  &amp;quot;calibration&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;View&amp;quot;)&lt;br /&gt;
        click_link &amp;quot;View&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* When the project is in review stage, the number of review allowance will not affect by the number of calibration review numbers, so we check the number of review allow is still the same after changing the stage to review stage and the page should contains Calibration Review 1 and Review 1.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in review stage' do&lt;br /&gt;
    it 'excludes calibration reviews from outstanding review restriction and total review restriction' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                   DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                   DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Number of reviews allowed: 3&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    it 'shows \'Review 1, 2, 3...\' and \'Calibration review 1, 2, 3...\' on student_review#list page' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review 1&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
* app/controllers/student_review_controller.rb&lt;br /&gt;
* app/models/deadline_right.rb&lt;br /&gt;
* app/models/due_date.rb&lt;br /&gt;
* app/views/assignments/edit/_due_dates.html.erb&lt;br /&gt;
* app/views/student_review/_responses.html.erb&lt;br /&gt;
* app/views/student_review/list.html.erb&lt;br /&gt;
* New created file: spec/features/calibration_spec.rb&lt;br /&gt;
* New created file: 20171206202730_add_calibration_review_to_deadline_types.rb&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114577</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114577"/>
		<updated>2017-12-06T22:54:16Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* How's the function working after implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:case.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the first round submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the current stage is in calibration review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student submitted his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works when the current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. By following the process of TDD we can ensure to maintain the minimum amount of code while writing that specific function, and the developer can gain an overview of the function.&lt;br /&gt;
&lt;br /&gt;
== What did we implement ==&lt;br /&gt;
&lt;br /&gt;
1. We created a file &amp;quot;calibration_spec.rb&amp;quot; in &amp;quot;spec/ features&amp;quot; and write feature tests for the calibration function.&lt;br /&gt;
&lt;br /&gt;
2. We created a migration file &amp;quot;_add_new_deadline_type.rb&amp;quot; to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
3. We added a calibration due date in due date tab if it's a calibration assignment &lt;br /&gt;
&lt;br /&gt;
4. We added calibration_review in deadline_right file (Modified file: app/models/deadline_right.rb)&lt;br /&gt;
 &lt;br /&gt;
5. We changed the function of finding next due date from find_by to where().order('due_at').first &lt;br /&gt;
 &lt;br /&gt;
6. We changed &amp;quot;app/controllers/student_review_controller.rb&amp;quot; file to exclude calibration reviews when counting the review number. We filtered the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
7. We changed the view for student review list in &amp;quot;app/views/student_review/list.html.erb&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
== How's the function working after implementation ==&lt;br /&gt;
You can refer to a youtube video to see how's calibration function working after our implementation: https://youtu.be/s4-Oh3pLN-E&lt;br /&gt;
&lt;br /&gt;
Below are the screenshots for the important parts:&lt;br /&gt;
&lt;br /&gt;
1. After enable calibration for training function, the instructor can see a calibration due date in &amp;quot;due date&amp;quot; tab and can assign a due date for this calibration training:&lt;br /&gt;
[[File:Capture1.GIF]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. When the current stage is in &amp;quot;Calibration Review&amp;quot; we can only do the calibration reviews and show calibration results after submitting.&lt;br /&gt;
[[File:cReview.png]]&lt;br /&gt;
&lt;br /&gt;
3. When the current stage is in &amp;quot;Review&amp;quot;, we can see the calibration review and do the regular review. &lt;br /&gt;
[[File:Review5.png]]&lt;br /&gt;
&lt;br /&gt;
== Tests ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
* This feature test check for when Calibration for training? is selected, the value of assignment is calibrated is set to be true so the calibration tab will show up on the top of the page to fill in the due dates for the calibration period.&lt;br /&gt;
 &lt;br /&gt;
 context 'in assignments#edit page' do&lt;br /&gt;
    it 'has a checkbox with title \'Calibration for training?\' on \'General\' tab' do&lt;br /&gt;
      assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
      instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
      visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'General'&lt;br /&gt;
      expect(page).to have_field('Calibration for training?')&lt;br /&gt;
    end&lt;br /&gt;
    context 'when clicking \'Calibration for training?\' checkbox and clicking \'save\' button' do&lt;br /&gt;
      context '\'Calibration\' due date' do&lt;br /&gt;
        it 'works correctly' do&lt;br /&gt;
          assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
          instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
          visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
          click_link 'General'&lt;br /&gt;
          expect(page).to have_content('Calibration for training?')&lt;br /&gt;
          find(:css, &amp;quot;#assignment_is_calibrated_field&amp;quot;).set(true)&lt;br /&gt;
          click_button 'Save'&lt;br /&gt;
          expect(page).to have_link('Calibration')&lt;br /&gt;
          click_link 'Due dates'&lt;br /&gt;
          fill_in 'datetimepicker_calibration_review', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
          click_button 'submit_btn'&lt;br /&gt;
          calibration_type_id = DeadlineType.where(name: 'calibration_review')[0].id&lt;br /&gt;
          calibration_due_date = DueDate.find(12)&lt;br /&gt;
          expect(calibration_due_date).to have_attributes(&lt;br /&gt;
                                              deadline_type_id: calibration_type_id,&lt;br /&gt;
                                              type: 'AssignmentDueDate'&lt;br /&gt;
                                          )&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
* Since the test contained duplicate code, we load the code in load_work method and set the stage of the current assignment as &amp;quot;calibration&amp;quot; state so the review contains Calibration Review 1, 2, 3 and student can view their calibration result when clicking on View link.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in calibration stage' do&lt;br /&gt;
    context 'calibration feature' do&lt;br /&gt;
      it 'works correctly' do&lt;br /&gt;
        load_work(DateTime.now.in_time_zone + 10, DateTime.now.in_time_zone + 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                  DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                  DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50,  &amp;quot;calibration&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;View&amp;quot;)&lt;br /&gt;
        click_link &amp;quot;View&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* When the project is in review stage, the number of review allowance will not affect by the number of calibration review numbers, so we check the number of review allow is still the same after changing the stage to review stage and the page should contains Calibration Review 1 and Review 1.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in review stage' do&lt;br /&gt;
    it 'excludes calibration reviews from outstanding review restriction and total review restriction' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                   DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                   DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Number of reviews allowed: 3&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    it 'shows \'Review 1, 2, 3...\' and \'Calibration review 1, 2, 3...\' on student_review#list page' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review 1&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
* app/controllers/student_review_controller.rb&lt;br /&gt;
* app/models/deadline_right.rb&lt;br /&gt;
* app/models/due_date.rb&lt;br /&gt;
* app/views/assignments/edit/_due_dates.html.erb&lt;br /&gt;
* app/views/student_review/_responses.html.erb&lt;br /&gt;
* app/views/student_review/list.html.erb&lt;br /&gt;
* New created file: spec/features/calibration_spec.rb&lt;br /&gt;
* New created file: 20171206202730_add_calibration_review_to_deadline_types.rb&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114576</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114576"/>
		<updated>2017-12-06T22:54:02Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* How's the function working after implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:case.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the first round submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the current stage is in calibration review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student submitted his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works when the current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. By following the process of TDD we can ensure to maintain the minimum amount of code while writing that specific function, and the developer can gain an overview of the function.&lt;br /&gt;
&lt;br /&gt;
== What did we implement ==&lt;br /&gt;
&lt;br /&gt;
1. We created a file &amp;quot;calibration_spec.rb&amp;quot; in &amp;quot;spec/ features&amp;quot; and write feature tests for the calibration function.&lt;br /&gt;
&lt;br /&gt;
2. We created a migration file &amp;quot;_add_new_deadline_type.rb&amp;quot; to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
3. We added a calibration due date in due date tab if it's a calibration assignment &lt;br /&gt;
&lt;br /&gt;
4. We added calibration_review in deadline_right file (Modified file: app/models/deadline_right.rb)&lt;br /&gt;
 &lt;br /&gt;
5. We changed the function of finding next due date from find_by to where().order('due_at').first &lt;br /&gt;
 &lt;br /&gt;
6. We changed &amp;quot;app/controllers/student_review_controller.rb&amp;quot; file to exclude calibration reviews when counting the review number. We filtered the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
7. We changed the view for student review list in &amp;quot;app/views/student_review/list.html.erb&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
== How's the function working after implementation ==&lt;br /&gt;
You can refer to a youtube video to see how's calibration function working after our implementation: https://youtu.be/s4-Oh3pLN-E&lt;br /&gt;
&lt;br /&gt;
Below are the screenshots for the important parts:&lt;br /&gt;
&lt;br /&gt;
1. After enable calibration for training function, the instructor can see a calibration due date in &amp;quot;due date&amp;quot; tab and can assign a due date for this calibration training:&lt;br /&gt;
[[File:Capture1.GIF]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. When the current stage is in &amp;quot;Calibration Review&amp;quot; we can only do the calibration reviews and show calibration results after submitting.&lt;br /&gt;
[[File:cReview.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. When the current stage is in &amp;quot;Review&amp;quot;, we can see the calibration review and do the regular review. &lt;br /&gt;
[[File:Review5.png]]&lt;br /&gt;
&lt;br /&gt;
== Tests ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
* This feature test check for when Calibration for training? is selected, the value of assignment is calibrated is set to be true so the calibration tab will show up on the top of the page to fill in the due dates for the calibration period.&lt;br /&gt;
 &lt;br /&gt;
 context 'in assignments#edit page' do&lt;br /&gt;
    it 'has a checkbox with title \'Calibration for training?\' on \'General\' tab' do&lt;br /&gt;
      assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
      instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
      visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'General'&lt;br /&gt;
      expect(page).to have_field('Calibration for training?')&lt;br /&gt;
    end&lt;br /&gt;
    context 'when clicking \'Calibration for training?\' checkbox and clicking \'save\' button' do&lt;br /&gt;
      context '\'Calibration\' due date' do&lt;br /&gt;
        it 'works correctly' do&lt;br /&gt;
          assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
          instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
          visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
          click_link 'General'&lt;br /&gt;
          expect(page).to have_content('Calibration for training?')&lt;br /&gt;
          find(:css, &amp;quot;#assignment_is_calibrated_field&amp;quot;).set(true)&lt;br /&gt;
          click_button 'Save'&lt;br /&gt;
          expect(page).to have_link('Calibration')&lt;br /&gt;
          click_link 'Due dates'&lt;br /&gt;
          fill_in 'datetimepicker_calibration_review', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
          click_button 'submit_btn'&lt;br /&gt;
          calibration_type_id = DeadlineType.where(name: 'calibration_review')[0].id&lt;br /&gt;
          calibration_due_date = DueDate.find(12)&lt;br /&gt;
          expect(calibration_due_date).to have_attributes(&lt;br /&gt;
                                              deadline_type_id: calibration_type_id,&lt;br /&gt;
                                              type: 'AssignmentDueDate'&lt;br /&gt;
                                          )&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
* Since the test contained duplicate code, we load the code in load_work method and set the stage of the current assignment as &amp;quot;calibration&amp;quot; state so the review contains Calibration Review 1, 2, 3 and student can view their calibration result when clicking on View link.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in calibration stage' do&lt;br /&gt;
    context 'calibration feature' do&lt;br /&gt;
      it 'works correctly' do&lt;br /&gt;
        load_work(DateTime.now.in_time_zone + 10, DateTime.now.in_time_zone + 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                  DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                  DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50,  &amp;quot;calibration&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;View&amp;quot;)&lt;br /&gt;
        click_link &amp;quot;View&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* When the project is in review stage, the number of review allowance will not affect by the number of calibration review numbers, so we check the number of review allow is still the same after changing the stage to review stage and the page should contains Calibration Review 1 and Review 1.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in review stage' do&lt;br /&gt;
    it 'excludes calibration reviews from outstanding review restriction and total review restriction' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                   DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                   DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Number of reviews allowed: 3&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    it 'shows \'Review 1, 2, 3...\' and \'Calibration review 1, 2, 3...\' on student_review#list page' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review 1&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
* app/controllers/student_review_controller.rb&lt;br /&gt;
* app/models/deadline_right.rb&lt;br /&gt;
* app/models/due_date.rb&lt;br /&gt;
* app/views/assignments/edit/_due_dates.html.erb&lt;br /&gt;
* app/views/student_review/_responses.html.erb&lt;br /&gt;
* app/views/student_review/list.html.erb&lt;br /&gt;
* New created file: spec/features/calibration_spec.rb&lt;br /&gt;
* New created file: 20171206202730_add_calibration_review_to_deadline_types.rb&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114575</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114575"/>
		<updated>2017-12-06T22:53:40Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* How's the function working after implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:case.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the first round submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the current stage is in calibration review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student submitted his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works when the current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. By following the process of TDD we can ensure to maintain the minimum amount of code while writing that specific function, and the developer can gain an overview of the function.&lt;br /&gt;
&lt;br /&gt;
== What did we implement ==&lt;br /&gt;
&lt;br /&gt;
1. We created a file &amp;quot;calibration_spec.rb&amp;quot; in &amp;quot;spec/ features&amp;quot; and write feature tests for the calibration function.&lt;br /&gt;
&lt;br /&gt;
2. We created a migration file &amp;quot;_add_new_deadline_type.rb&amp;quot; to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
3. We added a calibration due date in due date tab if it's a calibration assignment &lt;br /&gt;
&lt;br /&gt;
4. We added calibration_review in deadline_right file (Modified file: app/models/deadline_right.rb)&lt;br /&gt;
 &lt;br /&gt;
5. We changed the function of finding next due date from find_by to where().order('due_at').first &lt;br /&gt;
 &lt;br /&gt;
6. We changed &amp;quot;app/controllers/student_review_controller.rb&amp;quot; file to exclude calibration reviews when counting the review number. We filtered the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
7. We changed the view for student review list in &amp;quot;app/views/student_review/list.html.erb&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
== How's the function working after implementation ==&lt;br /&gt;
You can refer to a youtube video to see how's calibration function working after our implementation: https://youtu.be/s4-Oh3pLN-E&lt;br /&gt;
&lt;br /&gt;
Below are the screenshots for the important parts:&lt;br /&gt;
&lt;br /&gt;
1. After enable calibration for training function, the instructor can see a calibration due date in &amp;quot;due date&amp;quot; tab and can assign a due date for this calibration training:&lt;br /&gt;
&lt;br /&gt;
[[File:Capture1.GIF]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. When the current stage is in &amp;quot;Calibration Review&amp;quot; we can only do the calibration reviews and show calibration results after submitting.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:cReview.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. When the current stage is in &amp;quot;Review&amp;quot;, we can see the calibration review and do the regular review. &lt;br /&gt;
&lt;br /&gt;
[[File:Review5.png]]&lt;br /&gt;
&lt;br /&gt;
== Tests ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
* This feature test check for when Calibration for training? is selected, the value of assignment is calibrated is set to be true so the calibration tab will show up on the top of the page to fill in the due dates for the calibration period.&lt;br /&gt;
 &lt;br /&gt;
 context 'in assignments#edit page' do&lt;br /&gt;
    it 'has a checkbox with title \'Calibration for training?\' on \'General\' tab' do&lt;br /&gt;
      assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
      instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
      visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'General'&lt;br /&gt;
      expect(page).to have_field('Calibration for training?')&lt;br /&gt;
    end&lt;br /&gt;
    context 'when clicking \'Calibration for training?\' checkbox and clicking \'save\' button' do&lt;br /&gt;
      context '\'Calibration\' due date' do&lt;br /&gt;
        it 'works correctly' do&lt;br /&gt;
          assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
          instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
          visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
          click_link 'General'&lt;br /&gt;
          expect(page).to have_content('Calibration for training?')&lt;br /&gt;
          find(:css, &amp;quot;#assignment_is_calibrated_field&amp;quot;).set(true)&lt;br /&gt;
          click_button 'Save'&lt;br /&gt;
          expect(page).to have_link('Calibration')&lt;br /&gt;
          click_link 'Due dates'&lt;br /&gt;
          fill_in 'datetimepicker_calibration_review', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
          click_button 'submit_btn'&lt;br /&gt;
          calibration_type_id = DeadlineType.where(name: 'calibration_review')[0].id&lt;br /&gt;
          calibration_due_date = DueDate.find(12)&lt;br /&gt;
          expect(calibration_due_date).to have_attributes(&lt;br /&gt;
                                              deadline_type_id: calibration_type_id,&lt;br /&gt;
                                              type: 'AssignmentDueDate'&lt;br /&gt;
                                          )&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
* Since the test contained duplicate code, we load the code in load_work method and set the stage of the current assignment as &amp;quot;calibration&amp;quot; state so the review contains Calibration Review 1, 2, 3 and student can view their calibration result when clicking on View link.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in calibration stage' do&lt;br /&gt;
    context 'calibration feature' do&lt;br /&gt;
      it 'works correctly' do&lt;br /&gt;
        load_work(DateTime.now.in_time_zone + 10, DateTime.now.in_time_zone + 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                  DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                  DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50,  &amp;quot;calibration&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;View&amp;quot;)&lt;br /&gt;
        click_link &amp;quot;View&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* When the project is in review stage, the number of review allowance will not affect by the number of calibration review numbers, so we check the number of review allow is still the same after changing the stage to review stage and the page should contains Calibration Review 1 and Review 1.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in review stage' do&lt;br /&gt;
    it 'excludes calibration reviews from outstanding review restriction and total review restriction' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                   DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                   DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Number of reviews allowed: 3&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    it 'shows \'Review 1, 2, 3...\' and \'Calibration review 1, 2, 3...\' on student_review#list page' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review 1&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
* app/controllers/student_review_controller.rb&lt;br /&gt;
* app/models/deadline_right.rb&lt;br /&gt;
* app/models/due_date.rb&lt;br /&gt;
* app/views/assignments/edit/_due_dates.html.erb&lt;br /&gt;
* app/views/student_review/_responses.html.erb&lt;br /&gt;
* app/views/student_review/list.html.erb&lt;br /&gt;
* New created file: spec/features/calibration_spec.rb&lt;br /&gt;
* New created file: 20171206202730_add_calibration_review_to_deadline_types.rb&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114574</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114574"/>
		<updated>2017-12-06T22:52:43Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:case.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the first round submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the current stage is in calibration review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student submitted his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works when the current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. By following the process of TDD we can ensure to maintain the minimum amount of code while writing that specific function, and the developer can gain an overview of the function.&lt;br /&gt;
&lt;br /&gt;
== What did we implement ==&lt;br /&gt;
&lt;br /&gt;
1. We created a file &amp;quot;calibration_spec.rb&amp;quot; in &amp;quot;spec/ features&amp;quot; and write feature tests for the calibration function.&lt;br /&gt;
&lt;br /&gt;
2. We created a migration file &amp;quot;_add_new_deadline_type.rb&amp;quot; to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
3. We added a calibration due date in due date tab if it's a calibration assignment &lt;br /&gt;
&lt;br /&gt;
4. We added calibration_review in deadline_right file (Modified file: app/models/deadline_right.rb)&lt;br /&gt;
 &lt;br /&gt;
5. We changed the function of finding next due date from find_by to where().order('due_at').first &lt;br /&gt;
 &lt;br /&gt;
6. We changed &amp;quot;app/controllers/student_review_controller.rb&amp;quot; file to exclude calibration reviews when counting the review number. We filtered the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
7. We changed the view for student review list in &amp;quot;app/views/student_review/list.html.erb&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
== How's the function working after implementation ==&lt;br /&gt;
You can refer to a youtube video to see how's calibration function working after our implementation: https://youtu.be/s4-Oh3pLN-E&lt;br /&gt;
&lt;br /&gt;
Below are the screenshots for the important parts:&lt;br /&gt;
&lt;br /&gt;
1. After enable calibration for training function, the instructor can see a calibration due date in &amp;quot;due date&amp;quot; tab and can assign a due date for this calibration training:&lt;br /&gt;
&lt;br /&gt;
[[File:Capture1.GIF]]&lt;br /&gt;
&lt;br /&gt;
2. When the current stage is in &amp;quot;Calibration Review&amp;quot; we can only do the calibration reviews and show calibration results after submitting.&lt;br /&gt;
&lt;br /&gt;
[[File:cReview.png]]&lt;br /&gt;
&lt;br /&gt;
3. When the current stage is in &amp;quot;Review&amp;quot;, we can see the calibration review and do the regular review. &lt;br /&gt;
&lt;br /&gt;
[[File:Review5.png]]&lt;br /&gt;
&lt;br /&gt;
== Tests ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
* This feature test check for when Calibration for training? is selected, the value of assignment is calibrated is set to be true so the calibration tab will show up on the top of the page to fill in the due dates for the calibration period.&lt;br /&gt;
 &lt;br /&gt;
 context 'in assignments#edit page' do&lt;br /&gt;
    it 'has a checkbox with title \'Calibration for training?\' on \'General\' tab' do&lt;br /&gt;
      assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
      instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
      visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'General'&lt;br /&gt;
      expect(page).to have_field('Calibration for training?')&lt;br /&gt;
    end&lt;br /&gt;
    context 'when clicking \'Calibration for training?\' checkbox and clicking \'save\' button' do&lt;br /&gt;
      context '\'Calibration\' due date' do&lt;br /&gt;
        it 'works correctly' do&lt;br /&gt;
          assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
          instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
          visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
          click_link 'General'&lt;br /&gt;
          expect(page).to have_content('Calibration for training?')&lt;br /&gt;
          find(:css, &amp;quot;#assignment_is_calibrated_field&amp;quot;).set(true)&lt;br /&gt;
          click_button 'Save'&lt;br /&gt;
          expect(page).to have_link('Calibration')&lt;br /&gt;
          click_link 'Due dates'&lt;br /&gt;
          fill_in 'datetimepicker_calibration_review', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
          click_button 'submit_btn'&lt;br /&gt;
          calibration_type_id = DeadlineType.where(name: 'calibration_review')[0].id&lt;br /&gt;
          calibration_due_date = DueDate.find(12)&lt;br /&gt;
          expect(calibration_due_date).to have_attributes(&lt;br /&gt;
                                              deadline_type_id: calibration_type_id,&lt;br /&gt;
                                              type: 'AssignmentDueDate'&lt;br /&gt;
                                          )&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
* Since the test contained duplicate code, we load the code in load_work method and set the stage of the current assignment as &amp;quot;calibration&amp;quot; state so the review contains Calibration Review 1, 2, 3 and student can view their calibration result when clicking on View link.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in calibration stage' do&lt;br /&gt;
    context 'calibration feature' do&lt;br /&gt;
      it 'works correctly' do&lt;br /&gt;
        load_work(DateTime.now.in_time_zone + 10, DateTime.now.in_time_zone + 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                  DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                  DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50,  &amp;quot;calibration&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;View&amp;quot;)&lt;br /&gt;
        click_link &amp;quot;View&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* When the project is in review stage, the number of review allowance will not affect by the number of calibration review numbers, so we check the number of review allow is still the same after changing the stage to review stage and the page should contains Calibration Review 1 and Review 1.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in review stage' do&lt;br /&gt;
    it 'excludes calibration reviews from outstanding review restriction and total review restriction' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                   DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                   DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Number of reviews allowed: 3&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    it 'shows \'Review 1, 2, 3...\' and \'Calibration review 1, 2, 3...\' on student_review#list page' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review 1&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
* app/controllers/student_review_controller.rb&lt;br /&gt;
* app/models/deadline_right.rb&lt;br /&gt;
* app/models/due_date.rb&lt;br /&gt;
* app/views/assignments/edit/_due_dates.html.erb&lt;br /&gt;
* app/views/student_review/_responses.html.erb&lt;br /&gt;
* app/views/student_review/list.html.erb&lt;br /&gt;
* New created file: spec/features/calibration_spec.rb&lt;br /&gt;
* New created file: 20171206202730_add_calibration_review_to_deadline_types.rb&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:CReview.png&amp;diff=114573</id>
		<title>File:CReview.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:CReview.png&amp;diff=114573"/>
		<updated>2017-12-06T22:49:52Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Review5.png&amp;diff=114572</id>
		<title>File:Review5.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Review5.png&amp;diff=114572"/>
		<updated>2017-12-06T22:48:24Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Review4.png&amp;diff=114571</id>
		<title>File:Review4.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Review4.png&amp;diff=114571"/>
		<updated>2017-12-06T22:47:33Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Duedate.png&amp;diff=114570</id>
		<title>File:Duedate.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Duedate.png&amp;diff=114570"/>
		<updated>2017-12-06T22:44:38Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114569</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114569"/>
		<updated>2017-12-06T22:38:07Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* What did we implement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:case.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the first round submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the current stage is in calibration review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student submitted his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works when the current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. By following the process of TDD we can ensure to maintain the minimum amount of code while writing that specific function, and the developer can gain an overview of the function.&lt;br /&gt;
&lt;br /&gt;
== What did we implement ==&lt;br /&gt;
&lt;br /&gt;
1. We created a file &amp;quot;calibration_spec.rb&amp;quot; in &amp;quot;spec/ features&amp;quot; and write feature tests for the calibration function.&lt;br /&gt;
&lt;br /&gt;
2. We created a migration file &amp;quot;_add_new_deadline_type.rb&amp;quot; to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
3. We added a calibration due date in due date tab if it's a calibration assignment &lt;br /&gt;
&lt;br /&gt;
4. We added calibration_review in deadline_right file (Modified file: app/models/deadline_right.rb)&lt;br /&gt;
 &lt;br /&gt;
5. We changed the function of finding next due date from find_by to where().order('due_at').first &lt;br /&gt;
 &lt;br /&gt;
6. We changed &amp;quot;app/controllers/student_review_controller.rb&amp;quot; file to exclude calibration reviews when counting the review number. We filtered the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
7. We changed the view for student review list in &amp;quot;app/views/student_review/list.html.erb&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
== Tests ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
* This feature test check for when Calibration for training? is selected, the value of assignment is calibrated is set to be true so the calibration tab will show up on the top of the page to fill in the due dates for the calibration period.&lt;br /&gt;
 &lt;br /&gt;
 context 'in assignments#edit page' do&lt;br /&gt;
    it 'has a checkbox with title \'Calibration for training?\' on \'General\' tab' do&lt;br /&gt;
      assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
      instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
      visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'General'&lt;br /&gt;
      expect(page).to have_field('Calibration for training?')&lt;br /&gt;
    end&lt;br /&gt;
    context 'when clicking \'Calibration for training?\' checkbox and clicking \'save\' button' do&lt;br /&gt;
      context '\'Calibration\' due date' do&lt;br /&gt;
        it 'works correctly' do&lt;br /&gt;
          assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
          instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
          visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
          click_link 'General'&lt;br /&gt;
          expect(page).to have_content('Calibration for training?')&lt;br /&gt;
          find(:css, &amp;quot;#assignment_is_calibrated_field&amp;quot;).set(true)&lt;br /&gt;
          click_button 'Save'&lt;br /&gt;
          expect(page).to have_link('Calibration')&lt;br /&gt;
          click_link 'Due dates'&lt;br /&gt;
          fill_in 'datetimepicker_calibration_review', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
          click_button 'submit_btn'&lt;br /&gt;
          calibration_type_id = DeadlineType.where(name: 'calibration_review')[0].id&lt;br /&gt;
          calibration_due_date = DueDate.find(12)&lt;br /&gt;
          expect(calibration_due_date).to have_attributes(&lt;br /&gt;
                                              deadline_type_id: calibration_type_id,&lt;br /&gt;
                                              type: 'AssignmentDueDate'&lt;br /&gt;
                                          )&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
* Since the test contained duplicate code, we load the code in load_work method and set the stage of the current assignment as &amp;quot;calibration&amp;quot; state so the review contains Calibration Review 1, 2, 3 and student can view their calibration result when clicking on View link.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in calibration stage' do&lt;br /&gt;
    context 'calibration feature' do&lt;br /&gt;
      it 'works correctly' do&lt;br /&gt;
        load_work(DateTime.now.in_time_zone + 10, DateTime.now.in_time_zone + 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                  DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                  DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50,  &amp;quot;calibration&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;View&amp;quot;)&lt;br /&gt;
        click_link &amp;quot;View&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* When the project is in review stage, the number of review allowance will not affect by the number of calibration review numbers, so we check the number of review allow is still the same after changing the stage to review stage and the page should contains Calibration Review 1 and Review 1.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in review stage' do&lt;br /&gt;
    it 'excludes calibration reviews from outstanding review restriction and total review restriction' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                   DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                   DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Number of reviews allowed: 3&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    it 'shows \'Review 1, 2, 3...\' and \'Calibration review 1, 2, 3...\' on student_review#list page' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review 1&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
* app/controllers/student_review_controller.rb&lt;br /&gt;
* app/models/deadline_right.rb&lt;br /&gt;
* app/models/due_date.rb&lt;br /&gt;
* app/views/assignments/edit/_due_dates.html.erb&lt;br /&gt;
* app/views/student_review/_responses.html.erb&lt;br /&gt;
* app/views/student_review/list.html.erb&lt;br /&gt;
* New created file: spec/features/calibration_spec.rb&lt;br /&gt;
* New created file: 20171206202730_add_calibration_review_to_deadline_types.rb&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114568</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114568"/>
		<updated>2017-12-06T22:37:48Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* What did we implement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:case.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the first round submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the current stage is in calibration review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student submitted his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works when the current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. By following the process of TDD we can ensure to maintain the minimum amount of code while writing that specific function, and the developer can gain an overview of the function.&lt;br /&gt;
&lt;br /&gt;
== What did we implement ==&lt;br /&gt;
&lt;br /&gt;
1. We created a file &amp;quot;calibration_spec.rb&amp;quot; in &amp;quot;spec/ features&amp;quot; and write feature tests for the calibration function.&lt;br /&gt;
&lt;br /&gt;
2. We created a migration file &amp;quot;_add_new_deadline_type.rb&amp;quot; to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
3. We added a calibration due date in due date tab if it's a calibration assignment &lt;br /&gt;
&lt;br /&gt;
[[File:Capture1.GIF]]&lt;br /&gt;
&lt;br /&gt;
4. We added calibration_review in deadline_right file (Modified file: app/models/deadline_right.rb)&lt;br /&gt;
 &lt;br /&gt;
5. We changed the function of finding next due date from find_by to where().order('due_at').first &lt;br /&gt;
 &lt;br /&gt;
6. We changed &amp;quot;app/controllers/student_review_controller.rb&amp;quot; file to exclude calibration reviews when counting the review number. We filtered the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
7. We changed the view for student review list in &amp;quot;app/views/student_review/list.html.erb&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
== Tests ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
* This feature test check for when Calibration for training? is selected, the value of assignment is calibrated is set to be true so the calibration tab will show up on the top of the page to fill in the due dates for the calibration period.&lt;br /&gt;
 &lt;br /&gt;
 context 'in assignments#edit page' do&lt;br /&gt;
    it 'has a checkbox with title \'Calibration for training?\' on \'General\' tab' do&lt;br /&gt;
      assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
      instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
      visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'General'&lt;br /&gt;
      expect(page).to have_field('Calibration for training?')&lt;br /&gt;
    end&lt;br /&gt;
    context 'when clicking \'Calibration for training?\' checkbox and clicking \'save\' button' do&lt;br /&gt;
      context '\'Calibration\' due date' do&lt;br /&gt;
        it 'works correctly' do&lt;br /&gt;
          assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
          instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
          visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
          click_link 'General'&lt;br /&gt;
          expect(page).to have_content('Calibration for training?')&lt;br /&gt;
          find(:css, &amp;quot;#assignment_is_calibrated_field&amp;quot;).set(true)&lt;br /&gt;
          click_button 'Save'&lt;br /&gt;
          expect(page).to have_link('Calibration')&lt;br /&gt;
          click_link 'Due dates'&lt;br /&gt;
          fill_in 'datetimepicker_calibration_review', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
          click_button 'submit_btn'&lt;br /&gt;
          calibration_type_id = DeadlineType.where(name: 'calibration_review')[0].id&lt;br /&gt;
          calibration_due_date = DueDate.find(12)&lt;br /&gt;
          expect(calibration_due_date).to have_attributes(&lt;br /&gt;
                                              deadline_type_id: calibration_type_id,&lt;br /&gt;
                                              type: 'AssignmentDueDate'&lt;br /&gt;
                                          )&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
* Since the test contained duplicate code, we load the code in load_work method and set the stage of the current assignment as &amp;quot;calibration&amp;quot; state so the review contains Calibration Review 1, 2, 3 and student can view their calibration result when clicking on View link.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in calibration stage' do&lt;br /&gt;
    context 'calibration feature' do&lt;br /&gt;
      it 'works correctly' do&lt;br /&gt;
        load_work(DateTime.now.in_time_zone + 10, DateTime.now.in_time_zone + 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                  DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                  DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50,  &amp;quot;calibration&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;View&amp;quot;)&lt;br /&gt;
        click_link &amp;quot;View&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* When the project is in review stage, the number of review allowance will not affect by the number of calibration review numbers, so we check the number of review allow is still the same after changing the stage to review stage and the page should contains Calibration Review 1 and Review 1.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in review stage' do&lt;br /&gt;
    it 'excludes calibration reviews from outstanding review restriction and total review restriction' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                   DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                   DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Number of reviews allowed: 3&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    it 'shows \'Review 1, 2, 3...\' and \'Calibration review 1, 2, 3...\' on student_review#list page' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review 1&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
* app/controllers/student_review_controller.rb&lt;br /&gt;
* app/models/deadline_right.rb&lt;br /&gt;
* app/models/due_date.rb&lt;br /&gt;
* app/views/assignments/edit/_due_dates.html.erb&lt;br /&gt;
* app/views/student_review/_responses.html.erb&lt;br /&gt;
* app/views/student_review/list.html.erb&lt;br /&gt;
* New created file: spec/features/calibration_spec.rb&lt;br /&gt;
* New created file: 20171206202730_add_calibration_review_to_deadline_types.rb&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114567</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114567"/>
		<updated>2017-12-06T22:36:48Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* What did we implement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:case.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the first round submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the current stage is in calibration review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student submitted his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works when the current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. By following the process of TDD we can ensure to maintain the minimum amount of code while writing that specific function, and the developer can gain an overview of the function.&lt;br /&gt;
&lt;br /&gt;
== What did we implement ==&lt;br /&gt;
&lt;br /&gt;
1. We created a file &amp;quot;calibration_spec.rb&amp;quot; in &amp;quot;spec/ features&amp;quot; and write feature tests for the calibration function.&lt;br /&gt;
&lt;br /&gt;
2. We created a migration file &amp;quot;_add_new_deadline_type.rb&amp;quot; to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
3. We added a calibration due date in due date tab if it's a calibration assignment &lt;br /&gt;
&lt;br /&gt;
[[File:Capture1.GIF]]&lt;br /&gt;
&lt;br /&gt;
4. We added calibration_review in deadline_right file (Modified file: app/models/deadline_right.rb)&lt;br /&gt;
 &lt;br /&gt;
5. We changed the function of finding next due date from find_by to where().order('due_at').first &lt;br /&gt;
 &lt;br /&gt;
6. We changed &amp;quot;app/controllers/student_review_controller.rb&amp;quot; file to exclude calibration reviews when counting the review number. We filtered the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture3.GIF]]&lt;br /&gt;
&lt;br /&gt;
7. We changed the view for student review list in &amp;quot;app/views/student_review/list.html.erb&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
== Tests ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
* This feature test check for when Calibration for training? is selected, the value of assignment is calibrated is set to be true so the calibration tab will show up on the top of the page to fill in the due dates for the calibration period.&lt;br /&gt;
 &lt;br /&gt;
 context 'in assignments#edit page' do&lt;br /&gt;
    it 'has a checkbox with title \'Calibration for training?\' on \'General\' tab' do&lt;br /&gt;
      assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
      instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
      visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'General'&lt;br /&gt;
      expect(page).to have_field('Calibration for training?')&lt;br /&gt;
    end&lt;br /&gt;
    context 'when clicking \'Calibration for training?\' checkbox and clicking \'save\' button' do&lt;br /&gt;
      context '\'Calibration\' due date' do&lt;br /&gt;
        it 'works correctly' do&lt;br /&gt;
          assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
          instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
          visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
          click_link 'General'&lt;br /&gt;
          expect(page).to have_content('Calibration for training?')&lt;br /&gt;
          find(:css, &amp;quot;#assignment_is_calibrated_field&amp;quot;).set(true)&lt;br /&gt;
          click_button 'Save'&lt;br /&gt;
          expect(page).to have_link('Calibration')&lt;br /&gt;
          click_link 'Due dates'&lt;br /&gt;
          fill_in 'datetimepicker_calibration_review', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
          click_button 'submit_btn'&lt;br /&gt;
          calibration_type_id = DeadlineType.where(name: 'calibration_review')[0].id&lt;br /&gt;
          calibration_due_date = DueDate.find(12)&lt;br /&gt;
          expect(calibration_due_date).to have_attributes(&lt;br /&gt;
                                              deadline_type_id: calibration_type_id,&lt;br /&gt;
                                              type: 'AssignmentDueDate'&lt;br /&gt;
                                          )&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
* Since the test contained duplicate code, we load the code in load_work method and set the stage of the current assignment as &amp;quot;calibration&amp;quot; state so the review contains Calibration Review 1, 2, 3 and student can view their calibration result when clicking on View link.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in calibration stage' do&lt;br /&gt;
    context 'calibration feature' do&lt;br /&gt;
      it 'works correctly' do&lt;br /&gt;
        load_work(DateTime.now.in_time_zone + 10, DateTime.now.in_time_zone + 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                  DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                  DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50,  &amp;quot;calibration&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;View&amp;quot;)&lt;br /&gt;
        click_link &amp;quot;View&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* When the project is in review stage, the number of review allowance will not affect by the number of calibration review numbers, so we check the number of review allow is still the same after changing the stage to review stage and the page should contains Calibration Review 1 and Review 1.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in review stage' do&lt;br /&gt;
    it 'excludes calibration reviews from outstanding review restriction and total review restriction' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                   DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                   DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Number of reviews allowed: 3&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    it 'shows \'Review 1, 2, 3...\' and \'Calibration review 1, 2, 3...\' on student_review#list page' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review 1&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
* app/controllers/student_review_controller.rb&lt;br /&gt;
* app/models/deadline_right.rb&lt;br /&gt;
* app/models/due_date.rb&lt;br /&gt;
* app/views/assignments/edit/_due_dates.html.erb&lt;br /&gt;
* app/views/student_review/_responses.html.erb&lt;br /&gt;
* app/views/student_review/list.html.erb&lt;br /&gt;
* New created file: spec/features/calibration_spec.rb&lt;br /&gt;
* New created file: 20171206202730_add_calibration_review_to_deadline_types.rb&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Review3.png&amp;diff=114566</id>
		<title>File:Review3.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Review3.png&amp;diff=114566"/>
		<updated>2017-12-06T22:35:58Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: uploaded a new version of &amp;amp;quot;File:Review3.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Review.jpeg&amp;diff=114565</id>
		<title>File:Review.jpeg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Review.jpeg&amp;diff=114565"/>
		<updated>2017-12-06T22:31:32Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:DueDate2.png&amp;diff=114564</id>
		<title>File:DueDate2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:DueDate2.png&amp;diff=114564"/>
		<updated>2017-12-06T22:30:12Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:DueDate.jpeg&amp;diff=114563</id>
		<title>File:DueDate.jpeg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:DueDate.jpeg&amp;diff=114563"/>
		<updated>2017-12-06T22:27:41Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114557</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114557"/>
		<updated>2017-12-06T21:00:05Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:case.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the first round submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the current stage is in calibration review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student submitted his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works when the current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. By following the process of TDD we can ensure to maintain the minimum amount of code while writing that specific function, and the developer can gain an overview of the function.&lt;br /&gt;
&lt;br /&gt;
== What did we implement ==&lt;br /&gt;
&lt;br /&gt;
1. We created a file &amp;quot;calibration_spec.rb&amp;quot; in &amp;quot;spec/ features&amp;quot; and write feature tests for the calibration function.&lt;br /&gt;
&lt;br /&gt;
2. We created a migration file &amp;quot;_add_new_deadline_type.rb&amp;quot; to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
3. We added a calibration due date in due date tab if it's a calibration assignment &lt;br /&gt;
&lt;br /&gt;
[[File:Capture1.GIF]]&lt;br /&gt;
&lt;br /&gt;
4. We added calibration_review in deadline_right file (Modified file: app/models/deadline_right.rb)&lt;br /&gt;
 &lt;br /&gt;
5. We changed the function of finding next due date from find_by to where().order('due_at').first &lt;br /&gt;
 &lt;br /&gt;
6. We changed &amp;quot;app/controllers/student_review_controller.rb&amp;quot; file to exclude calibration reviews when counting the review number. We filtered the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture2.GIF]]&lt;br /&gt;
&lt;br /&gt;
7. We changed the view for student review list in &amp;quot;app/views/student_review/list.html.erb&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture1.GIF]]&lt;br /&gt;
&lt;br /&gt;
== Tests ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
* This feature test check for when Calibration for training? is selected, the value of assignment is calibrated is set to be true so the calibration tab will show up on the top of the page to fill in the due dates for the calibration period.&lt;br /&gt;
 &lt;br /&gt;
 context 'in assignments#edit page' do&lt;br /&gt;
    it 'has a checkbox with title \'Calibration for training?\' on \'General\' tab' do&lt;br /&gt;
      assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
      instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
      visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'General'&lt;br /&gt;
      expect(page).to have_field('Calibration for training?')&lt;br /&gt;
    end&lt;br /&gt;
    context 'when clicking \'Calibration for training?\' checkbox and clicking \'save\' button' do&lt;br /&gt;
      context '\'Calibration\' due date' do&lt;br /&gt;
        it 'works correctly' do&lt;br /&gt;
          assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
          instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
          visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
          click_link 'General'&lt;br /&gt;
          expect(page).to have_content('Calibration for training?')&lt;br /&gt;
          find(:css, &amp;quot;#assignment_is_calibrated_field&amp;quot;).set(true)&lt;br /&gt;
          click_button 'Save'&lt;br /&gt;
          expect(page).to have_link('Calibration')&lt;br /&gt;
          click_link 'Due dates'&lt;br /&gt;
          fill_in 'datetimepicker_calibration_review', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
          click_button 'submit_btn'&lt;br /&gt;
          calibration_type_id = DeadlineType.where(name: 'calibration_review')[0].id&lt;br /&gt;
          calibration_due_date = DueDate.find(12)&lt;br /&gt;
          expect(calibration_due_date).to have_attributes(&lt;br /&gt;
                                              deadline_type_id: calibration_type_id,&lt;br /&gt;
                                              type: 'AssignmentDueDate'&lt;br /&gt;
                                          )&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
* Since the test contained duplicate code, we load the code in load_work method and set the stage of the current assignment as &amp;quot;calibration&amp;quot; state so the review contains Calibration Review 1, 2, 3 and student can view their calibration result when clicking on View link.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in calibration stage' do&lt;br /&gt;
    context 'calibration feature' do&lt;br /&gt;
      it 'works correctly' do&lt;br /&gt;
        load_work(DateTime.now.in_time_zone + 10, DateTime.now.in_time_zone + 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                  DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                  DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50,  &amp;quot;calibration&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;View&amp;quot;)&lt;br /&gt;
        click_link &amp;quot;View&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* When the project is in review stage, the number of review allowance will not affect by the number of calibration review numbers, so we check the number of review allow is still the same after changing the stage to review stage and the page should contains Calibration Review 1 and Review 1.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in review stage' do&lt;br /&gt;
    it 'excludes calibration reviews from outstanding review restriction and total review restriction' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                   DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                   DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Number of reviews allowed: 3&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    it 'shows \'Review 1, 2, 3...\' and \'Calibration review 1, 2, 3...\' on student_review#list page' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review 1&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
* app/controllers/student_review_controller.rb&lt;br /&gt;
* app/models/deadline_right.rb&lt;br /&gt;
* app/models/due_date.rb&lt;br /&gt;
* app/views/assignments/edit/_due_dates.html.erb&lt;br /&gt;
* app/views/student_review/_responses.html.erb&lt;br /&gt;
* app/views/student_review/list.html.erb&lt;br /&gt;
* New created file: spec/features/calibration_spec.rb&lt;br /&gt;
* New created file: 20171206202730_add_calibration_review_to_deadline_types.rb&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114556</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114556"/>
		<updated>2017-12-06T20:59:48Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:case.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the first round submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the current stage is in calibration review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student submitted his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works when the current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. By following the process of TDD we can ensure to maintain the minimum amount of code while writing that specific function, and the developer can gain an overview of the function.&lt;br /&gt;
&lt;br /&gt;
== What did we implement ==&lt;br /&gt;
&lt;br /&gt;
1. We created a file &amp;quot;calibration_spec.rb&amp;quot; in &amp;quot;spec/ features&amp;quot; and write feature tests for the calibration function.&lt;br /&gt;
&lt;br /&gt;
2. We created a migration file &amp;quot;_add_new_deadline_type.rb&amp;quot; to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
3. We added a calibration due date in due date tab if it's a calibration assignment &lt;br /&gt;
&lt;br /&gt;
[[File:Capture1.GIF]]&lt;br /&gt;
&lt;br /&gt;
4. We added calibration_review in deadline_right file (Modified file: app/models/deadline_right.rb)&lt;br /&gt;
 &lt;br /&gt;
5. We changed the function of finding next due date from find_by to where().order('due_at').first &lt;br /&gt;
 &lt;br /&gt;
6. We changed &amp;quot;app/controllers/student_review_controller.rb&amp;quot; file to exclude calibration reviews when counting the review number. We filtered the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture2.GIF]]&lt;br /&gt;
&lt;br /&gt;
7. We changed the view for student review list in &amp;quot;app/views/student_review/list.html.erb&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture1.GIF]]&lt;br /&gt;
&lt;br /&gt;
== Tests ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
* This feature test check for when Calibration for training? is selected, the value of assignment is calibrated is set to be true so the calibration tab will show up on the top of the page to fill in the due dates for the calibration period.&lt;br /&gt;
 &lt;br /&gt;
 context 'in assignments#edit page' do&lt;br /&gt;
    it 'has a checkbox with title \'Calibration for training?\' on \'General\' tab' do&lt;br /&gt;
      assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
      instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
      visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'General'&lt;br /&gt;
      expect(page).to have_field('Calibration for training?')&lt;br /&gt;
    end&lt;br /&gt;
    context 'when clicking \'Calibration for training?\' checkbox and clicking \'save\' button' do&lt;br /&gt;
      context '\'Calibration\' due date' do&lt;br /&gt;
        it 'works correctly' do&lt;br /&gt;
          assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
          instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
          visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
          click_link 'General'&lt;br /&gt;
          expect(page).to have_content('Calibration for training?')&lt;br /&gt;
          find(:css, &amp;quot;#assignment_is_calibrated_field&amp;quot;).set(true)&lt;br /&gt;
          click_button 'Save'&lt;br /&gt;
          expect(page).to have_link('Calibration')&lt;br /&gt;
          click_link 'Due dates'&lt;br /&gt;
          fill_in 'datetimepicker_calibration_review', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
          click_button 'submit_btn'&lt;br /&gt;
          calibration_type_id = DeadlineType.where(name: 'calibration_review')[0].id&lt;br /&gt;
          calibration_due_date = DueDate.find(12)&lt;br /&gt;
          expect(calibration_due_date).to have_attributes(&lt;br /&gt;
                                              deadline_type_id: calibration_type_id,&lt;br /&gt;
                                              type: 'AssignmentDueDate'&lt;br /&gt;
                                          )&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
* Since the test contained duplicate code, we load the code in load_work method and set the stage of the current assignment as &amp;quot;calibration&amp;quot; state so the review contains Calibration Review 1, 2, 3 and student can view their calibration result when clicking on View link.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in calibration stage' do&lt;br /&gt;
    context 'calibration feature' do&lt;br /&gt;
      it 'works correctly' do&lt;br /&gt;
        load_work(DateTime.now.in_time_zone + 10, DateTime.now.in_time_zone + 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                  DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                  DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50,  &amp;quot;calibration&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;View&amp;quot;)&lt;br /&gt;
        click_link &amp;quot;View&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* When the project is in review stage, the number of review allowance will not affect by the number of calibration review numbers, so we check the number of review allow is still the same after changing the stage to review stage and the page should contains Calibration Review 1 and Review 1.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in review stage' do&lt;br /&gt;
    it 'excludes calibration reviews from outstanding review restriction and total review restriction' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                   DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                   DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Number of reviews allowed: 3&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    it 'shows \'Review 1, 2, 3...\' and \'Calibration review 1, 2, 3...\' on student_review#list page' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review 1&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
* app/controllers/student_review_controller.rb&lt;br /&gt;
* app/models/deadline_right.rb&lt;br /&gt;
* app/models/due_date.rb&lt;br /&gt;
* app/views/assignments/edit/_due_dates.html.erb&lt;br /&gt;
* app/views/student_review/_responses.html.erb&lt;br /&gt;
* app/views/student_review/list.html.erb&lt;br /&gt;
* New created file: spec/features/calibration_spec.rb&lt;br /&gt;
* New created file: 20171206202730_add_calibration_review_to_deadline_types.rb&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114555</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114555"/>
		<updated>2017-12-06T20:59:39Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* Tests */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:case.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the first round submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the current stage is in calibration review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student submitted his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works when the current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. By following the process of TDD we can ensure to maintain the minimum amount of code while writing that specific function, and the developer can gain an overview of the function.&lt;br /&gt;
&lt;br /&gt;
== What did we implement ==&lt;br /&gt;
&lt;br /&gt;
1. We created a file &amp;quot;calibration_spec.rb&amp;quot; in &amp;quot;spec/ features&amp;quot; and write feature tests for the calibration function.&lt;br /&gt;
&lt;br /&gt;
2. We created a migration file &amp;quot;_add_new_deadline_type.rb&amp;quot; to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
3. We added a calibration due date in due date tab if it's a calibration assignment &lt;br /&gt;
&lt;br /&gt;
[[File:Capture1.GIF]]&lt;br /&gt;
&lt;br /&gt;
4. We added calibration_review in deadline_right file (Modified file: app/models/deadline_right.rb)&lt;br /&gt;
 &lt;br /&gt;
5. We changed the function of finding next due date from find_by to where().order('due_at').first &lt;br /&gt;
 &lt;br /&gt;
6. We changed &amp;quot;app/controllers/student_review_controller.rb&amp;quot; file to exclude calibration reviews when counting the review number. We filtered the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture2.GIF]]&lt;br /&gt;
&lt;br /&gt;
7. We changed the view for student review list in &amp;quot;app/views/student_review/list.html.erb&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture1.GIF]]&lt;br /&gt;
&lt;br /&gt;
== Tests ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
* This feature test check for when Calibration for training? is selected, the value of assignment is calibrated is set to be true so the calibration tab will show up on the top of the page to fill in the due dates for the calibration period.&lt;br /&gt;
 &lt;br /&gt;
 context 'in assignments#edit page' do&lt;br /&gt;
    it 'has a checkbox with title \'Calibration for training?\' on \'General\' tab' do&lt;br /&gt;
      assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
      instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
      visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'General'&lt;br /&gt;
      expect(page).to have_field('Calibration for training?')&lt;br /&gt;
    end&lt;br /&gt;
    context 'when clicking \'Calibration for training?\' checkbox and clicking \'save\' button' do&lt;br /&gt;
      context '\'Calibration\' due date' do&lt;br /&gt;
        it 'works correctly' do&lt;br /&gt;
          assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
          instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
          visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
          click_link 'General'&lt;br /&gt;
          expect(page).to have_content('Calibration for training?')&lt;br /&gt;
          find(:css, &amp;quot;#assignment_is_calibrated_field&amp;quot;).set(true)&lt;br /&gt;
          click_button 'Save'&lt;br /&gt;
          expect(page).to have_link('Calibration')&lt;br /&gt;
          click_link 'Due dates'&lt;br /&gt;
          fill_in 'datetimepicker_calibration_review', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
          click_button 'submit_btn'&lt;br /&gt;
          calibration_type_id = DeadlineType.where(name: 'calibration_review')[0].id&lt;br /&gt;
          calibration_due_date = DueDate.find(12)&lt;br /&gt;
          expect(calibration_due_date).to have_attributes(&lt;br /&gt;
                                              deadline_type_id: calibration_type_id,&lt;br /&gt;
                                              type: 'AssignmentDueDate'&lt;br /&gt;
                                          )&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2.When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
* Since the test contained duplicate code, we load the code in load_work method and set the stage of the current assignment as &amp;quot;calibration&amp;quot; state so the review contains Calibration Review 1, 2, 3 and student can view their calibration result when clicking on View link.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in calibration stage' do&lt;br /&gt;
    context 'calibration feature' do&lt;br /&gt;
      it 'works correctly' do&lt;br /&gt;
        load_work(DateTime.now.in_time_zone + 10, DateTime.now.in_time_zone + 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                  DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                  DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50,  &amp;quot;calibration&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;View&amp;quot;)&lt;br /&gt;
        click_link &amp;quot;View&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* When the project is in review stage, the number of review allowance will not affect by the number of calibration review numbers, so we check the number of review allow is still the same after changing the stage to review stage and the page should contains Calibration Review 1 and Review 1.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in review stage' do&lt;br /&gt;
    it 'excludes calibration reviews from outstanding review restriction and total review restriction' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                   DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                   DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Number of reviews allowed: 3&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    it 'shows \'Review 1, 2, 3...\' and \'Calibration review 1, 2, 3...\' on student_review#list page' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review 1&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
* app/controllers/student_review_controller.rb&lt;br /&gt;
* app/models/deadline_right.rb&lt;br /&gt;
* app/models/due_date.rb&lt;br /&gt;
* app/views/assignments/edit/_due_dates.html.erb&lt;br /&gt;
* app/views/student_review/_responses.html.erb&lt;br /&gt;
* app/views/student_review/list.html.erb&lt;br /&gt;
* New created file: spec/features/calibration_spec.rb&lt;br /&gt;
* New created file: 20171206202730_add_calibration_review_to_deadline_types.rb&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114554</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114554"/>
		<updated>2017-12-06T20:59:22Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:case.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the first round submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the current stage is in calibration review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student submitted his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works when the current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. By following the process of TDD we can ensure to maintain the minimum amount of code while writing that specific function, and the developer can gain an overview of the function.&lt;br /&gt;
&lt;br /&gt;
== What did we implement ==&lt;br /&gt;
&lt;br /&gt;
1. We created a file &amp;quot;calibration_spec.rb&amp;quot; in &amp;quot;spec/ features&amp;quot; and write feature tests for the calibration function.&lt;br /&gt;
&lt;br /&gt;
2. We created a migration file &amp;quot;_add_new_deadline_type.rb&amp;quot; to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
3. We added a calibration due date in due date tab if it's a calibration assignment &lt;br /&gt;
&lt;br /&gt;
[[File:Capture1.GIF]]&lt;br /&gt;
&lt;br /&gt;
4. We added calibration_review in deadline_right file (Modified file: app/models/deadline_right.rb)&lt;br /&gt;
 &lt;br /&gt;
5. We changed the function of finding next due date from find_by to where().order('due_at').first &lt;br /&gt;
 &lt;br /&gt;
6. We changed &amp;quot;app/controllers/student_review_controller.rb&amp;quot; file to exclude calibration reviews when counting the review number. We filtered the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture2.GIF]]&lt;br /&gt;
&lt;br /&gt;
7. We changed the view for student review list in &amp;quot;app/views/student_review/list.html.erb&amp;quot; file.&lt;br /&gt;
&lt;br /&gt;
[[File:Capture1.GIF]]&lt;br /&gt;
&lt;br /&gt;
== Tests ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
* This feature test check for when Calibration for training? is selected, the value of assignment is calibrated is set to be true so the calibration tab will show up on the top of the page to fill in the due dates for the calibration period.&lt;br /&gt;
 &lt;br /&gt;
 context 'in assignments#edit page' do&lt;br /&gt;
    it 'has a checkbox with title \'Calibration for training?\' on \'General\' tab' do&lt;br /&gt;
      assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
      instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
      visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'General'&lt;br /&gt;
      expect(page).to have_field('Calibration for training?')&lt;br /&gt;
    end&lt;br /&gt;
    context 'when clicking \'Calibration for training?\' checkbox and clicking \'save\' button' do&lt;br /&gt;
      context '\'Calibration\' due date' do&lt;br /&gt;
        it 'works correctly' do&lt;br /&gt;
          assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
          instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
          visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
          click_link 'General'&lt;br /&gt;
          expect(page).to have_content('Calibration for training?')&lt;br /&gt;
          find(:css, &amp;quot;#assignment_is_calibrated_field&amp;quot;).set(true)&lt;br /&gt;
          click_button 'Save'&lt;br /&gt;
          expect(page).to have_link('Calibration')&lt;br /&gt;
          click_link 'Due dates'&lt;br /&gt;
          fill_in 'datetimepicker_calibration_review', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
          click_button 'submit_btn'&lt;br /&gt;
          calibration_type_id = DeadlineType.where(name: 'calibration_review')[0].id&lt;br /&gt;
          calibration_due_date = DueDate.find(12)&lt;br /&gt;
          expect(calibration_due_date).to have_attributes(&lt;br /&gt;
                                              deadline_type_id: calibration_type_id,&lt;br /&gt;
                                              type: 'AssignmentDueDate'&lt;br /&gt;
                                          )&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3.When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
* Since the test contained duplicate code, we load the code in load_work method and set the stage of the current assignment as &amp;quot;calibration&amp;quot; state so the review contains Calibration Review 1, 2, 3 and student can view their calibration result when clicking on View link.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in calibration stage' do&lt;br /&gt;
    context 'calibration feature' do&lt;br /&gt;
      it 'works correctly' do&lt;br /&gt;
        load_work(DateTime.now.in_time_zone + 10, DateTime.now.in_time_zone + 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                  DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                  DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50,  &amp;quot;calibration&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;View&amp;quot;)&lt;br /&gt;
        click_link &amp;quot;View&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* When the project is in review stage, the number of review allowance will not affect by the number of calibration review numbers, so we check the number of review allow is still the same after changing the stage to review stage and the page should contains Calibration Review 1 and Review 1.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in review stage' do&lt;br /&gt;
    it 'excludes calibration reviews from outstanding review restriction and total review restriction' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                   DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                   DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Number of reviews allowed: 3&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    it 'shows \'Review 1, 2, 3...\' and \'Calibration review 1, 2, 3...\' on student_review#list page' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review 1&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
== Files Modified ==&lt;br /&gt;
* app/controllers/student_review_controller.rb&lt;br /&gt;
* app/models/deadline_right.rb&lt;br /&gt;
* app/models/due_date.rb&lt;br /&gt;
* app/views/assignments/edit/_due_dates.html.erb&lt;br /&gt;
* app/views/student_review/_responses.html.erb&lt;br /&gt;
* app/views/student_review/list.html.erb&lt;br /&gt;
* New created file: spec/features/calibration_spec.rb&lt;br /&gt;
* New created file: 20171206202730_add_calibration_review_to_deadline_types.rb&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114552</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114552"/>
		<updated>2017-12-06T20:58:32Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:case.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the first round submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the current stage is in calibration review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student submitted his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works when the current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. By following the process of TDD we can ensure to maintain the minimum amount of code while writing that specific function, and the developer can gain an overview of the function.&lt;br /&gt;
&lt;br /&gt;
== What did we implement ==&lt;br /&gt;
&lt;br /&gt;
1. We created a file &amp;quot;calibration_spec.rb&amp;quot; in &amp;quot;spec/ features&amp;quot; and write feature tests for the calibration function.&lt;br /&gt;
&lt;br /&gt;
2. We created a migration file &amp;quot;_add_new_deadline_type.rb&amp;quot; to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
3. We added a calibration due date in due date tab if it's a calibration assignment &lt;br /&gt;
[[File:Capture1.GIF]]&lt;br /&gt;
&lt;br /&gt;
4. We added calibration_review in deadline_right file (Modified file: app/models/deadline_right.rb)&lt;br /&gt;
 &lt;br /&gt;
5. We changed the function of finding next due date from find_by to where().order('due_at').first &lt;br /&gt;
 &lt;br /&gt;
6. We changed &amp;quot;app/controllers/student_review_controller.rb&amp;quot; file to exclude calibration reviews when counting the review number. We filtered the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
[[File:Capture2.GIF]]&lt;br /&gt;
&lt;br /&gt;
7. We changed the view for student review list in &amp;quot;app/views/student_review/list.html.erb&amp;quot; file.&lt;br /&gt;
[[File:Capture1.GIF]]&lt;br /&gt;
&lt;br /&gt;
== Tests ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
* This feature test check for when Calibration for training? is selected, the value of assignment is calibrated is set to be true so the calibration tab will show up on the top of the page to fill in the due dates for the calibration period.&lt;br /&gt;
 &lt;br /&gt;
 context 'in assignments#edit page' do&lt;br /&gt;
    it 'has a checkbox with title \'Calibration for training?\' on \'General\' tab' do&lt;br /&gt;
      assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
      instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
      visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'General'&lt;br /&gt;
      expect(page).to have_field('Calibration for training?')&lt;br /&gt;
    end&lt;br /&gt;
    context 'when clicking \'Calibration for training?\' checkbox and clicking \'save\' button' do&lt;br /&gt;
      context '\'Calibration\' due date' do&lt;br /&gt;
        it 'works correctly' do&lt;br /&gt;
          assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
          instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
          visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
          click_link 'General'&lt;br /&gt;
          expect(page).to have_content('Calibration for training?')&lt;br /&gt;
          find(:css, &amp;quot;#assignment_is_calibrated_field&amp;quot;).set(true)&lt;br /&gt;
          click_button 'Save'&lt;br /&gt;
          expect(page).to have_link('Calibration')&lt;br /&gt;
          click_link 'Due dates'&lt;br /&gt;
          fill_in 'datetimepicker_calibration_review', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
          click_button 'submit_btn'&lt;br /&gt;
          calibration_type_id = DeadlineType.where(name: 'calibration_review')[0].id&lt;br /&gt;
          calibration_due_date = DueDate.find(12)&lt;br /&gt;
          expect(calibration_due_date).to have_attributes(&lt;br /&gt;
                                              deadline_type_id: calibration_type_id,&lt;br /&gt;
                                              type: 'AssignmentDueDate'&lt;br /&gt;
                                          )&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3.When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
* Since the test contained duplicate code, we load the code in load_work method and set the stage of the current assignment as &amp;quot;calibration&amp;quot; state so the review contains Calibration Review 1, 2, 3 and student can view their calibration result when clicking on View link.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in calibration stage' do&lt;br /&gt;
    context 'calibration feature' do&lt;br /&gt;
      it 'works correctly' do&lt;br /&gt;
        load_work(DateTime.now.in_time_zone + 10, DateTime.now.in_time_zone + 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                  DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                  DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50,  &amp;quot;calibration&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;View&amp;quot;)&lt;br /&gt;
        click_link &amp;quot;View&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* When the project is in review stage, the number of review allowance will not affect by the number of calibration review numbers, so we check the number of review allow is still the same after changing the stage to review stage and the page should contains Calibration Review 1 and Review 1.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in review stage' do&lt;br /&gt;
    it 'excludes calibration reviews from outstanding review restriction and total review restriction' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                   DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                   DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Number of reviews allowed: 3&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    it 'shows \'Review 1, 2, 3...\' and \'Calibration review 1, 2, 3...\' on student_review#list page' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review 1&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
8. Files modified&lt;br /&gt;
* app/controllers/student_review_controller.rb&lt;br /&gt;
* app/models/deadline_right.rb&lt;br /&gt;
* app/models/due_date.rb&lt;br /&gt;
* app/views/assignments/edit/_due_dates.html.erb&lt;br /&gt;
* app/views/student_review/_responses.html.erb&lt;br /&gt;
* app/views/student_review/list.html.erb&lt;br /&gt;
* New created file: spec/features/calibration_spec.rb&lt;br /&gt;
* New created file: 20171206202730_add_calibration_review_to_deadline_types.rb&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114543</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114543"/>
		<updated>2017-12-06T18:57:15Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:case.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the first round submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the current stage is in calibration review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student submitted his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works when the current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. By following the process of TDD we can ensure to maintain the minimum amount of code while writing that specific function, and the developer can gain an overview of the function.&lt;br /&gt;
&lt;br /&gt;
== What did we implement ==&lt;br /&gt;
&lt;br /&gt;
1. We created a file &amp;quot;calibration_spec.rb&amp;quot; in &amp;quot;spec/ features&amp;quot; and write feature tests for the calibration function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. We created a migration file &amp;quot;222222222222222_add_new_deadline_type.rb&amp;quot; to add a new record to deadline_types model&lt;br /&gt;
 &lt;br /&gt;
 class AddNewDeadlineType &amp;lt; ActiveRecord::Migration&lt;br /&gt;
   def self.up&lt;br /&gt;
     execute &amp;quot;INSERT INTO `deadline_types` VALUES (12,'calibration_review');&amp;quot;&lt;br /&gt;
   end&lt;br /&gt;
   def self.down&lt;br /&gt;
     execute &amp;quot;DELETE FROM `deadline_types` WHERE `name` = 'calibration_review';&amp;quot;&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
3. We added a calibration due date in due date tab if it's a calibration assignment (Modified file: app/views/assignments/edit/_due_dates.html.erb)&lt;br /&gt;
  &amp;lt;% if @assignment_form.assignment.is_calibrated %&amp;gt;&lt;br /&gt;
            addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty==nil ? false:@due_date_nameurl_notempty %&amp;gt;,'calibration', &lt;br /&gt;
                                                  0, &amp;lt;%= due_date(@assignment_form.assignment, 'calibration_review').to_json.html_safe %&amp;gt;);&lt;br /&gt;
  &amp;lt;%end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. We added calibration_review in deadline_right file (Modified file: app/models/deadline_right.rb)&lt;br /&gt;
  'calibration_review' =&amp;gt; {&lt;br /&gt;
         'submission_allowed' =&amp;gt; NO,&lt;br /&gt;
         'can_review' =&amp;gt; OK,&lt;br /&gt;
         'review_of_review_allowed' =&amp;gt; NO&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
5. We changed the function of finding next due date from find_by to where().order('due_at').first (Modified file: app/models/due_date.rb)&lt;br /&gt;
 next_due_date = AssignmentDueDate.where(['parent_id = ? &amp;amp;&amp;amp; due_at &amp;gt;= ?', assignment_id, Time.zone.now]).order('due_at').first&lt;br /&gt;
 &lt;br /&gt;
6. We changed &amp;quot;app/controllers/student_review_controller.rb&amp;quot; file to exclude calibration reviews when counting the review number. We filtered the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
    @regular_review_mappings = []&lt;br /&gt;
    @calibration_review_mappings = []&lt;br /&gt;
    @participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
    return unless current_user_id?(@participant.user_id)&lt;br /&gt;
    @assignment = @participant.assignment&lt;br /&gt;
    # Find the current phase that the assignment is in.&lt;br /&gt;
    @topic_id = SignedUpTeam.topic_id(@participant.parent_id, @participant.user_id)&lt;br /&gt;
    @review_phase = @assignment.get_current_stage(@topic_id)&lt;br /&gt;
    # ACS Removed the if condition(and corressponding else) which differentiate assignments as team and individual assignments&lt;br /&gt;
    # to treat all assignments as team assignments&lt;br /&gt;
    @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)    &lt;br /&gt;
    # if it is an calibrated assignment, change the response_map order in a certain way&lt;br /&gt;
    @review_mappings = @review_mappings.sort_by {|mapping| mapping.id % 5} if @assignment.is_calibrated == true&lt;br /&gt;
    @metareview_mappings = MetareviewResponseMap.where(reviewer_id: @participant.id)   &lt;br /&gt;
    # Calculate the number of reviews that the user has completed so far.&lt;br /&gt;
    @calibration_deadline = @assignment.due_dates.find_by_deadline_type_id(12)&lt;br /&gt;
    @num_reviews_total = @review_mappings.size   &lt;br /&gt;
    # Add the reviews which are requested and not began.&lt;br /&gt;
    @num_regular_reviews_completed = 0&lt;br /&gt;
    @num_calibration_reviews_completed = 0&lt;br /&gt;
    @num_regular_reviews_total = 0&lt;br /&gt;
    @num_calibration_reviews_total = 0&lt;br /&gt;
    assignment_submission_due_date = @assignment.due_dates.select {|due_date| due_date.deadline_type_id == 1}.first.due_at&lt;br /&gt;
    @review_mappings.each do |map|&lt;br /&gt;
      next if map.response.empty?&lt;br /&gt;
      if map.response.last.updated_at &amp;lt; assignment_submission_due_date&lt;br /&gt;
        @num_calibration_reviews_completed += 1 if map.response.last.is_submitted&lt;br /&gt;
      else&lt;br /&gt;
        # @regular_review_mappings.push(map)&lt;br /&gt;
        @num_regular_reviews_completed += 1 if map.response.last.is_submitted&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    @review_mappings.each do |map|&lt;br /&gt;
      if map.updated_at &amp;lt; assignment_submission_due_date&lt;br /&gt;
        @calibration_review_mappings.push(map)&lt;br /&gt;
        @num_calibration_reviews_total += 1&lt;br /&gt;
      else&lt;br /&gt;
        @regular_review_mappings.push(map)&lt;br /&gt;
        @num_regular_reviews_total += 1&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    @num_calibration_reviews_in_progress = @num_calibration_reviews_total - @num_calibration_reviews_completed&lt;br /&gt;
        @num_regular_reviews_in_progress = @num_regular_reviews_total - @num_regular_reviews_completed&lt;br /&gt;
    # Calculate the number of metareviews that the user has completed so far.&lt;br /&gt;
    @num_metareviews_total = @metareview_mappings.size&lt;br /&gt;
    @num_metareviews_completed = 0&lt;br /&gt;
    @metareview_mappings.each do |map|&lt;br /&gt;
        @num_metareviews_completed += 1 unless map.response.empty?&lt;br /&gt;
    end&lt;br /&gt;
    @num_metareviews_in_progress = @num_metareviews_total - @num_metareviews_completed&lt;br /&gt;
    @topic_id = SignedUpTeam.topic_id(@assignment.id, @participant.user_id)&lt;br /&gt;
&lt;br /&gt;
7. We changed the view for student review list in &amp;quot;app/views/student_review/list.html.erb&amp;quot; file.&lt;br /&gt;
 &lt;br /&gt;
If the current stage is &amp;quot;Calibration Review&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;% if check_reviewable_topics(@assignment) or @assignment.get_current_stage(@topic_id) == &amp;quot;Finished&amp;quot; %&amp;gt;&lt;br /&gt;
    &amp;lt;%= render :partial =&amp;gt; 'responses', :locals =&amp;gt; {:mappings =&amp;gt; @calibration_review_mappings, :title =&amp;gt; 'Calibration Review'} %&amp;gt;&lt;br /&gt;
    &amp;lt;% if @assignment.dynamic_reviewer_assignment? %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @num_calibration_reviews_in_progress &amp;gt;= Assignment.max_outstanding_reviews %&amp;gt;&lt;br /&gt;
            &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
            &amp;lt;span&amp;gt;Note: You can't have more than 2 calibration reviews. You must complete one of your calibration reviews before selecting another.&amp;lt;/span&amp;gt;&lt;br /&gt;
        &amp;lt;% elsif @assignment.num_reviews &amp;amp;&amp;amp; @assignment.num_reviews &amp;gt;= 0 &amp;amp;&amp;amp; @num_calibration_reviews_total &amp;gt; @assignment.num_reviews %&amp;gt;&lt;br /&gt;
            &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
            &amp;lt;span&amp;gt;Note: You can't do more than &amp;lt;%= @assignment.num_reviews %&amp;gt;&lt;br /&gt;
              reviews according to assignment policy.&amp;lt;/span&amp;gt;&lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
            &amp;lt;%= render :partial =&amp;gt; 'set_dynamic_review', :locals =&amp;gt; {:assignment =&amp;gt; @assignment, :participant =&amp;gt; @participant} %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
     &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;% else %&amp;gt;&lt;br /&gt;
      &amp;lt;em&amp;gt;Reviews cannot be performed at this time&amp;lt;/em&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the current stage is &amp;quot;Review&amp;quot;&lt;br /&gt;
 &amp;lt;% if @assignment.get_current_stage(@topic_id) == &amp;quot;review&amp;quot; %&amp;gt;&lt;br /&gt;
    &amp;lt;% if check_reviewable_topics(@assignment) or @assignment.get_current_stage(@topic_id) == &amp;quot;Finished&amp;quot; %&amp;gt;&lt;br /&gt;
        &amp;lt;%= render :partial =&amp;gt; 'responses', :locals =&amp;gt; {:mappings =&amp;gt; @regular_review_mappings, :title =&amp;gt; 'Review'} %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @assignment.dynamic_reviewer_assignment? %&amp;gt;&lt;br /&gt;
            &amp;lt;% if @num_reviews_in_progress &amp;gt;= Assignment.max_outstanding_reviews %&amp;gt;&lt;br /&gt;
                &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
                &amp;lt;span&amp;gt;Note: You can't have more than 2 outstanding reviews. You must complete one of your outstanding reviews before selecting another.&amp;lt;/span&amp;gt;&lt;br /&gt;
            &amp;lt;% elsif @assignment.num_reviews &amp;amp;&amp;amp; @assignment.num_reviews &amp;gt;= 0 &amp;amp;&amp;amp; @num_reviews_total &amp;gt; @assignment.num_reviews %&amp;gt;&lt;br /&gt;
                &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
                &amp;lt;span&amp;gt;Note: You can't do more than &amp;lt;%= @assignment.num_reviews %&amp;gt; reviews according to assignment policy.&amp;lt;/span&amp;gt;&lt;br /&gt;
            &amp;lt;% else %&amp;gt;&lt;br /&gt;
                &amp;lt;%= render :partial =&amp;gt; 'set_dynamic_review', :locals =&amp;gt; {:assignment =&amp;gt; @assignment, :participant =&amp;gt; @participant} %&amp;gt;&lt;br /&gt;
            &amp;lt;% end %&amp;gt;&lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
                &amp;lt;em&amp;gt;Reviews cannot be performed at this time&amp;lt;/em&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tests ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
* This feature test check for when Calibration for training? is selected, the value of assignment is calibrated is set to be true so the calibration tab will show up on the top of the page to fill in the due dates for the calibration period.&lt;br /&gt;
 &lt;br /&gt;
 context 'in assignments#edit page' do&lt;br /&gt;
    it 'has a checkbox with title \'Calibration for training?\' on \'General\' tab' do&lt;br /&gt;
      assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
      instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
      visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'General'&lt;br /&gt;
      expect(page).to have_field('Calibration for training?')&lt;br /&gt;
    end&lt;br /&gt;
    context 'when clicking \'Calibration for training?\' checkbox and clicking \'save\' button' do&lt;br /&gt;
      context '\'Calibration\' due date' do&lt;br /&gt;
        it 'works correctly' do&lt;br /&gt;
          assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
          instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
          visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
          click_link 'General'&lt;br /&gt;
          expect(page).to have_content('Calibration for training?')&lt;br /&gt;
          find(:css, &amp;quot;#assignment_is_calibrated_field&amp;quot;).set(true)&lt;br /&gt;
          click_button 'Save'&lt;br /&gt;
          expect(page).to have_link('Calibration')&lt;br /&gt;
          click_link 'Due dates'&lt;br /&gt;
          fill_in 'datetimepicker_calibration_review', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
          click_button 'submit_btn'&lt;br /&gt;
          calibration_type_id = DeadlineType.where(name: 'calibration_review')[0].id&lt;br /&gt;
          calibration_due_date = DueDate.find(12)&lt;br /&gt;
          expect(calibration_due_date).to have_attributes(&lt;br /&gt;
                                              deadline_type_id: calibration_type_id,&lt;br /&gt;
                                              type: 'AssignmentDueDate'&lt;br /&gt;
                                          )&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3.When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
* Since the test contained duplicate code, we load the code in load_work method and set the stage of the current assignment as &amp;quot;calibration&amp;quot; state so the review contains Calibration Review 1, 2, 3 and student can view their calibration result when clicking on View link.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in calibration stage' do&lt;br /&gt;
    context 'calibration feature' do&lt;br /&gt;
      it 'works correctly' do&lt;br /&gt;
        load_work(DateTime.now.in_time_zone + 10, DateTime.now.in_time_zone + 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                  DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                  DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50,  &amp;quot;calibration&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;View&amp;quot;)&lt;br /&gt;
        click_link &amp;quot;View&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* When the project is in review stage, the number of review allowance will not affect by the number of calibration review numbers, so we check the number of review allow is still the same after changing the stage to review stage and the page should contains Calibration Review 1 and Review 1.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in review stage' do&lt;br /&gt;
    it 'excludes calibration reviews from outstanding review restriction and total review restriction' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                   DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                   DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Number of reviews allowed: 3&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    it 'shows \'Review 1, 2, 3...\' and \'Calibration review 1, 2, 3...\' on student_review#list page' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review 1&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114542</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114542"/>
		<updated>2017-12-06T18:56:25Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* What did we implement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:case.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the first round submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the current stage is in calibration review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student submitted his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works when the current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. By following the process of TDD we can ensure to maintain the minimum amount of code while writing that specific function, and the developer can gain an overview of the function.&lt;br /&gt;
&lt;br /&gt;
== What did we implement ==&lt;br /&gt;
&lt;br /&gt;
1. We created a file &amp;quot;calibration_spec.rb&amp;quot; in &amp;quot;spec/ features&amp;quot; and write feature tests for the calibration function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. We created a migration file &amp;quot;222222222222222_add_new_deadline_type.rb&amp;quot; to add a new record to deadline_types model&lt;br /&gt;
 &lt;br /&gt;
 class AddNewDeadlineType &amp;lt; ActiveRecord::Migration&lt;br /&gt;
   def self.up&lt;br /&gt;
     execute &amp;quot;INSERT INTO `deadline_types` VALUES (12,'calibration_review');&amp;quot;&lt;br /&gt;
   end&lt;br /&gt;
   def self.down&lt;br /&gt;
     execute &amp;quot;DELETE FROM `deadline_types` WHERE `name` = 'calibration_review';&amp;quot;&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
3. We added a calibration due date in due date tab if it's a calibration assignment (Modified file: app/views/assignments/edit/_due_dates.html.erb)&lt;br /&gt;
  &amp;lt;% if @assignment_form.assignment.is_calibrated %&amp;gt;&lt;br /&gt;
            addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty==nil ? false:@due_date_nameurl_notempty %&amp;gt;,'calibration', &lt;br /&gt;
                                                  0, &amp;lt;%= due_date(@assignment_form.assignment, 'calibration_review').to_json.html_safe %&amp;gt;);&lt;br /&gt;
  &amp;lt;%end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. We added calibration_review in deadline_right file (Modified file: app/models/deadline_right.rb)&lt;br /&gt;
  'calibration_review' =&amp;gt; {&lt;br /&gt;
         'submission_allowed' =&amp;gt; NO,&lt;br /&gt;
         'can_review' =&amp;gt; OK,&lt;br /&gt;
         'review_of_review_allowed' =&amp;gt; NO&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
5. We changed the function of finding next due date from find_by to where().order('due_at').first (Modified file: app/models/due_date.rb)&lt;br /&gt;
 next_due_date = AssignmentDueDate.where(['parent_id = ? &amp;amp;&amp;amp; due_at &amp;gt;= ?', assignment_id, Time.zone.now]).order('due_at').first&lt;br /&gt;
 &lt;br /&gt;
6. We changed &amp;quot;app/controllers/student_review_controller.rb&amp;quot; file to exclude calibration reviews when counting the review number. We filtered the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
    @regular_review_mappings = []&lt;br /&gt;
    @calibration_review_mappings = []&lt;br /&gt;
    @participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
    return unless current_user_id?(@participant.user_id)&lt;br /&gt;
    @assignment = @participant.assignment&lt;br /&gt;
    # Find the current phase that the assignment is in.&lt;br /&gt;
    @topic_id = SignedUpTeam.topic_id(@participant.parent_id, @participant.user_id)&lt;br /&gt;
    @review_phase = @assignment.get_current_stage(@topic_id)&lt;br /&gt;
    # ACS Removed the if condition(and corressponding else) which differentiate assignments as team and individual assignments&lt;br /&gt;
    # to treat all assignments as team assignments&lt;br /&gt;
    @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)    &lt;br /&gt;
    # if it is an calibrated assignment, change the response_map order in a certain way&lt;br /&gt;
    @review_mappings = @review_mappings.sort_by {|mapping| mapping.id % 5} if @assignment.is_calibrated == true&lt;br /&gt;
    @metareview_mappings = MetareviewResponseMap.where(reviewer_id: @participant.id)   &lt;br /&gt;
    # Calculate the number of reviews that the user has completed so far.&lt;br /&gt;
    @calibration_deadline = @assignment.due_dates.find_by_deadline_type_id(12)&lt;br /&gt;
    @num_reviews_total = @review_mappings.size   &lt;br /&gt;
    # Add the reviews which are requested and not began.&lt;br /&gt;
    @num_regular_reviews_completed = 0&lt;br /&gt;
    @num_calibration_reviews_completed = 0&lt;br /&gt;
    @num_regular_reviews_total = 0&lt;br /&gt;
    @num_calibration_reviews_total = 0&lt;br /&gt;
    assignment_submission_due_date = @assignment.due_dates.select {|due_date| due_date.deadline_type_id == 1}.first.due_at&lt;br /&gt;
    @review_mappings.each do |map|&lt;br /&gt;
      next if map.response.empty?&lt;br /&gt;
      if map.response.last.updated_at &amp;lt; assignment_submission_due_date&lt;br /&gt;
        @num_calibration_reviews_completed += 1 if map.response.last.is_submitted&lt;br /&gt;
      else&lt;br /&gt;
        # @regular_review_mappings.push(map)&lt;br /&gt;
        @num_regular_reviews_completed += 1 if map.response.last.is_submitted&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    @review_mappings.each do |map|&lt;br /&gt;
      if map.updated_at &amp;lt; assignment_submission_due_date&lt;br /&gt;
        @calibration_review_mappings.push(map)&lt;br /&gt;
        @num_calibration_reviews_total += 1&lt;br /&gt;
      else&lt;br /&gt;
        @regular_review_mappings.push(map)&lt;br /&gt;
        @num_regular_reviews_total += 1&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    @num_calibration_reviews_in_progress = @num_calibration_reviews_total - @num_calibration_reviews_completed&lt;br /&gt;
        @num_regular_reviews_in_progress = @num_regular_reviews_total - @num_regular_reviews_completed&lt;br /&gt;
    # Calculate the number of metareviews that the user has completed so far.&lt;br /&gt;
    @num_metareviews_total = @metareview_mappings.size&lt;br /&gt;
    @num_metareviews_completed = 0&lt;br /&gt;
    @metareview_mappings.each do |map|&lt;br /&gt;
        @num_metareviews_completed += 1 unless map.response.empty?&lt;br /&gt;
    end&lt;br /&gt;
    @num_metareviews_in_progress = @num_metareviews_total - @num_metareviews_completed&lt;br /&gt;
    @topic_id = SignedUpTeam.topic_id(@assignment.id, @participant.user_id)&lt;br /&gt;
&lt;br /&gt;
7. We changed the view for student review list in &amp;quot;app/views/student_review/list.html.erb&amp;quot; file.&lt;br /&gt;
 &lt;br /&gt;
If the current stage is &amp;quot;Calibration Review&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;% if check_reviewable_topics(@assignment) or @assignment.get_current_stage(@topic_id) == &amp;quot;Finished&amp;quot; %&amp;gt;&lt;br /&gt;
    &amp;lt;%= render :partial =&amp;gt; 'responses', :locals =&amp;gt; {:mappings =&amp;gt; @calibration_review_mappings, :title =&amp;gt; 'Calibration Review'} %&amp;gt;&lt;br /&gt;
    &amp;lt;% if @assignment.dynamic_reviewer_assignment? %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @num_calibration_reviews_in_progress &amp;gt;= Assignment.max_outstanding_reviews %&amp;gt;&lt;br /&gt;
            &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
            &amp;lt;span&amp;gt;Note: You can't have more than 2 calibration reviews. You must complete one of your calibration reviews before selecting another.&amp;lt;/span&amp;gt;&lt;br /&gt;
        &amp;lt;% elsif @assignment.num_reviews &amp;amp;&amp;amp; @assignment.num_reviews &amp;gt;= 0 &amp;amp;&amp;amp; @num_calibration_reviews_total &amp;gt; @assignment.num_reviews %&amp;gt;&lt;br /&gt;
            &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
            &amp;lt;span&amp;gt;Note: You can't do more than &amp;lt;%= @assignment.num_reviews %&amp;gt;&lt;br /&gt;
              reviews according to assignment policy.&amp;lt;/span&amp;gt;&lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
            &amp;lt;%= render :partial =&amp;gt; 'set_dynamic_review', :locals =&amp;gt; {:assignment =&amp;gt; @assignment, :participant =&amp;gt; @participant} %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
     &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;% else %&amp;gt;&lt;br /&gt;
      &amp;lt;em&amp;gt;Reviews cannot be performed at this time&amp;lt;/em&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the current stage is &amp;quot;Review&amp;quot;&lt;br /&gt;
 &amp;lt;% if @assignment.get_current_stage(@topic_id) == &amp;quot;review&amp;quot; %&amp;gt;&lt;br /&gt;
    &amp;lt;% if check_reviewable_topics(@assignment) or @assignment.get_current_stage(@topic_id) == &amp;quot;Finished&amp;quot; %&amp;gt;&lt;br /&gt;
        &amp;lt;%= render :partial =&amp;gt; 'responses', :locals =&amp;gt; {:mappings =&amp;gt; @regular_review_mappings, :title =&amp;gt; 'Review'} %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @assignment.dynamic_reviewer_assignment? %&amp;gt;&lt;br /&gt;
            &amp;lt;% if @num_reviews_in_progress &amp;gt;= Assignment.max_outstanding_reviews %&amp;gt;&lt;br /&gt;
                &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
                &amp;lt;span&amp;gt;Note: You can't have more than 2 outstanding reviews. You must complete one of your outstanding reviews before selecting another.&amp;lt;/span&amp;gt;&lt;br /&gt;
            &amp;lt;% elsif @assignment.num_reviews &amp;amp;&amp;amp; @assignment.num_reviews &amp;gt;= 0 &amp;amp;&amp;amp; @num_reviews_total &amp;gt; @assignment.num_reviews %&amp;gt;&lt;br /&gt;
                &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
                &amp;lt;span&amp;gt;Note: You can't do more than &amp;lt;%= @assignment.num_reviews %&amp;gt; reviews according to assignment policy.&amp;lt;/span&amp;gt;&lt;br /&gt;
            &amp;lt;% else %&amp;gt;&lt;br /&gt;
                &amp;lt;%= render :partial =&amp;gt; 'set_dynamic_review', :locals =&amp;gt; {:assignment =&amp;gt; @assignment, :participant =&amp;gt; @participant} %&amp;gt;&lt;br /&gt;
            &amp;lt;% end %&amp;gt;&lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
                &amp;lt;em&amp;gt;Reviews cannot be performed at this time&amp;lt;/em&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
* This feature test check for when Calibration for training? is selected, the value of assignment is calibrated is set to be true so the calibration tab will show up on the top of the page to fill in the due dates for the calibration period.&lt;br /&gt;
 &lt;br /&gt;
 context 'in assignments#edit page' do&lt;br /&gt;
    it 'has a checkbox with title \'Calibration for training?\' on \'General\' tab' do&lt;br /&gt;
      assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
      instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
      visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'General'&lt;br /&gt;
      expect(page).to have_field('Calibration for training?')&lt;br /&gt;
    end&lt;br /&gt;
    context 'when clicking \'Calibration for training?\' checkbox and clicking \'save\' button' do&lt;br /&gt;
      context '\'Calibration\' due date' do&lt;br /&gt;
        it 'works correctly' do&lt;br /&gt;
          assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
          instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
          visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
          click_link 'General'&lt;br /&gt;
          expect(page).to have_content('Calibration for training?')&lt;br /&gt;
          find(:css, &amp;quot;#assignment_is_calibrated_field&amp;quot;).set(true)&lt;br /&gt;
          click_button 'Save'&lt;br /&gt;
          expect(page).to have_link('Calibration')&lt;br /&gt;
          click_link 'Due dates'&lt;br /&gt;
          fill_in 'datetimepicker_calibration_review', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
          click_button 'submit_btn'&lt;br /&gt;
          calibration_type_id = DeadlineType.where(name: 'calibration_review')[0].id&lt;br /&gt;
          calibration_due_date = DueDate.find(12)&lt;br /&gt;
          expect(calibration_due_date).to have_attributes(&lt;br /&gt;
                                              deadline_type_id: calibration_type_id,&lt;br /&gt;
                                              type: 'AssignmentDueDate'&lt;br /&gt;
                                          )&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3.When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
* Since the test contained duplicate code, we load the code in load_work method and set the stage of the current assignment as &amp;quot;calibration&amp;quot; state so the review contains Calibration Review 1, 2, 3 and student can view their calibration result when clicking on View link.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in calibration stage' do&lt;br /&gt;
    context 'calibration feature' do&lt;br /&gt;
      it 'works correctly' do&lt;br /&gt;
        load_work(DateTime.now.in_time_zone + 10, DateTime.now.in_time_zone + 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                  DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                  DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50,  &amp;quot;calibration&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;View&amp;quot;)&lt;br /&gt;
        click_link &amp;quot;View&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* When the project is in review stage, the number of review allowance will not affect by the number of calibration review numbers, so we check the number of review allow is still the same after changing the stage to review stage and the page should contains Calibration Review 1 and Review 1.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in review stage' do&lt;br /&gt;
    it 'excludes calibration reviews from outstanding review restriction and total review restriction' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                   DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                   DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Number of reviews allowed: 3&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    it 'shows \'Review 1, 2, 3...\' and \'Calibration review 1, 2, 3...\' on student_review#list page' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review 1&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114541</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114541"/>
		<updated>2017-12-06T18:55:59Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* What did we implement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:case.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the first round submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the current stage is in calibration review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student submitted his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works when the current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. By following the process of TDD we can ensure to maintain the minimum amount of code while writing that specific function, and the developer can gain an overview of the function.&lt;br /&gt;
&lt;br /&gt;
== What did we implement ==&lt;br /&gt;
&lt;br /&gt;
1. We created a file &amp;quot;calibration_spec.rb&amp;quot; in &amp;quot;spec/ features&amp;quot; and write feature tests for the calibration function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. We created a migration file &amp;quot;222222222222222_add_new_deadline_type.rb&amp;quot; to add a new record to deadline_types model&lt;br /&gt;
 &lt;br /&gt;
 class AddNewDeadlineType &amp;lt; ActiveRecord::Migration&lt;br /&gt;
   def self.up&lt;br /&gt;
     execute &amp;quot;INSERT INTO `deadline_types` VALUES (12,'calibration_review');&amp;quot;&lt;br /&gt;
   end&lt;br /&gt;
   def self.down&lt;br /&gt;
     execute &amp;quot;DELETE FROM `deadline_types` WHERE `name` = 'calibration_review';&amp;quot;&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
3. We added a calibration due date in due date tab if it's a calibration assignment (Modified file: app/views/assignments/edit/_due_dates.html.erb)&lt;br /&gt;
  &amp;lt;% if @assignment_form.assignment.is_calibrated %&amp;gt;&lt;br /&gt;
            addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty==nil ? false:@due_date_nameurl_notempty %&amp;gt;,'calibration', &lt;br /&gt;
                                                  0, &amp;lt;%= due_date(@assignment_form.assignment, 'calibration_review').to_json.html_safe %&amp;gt;);&lt;br /&gt;
  &amp;lt;%end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. We added calibration_review in deadline_right file (Modified file: app/models/deadline_right.rb)&lt;br /&gt;
  'calibration_review' =&amp;gt; {&lt;br /&gt;
         'submission_allowed' =&amp;gt; NO,&lt;br /&gt;
         'can_review' =&amp;gt; OK,&lt;br /&gt;
         'review_of_review_allowed' =&amp;gt; NO&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
5. We changed the function of finding next due date from find_by to where().order('due_at').first (Modified file: app/models/due_date.rb)&lt;br /&gt;
 next_due_date = AssignmentDueDate.where(['parent_id = ? &amp;amp;&amp;amp; due_at &amp;gt;= ?', assignment_id, Time.zone.now]).order('due_at').first&lt;br /&gt;
 &lt;br /&gt;
6. We changed &amp;quot;app/controllers/student_review_controller.rb&amp;quot; file to exclude calibration reviews when counting the review number. We filtered the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
    @regular_review_mappings = []&lt;br /&gt;
    @calibration_review_mappings = []&lt;br /&gt;
    @participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
    return unless current_user_id?(@participant.user_id)&lt;br /&gt;
    @assignment = @participant.assignment&lt;br /&gt;
    # Find the current phase that the assignment is in.&lt;br /&gt;
    @topic_id = SignedUpTeam.topic_id(@participant.parent_id, @participant.user_id)&lt;br /&gt;
    @review_phase = @assignment.get_current_stage(@topic_id)&lt;br /&gt;
    # ACS Removed the if condition(and corressponding else) which differentiate assignments as team and individual assignments&lt;br /&gt;
    # to treat all assignments as team assignments&lt;br /&gt;
    @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)    &lt;br /&gt;
    # if it is an calibrated assignment, change the response_map order in a certain way&lt;br /&gt;
    @review_mappings = @review_mappings.sort_by {|mapping| mapping.id % 5} if @assignment.is_calibrated == true&lt;br /&gt;
    @metareview_mappings = MetareviewResponseMap.where(reviewer_id: @participant.id)   &lt;br /&gt;
    # Calculate the number of reviews that the user has completed so far.&lt;br /&gt;
    @calibration_deadline = @assignment.due_dates.find_by_deadline_type_id(12)&lt;br /&gt;
    @num_reviews_total = @review_mappings.size   &lt;br /&gt;
    # Add the reviews which are requested and not began.&lt;br /&gt;
    @num_regular_reviews_completed = 0&lt;br /&gt;
    @num_calibration_reviews_completed = 0&lt;br /&gt;
    @num_regular_reviews_total = 0&lt;br /&gt;
    @num_calibration_reviews_total = 0&lt;br /&gt;
    assignment_submission_due_date = @assignment.due_dates.select {|due_date| due_date.deadline_type_id == 1}.first.due_at&lt;br /&gt;
    @review_mappings.each do |map|&lt;br /&gt;
      next if map.response.empty?&lt;br /&gt;
      if map.response.last.updated_at &amp;lt; assignment_submission_due_date&lt;br /&gt;
        @num_calibration_reviews_completed += 1 if map.response.last.is_submitted&lt;br /&gt;
      else&lt;br /&gt;
        # @regular_review_mappings.push(map)&lt;br /&gt;
        @num_regular_reviews_completed += 1 if map.response.last.is_submitted&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    @review_mappings.each do |map|&lt;br /&gt;
      if map.updated_at &amp;lt; assignment_submission_due_date&lt;br /&gt;
        @calibration_review_mappings.push(map)&lt;br /&gt;
        @num_calibration_reviews_total += 1&lt;br /&gt;
      else&lt;br /&gt;
        @regular_review_mappings.push(map)&lt;br /&gt;
        @num_regular_reviews_total += 1&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    @num_calibration_reviews_in_progress = @num_calibration_reviews_total - @num_calibration_reviews_completed&lt;br /&gt;
        @num_regular_reviews_in_progress = @num_regular_reviews_total - @num_regular_reviews_completed&lt;br /&gt;
    # Calculate the number of metareviews that the user has completed so far.&lt;br /&gt;
    @num_metareviews_total = @metareview_mappings.size&lt;br /&gt;
    @num_metareviews_completed = 0&lt;br /&gt;
    @metareview_mappings.each do |map|&lt;br /&gt;
        @num_metareviews_completed += 1 unless map.response.empty?&lt;br /&gt;
    end&lt;br /&gt;
    @num_metareviews_in_progress = @num_metareviews_total - @num_metareviews_completed&lt;br /&gt;
    @topic_id = SignedUpTeam.topic_id(@assignment.id, @participant.user_id)&lt;br /&gt;
&lt;br /&gt;
7. We changed the view for student review list in &amp;quot;app/views/student_review/list.html.erb&amp;quot; file.&lt;br /&gt;
 &lt;br /&gt;
If the current stage is &amp;quot;Calibration Review&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;% if check_reviewable_topics(@assignment) or @assignment.get_current_stage(@topic_id) == &amp;quot;Finished&amp;quot; %&amp;gt;&lt;br /&gt;
    &amp;lt;%= render :partial =&amp;gt; 'responses', :locals =&amp;gt; {:mappings =&amp;gt; @calibration_review_mappings, :title =&amp;gt; 'Calibration Review'} %&amp;gt;&lt;br /&gt;
    &amp;lt;% if @assignment.dynamic_reviewer_assignment? %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @num_calibration_reviews_in_progress &amp;gt;= Assignment.max_outstanding_reviews %&amp;gt;&lt;br /&gt;
            &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
            &amp;lt;span&amp;gt;Note: You can't have more than 2 calibration reviews. You must complete one of your calibration reviews before selecting another.&amp;lt;/span&amp;gt;&lt;br /&gt;
        &amp;lt;% elsif @assignment.num_reviews &amp;amp;&amp;amp; @assignment.num_reviews &amp;gt;= 0 &amp;amp;&amp;amp; @num_calibration_reviews_total &amp;gt; @assignment.num_reviews %&amp;gt;&lt;br /&gt;
            &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
            &amp;lt;span&amp;gt;Note: You can't do more than &amp;lt;%= @assignment.num_reviews %&amp;gt;&lt;br /&gt;
              reviews according to assignment policy.&amp;lt;/span&amp;gt;&lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
            &amp;lt;%= render :partial =&amp;gt; 'set_dynamic_review', :locals =&amp;gt; {:assignment =&amp;gt; @assignment, :participant =&amp;gt; @participant} %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
     &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;% else %&amp;gt;&lt;br /&gt;
      &amp;lt;p&amp;gt;&amp;lt;em&amp;gt;Reviews cannot be performed at this time&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the current stage is &amp;quot;Review&amp;quot;&lt;br /&gt;
 &amp;lt;% if @assignment.get_current_stage(@topic_id) == &amp;quot;review&amp;quot; %&amp;gt;&lt;br /&gt;
    &amp;lt;% if check_reviewable_topics(@assignment) or @assignment.get_current_stage(@topic_id) == &amp;quot;Finished&amp;quot; %&amp;gt;&lt;br /&gt;
        &amp;lt;%= render :partial =&amp;gt; 'responses', :locals =&amp;gt; {:mappings =&amp;gt; @regular_review_mappings, :title =&amp;gt; 'Review'} %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @assignment.dynamic_reviewer_assignment? %&amp;gt;&lt;br /&gt;
            &amp;lt;% if @num_reviews_in_progress &amp;gt;= Assignment.max_outstanding_reviews %&amp;gt;&lt;br /&gt;
                &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
                &amp;lt;span&amp;gt;Note: You can't have more than 2 outstanding reviews. You must complete one of your outstanding reviews before selecting another.&amp;lt;/span&amp;gt;&lt;br /&gt;
            &amp;lt;% elsif @assignment.num_reviews &amp;amp;&amp;amp; @assignment.num_reviews &amp;gt;= 0 &amp;amp;&amp;amp; @num_reviews_total &amp;gt; @assignment.num_reviews %&amp;gt;&lt;br /&gt;
                &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
                &amp;lt;span&amp;gt;Note: You can't do more than &amp;lt;%= @assignment.num_reviews %&amp;gt; reviews according to assignment policy.&amp;lt;/span&amp;gt;&lt;br /&gt;
            &amp;lt;% else %&amp;gt;&lt;br /&gt;
                &amp;lt;%= render :partial =&amp;gt; 'set_dynamic_review', :locals =&amp;gt; {:assignment =&amp;gt; @assignment, :participant =&amp;gt; @participant} %&amp;gt;&lt;br /&gt;
            &amp;lt;% end %&amp;gt;&lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
                &amp;lt;p&amp;gt;&amp;lt;em&amp;gt;Reviews cannot be performed at this time&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
* This feature test check for when Calibration for training? is selected, the value of assignment is calibrated is set to be true so the calibration tab will show up on the top of the page to fill in the due dates for the calibration period.&lt;br /&gt;
 &lt;br /&gt;
 context 'in assignments#edit page' do&lt;br /&gt;
    it 'has a checkbox with title \'Calibration for training?\' on \'General\' tab' do&lt;br /&gt;
      assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
      instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
      visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'General'&lt;br /&gt;
      expect(page).to have_field('Calibration for training?')&lt;br /&gt;
    end&lt;br /&gt;
    context 'when clicking \'Calibration for training?\' checkbox and clicking \'save\' button' do&lt;br /&gt;
      context '\'Calibration\' due date' do&lt;br /&gt;
        it 'works correctly' do&lt;br /&gt;
          assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
          instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
          visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
          click_link 'General'&lt;br /&gt;
          expect(page).to have_content('Calibration for training?')&lt;br /&gt;
          find(:css, &amp;quot;#assignment_is_calibrated_field&amp;quot;).set(true)&lt;br /&gt;
          click_button 'Save'&lt;br /&gt;
          expect(page).to have_link('Calibration')&lt;br /&gt;
          click_link 'Due dates'&lt;br /&gt;
          fill_in 'datetimepicker_calibration_review', with: (Time.now.in_time_zone + 10.days).strftime(&amp;quot;%Y/%m/%d %H:%M&amp;quot;)&lt;br /&gt;
          click_button 'submit_btn'&lt;br /&gt;
          calibration_type_id = DeadlineType.where(name: 'calibration_review')[0].id&lt;br /&gt;
          calibration_due_date = DueDate.find(12)&lt;br /&gt;
          expect(calibration_due_date).to have_attributes(&lt;br /&gt;
                                              deadline_type_id: calibration_type_id,&lt;br /&gt;
                                              type: 'AssignmentDueDate'&lt;br /&gt;
                                          )&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
3.When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
* Since the test contained duplicate code, we load the code in load_work method and set the stage of the current assignment as &amp;quot;calibration&amp;quot; state so the review contains Calibration Review 1, 2, 3 and student can view their calibration result when clicking on View link.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in calibration stage' do&lt;br /&gt;
    context 'calibration feature' do&lt;br /&gt;
      it 'works correctly' do&lt;br /&gt;
        load_work(DateTime.now.in_time_zone + 10, DateTime.now.in_time_zone + 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                  DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                  DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50,  &amp;quot;calibration&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
        expect(page).to have_content(&amp;quot;View&amp;quot;)&lt;br /&gt;
        click_link &amp;quot;View&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* When the project is in review stage, the number of review allowance will not affect by the number of calibration review numbers, so we check the number of review allow is still the same after changing the stage to review stage and the page should contains Calibration Review 1 and Review 1.&lt;br /&gt;
&lt;br /&gt;
  context 'when current assignment is in review stage' do&lt;br /&gt;
    it 'excludes calibration reviews from outstanding review restriction and total review restriction' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                   DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                   DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Number of reviews allowed: 3&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
    it 'shows \'Review 1, 2, 3...\' and \'Calibration review 1, 2, 3...\' on student_review#list page' do&lt;br /&gt;
      load_work(DateTime.now.in_time_zone - 10, DateTime.now.in_time_zone - 20, DateTime.now.in_time_zone + 30,&lt;br /&gt;
                DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, DateTime.now.in_time_zone + 20,&lt;br /&gt;
                DateTime.now.in_time_zone + 30, DateTime.now.in_time_zone + 40, DateTime.now.in_time_zone + 50, &amp;quot;review&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Calibration Review 1&amp;quot;)&lt;br /&gt;
      expect(page).to have_content(&amp;quot;Review 1&amp;quot;)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
end&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114538</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114538"/>
		<updated>2017-12-06T18:46:59Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* What did we implement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:case.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the first round submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the current stage is in calibration review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student submitted his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works when the current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. By following the process of TDD we can ensure to maintain the minimum amount of code while writing that specific function, and the developer can gain an overview of the function.&lt;br /&gt;
&lt;br /&gt;
== What did we implement ==&lt;br /&gt;
&lt;br /&gt;
1. We created a file &amp;quot;calibration_spec.rb&amp;quot; in &amp;quot;spec/ features&amp;quot; and write feature tests for the calibration function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. We created a migration file &amp;quot;222222222222222_add_new_deadline_type.rb&amp;quot; to add a new record to deadline_types model&lt;br /&gt;
 &lt;br /&gt;
 class AddNewDeadlineType &amp;lt; ActiveRecord::Migration&lt;br /&gt;
   def self.up&lt;br /&gt;
     execute &amp;quot;INSERT INTO `deadline_types` VALUES (12,'calibration_review');&amp;quot;&lt;br /&gt;
   end&lt;br /&gt;
   def self.down&lt;br /&gt;
     execute &amp;quot;DELETE FROM `deadline_types` WHERE `name` = 'calibration_review';&amp;quot;&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
3. We added a calibration due date in due date tab if it's a calibration assignment (Modified file: app/views/assignments/edit/_due_dates.html.erb)&lt;br /&gt;
  &amp;lt;% if @assignment_form.assignment.is_calibrated %&amp;gt;&lt;br /&gt;
            addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty==nil ? false:@due_date_nameurl_notempty %&amp;gt;,'calibration', &lt;br /&gt;
                                                  0, &amp;lt;%= due_date(@assignment_form.assignment, 'calibration_review').to_json.html_safe %&amp;gt;);&lt;br /&gt;
  &amp;lt;%end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. We added calibration_review in deadline_right file (Modified file: app/models/deadline_right.rb)&lt;br /&gt;
  'calibration_review' =&amp;gt; {&lt;br /&gt;
         'submission_allowed' =&amp;gt; NO,&lt;br /&gt;
         'can_review' =&amp;gt; OK,&lt;br /&gt;
         'review_of_review_allowed' =&amp;gt; NO&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
5. We changed the function of finding next due date from find_by to where().order('due_at').first (Modified file: app/models/due_date.rb)&lt;br /&gt;
 next_due_date = AssignmentDueDate.where(['parent_id = ? &amp;amp;&amp;amp; due_at &amp;gt;= ?', assignment_id, Time.zone.now]).order('due_at').first&lt;br /&gt;
 &lt;br /&gt;
6. We changed &amp;quot;app/controllers/student_review_controller.rb&amp;quot; file to exclude calibration reviews when counting the review number. We filtered the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
    @regular_review_mappings = []&lt;br /&gt;
    @calibration_review_mappings = []&lt;br /&gt;
    @participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
    return unless current_user_id?(@participant.user_id)&lt;br /&gt;
    @assignment = @participant.assignment&lt;br /&gt;
    # Find the current phase that the assignment is in.&lt;br /&gt;
    @topic_id = SignedUpTeam.topic_id(@participant.parent_id, @participant.user_id)&lt;br /&gt;
    @review_phase = @assignment.get_current_stage(@topic_id)&lt;br /&gt;
    # ACS Removed the if condition(and corressponding else) which differentiate assignments as team and individual assignments&lt;br /&gt;
    # to treat all assignments as team assignments&lt;br /&gt;
    @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    &lt;br /&gt;
    # if it is an calibrated assignment, change the response_map order in a certain way&lt;br /&gt;
    @review_mappings = @review_mappings.sort_by {|mapping| mapping.id % 5} if @assignment.is_calibrated == true&lt;br /&gt;
    @metareview_mappings = MetareviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    &lt;br /&gt;
    # Calculate the number of reviews that the user has completed so far.&lt;br /&gt;
    @calibration_deadline = @assignment.due_dates.find_by_deadline_type_id(12)&lt;br /&gt;
    @num_reviews_total = @review_mappings.size&lt;br /&gt;
    &lt;br /&gt;
    # Add the reviews which are requested and not began.&lt;br /&gt;
    @num_regular_reviews_completed = 0&lt;br /&gt;
    @num_calibration_reviews_completed = 0&lt;br /&gt;
    @num_regular_reviews_total = 0&lt;br /&gt;
    @num_calibration_reviews_total = 0&lt;br /&gt;
    assignment_submission_due_date = @assignment.due_dates.select {|due_date| due_date.deadline_type_id == 1}.first.due_at&lt;br /&gt;
    @review_mappings.each do |map|&lt;br /&gt;
&lt;br /&gt;
      next if map.response.empty?&lt;br /&gt;
      if map.response.last.updated_at &amp;lt; assignment_submission_due_date&lt;br /&gt;
        @num_calibration_reviews_completed += 1 if map.response.last.is_submitted&lt;br /&gt;
      else&lt;br /&gt;
        # @regular_review_mappings.push(map)&lt;br /&gt;
        @num_regular_reviews_completed += 1 if map.response.last.is_submitted&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    @review_mappings.each do |map|&lt;br /&gt;
      if map.updated_at &amp;lt; assignment_submission_due_date&lt;br /&gt;
        @calibration_review_mappings.push(map)&lt;br /&gt;
        @num_calibration_reviews_total += 1&lt;br /&gt;
      else&lt;br /&gt;
        @regular_review_mappings.push(map)&lt;br /&gt;
        @num_regular_reviews_total += 1&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    @num_calibration_reviews_in_progress = @num_calibration_reviews_total - @num_calibration_reviews_completed&lt;br /&gt;
        @num_regular_reviews_in_progress = @num_regular_reviews_total - @num_regular_reviews_completed&lt;br /&gt;
&lt;br /&gt;
    # Calculate the number of metareviews that the user has completed so far.&lt;br /&gt;
    @num_metareviews_total = @metareview_mappings.size&lt;br /&gt;
    @num_metareviews_completed = 0&lt;br /&gt;
    @metareview_mappings.each do |map|&lt;br /&gt;
        @num_metareviews_completed += 1 unless map.response.empty?&lt;br /&gt;
    end&lt;br /&gt;
    @num_metareviews_in_progress = @num_metareviews_total - @num_metareviews_completed&lt;br /&gt;
    @topic_id = SignedUpTeam.topic_id(@assignment.id, @participant.user_id)&lt;br /&gt;
&lt;br /&gt;
7. We changed the view for student review list in &amp;quot;app/views/student_review/list.html.erb&amp;quot; file.&lt;br /&gt;
 &lt;br /&gt;
If the current stage is &amp;quot;Calibration Review&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;% if check_reviewable_topics(@assignment) or @assignment.get_current_stage(@topic_id) == &amp;quot;Finished&amp;quot; %&amp;gt;&lt;br /&gt;
    &amp;lt;%= render :partial =&amp;gt; 'responses', :locals =&amp;gt; {:mappings =&amp;gt; @calibration_review_mappings, :title =&amp;gt; 'Calibration Review'} %&amp;gt;&lt;br /&gt;
    &amp;lt;% if @assignment.dynamic_reviewer_assignment? %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @num_calibration_reviews_in_progress &amp;gt;= Assignment.max_outstanding_reviews %&amp;gt;&lt;br /&gt;
            &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
            &amp;lt;span&amp;gt;Note: You can't have more than 2 calibration reviews. You must complete one of your calibration reviews before selecting another.&amp;lt;/span&amp;gt;&lt;br /&gt;
        &amp;lt;% elsif @assignment.num_reviews &amp;amp;&amp;amp; @assignment.num_reviews &amp;gt;= 0 &amp;amp;&amp;amp; @num_calibration_reviews_total &amp;gt; @assignment.num_reviews %&amp;gt;&lt;br /&gt;
            &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
            &amp;lt;span&amp;gt;Note: You can't do more than &amp;lt;%= @assignment.num_reviews %&amp;gt;&lt;br /&gt;
              reviews according to assignment policy.&amp;lt;/span&amp;gt;&lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
            &amp;lt;%= render :partial =&amp;gt; 'set_dynamic_review', :locals =&amp;gt; {:assignment =&amp;gt; @assignment, :participant =&amp;gt; @participant} %&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
     &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;% else %&amp;gt;&lt;br /&gt;
      &amp;lt;p&amp;gt;&amp;lt;em&amp;gt;Reviews cannot be performed at this time&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the current stage is &amp;quot;Review&amp;quot;&lt;br /&gt;
 &amp;lt;% if @assignment.get_current_stage(@topic_id) == &amp;quot;review&amp;quot; %&amp;gt;&lt;br /&gt;
    &amp;lt;% if check_reviewable_topics(@assignment) or @assignment.get_current_stage(@topic_id) == &amp;quot;Finished&amp;quot; %&amp;gt;&lt;br /&gt;
        &amp;lt;%= render :partial =&amp;gt; 'responses', :locals =&amp;gt; {:mappings =&amp;gt; @regular_review_mappings, :title =&amp;gt; 'Review'} %&amp;gt;&lt;br /&gt;
        &amp;lt;% if @assignment.dynamic_reviewer_assignment? %&amp;gt;&lt;br /&gt;
            &amp;lt;% if @num_reviews_in_progress &amp;gt;= Assignment.max_outstanding_reviews %&amp;gt;&lt;br /&gt;
                &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
                &amp;lt;span&amp;gt;Note: You can't have more than 2 outstanding reviews. You must complete one of your outstanding reviews before selecting another.&amp;lt;/span&amp;gt;&lt;br /&gt;
            &amp;lt;% elsif @assignment.num_reviews &amp;amp;&amp;amp; @assignment.num_reviews &amp;gt;= 0 &amp;amp;&amp;amp; @num_reviews_total &amp;gt; @assignment.num_reviews %&amp;gt;&lt;br /&gt;
                &amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
                &amp;lt;span&amp;gt;Note: You can't do more than &amp;lt;%= @assignment.num_reviews %&amp;gt; reviews according to assignment policy.&amp;lt;/span&amp;gt;&lt;br /&gt;
            &amp;lt;% else %&amp;gt;&lt;br /&gt;
                &amp;lt;%= render :partial =&amp;gt; 'set_dynamic_review', :locals =&amp;gt; {:assignment =&amp;gt; @assignment, :participant =&amp;gt; @participant} %&amp;gt;&lt;br /&gt;
            &amp;lt;% end %&amp;gt;&lt;br /&gt;
        &amp;lt;% else %&amp;gt;&lt;br /&gt;
                &amp;lt;p&amp;gt;&amp;lt;em&amp;gt;Reviews cannot be performed at this time&amp;lt;/em&amp;gt;&amp;lt;/p&amp;gt;&lt;br /&gt;
        &amp;lt;% end %&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
 &amp;lt;% end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
* This feature test check for when Calibration for training? is selected, the value of assignment is calibrated is set to be true so the calibration tab will show up on the top of the page to fill in the due dates for the calibration period.&lt;br /&gt;
 context 'in assignments#edit page' do&lt;br /&gt;
    it 'has a checkbox with title \'Calibration for training?\' on \'General\' tab' do&lt;br /&gt;
      assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
      instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
      stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
      visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
      click_link 'General'&lt;br /&gt;
      expect(page).to have_field('Calibration for training?')&lt;br /&gt;
    end&lt;br /&gt;
    context 'when clicking \'Calibration for training?\' checkbox and clicking \'save\' button' do&lt;br /&gt;
      context '\'Calibration\' due date' do&lt;br /&gt;
        it 'works correctly' do&lt;br /&gt;
          assignment = Assignment.where(name: &amp;quot;Assignment1665&amp;quot;).first&lt;br /&gt;
          instructor = User.find_by(name: &amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          login_as(&amp;quot;instructor6&amp;quot;)&lt;br /&gt;
          stub_current_user(instructor, instructor.role.name, instructor.role)&lt;br /&gt;
          visit &amp;quot;/assignments/#{assignment.id}/edit&amp;quot;&lt;br /&gt;
          click_link 'General'&lt;br /&gt;
          expect(page).to have_content('Calibration for training?')&lt;br /&gt;
          find(:css, &amp;quot;#assignment_is_calibrated_field&amp;quot;).set(true)&lt;br /&gt;
          click_button 'Save'&lt;br /&gt;
          expect(page).to have_link('Calibration')&lt;br /&gt;
          click_link 'Due dates'&lt;br /&gt;
          fill_in 'calibration', with: 'Date'&lt;br /&gt;
          click_button 'Save'&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
2. When it is in assignments#edit page and clicking &amp;quot;Calibration for training?&amp;quot; checkbox and clicking &amp;quot;save&amp;quot; button:&lt;br /&gt;
* To check it displays a new tab named &amp;quot;Calibration&amp;quot; and adds a calibration due date in &amp;quot;Due dates&amp;quot; tab&lt;br /&gt;
* To check  it allows instructors to change and save date &amp;amp; time and permissions of calibration due date&lt;br /&gt;
3.When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
4. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Hmtl_for_calibration_review_list.png&amp;diff=114534</id>
		<title>File:Hmtl for calibration review list.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Hmtl_for_calibration_review_list.png&amp;diff=114534"/>
		<updated>2017-12-06T18:44:41Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114526</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=114526"/>
		<updated>2017-12-06T18:33:04Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* Design Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:case.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the first round submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the current stage is in calibration review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student submitted his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works when the current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Current stage is &amp;quot;submit&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. By following the process of TDD we can ensure to maintain the minimum amount of code while writing that specific function, and the developer can gain an overview of the function.&lt;br /&gt;
&lt;br /&gt;
== What did we implement ==&lt;br /&gt;
&lt;br /&gt;
1. We created a file &amp;quot;calibration_spec.rb&amp;quot; in &amp;quot;spec/ features&amp;quot; and write feature tests for the calibration function.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. We created a migration file &amp;quot;222222222222222_add_new_deadline_type.rb&amp;quot; to add a new record to deadline_types model&lt;br /&gt;
 &lt;br /&gt;
 class AddNewDeadlineType &amp;lt; ActiveRecord::Migration&lt;br /&gt;
   def self.up&lt;br /&gt;
     execute &amp;quot;INSERT INTO `deadline_types` VALUES (12,'calibration_review');&amp;quot;&lt;br /&gt;
   end&lt;br /&gt;
   def self.down&lt;br /&gt;
     execute &amp;quot;DELETE FROM `deadline_types` WHERE `name` = 'calibration_review';&amp;quot;&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
&lt;br /&gt;
3. We added a calibration due date in due date tab if it's a calibration assignment (Modified file: app/views/assignments/edit/_due_dates.html.erb)&lt;br /&gt;
  &amp;lt;% if @assignment_form.assignment.is_calibrated %&amp;gt;&lt;br /&gt;
            addDueDateTableElement(&amp;lt;%= @due_date_nameurl_notempty==nil ? false:@due_date_nameurl_notempty %&amp;gt;,'calibration', &lt;br /&gt;
                                                  0, &amp;lt;%= due_date(@assignment_form.assignment, 'calibration_review').to_json.html_safe %&amp;gt;);&lt;br /&gt;
  &amp;lt;%end %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
4. We added calibration_review in deadline_right file (Modified file: app/models/deadline_right.rb)&lt;br /&gt;
  'calibration_review' =&amp;gt; {&lt;br /&gt;
         'submission_allowed' =&amp;gt; NO,&lt;br /&gt;
         'can_review' =&amp;gt; OK,&lt;br /&gt;
         'review_of_review_allowed' =&amp;gt; NO&lt;br /&gt;
   }&lt;br /&gt;
&lt;br /&gt;
5. We changed the function of finding next due date from find_by to where().order('due_at').first (Modified file: app/models/due_date.rb)&lt;br /&gt;
 next_due_date = AssignmentDueDate.where(['parent_id = ? &amp;amp;&amp;amp; due_at &amp;gt;= ?', assignment_id, Time.zone.now]).order('due_at').first&lt;br /&gt;
 &lt;br /&gt;
6. We changed &amp;quot;app/controllers/student_review_controller.rb&amp;quot; file to exclude calibration reviews when counting the review number. We filtered the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
    @regular_review_mappings = []&lt;br /&gt;
    @calibration_review_mappings = []&lt;br /&gt;
    @participant = AssignmentParticipant.find(params[:id])&lt;br /&gt;
    return unless current_user_id?(@participant.user_id)&lt;br /&gt;
    @assignment = @participant.assignment&lt;br /&gt;
    # Find the current phase that the assignment is in.&lt;br /&gt;
    @topic_id = SignedUpTeam.topic_id(@participant.parent_id, @participant.user_id)&lt;br /&gt;
    @review_phase = @assignment.get_current_stage(@topic_id)&lt;br /&gt;
    # ACS Removed the if condition(and corressponding else) which differentiate assignments as team and individual assignments&lt;br /&gt;
    # to treat all assignments as team assignments&lt;br /&gt;
    @review_mappings = ReviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    &lt;br /&gt;
    # if it is an calibrated assignment, change the response_map order in a certain way&lt;br /&gt;
    @review_mappings = @review_mappings.sort_by {|mapping| mapping.id % 5} if @assignment.is_calibrated == true&lt;br /&gt;
    @metareview_mappings = MetareviewResponseMap.where(reviewer_id: @participant.id)&lt;br /&gt;
    &lt;br /&gt;
    # Calculate the number of reviews that the user has completed so far.&lt;br /&gt;
    @calibration_deadline = @assignment.due_dates.find_by_deadline_type_id(12)&lt;br /&gt;
    @num_reviews_total = @review_mappings.size&lt;br /&gt;
    &lt;br /&gt;
    # Add the reviews which are requested and not began.&lt;br /&gt;
    @num_regular_reviews_completed = 0&lt;br /&gt;
    @num_calibration_reviews_completed = 0&lt;br /&gt;
    @num_regular_reviews_total = 0&lt;br /&gt;
    @num_calibration_reviews_total = 0&lt;br /&gt;
    assignment_submission_due_date = @assignment.due_dates.select {|due_date| due_date.deadline_type_id == 1}.first.due_at&lt;br /&gt;
    @review_mappings.each do |map|&lt;br /&gt;
&lt;br /&gt;
      next if map.response.empty?&lt;br /&gt;
      if map.response.last.updated_at &amp;lt; assignment_submission_due_date&lt;br /&gt;
        @num_calibration_reviews_completed += 1 if map.response.last.is_submitted&lt;br /&gt;
      else&lt;br /&gt;
        # @regular_review_mappings.push(map)&lt;br /&gt;
        @num_regular_reviews_completed += 1 if map.response.last.is_submitted&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
    @review_mappings.each do |map|&lt;br /&gt;
      if map.updated_at &amp;lt; assignment_submission_due_date&lt;br /&gt;
        @calibration_review_mappings.push(map)&lt;br /&gt;
        @num_calibration_reviews_total += 1&lt;br /&gt;
      else&lt;br /&gt;
        @regular_review_mappings.push(map)&lt;br /&gt;
        @num_regular_reviews_total += 1&lt;br /&gt;
      end&lt;br /&gt;
    end&lt;br /&gt;
&lt;br /&gt;
    @num_calibration_reviews_in_progress = @num_calibration_reviews_total - @num_calibration_reviews_completed&lt;br /&gt;
        @num_regular_reviews_in_progress = @num_regular_reviews_total - @num_regular_reviews_completed&lt;br /&gt;
&lt;br /&gt;
    # Calculate the number of metareviews that the user has completed so far.&lt;br /&gt;
    @num_metareviews_total = @metareview_mappings.size&lt;br /&gt;
    @num_metareviews_completed = 0&lt;br /&gt;
    @metareview_mappings.each do |map|&lt;br /&gt;
        @num_metareviews_completed += 1 unless map.response.empty?&lt;br /&gt;
    end&lt;br /&gt;
    @num_metareviews_in_progress = @num_metareviews_total - @num_metareviews_completed&lt;br /&gt;
    @topic_id = SignedUpTeam.topic_id(@assignment.id, @participant.user_id)&lt;br /&gt;
&lt;br /&gt;
7.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
2. When it is in assignments#edit page and clicking &amp;quot;Calibration for training?&amp;quot; checkbox and clicking &amp;quot;save&amp;quot; button:&lt;br /&gt;
* To check it displays a new tab named &amp;quot;Calibration&amp;quot; and adds a calibration due date in &amp;quot;Due dates&amp;quot; tab&lt;br /&gt;
* To check  it allows instructors to change and save date &amp;amp; time and permissions of calibration due date&lt;br /&gt;
3.When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
4. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113304</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113304"/>
		<updated>2017-11-14T21:48:48Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* Design Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:Usecase.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works before the calibration due date.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The calibration due date has been added.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work has the expert review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student finished his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. Also the refactoring process is safe since it happens after the test is written. Tests can also serve as a documentation to a developer.&lt;br /&gt;
&lt;br /&gt;
== Design Plan ==&lt;br /&gt;
&lt;br /&gt;
Due to the fact that the calibration feature is currently working, our approach for this project would be editing existing files or linked files between different places. Therefore, design patterns will not be required to implement. &lt;br /&gt;
&lt;br /&gt;
Below are the specifications and our plans to achieve them in our project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Specification: We need to add a new kind of due date, that is calibration due date, if we want to integration calibration feature into normal assignment.&lt;br /&gt;
&lt;br /&gt;
Our plan : Create a migration to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Specification: After calibration is enabled, a row should appear to deal with calibration due date in &amp;quot;Due Dates tab&amp;quot;. The other content of this row is just the same as other due dates.&lt;br /&gt;
&lt;br /&gt;
Our plan :  Add a row in due dates tab with the name &amp;quot;Calibration&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Picture for 1&amp;amp;2'''&lt;br /&gt;
&lt;br /&gt;
[[File:DueDate.GIF]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3.Specification:  In student_task/list page, current stage column should display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Change the current stage column to &amp;quot;Calibration&amp;quot; if the assignment is now in calibration period&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Picture for 3'''&lt;br /&gt;
&lt;br /&gt;
[[File:Student view.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Specification: In student_review/list page, change the logic in this view and exclude calibration reviews when counting the review number. &lt;br /&gt;
&lt;br /&gt;
Our plan: Filter the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Specification: In student_review/list page, change the wording and numbering on this view. Calibrated review 1,2,3 to represent reviews done in calibration period; Review 1, 2, 3 to represent reviews done in normal review period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Check the review type and change the name to &amp;quot;Calibrated review&amp;quot; if it is a calibrated review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Picture for 4&amp;amp;5'''&lt;br /&gt;
&lt;br /&gt;
[[File:Review list.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
2. When it is in assignments#edit page and clicking &amp;quot;Calibration for training?&amp;quot; checkbox and clicking &amp;quot;save&amp;quot; button:&lt;br /&gt;
* To check it displays a new tab named &amp;quot;Calibration&amp;quot; and adds a calibration due date in &amp;quot;Due dates&amp;quot; tab&lt;br /&gt;
* To check  it allows instructors to change and save date &amp;amp; time and permissions of calibration due date&lt;br /&gt;
3.When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
4. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Review_list.png&amp;diff=113303</id>
		<title>File:Review list.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Review_list.png&amp;diff=113303"/>
		<updated>2017-11-14T21:48:23Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113300</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113300"/>
		<updated>2017-11-14T21:47:18Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* Design Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:Usecase.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works before the calibration due date.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The calibration due date has been added.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work has the expert review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student finished his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. Also the refactoring process is safe since it happens after the test is written. Tests can also serve as a documentation to a developer.&lt;br /&gt;
&lt;br /&gt;
== Design Plan ==&lt;br /&gt;
&lt;br /&gt;
Due to the fact that the calibration feature is currently working, our approach for this project would be editing existing files or linked files between different places. Therefore, design patterns will not be required to implement. &lt;br /&gt;
&lt;br /&gt;
Below are the specifications and our plans to achieve them in our project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Specification: We need to add a new kind of due date, that is calibration due date, if we want to integration calibration feature into normal assignment.&lt;br /&gt;
&lt;br /&gt;
Our plan : Create a migration to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Specification: After calibration is enabled, a row should appear to deal with calibration due date in &amp;quot;Due Dates tab&amp;quot;. The other content of this row is just the same as other due dates.&lt;br /&gt;
&lt;br /&gt;
Our plan :  Add a row in due dates tab with the name &amp;quot;Calibration&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Picture for 1&amp;amp;2'''&lt;br /&gt;
&lt;br /&gt;
[[File:DueDate.GIF]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3.Specification:  In student_task/list page, current stage column should display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Change the current stage column to &amp;quot;Calibration&amp;quot; if the assignment is now in calibration period&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Picture for 3'''&lt;br /&gt;
&lt;br /&gt;
[[File:Student view.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Specification: In student_review/list page, change the logic in this view and exclude calibration reviews when counting the review number. &lt;br /&gt;
&lt;br /&gt;
Our plan: Filter the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Specification: In student_review/list page, change the wording and numbering on this view. Calibrated review 1,2,3 to represent reviews done in calibration period; Review 1, 2, 3 to represent reviews done in normal review period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Check the review type and change the name to &amp;quot;Calibrated review&amp;quot; if it is a calibrated review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Picture for 4&amp;amp;5'''&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration Review and Review.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
2. When it is in assignments#edit page and clicking &amp;quot;Calibration for training?&amp;quot; checkbox and clicking &amp;quot;save&amp;quot; button:&lt;br /&gt;
* To check it displays a new tab named &amp;quot;Calibration&amp;quot; and adds a calibration due date in &amp;quot;Due dates&amp;quot; tab&lt;br /&gt;
* To check  it allows instructors to change and save date &amp;amp; time and permissions of calibration due date&lt;br /&gt;
3.When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
4. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113299</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113299"/>
		<updated>2017-11-14T21:47:02Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* Design Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:Usecase.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works before the calibration due date.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The calibration due date has been added.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work has the expert review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student finished his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. Also the refactoring process is safe since it happens after the test is written. Tests can also serve as a documentation to a developer.&lt;br /&gt;
&lt;br /&gt;
== Design Plan ==&lt;br /&gt;
&lt;br /&gt;
Due to the fact that the calibration feature is currently working, our approach for this project would be editing existing files or linked files between different places. Therefore, design patterns will not be required to implement. &lt;br /&gt;
&lt;br /&gt;
Below are the specifications and our plans to achieve them in our project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Specification: We need to add a new kind of due date, that is calibration due date, if we want to integration calibration feature into normal assignment.&lt;br /&gt;
&lt;br /&gt;
Our plan : Create a migration to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Specification: After calibration is enabled, a row should appear to deal with calibration due date in &amp;quot;Due Dates tab&amp;quot;. The other content of this row is just the same as other due dates.&lt;br /&gt;
&lt;br /&gt;
Our plan :  Add a row in due dates tab with the name &amp;quot;Calibration&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Picture for 1&amp;amp;2'''&lt;br /&gt;
&lt;br /&gt;
[[File:DueDate.GIF]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3.Specification:  In student_task/list page, current stage column should display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Change the current stage column to &amp;quot;Calibration&amp;quot; if the assignment is now in calibration period&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Picture for 3'''&lt;br /&gt;
&lt;br /&gt;
[[File:Student view.GIF]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Specification: In student_review/list page, change the logic in this view and exclude calibration reviews when counting the review number. &lt;br /&gt;
&lt;br /&gt;
Our plan: Filter the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Specification: In student_review/list page, change the wording and numbering on this view. Calibrated review 1,2,3 to represent reviews done in calibration period; Review 1, 2, 3 to represent reviews done in normal review period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Check the review type and change the name to &amp;quot;Calibrated review&amp;quot; if it is a calibrated review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Picture for 4&amp;amp;5'''&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration Review and Review.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
2. When it is in assignments#edit page and clicking &amp;quot;Calibration for training?&amp;quot; checkbox and clicking &amp;quot;save&amp;quot; button:&lt;br /&gt;
* To check it displays a new tab named &amp;quot;Calibration&amp;quot; and adds a calibration due date in &amp;quot;Due dates&amp;quot; tab&lt;br /&gt;
* To check  it allows instructors to change and save date &amp;amp; time and permissions of calibration due date&lt;br /&gt;
3.When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
4. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Student_view.png&amp;diff=113298</id>
		<title>File:Student view.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Student_view.png&amp;diff=113298"/>
		<updated>2017-11-14T21:46:19Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113297</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113297"/>
		<updated>2017-11-14T21:45:19Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* Design Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:Usecase.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works before the calibration due date.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The calibration due date has been added.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work has the expert review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student finished his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. Also the refactoring process is safe since it happens after the test is written. Tests can also serve as a documentation to a developer.&lt;br /&gt;
&lt;br /&gt;
== Design Plan ==&lt;br /&gt;
&lt;br /&gt;
Due to the fact that the calibration feature is currently working, our approach for this project would be editing existing files or linked files between different places. Therefore, design patterns will not be required to implement. &lt;br /&gt;
&lt;br /&gt;
Below are the specifications and our plans to achieve them in our project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Specification: We need to add a new kind of due date, that is calibration due date, if we want to integration calibration feature into normal assignment.&lt;br /&gt;
&lt;br /&gt;
Our plan : Create a migration to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Specification: After calibration is enabled, a row should appear to deal with calibration due date in &amp;quot;Due Dates tab&amp;quot;. The other content of this row is just the same as other due dates.&lt;br /&gt;
&lt;br /&gt;
Our plan :  Add a row in due dates tab with the name &amp;quot;Calibration&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Picture for 1&amp;amp;2'''&lt;br /&gt;
&lt;br /&gt;
[[File:DueDate.GIF]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3.Specification:  In student_task/list page, current stage column should display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Change the current stage column to &amp;quot;Calibration&amp;quot; if the assignment is now in calibration period&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Picture for 3'''&lt;br /&gt;
&lt;br /&gt;
[[File:StudentView.GIF]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Specification: In student_review/list page, change the logic in this view and exclude calibration reviews when counting the review number. &lt;br /&gt;
&lt;br /&gt;
Our plan: Filter the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Specification: In student_review/list page, change the wording and numbering on this view. Calibrated review 1,2,3 to represent reviews done in calibration period; Review 1, 2, 3 to represent reviews done in normal review period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Check the review type and change the name to &amp;quot;Calibrated review&amp;quot; if it is a calibrated review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Picture for 4&amp;amp;5'''&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration Review and Review.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
2. When it is in assignments#edit page and clicking &amp;quot;Calibration for training?&amp;quot; checkbox and clicking &amp;quot;save&amp;quot; button:&lt;br /&gt;
* To check it displays a new tab named &amp;quot;Calibration&amp;quot; and adds a calibration due date in &amp;quot;Due dates&amp;quot; tab&lt;br /&gt;
* To check  it allows instructors to change and save date &amp;amp; time and permissions of calibration due date&lt;br /&gt;
3.When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
4. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113296</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113296"/>
		<updated>2017-11-14T21:44:46Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* Design Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:Usecase.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works before the calibration due date.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The calibration due date has been added.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work has the expert review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student finished his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. Also the refactoring process is safe since it happens after the test is written. Tests can also serve as a documentation to a developer.&lt;br /&gt;
&lt;br /&gt;
== Design Plan ==&lt;br /&gt;
&lt;br /&gt;
Due to the fact that the calibration feature is currently working, our approach for this project would be editing existing files or linked files between different places. Therefore, design patterns will not be required to implement. &lt;br /&gt;
&lt;br /&gt;
Below are the specifications and our plans to achieve them in our project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Specification: We need to add a new kind of due date, that is calibration due date, if we want to integration calibration feature into normal assignment.&lt;br /&gt;
&lt;br /&gt;
Our plan : Create a migration to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Specification: After calibration is enabled, a row should appear to deal with calibration due date in &amp;quot;Due Dates tab&amp;quot;. The other content of this row is just the same as other due dates.&lt;br /&gt;
&lt;br /&gt;
Our plan :  Add a row in due dates tab with the name &amp;quot;Calibration&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Picture for 1&amp;amp;2&lt;br /&gt;
&lt;br /&gt;
[[File:DueDate.GIF]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3.Specification:  In student_task/list page, current stage column should display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Change the current stage column to &amp;quot;Calibration&amp;quot; if the assignment is now in calibration period&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Picture for 3&lt;br /&gt;
&lt;br /&gt;
[[File:StudentView.GIF]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Specification: In student_review/list page, change the logic in this view and exclude calibration reviews when counting the review number. &lt;br /&gt;
&lt;br /&gt;
Our plan: Filter the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Specification: In student_review/list page, change the wording and numbering on this view. Calibrated review 1,2,3 to represent reviews done in calibration period; Review 1, 2, 3 to represent reviews done in normal review period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Check the review type and change the name to &amp;quot;Calibrated review&amp;quot; if it is a calibrated review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Picture for 4&amp;amp;5&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration Review and Review.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
2. When it is in assignments#edit page and clicking &amp;quot;Calibration for training?&amp;quot; checkbox and clicking &amp;quot;save&amp;quot; button:&lt;br /&gt;
* To check it displays a new tab named &amp;quot;Calibration&amp;quot; and adds a calibration due date in &amp;quot;Due dates&amp;quot; tab&lt;br /&gt;
* To check  it allows instructors to change and save date &amp;amp; time and permissions of calibration due date&lt;br /&gt;
3.When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
4. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113293</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113293"/>
		<updated>2017-11-14T21:43:25Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* Design Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:Usecase.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works before the calibration due date.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The calibration due date has been added.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work has the expert review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student finished his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. Also the refactoring process is safe since it happens after the test is written. Tests can also serve as a documentation to a developer.&lt;br /&gt;
&lt;br /&gt;
== Design Plan ==&lt;br /&gt;
&lt;br /&gt;
Due to the fact that the calibration feature is currently working, our approach for this project would be editing existing files or linked files between different places. Therefore, design patterns will not be required to implement. &lt;br /&gt;
&lt;br /&gt;
Below are the specifications and our plans to achieve them in our project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Specification: We need to add a new kind of due date, that is calibration due date, if we want to integration calibration feature into normal assignment.&lt;br /&gt;
&lt;br /&gt;
Our plan : Create a migration to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Specification: After calibration is enabled, a row should appear to deal with calibration due date in &amp;quot;Due Dates tab&amp;quot;. The other content of this row is just the same as other due dates.&lt;br /&gt;
&lt;br /&gt;
Our plan :  Add a row in due dates tab with the name &amp;quot;Calibration&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Picture for 1&amp;amp;2&lt;br /&gt;
&lt;br /&gt;
[[File:DueDate.GIF]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3.Specification:  In student_task/list page, current stage column should display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Change the current stage column to &amp;quot;Calibration&amp;quot; if the assignment is now in calibration period&lt;br /&gt;
&lt;br /&gt;
Picture for 3&lt;br /&gt;
&lt;br /&gt;
[[File:StudentView.GIF]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Specification: In student_review/list page, change the logic in this view and exclude calibration reviews when counting the review number. &lt;br /&gt;
&lt;br /&gt;
Our plan: Filter the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Specification: In student_review/list page, change the wording and numbering on this view. Calibrated review 1,2,3 to represent reviews done in calibration period; Review 1, 2, 3 to represent reviews done in normal review period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Check the review type and change the name to &amp;quot;Calibrated review&amp;quot; if it is a calibrated review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Picture for 4&amp;amp;5&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration Review and Review.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
2. When it is in assignments#edit page and clicking &amp;quot;Calibration for training?&amp;quot; checkbox and clicking &amp;quot;save&amp;quot; button:&lt;br /&gt;
* To check it displays a new tab named &amp;quot;Calibration&amp;quot; and adds a calibration due date in &amp;quot;Due dates&amp;quot; tab&lt;br /&gt;
* To check  it allows instructors to change and save date &amp;amp; time and permissions of calibration due date&lt;br /&gt;
3.When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
4. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113292</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113292"/>
		<updated>2017-11-14T21:43:06Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* Design Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:Usecase.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works before the calibration due date.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The calibration due date has been added.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work has the expert review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student finished his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. Also the refactoring process is safe since it happens after the test is written. Tests can also serve as a documentation to a developer.&lt;br /&gt;
&lt;br /&gt;
== Design Plan ==&lt;br /&gt;
&lt;br /&gt;
Due to the fact that the calibration feature is currently working, our approach for this project would be editing existing files or linked files between different places. Therefore, design patterns will not be required to implement. &lt;br /&gt;
&lt;br /&gt;
Below are the specifications and our plans to achieve them in our project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Specification: We need to add a new kind of due date, that is calibration due date, if we want to integration calibration feature into normal assignment.&lt;br /&gt;
&lt;br /&gt;
Our plan : Create a migration to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Specification: After calibration is enabled, a row should appear to deal with calibration due date in &amp;quot;Due Dates tab&amp;quot;. The other content of this row is just the same as other due dates.&lt;br /&gt;
&lt;br /&gt;
Our plan :  Add a row in due dates tab with the name &amp;quot;Calibration&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Picture for 1&amp;amp;2&lt;br /&gt;
&lt;br /&gt;
[[File:DueDate.GIF]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3.Specification:  In student_task/list page, current stage column should display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Change the current stage column to &amp;quot;Calibration&amp;quot; if the assignment is now in calibration period&lt;br /&gt;
&lt;br /&gt;
Picture for 3&lt;br /&gt;
&lt;br /&gt;
[[File:StudentView.GIF]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Specification: In student_review/list page, change the logic in this view and exclude calibration reviews when counting the review number. &lt;br /&gt;
&lt;br /&gt;
Our plan: Filter the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Specification: In student_review/list page, change the wording and numbering on this view. Calibrated review 1,2,3 to represent reviews done in calibration period; Review 1, 2, 3 to represent reviews done in normal review period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Check the review type and change the name to &amp;quot;Calibrated review&amp;quot; if it is a calibrated review.&lt;br /&gt;
&lt;br /&gt;
Picture for 4&amp;amp;5&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration Review and Review.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
2. When it is in assignments#edit page and clicking &amp;quot;Calibration for training?&amp;quot; checkbox and clicking &amp;quot;save&amp;quot; button:&lt;br /&gt;
* To check it displays a new tab named &amp;quot;Calibration&amp;quot; and adds a calibration due date in &amp;quot;Due dates&amp;quot; tab&lt;br /&gt;
* To check  it allows instructors to change and save date &amp;amp; time and permissions of calibration due date&lt;br /&gt;
3.When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
4. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113284</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113284"/>
		<updated>2017-11-14T21:39:46Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* Design Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:Usecase.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works before the calibration due date.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The calibration due date has been added.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work has the expert review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student finished his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. Also the refactoring process is safe since it happens after the test is written. Tests can also serve as a documentation to a developer.&lt;br /&gt;
&lt;br /&gt;
== Design Plan ==&lt;br /&gt;
&lt;br /&gt;
Due to the fact that the calibration feature is currently working, our approach for this project would be editing existing files or linked files between different places. Therefore, design patterns will not be required to implement. &lt;br /&gt;
&lt;br /&gt;
Below are the specifications and our plans to achieve them in our project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Specification: We need to add a new kind of due date, that is calibration due date, if we want to integration calibration feature into normal assignment.&lt;br /&gt;
&lt;br /&gt;
Our plan : Create a migration to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Specification: After calibration is enabled, a row should appear to deal with calibration due date in &amp;quot;Due Dates tab&amp;quot;. The other content of this row is just the same as other due dates.&lt;br /&gt;
&lt;br /&gt;
Our plan :  Add a row in due dates tab with the name &amp;quot;Calibration&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Picture:&lt;br /&gt;
&lt;br /&gt;
[[File:DueDate.GIF]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3.Specification:  In student_task/list page, current stage column should display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Change the current stage column to &amp;quot;Calibration&amp;quot; if the assignment is now in calibration period&lt;br /&gt;
&lt;br /&gt;
Picture:&lt;br /&gt;
&lt;br /&gt;
[[File:StudentView.GIF]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Specification: In student_review/list page, change the logic in this view and exclude calibration reviews when counting the review number. &lt;br /&gt;
&lt;br /&gt;
Our plan: Filter the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Specification: In student_review/list page, change the wording and numbering on this view. Calibrated review 1,2,3 to represent reviews done in calibration period; Review 1, 2, 3 to represent reviews done in normal review period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Check the review type and change the name to &amp;quot;Calibrated review&amp;quot; if it is a calibrated review.&lt;br /&gt;
&lt;br /&gt;
Picture:&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration Review and Review.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
2. When it is in assignments#edit page and clicking &amp;quot;Calibration for training?&amp;quot; checkbox and clicking &amp;quot;save&amp;quot; button:&lt;br /&gt;
* To check it displays a new tab named &amp;quot;Calibration&amp;quot; and adds a calibration due date in &amp;quot;Due dates&amp;quot; tab&lt;br /&gt;
* To check  it allows instructors to change and save date &amp;amp; time and permissions of calibration due date&lt;br /&gt;
3.When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
4. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113275</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113275"/>
		<updated>2017-11-14T21:31:29Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* Design Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:Usecase.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works before the calibration due date.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The calibration due date has been added.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work has the expert review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student finished his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. Also the refactoring process is safe since it happens after the test is written. Tests can also serve as a documentation to a developer.&lt;br /&gt;
&lt;br /&gt;
== Design Plan ==&lt;br /&gt;
&lt;br /&gt;
Due to the fact that the calibration feature is currently working, our approach for this project would be editing existing files or linked files between different places. Therefore, design patterns will not be required to implement. &lt;br /&gt;
&lt;br /&gt;
Below are the specification and our plan to achieve them in our project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Specification: We need to add a new kind of due date, that is calibration due date, if we want to integration calibration feature into normal assignment.&lt;br /&gt;
&lt;br /&gt;
Our plan : Create a migration to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Specification: After calibration is enabled, a row should appear to deal with calibration due date in &amp;quot;Due Dates tab&amp;quot;. The other content of this row is just the same as other due dates.&lt;br /&gt;
&lt;br /&gt;
Our plan :  Add a row in due dates tab with the name &amp;quot;Calibration&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Picture:&lt;br /&gt;
&lt;br /&gt;
[[File:DueDate.GIF]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3.Specification:  In student_task/list page, current stage column should display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Change the current stage column to &amp;quot;Calibration&amp;quot; if the assignment is now in calibration period&lt;br /&gt;
&lt;br /&gt;
Picture:&lt;br /&gt;
&lt;br /&gt;
[[File:StudentView.GIF]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Specification: In student_review/list page, change the logic in this view and exclude calibration reviews when counting the review number. &lt;br /&gt;
&lt;br /&gt;
Our plan: Filter the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Specification: In student_review/list page, change the wording and numbering on this view. Calibrated review 1,2,3 to represent reviews done in calibration period; Review 1, 2, 3 to represent reviews done in normal review period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Check the review type and change the name to &amp;quot;Calibrated review&amp;quot; if it is a calibrated review.&lt;br /&gt;
&lt;br /&gt;
Picture:&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration Review and Review.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
2. When it is in assignments#edit page and clicking &amp;quot;Calibration for training?&amp;quot; checkbox and clicking &amp;quot;save&amp;quot; button:&lt;br /&gt;
* To check it displays a new tab named &amp;quot;Calibration&amp;quot; and adds a calibration due date in &amp;quot;Due dates&amp;quot; tab&lt;br /&gt;
* To check  it allows instructors to change and save date &amp;amp; time and permissions of calibration due date&lt;br /&gt;
3.When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
4. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113274</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113274"/>
		<updated>2017-11-14T21:29:51Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* Design Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:Usecase.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works before the calibration due date.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The calibration due date has been added.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work has the expert review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student finished his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. Also the refactoring process is safe since it happens after the test is written. Tests can also serve as a documentation to a developer.&lt;br /&gt;
&lt;br /&gt;
== Design Plan ==&lt;br /&gt;
&lt;br /&gt;
Due to the fact that the calibration feature is currently working, our approach for this project would be editing existing files or linked files between different places. Therefore, design patterns will not be required to implement. &lt;br /&gt;
&lt;br /&gt;
Below are the specification and our plan to achieve them in our project.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1. Specification: We need to add a new kind of due date, that is calibration due date, if we want to integration calibration feature into normal assignment.&lt;br /&gt;
&lt;br /&gt;
Our plan : Create a migration to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Specification: After calibration is enabled, a row should appear to deal with calibration due date in &amp;quot;Due Dates tab&amp;quot;. The other content of this row is just the same as other due dates.&lt;br /&gt;
&lt;br /&gt;
Our plan :  Add a row in due dates tab with the name &amp;quot;Calibration&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:DueDate.GIF]]&lt;br /&gt;
&lt;br /&gt;
Picture above is what the page looks after adding a due date named &amp;quot;Calibration&amp;quot; in &amp;quot;Due Dates tab&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3.Specification:  In student_task/list page, current stage column should display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Change the current stage column to &amp;quot;Calibration&amp;quot; if the assignment is now in calibration period&lt;br /&gt;
&lt;br /&gt;
[[File:StudentView.GIF]]&lt;br /&gt;
&lt;br /&gt;
Picture above is the student_task/list page after changing the current stage column to &amp;quot;Calibration&amp;quot; if the assignment is now in calibration period&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Specification: In student_review/list page, change the logic in this view and exclude calibration reviews when counting the review number. &lt;br /&gt;
&lt;br /&gt;
Our plan: Filter the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Specification: In student_review/list page, change the wording and numbering on this view. Calibrated review 1,2,3 to represent reviews done in calibration period; Review 1, 2, 3 to represent reviews done in normal review period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Check the review type and change the name to &amp;quot;Calibrated review&amp;quot; if it is a calibrated review.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration Review and Review.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is the the student_review/list page after splitting the name of calibrated review and normal review&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
2. When it is in assignments#edit page and clicking &amp;quot;Calibration for training?&amp;quot; checkbox and clicking &amp;quot;save&amp;quot; button:&lt;br /&gt;
* To check it displays a new tab named &amp;quot;Calibration&amp;quot; and adds a calibration due date in &amp;quot;Due dates&amp;quot; tab&lt;br /&gt;
* To check  it allows instructors to change and save date &amp;amp; time and permissions of calibration due date&lt;br /&gt;
3.When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
4. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113273</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113273"/>
		<updated>2017-11-14T21:24:54Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* Design Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:Usecase.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works before the calibration due date.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The calibration due date has been added.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work has the expert review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student finished his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. Also the refactoring process is safe since it happens after the test is written. Tests can also serve as a documentation to a developer.&lt;br /&gt;
&lt;br /&gt;
== Design Plan ==&lt;br /&gt;
&lt;br /&gt;
Due to the fact that the calibration feature is currently working, our approach for this project would be editing existing files or linked files between different places. Therefore, design patterns will not be required to implement. Below are the specification and our plan to achieve them in our project.&lt;br /&gt;
&lt;br /&gt;
1. Specification: We need to add a new kind of due date, that is calibration due date, if we want to integration calibration feature into normal assignment.&lt;br /&gt;
&lt;br /&gt;
Our plan : Create a migration to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Specification: After calibration is enabled, a row should appear to deal with calibration due date in &amp;quot;Due Dates tab&amp;quot;. The other content of this row is just the same as other due dates.&lt;br /&gt;
&lt;br /&gt;
Our plan :  Add a row in due dates tab with the name &amp;quot;Calibration&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:DueDate.GIF]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3.Specification:  In student_task/list page, current stage column should display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Change the current stage column to &amp;quot;Calibration&amp;quot; if the assignment is now in calibration period&lt;br /&gt;
&lt;br /&gt;
[[File:StudentView.GIF]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Specification: In student_review/list page, change the logic in this view and exclude calibration reviews when counting the review number. &lt;br /&gt;
&lt;br /&gt;
Our plan: Filter the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
5. Specification: In student_review/list page, change the wording and numbering on this view. Calibrated review 1,2,3 to represent reviews done in calibration period; Review 1, 2, 3 to represent reviews done in normal review period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Check the review type and change the name to &amp;quot;Calibrated review&amp;quot; if it is a calibrated review.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration Review and Review.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
2. When it is in assignments#edit page and clicking &amp;quot;Calibration for training?&amp;quot; checkbox and clicking &amp;quot;save&amp;quot; button:&lt;br /&gt;
* To check it displays a new tab named &amp;quot;Calibration&amp;quot; and adds a calibration due date in &amp;quot;Due dates&amp;quot; tab&lt;br /&gt;
* To check  it allows instructors to change and save date &amp;amp; time and permissions of calibration due date&lt;br /&gt;
3.When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
4. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113272</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113272"/>
		<updated>2017-11-14T21:23:49Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* Overall Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:Usecase.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works before the calibration due date.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The calibration due date has been added.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work has the expert review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student finished his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. Also the refactoring process is safe since it happens after the test is written. Tests can also serve as a documentation to a developer.&lt;br /&gt;
&lt;br /&gt;
== Design Plan ==&lt;br /&gt;
&lt;br /&gt;
Due to the fact that the calibration feature is currently working, our approach for this project would be editing existing files or linked files between different places. Therefore, design patterns will not be required to implement.&lt;br /&gt;
&lt;br /&gt;
Below are the specification and our plan to achieve them in our project.&lt;br /&gt;
&lt;br /&gt;
1. Specification: We need to add a new kind of due date, that is calibration due date, if we want to integration calibration feature into normal assignment.&lt;br /&gt;
&lt;br /&gt;
Our plan : Create a migration to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Specification: After calibration is enabled, a row should appear to deal with calibration due date in &amp;quot;Due Dates tab&amp;quot;. The other content of this row is just the same as other due dates.&lt;br /&gt;
&lt;br /&gt;
Our plan :  Add a row in due dates tab with the name &amp;quot;Calibration&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:DueDate.GIF]]&lt;br /&gt;
&lt;br /&gt;
3.Specification:  In student_task/list page, current stage column should display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Change the current stage column to &amp;quot;Calibration&amp;quot; if the assignment is now in calibration period&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:StudentView.GIF]]&lt;br /&gt;
&lt;br /&gt;
4. Specification: In student_review/list page, change the logic in this view and exclude calibration reviews when counting the review number. &lt;br /&gt;
&lt;br /&gt;
Our plan: Filter the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
5. Specification: In student_review/list page, change the wording and numbering on this view. Calibrated review 1,2,3 to represent reviews done in calibration period; Review 1, 2, 3 to represent reviews done in normal review period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Check the review type and change the name to &amp;quot;Calibrated review&amp;quot; if it is a calibrated review.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration Review and Review.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
2. When it is in assignments#edit page and clicking &amp;quot;Calibration for training?&amp;quot; checkbox and clicking &amp;quot;save&amp;quot; button:&lt;br /&gt;
* To check it displays a new tab named &amp;quot;Calibration&amp;quot; and adds a calibration due date in &amp;quot;Due dates&amp;quot; tab&lt;br /&gt;
* To check  it allows instructors to change and save date &amp;amp; time and permissions of calibration due date&lt;br /&gt;
3.When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
4. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113271</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113271"/>
		<updated>2017-11-14T21:23:35Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* Overall Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Picture above is  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:Usecase.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works before the calibration due date.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The calibration due date has been added.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work has the expert review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student finished his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. Also the refactoring process is safe since it happens after the test is written. Tests can also serve as a documentation to a developer.&lt;br /&gt;
&lt;br /&gt;
== Design Plan ==&lt;br /&gt;
&lt;br /&gt;
Due to the fact that the calibration feature is currently working, our approach for this project would be editing existing files or linked files between different places. Therefore, design patterns will not be required to implement.&lt;br /&gt;
&lt;br /&gt;
Below are the specification and our plan to achieve them in our project.&lt;br /&gt;
&lt;br /&gt;
1. Specification: We need to add a new kind of due date, that is calibration due date, if we want to integration calibration feature into normal assignment.&lt;br /&gt;
&lt;br /&gt;
Our plan : Create a migration to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Specification: After calibration is enabled, a row should appear to deal with calibration due date in &amp;quot;Due Dates tab&amp;quot;. The other content of this row is just the same as other due dates.&lt;br /&gt;
&lt;br /&gt;
Our plan :  Add a row in due dates tab with the name &amp;quot;Calibration&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:DueDate.GIF]]&lt;br /&gt;
&lt;br /&gt;
3.Specification:  In student_task/list page, current stage column should display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Change the current stage column to &amp;quot;Calibration&amp;quot; if the assignment is now in calibration period&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:StudentView.GIF]]&lt;br /&gt;
&lt;br /&gt;
4. Specification: In student_review/list page, change the logic in this view and exclude calibration reviews when counting the review number. &lt;br /&gt;
&lt;br /&gt;
Our plan: Filter the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
5. Specification: In student_review/list page, change the wording and numbering on this view. Calibrated review 1,2,3 to represent reviews done in calibration period; Review 1, 2, 3 to represent reviews done in normal review period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Check the review type and change the name to &amp;quot;Calibrated review&amp;quot; if it is a calibrated review.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration Review and Review.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
2. When it is in assignments#edit page and clicking &amp;quot;Calibration for training?&amp;quot; checkbox and clicking &amp;quot;save&amp;quot; button:&lt;br /&gt;
* To check it displays a new tab named &amp;quot;Calibration&amp;quot; and adds a calibration due date in &amp;quot;Due dates&amp;quot; tab&lt;br /&gt;
* To check  it allows instructors to change and save date &amp;amp; time and permissions of calibration due date&lt;br /&gt;
3.When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
4. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113270</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113270"/>
		<updated>2017-11-14T21:23:08Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* Overall Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
Figure1  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:Usecase.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works before the calibration due date.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The calibration due date has been added.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work has the expert review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student finished his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. Also the refactoring process is safe since it happens after the test is written. Tests can also serve as a documentation to a developer.&lt;br /&gt;
&lt;br /&gt;
== Design Plan ==&lt;br /&gt;
&lt;br /&gt;
Due to the fact that the calibration feature is currently working, our approach for this project would be editing existing files or linked files between different places. Therefore, design patterns will not be required to implement.&lt;br /&gt;
&lt;br /&gt;
Below are the specification and our plan to achieve them in our project.&lt;br /&gt;
&lt;br /&gt;
1. Specification: We need to add a new kind of due date, that is calibration due date, if we want to integration calibration feature into normal assignment.&lt;br /&gt;
&lt;br /&gt;
Our plan : Create a migration to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Specification: After calibration is enabled, a row should appear to deal with calibration due date in &amp;quot;Due Dates tab&amp;quot;. The other content of this row is just the same as other due dates.&lt;br /&gt;
&lt;br /&gt;
Our plan :  Add a row in due dates tab with the name &amp;quot;Calibration&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:DueDate.GIF]]&lt;br /&gt;
&lt;br /&gt;
3.Specification:  In student_task/list page, current stage column should display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Change the current stage column to &amp;quot;Calibration&amp;quot; if the assignment is now in calibration period&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:StudentView.GIF]]&lt;br /&gt;
&lt;br /&gt;
4. Specification: In student_review/list page, change the logic in this view and exclude calibration reviews when counting the review number. &lt;br /&gt;
&lt;br /&gt;
Our plan: Filter the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
5. Specification: In student_review/list page, change the wording and numbering on this view. Calibrated review 1,2,3 to represent reviews done in calibration period; Review 1, 2, 3 to represent reviews done in normal review period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Check the review type and change the name to &amp;quot;Calibrated review&amp;quot; if it is a calibrated review.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration Review and Review.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
2. When it is in assignments#edit page and clicking &amp;quot;Calibration for training?&amp;quot; checkbox and clicking &amp;quot;save&amp;quot; button:&lt;br /&gt;
* To check it displays a new tab named &amp;quot;Calibration&amp;quot; and adds a calibration due date in &amp;quot;Due dates&amp;quot; tab&lt;br /&gt;
* To check  it allows instructors to change and save date &amp;amp; time and permissions of calibration due date&lt;br /&gt;
3.When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
4. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113269</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113269"/>
		<updated>2017-11-14T21:22:54Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* Overall Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration for training.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure1  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:Usecase.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works before the calibration due date.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The calibration due date has been added.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work has the expert review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student finished his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. Also the refactoring process is safe since it happens after the test is written. Tests can also serve as a documentation to a developer.&lt;br /&gt;
&lt;br /&gt;
== Design Plan ==&lt;br /&gt;
&lt;br /&gt;
Due to the fact that the calibration feature is currently working, our approach for this project would be editing existing files or linked files between different places. Therefore, design patterns will not be required to implement.&lt;br /&gt;
&lt;br /&gt;
Below are the specification and our plan to achieve them in our project.&lt;br /&gt;
&lt;br /&gt;
1. Specification: We need to add a new kind of due date, that is calibration due date, if we want to integration calibration feature into normal assignment.&lt;br /&gt;
&lt;br /&gt;
Our plan : Create a migration to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Specification: After calibration is enabled, a row should appear to deal with calibration due date in &amp;quot;Due Dates tab&amp;quot;. The other content of this row is just the same as other due dates.&lt;br /&gt;
&lt;br /&gt;
Our plan :  Add a row in due dates tab with the name &amp;quot;Calibration&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:DueDate.GIF]]&lt;br /&gt;
&lt;br /&gt;
3.Specification:  In student_task/list page, current stage column should display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Change the current stage column to &amp;quot;Calibration&amp;quot; if the assignment is now in calibration period&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:StudentView.GIF]]&lt;br /&gt;
&lt;br /&gt;
4. Specification: In student_review/list page, change the logic in this view and exclude calibration reviews when counting the review number. &lt;br /&gt;
&lt;br /&gt;
Our plan: Filter the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
5. Specification: In student_review/list page, change the wording and numbering on this view. Calibrated review 1,2,3 to represent reviews done in calibration period; Review 1, 2, 3 to represent reviews done in normal review period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Check the review type and change the name to &amp;quot;Calibrated review&amp;quot; if it is a calibrated review.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration Review and Review.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
2. When it is in assignments#edit page and clicking &amp;quot;Calibration for training?&amp;quot; checkbox and clicking &amp;quot;save&amp;quot; button:&lt;br /&gt;
* To check it displays a new tab named &amp;quot;Calibration&amp;quot; and adds a calibration due date in &amp;quot;Due dates&amp;quot; tab&lt;br /&gt;
* To check  it allows instructors to change and save date &amp;amp; time and permissions of calibration due date&lt;br /&gt;
3.When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
4. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Calibration_for_training.png&amp;diff=113268</id>
		<title>File:Calibration for training.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Calibration_for_training.png&amp;diff=113268"/>
		<updated>2017-11-14T21:22:39Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113267</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113267"/>
		<updated>2017-11-14T21:21:28Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* Overall Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnableCalibration.GIF]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Figure1  &amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:Usecase.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works before the calibration due date.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The calibration due date has been added.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work has the expert review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student finished his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. Also the refactoring process is safe since it happens after the test is written. Tests can also serve as a documentation to a developer.&lt;br /&gt;
&lt;br /&gt;
== Design Plan ==&lt;br /&gt;
&lt;br /&gt;
Due to the fact that the calibration feature is currently working, our approach for this project would be editing existing files or linked files between different places. Therefore, design patterns will not be required to implement.&lt;br /&gt;
&lt;br /&gt;
Below are the specification and our plan to achieve them in our project.&lt;br /&gt;
&lt;br /&gt;
1. Specification: We need to add a new kind of due date, that is calibration due date, if we want to integration calibration feature into normal assignment.&lt;br /&gt;
&lt;br /&gt;
Our plan : Create a migration to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Specification: After calibration is enabled, a row should appear to deal with calibration due date in &amp;quot;Due Dates tab&amp;quot;. The other content of this row is just the same as other due dates.&lt;br /&gt;
&lt;br /&gt;
Our plan :  Add a row in due dates tab with the name &amp;quot;Calibration&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:DueDate.GIF]]&lt;br /&gt;
&lt;br /&gt;
3.Specification:  In student_task/list page, current stage column should display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Change the current stage column to &amp;quot;Calibration&amp;quot; if the assignment is now in calibration period&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:StudentView.GIF]]&lt;br /&gt;
&lt;br /&gt;
4. Specification: In student_review/list page, change the logic in this view and exclude calibration reviews when counting the review number. &lt;br /&gt;
&lt;br /&gt;
Our plan: Filter the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
5. Specification: In student_review/list page, change the wording and numbering on this view. Calibrated review 1,2,3 to represent reviews done in calibration period; Review 1, 2, 3 to represent reviews done in normal review period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Check the review type and change the name to &amp;quot;Calibrated review&amp;quot; if it is a calibrated review.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration Review and Review.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
2. When it is in assignments#edit page and clicking &amp;quot;Calibration for training?&amp;quot; checkbox and clicking &amp;quot;save&amp;quot; button:&lt;br /&gt;
* To check it displays a new tab named &amp;quot;Calibration&amp;quot; and adds a calibration due date in &amp;quot;Due dates&amp;quot; tab&lt;br /&gt;
* To check  it allows instructors to change and save date &amp;amp; time and permissions of calibration due date&lt;br /&gt;
3.When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
4. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113266</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113266"/>
		<updated>2017-11-14T21:20:28Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* Overall Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnableCalibration.GIF]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:Usecase.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works before the calibration due date.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The calibration due date has been added.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work has the expert review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student finished his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. Also the refactoring process is safe since it happens after the test is written. Tests can also serve as a documentation to a developer.&lt;br /&gt;
&lt;br /&gt;
== Design Plan ==&lt;br /&gt;
&lt;br /&gt;
Due to the fact that the calibration feature is currently working, our approach for this project would be editing existing files or linked files between different places. Therefore, design patterns will not be required to implement.&lt;br /&gt;
&lt;br /&gt;
Below are the specification and our plan to achieve them in our project.&lt;br /&gt;
&lt;br /&gt;
1. Specification: We need to add a new kind of due date, that is calibration due date, if we want to integration calibration feature into normal assignment.&lt;br /&gt;
&lt;br /&gt;
Our plan : Create a migration to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Specification: After calibration is enabled, a row should appear to deal with calibration due date in &amp;quot;Due Dates tab&amp;quot;. The other content of this row is just the same as other due dates.&lt;br /&gt;
&lt;br /&gt;
Our plan :  Add a row in due dates tab with the name &amp;quot;Calibration&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:DueDate.GIF]]&lt;br /&gt;
&lt;br /&gt;
3.Specification:  In student_task/list page, current stage column should display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Change the current stage column to &amp;quot;Calibration&amp;quot; if the assignment is now in calibration period&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:StudentView.GIF]]&lt;br /&gt;
&lt;br /&gt;
4. Specification: In student_review/list page, change the logic in this view and exclude calibration reviews when counting the review number. &lt;br /&gt;
&lt;br /&gt;
Our plan: Filter the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
5. Specification: In student_review/list page, change the wording and numbering on this view. Calibrated review 1,2,3 to represent reviews done in calibration period; Review 1, 2, 3 to represent reviews done in normal review period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Check the review type and change the name to &amp;quot;Calibrated review&amp;quot; if it is a calibrated review.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration Review and Review.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
2. When it is in assignments#edit page and clicking &amp;quot;Calibration for training?&amp;quot; checkbox and clicking &amp;quot;save&amp;quot; button:&lt;br /&gt;
* To check it displays a new tab named &amp;quot;Calibration&amp;quot; and adds a calibration due date in &amp;quot;Due dates&amp;quot; tab&lt;br /&gt;
* To check  it allows instructors to change and save date &amp;amp; time and permissions of calibration due date&lt;br /&gt;
3.When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
4. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113265</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113265"/>
		<updated>2017-11-14T21:20:17Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* Overall Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:EnableCalibration.GIF]]&lt;br /&gt;
&amp;quot;Calibration for training?&amp;quot; box in editing/creating assignment page&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:Usecase.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works before the calibration due date.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The calibration due date has been added.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work has the expert review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student finished his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. Also the refactoring process is safe since it happens after the test is written. Tests can also serve as a documentation to a developer.&lt;br /&gt;
&lt;br /&gt;
== Design Plan ==&lt;br /&gt;
&lt;br /&gt;
Due to the fact that the calibration feature is currently working, our approach for this project would be editing existing files or linked files between different places. Therefore, design patterns will not be required to implement.&lt;br /&gt;
&lt;br /&gt;
Below are the specification and our plan to achieve them in our project.&lt;br /&gt;
&lt;br /&gt;
1. Specification: We need to add a new kind of due date, that is calibration due date, if we want to integration calibration feature into normal assignment.&lt;br /&gt;
&lt;br /&gt;
Our plan : Create a migration to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Specification: After calibration is enabled, a row should appear to deal with calibration due date in &amp;quot;Due Dates tab&amp;quot;. The other content of this row is just the same as other due dates.&lt;br /&gt;
&lt;br /&gt;
Our plan :  Add a row in due dates tab with the name &amp;quot;Calibration&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:DueDate.GIF]]&lt;br /&gt;
&lt;br /&gt;
3.Specification:  In student_task/list page, current stage column should display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Change the current stage column to &amp;quot;Calibration&amp;quot; if the assignment is now in calibration period&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:StudentView.GIF]]&lt;br /&gt;
&lt;br /&gt;
4. Specification: In student_review/list page, change the logic in this view and exclude calibration reviews when counting the review number. &lt;br /&gt;
&lt;br /&gt;
Our plan: Filter the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
5. Specification: In student_review/list page, change the wording and numbering on this view. Calibrated review 1,2,3 to represent reviews done in calibration period; Review 1, 2, 3 to represent reviews done in normal review period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Check the review type and change the name to &amp;quot;Calibrated review&amp;quot; if it is a calibrated review.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration Review and Review.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
2. When it is in assignments#edit page and clicking &amp;quot;Calibration for training?&amp;quot; checkbox and clicking &amp;quot;save&amp;quot; button:&lt;br /&gt;
* To check it displays a new tab named &amp;quot;Calibration&amp;quot; and adds a calibration due date in &amp;quot;Due dates&amp;quot; tab&lt;br /&gt;
* To check  it allows instructors to change and save date &amp;amp; time and permissions of calibration due date&lt;br /&gt;
3.When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
4. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113262</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113262"/>
		<updated>2017-11-14T21:18:53Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* Design Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:Usecase.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works before the calibration due date.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The calibration due date has been added.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work has the expert review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student finished his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. Also the refactoring process is safe since it happens after the test is written. Tests can also serve as a documentation to a developer.&lt;br /&gt;
&lt;br /&gt;
== Design Plan ==&lt;br /&gt;
&lt;br /&gt;
Due to the fact that the calibration feature is currently working, our approach for this project would be editing existing files or linked files between different places. Therefore, design patterns will not be required to implement.&lt;br /&gt;
&lt;br /&gt;
Below are the specification and our plan to achieve them in our project.&lt;br /&gt;
&lt;br /&gt;
1. Specification: We need to add a new kind of due date, that is calibration due date, if we want to integration calibration feature into normal assignment.&lt;br /&gt;
&lt;br /&gt;
Our plan : Create a migration to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Specification: After calibration is enabled, a row should appear to deal with calibration due date in &amp;quot;Due Dates tab&amp;quot;. The other content of this row is just the same as other due dates.&lt;br /&gt;
&lt;br /&gt;
Our plan :  Add a row in due dates tab with the name &amp;quot;Calibration&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:DueDate.GIF]]&lt;br /&gt;
&lt;br /&gt;
3.Specification:  In student_task/list page, current stage column should display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Change the current stage column to &amp;quot;Calibration&amp;quot; if the assignment is now in calibration period&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:StudentView.GIF]]&lt;br /&gt;
&lt;br /&gt;
4. Specification: In student_review/list page, change the logic in this view and exclude calibration reviews when counting the review number. &lt;br /&gt;
&lt;br /&gt;
Our plan: Filter the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
5. Specification: In student_review/list page, change the wording and numbering on this view. Calibrated review 1,2,3 to represent reviews done in calibration period; Review 1, 2, 3 to represent reviews done in normal review period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Check the review type and change the name to &amp;quot;Calibrated review&amp;quot; if it is a calibrated review.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration Review and Review.png]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
2. When it is in assignments#edit page and clicking &amp;quot;Calibration for training?&amp;quot; checkbox and clicking &amp;quot;save&amp;quot; button:&lt;br /&gt;
* To check it displays a new tab named &amp;quot;Calibration&amp;quot; and adds a calibration due date in &amp;quot;Due dates&amp;quot; tab&lt;br /&gt;
* To check  it allows instructors to change and save date &amp;amp; time and permissions of calibration due date&lt;br /&gt;
3.When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
4. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113260</id>
		<title>CSC/ECE 517 Fall 2017/E17A4 Allow calibration to be part of an assignment Team34</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2017/E17A4_Allow_calibration_to_be_part_of_an_assignment_Team34&amp;diff=113260"/>
		<updated>2017-11-14T21:18:10Z</updated>

		<summary type="html">&lt;p&gt;Tshi2: /* Design Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''1. Purpose'''&lt;br /&gt;
&lt;br /&gt;
Expertiza is an open source website based on Ruby on Rails. Calibration is one of the main feature Expertiza provides, which allows students to compare their reviews with experts' reviews and learn from the comparisons.&lt;br /&gt;
&lt;br /&gt;
'''2. Problem Definition'''&lt;br /&gt;
&lt;br /&gt;
Currently, the instructor is able to calibrate the students’ peer review abilities on Expertiza. However, the instructor needs to create a separate assignment just for calibration purpose of a project . Then the instructor and students can start doing peer reviews for the project with the newly created assignment . However, calibration should become one part of the normal assignment. The instructor could turn on this feature if necessary. Adding a separate assignment every time a project needs a calibration process is not efficient.&lt;br /&gt;
&lt;br /&gt;
This project proposes a solution to include the process of calibration in a regular assignment.&lt;br /&gt;
&lt;br /&gt;
== Overall Description ==&lt;br /&gt;
&lt;br /&gt;
“Calibration for training?” feature of an assignment in Expertiza provides a solution for the Instructor of a course to effectively add a calibration to a newly created or existing assignment. The instructor should be able to turn on this feature by checking the check box &amp;quot;Calibration for training?&amp;quot; under the General tab of an assignment. The instructor will also be able to provide or change the corresponding deadline for calibration. Then students will be pre-assigned several sample assignments. After students finish one peer review , there will be a link named “Show calibration results” to show the calibration report.&lt;br /&gt;
&lt;br /&gt;
== Requirements ==&lt;br /&gt;
&lt;br /&gt;
1. The instructor shall be able to add calibration process to an newly created or existing assignment.&lt;br /&gt;
&lt;br /&gt;
2. In student_task/list page, current stage column shall display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
3. The added calibration of an assignment shall have it owns type of due date.&lt;br /&gt;
&lt;br /&gt;
4. The added calibration of an assignment shall have the same behavior as the current working calibration process.&lt;br /&gt;
&lt;br /&gt;
== Use Cases ==&lt;br /&gt;
[[File:Usecase.GIF]]&lt;br /&gt;
&lt;br /&gt;
'''1. Edit/Create Assignment''' &lt;br /&gt;
&lt;br /&gt;
Use Case Id: 1&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can click to edit an existing assignment or create a new assignment. &lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The user is logged in as an instructor.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Instructor can edit the assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''2. Enable Calibration'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 2&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can select the option - &amp;quot;Calibration for training?&amp;quot; and save the assignment.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructor is in the editing or creating assignment page.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The assignment becomes a calibration assignment and the deadline for calibration now appears in the due dates tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''3. Add calibration due date'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 3&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can set due date for calibration under due dates tab.&lt;br /&gt;
&lt;br /&gt;
Actors:  Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Calibration for training? is enabled.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The deadline for calibration is now updated.&lt;br /&gt;
&lt;br /&gt;
Constraints: Calibration deadline should be before the submission deadline.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''4. Submit work'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 4 &lt;br /&gt;
&lt;br /&gt;
Use Case Description: Students can submit their works before the calibration due date.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The calibration due date has been added.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The database has the new works.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''5. Expert Review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 5&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Instructor can do expert reviews for works.&lt;br /&gt;
&lt;br /&gt;
Actors: Instructor&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work is submitted.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: The work has the expert review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''6. Calibration review'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 6&lt;br /&gt;
&lt;br /&gt;
Use Case Description:  Students can do calibration review.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: The assignment is a calibration assignment and the work has the expert review.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: Students have done the calibration review.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''7. View calibration result'''&lt;br /&gt;
&lt;br /&gt;
Use Case Id: 7&lt;br /&gt;
&lt;br /&gt;
Use Case Description: Student can see the comparison between their reviews and the experts' reviews.&lt;br /&gt;
&lt;br /&gt;
Actors: Student&lt;br /&gt;
&lt;br /&gt;
Pre Conditions: Instructors finished the expert reviews and this student finished his reviews.&lt;br /&gt;
&lt;br /&gt;
Post Conditions: NA&lt;br /&gt;
&lt;br /&gt;
== Test-Driven Development(TDD) ==&lt;br /&gt;
A software development process begins by writing an (initially failing) automated test case that defines a desired improvement or a new function, and generate the minimum amount of code to pass that test. It helps the developer to focus on a smaller portions of functionality at a time. Also the refactoring process is safe since it happens after the test is written. Tests can also serve as a documentation to a developer.&lt;br /&gt;
&lt;br /&gt;
== Design Plan ==&lt;br /&gt;
&lt;br /&gt;
Due to the fact that the calibration feature is currently working, our approach for this project would be editing existing files or linked files between different places. Therefore, design patterns will not be required to implement.&lt;br /&gt;
&lt;br /&gt;
Below are the specification and our plan to achieve them in our project.&lt;br /&gt;
&lt;br /&gt;
1. Specification: We need to add a new kind of due date, that is calibration due date, if we want to integration calibration feature into normal assignment.&lt;br /&gt;
&lt;br /&gt;
Our plan : Create a migration to add a new record to deadline_types model&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Specification: After calibration is enabled, a row should appear to deal with calibration due date in &amp;quot;Due Dates tab&amp;quot;. The other content of this row is just the same as other due dates.&lt;br /&gt;
&lt;br /&gt;
Our plan :  Add a row in due dates tab with the name &amp;quot;Calibration&amp;quot;&lt;br /&gt;
&lt;br /&gt;
[[File:DueDate.GIF]]&lt;br /&gt;
&lt;br /&gt;
3.Specification:  In student_task/list page, current stage column should display calibration when assignment is in calibration period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Change the current stage column to &amp;quot;Calibration&amp;quot; if the assignment is now in calibration period&lt;br /&gt;
&lt;br /&gt;
[[File:EnableCalibration.GIF]]&lt;br /&gt;
&lt;br /&gt;
4. Specification: In student_review/list page, change the logic in this view and exclude calibration reviews when counting the review number. &lt;br /&gt;
&lt;br /&gt;
Our plan: Filter the reviews with timestamp earlier than submission due date, which means reviews are done in calibration period.&lt;br /&gt;
&lt;br /&gt;
5. Specification: In student_review/list page, change the wording and numbering on this view. Calibrated review 1,2,3 to represent reviews done in calibration period; Review 1, 2, 3 to represent reviews done in normal review period.&lt;br /&gt;
&lt;br /&gt;
Our plan: Check the review type and change the name to &amp;quot;Calibrated review&amp;quot; if it is a calibrated review.&lt;br /&gt;
&lt;br /&gt;
[[File:Calibration Review and Review.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:StudentView.GIF]]&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
1. When it is in assignments#edit page:&lt;br /&gt;
* To check  it has a checkbox with title &amp;quot;Calibration for training?&amp;quot; in assignments#edit page&lt;br /&gt;
2. When it is in assignments#edit page and clicking &amp;quot;Calibration for training?&amp;quot; checkbox and clicking &amp;quot;save&amp;quot; button:&lt;br /&gt;
* To check it displays a new tab named &amp;quot;Calibration&amp;quot; and adds a calibration due date in &amp;quot;Due dates&amp;quot; tab&lt;br /&gt;
* To check  it allows instructors to change and save date &amp;amp; time and permissions of calibration due date&lt;br /&gt;
3.When current assignment is calibration stage:&lt;br /&gt;
* To check it shows current stage of the assignment to be &amp;quot;Calibration&amp;quot; on student_task#view page when current assignment is in calibration stage&lt;br /&gt;
* To check it shows &amp;quot;Calibration review 1,2,3...&amp;quot; instead of &amp;quot;Review 1,2,3...&amp;quot; on student_review#list page&lt;br /&gt;
* To check it allows students to do calibration review and the date can be saved successfully&lt;br /&gt;
* To check the student is able to compare the results of expert review by clicking &amp;quot;show calibration results&amp;quot; link&lt;br /&gt;
4. When current assignment if in review_stage:&lt;br /&gt;
* To check it excludes calibration reviews from outstanding review restriction and total review restriction&lt;br /&gt;
* To check it shows &amp;quot;Review 1,2,3...&amp;quot; instead of &amp;quot;Calibration review 1,2,3...&amp;quot; on student_review#list page&lt;/div&gt;</summary>
		<author><name>Tshi2</name></author>
	</entry>
</feed>