<?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=Pgupta24</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=Pgupta24"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Pgupta24"/>
	<updated>2026-05-13T04:40:58Z</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_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121600</id>
		<title>CSC/ECE 517 Fall 2018/E1855 let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121600"/>
		<updated>2018-12-18T06:21:38Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
The way Expertiza is set up right now is that only peers can review your work. However, there are cases when the course staff (Instructor/ TAs) would want to submit reviews as well. This project aims to implement this feature by allowing course staff to review the project on the same metrics as other students who review the project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
The current system does not allow instructors to submit reviews of student work. We will work upon the feature which will let them review using the same review form that students use to do reviews.&lt;br /&gt;
&lt;br /&gt;
=== Current scenario ===&lt;br /&gt;
&lt;br /&gt;
This is how some of the pages we are concerned with, currently look.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Submissions page for an assignment in Instructor View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Submissions_instr.jpeg | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A typical Scores table in a Student View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Grades_view_team_current.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions and Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
Following changes will be made to let staff perform reviews as well:&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Add a way for the instructors to perform a review.'''&lt;br /&gt;
&lt;br /&gt;
We have implemented links to ''Begin review'', ''Edit review'','' View review'' and ''Submit review'' in the assignment submissions view. &lt;br /&gt;
When the instructor/TA reviews a work for the first time, he/she is added as a participant and a review response mapping is created. &lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''View: ''' ''app/views/assignments/list_submissions.html.erb'' - To add links in the instructor view&lt;br /&gt;
* '''Controller: ''' ''app/controllers/review_mapping_controller.rb''  - Method: add_instructor_as_reviewer&lt;br /&gt;
  &lt;br /&gt;
In the second case, we can see a 'Begin review' link. This is the initial state when instructor review has not been added to the submission.&lt;br /&gt;
Once the instructor adds a review and submits it, we can see the 'Update review' link. If the deadline has passed, Update Review will change to View Review. In case he just saves the review, an 'Edit review' link will appear.&lt;br /&gt;
If the review deadline of one round is passed, the 'Edit review' link becomes 'Update review' link. This follows in line with what the student sees while performing a review. Similarly, just like students instructor would not able to edit the review once submitted. Instructor can update it till the final submission deadline passes.&lt;br /&gt;
&lt;br /&gt;
[[File:Latest_screen_instructor.JPG]]&lt;br /&gt;
[[File:Ins_TA_Review.png]]&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Add the instructor review in ''Your Scores'' table in case he has reviewed your work. Provide an icon to highlight the special nature of an instructors review.'''&lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''Assets: ''' ''app/assets/stylesheets/grades.scss'' - Icon to make an instructor's review distinct from other reviews&lt;br /&gt;
* '''View: ''' ''app/views/grades/view_team.html.erb'' - To modify the &amp;quot;Your scores&amp;quot; page to include an icon next to the peer review score indicating that the instructor's score is not included in the final peer review score.&lt;br /&gt;
* '''Models: ''' &lt;br /&gt;
** ''app/models/answer.rb'' - Method: compute_scores | Modification in logic to ensure instructor review scores are not counted in the overall score of the student.&lt;br /&gt;
** ''app/models/vm_question_response_score_cell.rb'' - Included a new variable called 'is_instructor_review' to identify an instructor review&lt;br /&gt;
** ''app/models/vm_question_response_row.rb'' - Change in average_score_for_row method to not include an instructor review score&lt;br /&gt;
** ''app/models/vm_question_response.rb'' - Modified the add_answer method to include the is_instructor_review to each row_score object&lt;br /&gt;
&lt;br /&gt;
A student should be able to make out if an instructor has reviewed his/his team's work. In case the instructor performs a review on the team's work, there will be an icon next to the instructor's review along with explicitly stating that it is an 'Instructor review'.&lt;br /&gt;
The average peer review score for the team has been modified to exclude the instructor's scores. Same has been taken into account for the average score calculated for each row.&lt;br /&gt;
&lt;br /&gt;
[[File:Score_hover.png]]&lt;br /&gt;
&lt;br /&gt;
Like shown in the above picture we can see a info button on which if we hover the text is shown.&lt;br /&gt;
&lt;br /&gt;
Possible icons :&lt;br /&gt;
 [[File:Instuctor.jpg]]  [[File:Instructor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
We added a test for a method '''add_instructor_as_review'''.&lt;br /&gt;
&lt;br /&gt;
1.Created a stub and mock to find the assignment team. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock:&lt;br /&gt;
let(:team) { double('AssignmentTeam', name: 'no one', id: 1, parent_id: 1) }&lt;br /&gt;
&lt;br /&gt;
Stub: &lt;br /&gt;
allow(AssignmentTeam).to receive(:find).with('1').and_return(team)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.Created a stub and mock to map the review with their response in ReviewResponseMap.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock: &lt;br /&gt;
let(:review_response_map) do double('ReviewResponseMap', id: 1, map_id: 1, assignment: assignment,reviewer: double('Participant', id: 1, name: 'reviewer'), reviewee: double('Participant', id: 2, name: 'reviewee'))  end&lt;br /&gt;
&lt;br /&gt;
Stub:&lt;br /&gt;
allow(ReviewResponseMap).to receive_message_chain(:where, :first).with(reviewee_id: 1, course_staff: true, reviewed_object_id: '1').with(no_args).and_return(nil)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3.Created a stub and mock to add current user as a participant in the assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock:&lt;br /&gt;
allow(AssignmentParticipant).to receive(:create).with(parent_id: 1, user_id: 1, can_submit: false, can_review: true, can_take_quiz: false, handle: 'handle').and_return(reviewer)&lt;br /&gt;
&lt;br /&gt;
Stub:&lt;br /&gt;
let(:participant) { double('AssignmentParticipant', id: 1, can_review: false, user: double('User', id: 1)) }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We use the above-mentioned stubs and mocks to test the following scenarios:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1. context 'when there is no response map and no reviewer'&lt;br /&gt;
2. context 'when there is a reviewer'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using a similar approach we tested '''select_reviewer''' and '''select_metareviewer''' functions. After running the above test, we found out that all the test cases passed resulting in '''''71%''''' coverage of review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
== '''Team''' ==&lt;br /&gt;
'''Members : '''&lt;br /&gt;
Harsh Shah, &lt;br /&gt;
Prachi Gupta, &lt;br /&gt;
Ramkumaar Kovil Kanthadai, &lt;br /&gt;
Raveena D'Costa.&lt;br /&gt;
&lt;br /&gt;
'''Mentor :''' Dr.Edward Gehringer&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Pull Request&lt;br /&gt;
* https://github.com/expertiza/expertiza/pull/1304&lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121599</id>
		<title>CSC/ECE 517 Fall 2018/E1855 let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121599"/>
		<updated>2018-12-18T06:20:05Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
The way Expertiza is set up right now is that only peers can review your work. However, there are cases when the course staff (Instructor/ TAs) would want to submit reviews as well. This project aims to implement this feature by allowing course staff to review the project on the same metrics as other students who review the project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
The current system does not allow instructors to submit reviews of student work. We will work upon the feature which will let them review using the same review form that students use to do reviews.&lt;br /&gt;
&lt;br /&gt;
=== Current scenario ===&lt;br /&gt;
&lt;br /&gt;
This is how some of the pages we are concerned with, currently look.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Submissions page for an assignment in Instructor View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Submissions_instr.jpeg | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A typical Scores table in a Student View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Grades_view_team_current.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions and Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
Following changes will be made to let staff perform reviews as well:&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Add a way for the instructors to perform a review.'''&lt;br /&gt;
&lt;br /&gt;
We have implemented links to ''Begin review'', ''Edit review'','' View review'' and ''Submit review'' in the assignment submissions view. &lt;br /&gt;
When the instructor/TA reviews a work for the first time, he/she is added as a participant and a review response mapping is created. &lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''View: ''' ''app/views/assignments/list_submissions.html.erb'' - To add links in the instructor view&lt;br /&gt;
* '''Controller: ''' ''app/controllers/review_mapping_controller.rb''  - Method: add_instructor_as_reviewer&lt;br /&gt;
  &lt;br /&gt;
In the second case, we can see a 'Begin review' link. This is the initial state when instructor review has not been added to the submission.&lt;br /&gt;
Once the instructor adds a review and submits it, we can see the 'Update review' link. If the deadline has passed, Update Review will change to View Review. In case he just saves the review, an 'Edit review' link will appear.&lt;br /&gt;
If the review deadline of one round is passed, the 'Edit review' link becomes 'Update review' link. This follows in line with what the student sees while performing a review. Similarly, just like students instructor would not able to edit the review once submitted. Instructor can update it till the final submission deadline passes.&lt;br /&gt;
&lt;br /&gt;
[[File:Latest_screen_instructor.JPG]]&lt;br /&gt;
[[File:Ins_TA_Review.png]]&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Add the instructor review in ''Your Scores'' table in case he has reviewed your work. Provide an icon to highlight the special nature of an instructors review.'''&lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''Assets: ''' ''app/assets/stylesheets/grades.scss'' - Icon to make an instructor's review distinct from other reviews&lt;br /&gt;
* '''View: ''' ''app/views/grades/view_team.html.erb'' - To modify the &amp;quot;Your scores&amp;quot; page to include an icon next to the peer review score indicating that the instructor's score is not included in the final peer review score.&lt;br /&gt;
* '''Models: ''' &lt;br /&gt;
** ''app/models/answer.rb'' - Method: compute_scores | Modification in logic to ensure instructor review scores are not counted in the overall score of the student.&lt;br /&gt;
** ''app/models/vm_question_response_score_cell.rb'' - Included a new variable called 'is_instructor_review' to identify an instructor review&lt;br /&gt;
** ''app/models/vm_question_response_row.rb'' - Change in average_score_for_row method to not include an instructor review score&lt;br /&gt;
** ''app/models/vm_question_response.rb'' - Modified the add_answer method to include the is_instructor_review to each row_score object&lt;br /&gt;
&lt;br /&gt;
A student should be able to make out if an instructor has reviewed his/his team's work. In case the instructor performs a review on the team's work, there will be an icon next to the instructor's review along with explicitly stating that it is an 'Instructor review'.&lt;br /&gt;
The average peer review score for the team has been modified to exclude the instructor's scores. Same has been taken into account for the average score calculated for each row.&lt;br /&gt;
&lt;br /&gt;
[[File:Score_hover.png]]&lt;br /&gt;
&lt;br /&gt;
Like shown in the above picture we can see a info button on which if we hover the text is shown.&lt;br /&gt;
&lt;br /&gt;
Possible icons :&lt;br /&gt;
 [[File:Instuctor.jpg]]  [[File:Instructor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
We added a test for a method '''add_instructor_as_review'''.&lt;br /&gt;
&lt;br /&gt;
1.Created a stub and mock to find the assignment team. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock:&lt;br /&gt;
let(:team) { double('AssignmentTeam', name: 'no one', id: 1, parent_id: 1) }&lt;br /&gt;
&lt;br /&gt;
Stub: &lt;br /&gt;
allow(AssignmentTeam).to receive(:find).with('1').and_return(team)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.Created a stub and mock to map the review with their response in ReviewResponseMap.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock: &lt;br /&gt;
let(:review_response_map) do double('ReviewResponseMap', id: 1, map_id: 1, assignment: assignment,reviewer: double('Participant', id: 1, name: 'reviewer'), reviewee: double('Participant', id: 2, name: 'reviewee'))  end&lt;br /&gt;
&lt;br /&gt;
Stub:&lt;br /&gt;
allow(ReviewResponseMap).to receive_message_chain(:where, :first).with(reviewee_id: 1, course_staff: true, reviewed_object_id: '1').with(no_args).and_return(nil)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3.Created a stub and mock to add current user as a participant in the assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock:&lt;br /&gt;
allow(AssignmentParticipant).to receive(:create).with(parent_id: 1, user_id: 1, can_submit: false, can_review: true, can_take_quiz: false, handle: 'handle').and_return(reviewer)&lt;br /&gt;
&lt;br /&gt;
Stub:&lt;br /&gt;
let(:participant) { double('AssignmentParticipant', id: 1, can_review: false, user: double('User', id: 1)) }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We use the above-mentioned stubs and mocks to test the following scenarios:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1. context 'when there is no response map and no reviewer'&lt;br /&gt;
2. context 'when there is a reviewer'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using a similar approach we tested '''select_reviewer''' and '''select_metareviewer''' function. After running the above test, we found out that all the test cases passed resulting in '''''71%''''' coverage of review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
== '''Team''' ==&lt;br /&gt;
'''Members : '''&lt;br /&gt;
Harsh Shah, &lt;br /&gt;
Prachi Gupta, &lt;br /&gt;
Ramkumaar Kovil Kanthadai, &lt;br /&gt;
Raveena D'Costa.&lt;br /&gt;
&lt;br /&gt;
'''Mentor :''' Dr.Edward Gehringer&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Pull Request&lt;br /&gt;
* https://github.com/expertiza/expertiza/pull/1304&lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121598</id>
		<title>CSC/ECE 517 Fall 2018/E1855 let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121598"/>
		<updated>2018-12-18T06:13:56Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
The way Expertiza is set up right now is that only peers can review your work. However, there are cases when the course staff (Instructor/ TAs) would want to submit reviews as well. This project aims to implement this feature by allowing course staff to review the project on the same metrics as other students who review the project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
The current system does not allow instructors to submit reviews of student work. We will work upon the feature which will let them review using the same review form that students use to do reviews.&lt;br /&gt;
&lt;br /&gt;
=== Current scenario ===&lt;br /&gt;
&lt;br /&gt;
This is how some of the pages we are concerned with, currently look.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Submissions page for an assignment in Instructor View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Submissions_instr.jpeg | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A typical Scores table in a Student View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Grades_view_team_current.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions and Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
Following changes will be made to let staff perform reviews as well:&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Add a way for the instructors to perform a review.'''&lt;br /&gt;
&lt;br /&gt;
We have implemented links to ''Begin review'', ''Edit review'','' View review'' and ''Submit review'' in the assignment submissions view. &lt;br /&gt;
When the instructor/TA reviews a work for the first time, he/she is added as a participant and a review response mapping is created. &lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''View: ''' ''app/views/assignments/list_submissions.html.erb'' - To add links in the instructor view&lt;br /&gt;
* '''Controller: ''' ''app/controllers/review_mapping_controller.rb''  - Method: add_instructor_as_reviewer&lt;br /&gt;
  &lt;br /&gt;
In the second case, we can see a 'Begin review' link. This is the initial state when instructor review has not been added to the submission.&lt;br /&gt;
Once the instructor adds a review and submits it, we can see the 'Update review' link. If the deadline has passed, Update Review will change to View Review. In case he just saves the review, an 'Edit review' link will appear.&lt;br /&gt;
If the review deadline of one round is passed, the 'Edit review' link becomes 'Update review' link. This follows in line with what the student sees while performing a review. Similarly, just like students instructor would not able to edit the review once submitted. Instructor can update it till the final submission deadline passes.&lt;br /&gt;
&lt;br /&gt;
[[File:Latest_screen_instructor.JPG]]&lt;br /&gt;
[[File:Ins_TA_Review.png]]&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Add the instructor review in ''Your Scores'' table in case he has reviewed your work. Provide an icon to highlight the special nature of an instructors review.'''&lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''Assets: ''' ''app/assets/stylesheets/grades.scss'' - Icon to make an instructor's review distinct from other reviews&lt;br /&gt;
* '''View: ''' ''app/views/grades/view_team.html.erb'' - To modify the &amp;quot;Your scores&amp;quot; page to include an icon next to the peer review score indicating that the instructor's score is not included in the final peer review score.&lt;br /&gt;
* '''Models: ''' &lt;br /&gt;
** ''app/models/answer.rb'' - Method: compute_scores | Modification in logic to ensure instructor review scores are not counted in the overall score of the student.&lt;br /&gt;
** ''app/models/vm_question_response_score_cell.rb'' - Included a new variable called 'is_instructor_review' to identify an instructor review&lt;br /&gt;
** ''app/models/vm_question_response_row.rb'' - Change in average_score_for_row method to not include an instructor review score&lt;br /&gt;
** ''app/models/vm_question_response.rb'' - Modified the add_answer method to include the is_instructor_review to each row_score object&lt;br /&gt;
&lt;br /&gt;
A student should be able to make out if an instructor has reviewed his/his team's work. In case the instructor performs a review on the team's work, there will be an icon next to the instructor's review along with explicitly stating that it is an 'Instructor review'.&lt;br /&gt;
The average peer review score for the team has been modified to exclude the instructor's scores. Same has been taken into account for the average score calculated for each row.&lt;br /&gt;
&lt;br /&gt;
[[File:Score_hover.png]]&lt;br /&gt;
&lt;br /&gt;
Like shown in the above picture we can see a info button on which if we hover the text is shown.&lt;br /&gt;
&lt;br /&gt;
Possible icons :&lt;br /&gt;
 [[File:Instuctor.jpg]]  [[File:Instructor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
We added a test for a method '''add_instructor_as_review'''.&lt;br /&gt;
&lt;br /&gt;
1.Created a stub and mock to find the assignment team. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock:&lt;br /&gt;
let(:team) { double('AssignmentTeam', name: 'no one', id: 1, parent_id: 1) }&lt;br /&gt;
&lt;br /&gt;
Stub: &lt;br /&gt;
allow(AssignmentTeam).to receive(:find).with('1').and_return(team)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.Created a stub and mock to map the review with their response in ReviewResponseMap.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock: &lt;br /&gt;
let(:review_response_map) do double('ReviewResponseMap', id: 1, map_id: 1, assignment: assignment,reviewer: double('Participant', id: 1, name: 'reviewer'), reviewee: double('Participant', id: 2, name: 'reviewee'))  end&lt;br /&gt;
&lt;br /&gt;
Stub:&lt;br /&gt;
allow(ReviewResponseMap).to receive_message_chain(:where, :first).with(reviewee_id: 1, course_staff: true, reviewed_object_id: '1').with(no_args).and_return(nil)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3.Created a stub and mock to add current user as a participant in the assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock:&lt;br /&gt;
allow(AssignmentParticipant).to receive(:create).with(parent_id: 1, user_id: 1, can_submit: false, can_review: true, can_take_quiz: false, handle: 'handle').and_return(reviewer)&lt;br /&gt;
&lt;br /&gt;
Stub:&lt;br /&gt;
let(:participant) { double('AssignmentParticipant', id: 1, can_review: false, user: double('User', id: 1)) }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We use the above-mentioned stubs and mocks to test the following scenarios:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1. context 'when there is no response map and no reviewer'&lt;br /&gt;
2. context 'when there is a reviewer'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using a similar approach we tested '''select_reviewer''' function. After running the above test, we found out that all the test cases passed resulting in '''''71%''''' coverage of review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
== '''Team''' ==&lt;br /&gt;
'''Members : '''&lt;br /&gt;
Harsh Shah, &lt;br /&gt;
Prachi Gupta, &lt;br /&gt;
Ramkumaar Kovil Kanthadai, &lt;br /&gt;
Raveena D'Costa.&lt;br /&gt;
&lt;br /&gt;
'''Mentor :''' Dr.Edward Gehringer&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Pull Request&lt;br /&gt;
* https://github.com/expertiza/expertiza/pull/1304&lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121597</id>
		<title>CSC/ECE 517 Fall 2018/E1855 let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121597"/>
		<updated>2018-12-18T06:11:48Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
The way Expertiza is set up right now is that only peers can review your work. However, there are cases when the course staff (Instructor/ TAs) would want to submit reviews as well. This project aims to implement this feature by allowing course staff to review the project on the same metrics as other students who review the project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
The current system does not allow instructors to submit reviews of student work. We will work upon the feature which will let them review using the same review form that students use to do reviews.&lt;br /&gt;
&lt;br /&gt;
=== Current scenario ===&lt;br /&gt;
&lt;br /&gt;
This is how some of the pages we are concerned with, currently look.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Submissions page for an assignment in Instructor View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Submissions_instr.jpeg | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A typical Scores table in a Student View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Grades_view_team_current.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions and Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
Following changes will be made to let staff perform reviews as well:&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Add a way for the instructors to perform a review.'''&lt;br /&gt;
&lt;br /&gt;
We have implemented links to ''Begin review'', ''Edit review'','' View review'' and ''Submit review'' in the assignment submissions view. &lt;br /&gt;
When the instructor/TA reviews a work for the first time, he/she is added as a participant and a review response mapping is created. &lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''View: ''' ''app/views/assignments/list_submissions.html.erb'' - To add links in the instructor view&lt;br /&gt;
* '''Controller: ''' ''app/controllers/review_mapping_controller.rb''  - Method: add_instructor_as_reviewer&lt;br /&gt;
  &lt;br /&gt;
In the second case, we can see a 'Begin review' link. This is the initial state when instructor review has not been added to the submission.&lt;br /&gt;
Once the instructor adds a review and submits it, we can see the 'Update review' link. If the deadline has passed, Update Review will change to View Review. In case he just saves the review, an 'Edit review' link will appear.&lt;br /&gt;
If the review deadline of one round is passed, the 'Edit review' link becomes 'Update review' link. This follows in line with what the student sees while performing a review. Similarly, just like students instructor would not able to edit the review once submitted. Instructor can update it till the final submission deadline passes.&lt;br /&gt;
&lt;br /&gt;
[[File:Latest_screen_instructor.JPG]]&lt;br /&gt;
[[File:Ins_TA_Review.png]]&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Add the instructor review in ''Your Scores'' table in case he has reviewed your work. Provide an icon to highlight the special nature of an instructors review.'''&lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''Assets: ''' ''app/assets/stylesheets/grades.scss'' - Icon to make an instructor's review distinct from other reviews&lt;br /&gt;
* '''View: ''' ''app/views/grades/view_team.html.erb'' - To modify the &amp;quot;Your scores&amp;quot; page to include an icon next to the peer review score indicating that the instructor's score is not included in the final peer review score.&lt;br /&gt;
* '''Models: ''' &lt;br /&gt;
** ''app/models/answer.rb'' - Method: compute_scores | Modification in logic to ensure instructor review scores are not counted in the overall score of the student.&lt;br /&gt;
** ''app/models/vm_question_response_score_cell.rb'' - Included a new variable called 'is_instructor_review' to identify an instructor review&lt;br /&gt;
** ''app/models/vm_question_response_row.rb'' - Change in average_score_for_row method to not include an instructor review score&lt;br /&gt;
** ''app/models/vm_question_response.rb'' - Modified the add_answer method to include the is_instructor_review to each row_score object&lt;br /&gt;
&lt;br /&gt;
A student should be able to make out if an instructor has reviewed his/his team's work. In case the instructor performs a review on the team's work, there will be an icon next to the instructor's review along with explicitly stating that it is an 'Instructor review'.&lt;br /&gt;
The average peer review score for the team has been modified to exclude the instructor's scores. Same has been taken into account for the average score calculated for each row.&lt;br /&gt;
&lt;br /&gt;
[[File:Score_hover.png]]&lt;br /&gt;
&lt;br /&gt;
Like shown in the above picture we can see a info button on which if we hover the text is shown.&lt;br /&gt;
&lt;br /&gt;
Possible icons :&lt;br /&gt;
 [[File:Instuctor.jpg]]  [[File:Instructor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
We added a test for a new method add_instructor_as_review&lt;br /&gt;
&lt;br /&gt;
1.Created a stub and mock to find the assignment team &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock:&lt;br /&gt;
let(:team) { double('AssignmentTeam', name: 'no one', id: 1, parent_id: 1) }&lt;br /&gt;
&lt;br /&gt;
Stub: &lt;br /&gt;
allow(AssignmentTeam).to receive(:find).with('1').and_return(team)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.Created a sub and mock to map the review with their response in ReviewResponseMap&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock: &lt;br /&gt;
let(:review_response_map) do double('ReviewResponseMap', id: 1, map_id: 1, assignment: assignment,reviewer: double('Participant', id: 1, name: 'reviewer'), reviewee: double('Participant', id: 2, name: 'reviewee'))  end&lt;br /&gt;
&lt;br /&gt;
Stub:&lt;br /&gt;
allow(ReviewResponseMap).to receive_message_chain(:where, :first).with(reviewee_id: 1, course_staff: true, reviewed_object_id: '1').with(no_args).and_return(nil)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3.Created a stub and mock to add current user as a participant in the assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock:&lt;br /&gt;
allow(AssignmentParticipant).to receive(:create).with(parent_id: 1, user_id: 1, can_submit: false, can_review: true, can_take_quiz: false, handle: 'handle').and_return(reviewer)&lt;br /&gt;
&lt;br /&gt;
Stub:&lt;br /&gt;
let(:participant) { double('AssignmentParticipant', id: 1, can_review: false, user: double('User', id: 1)) }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We use the above-mentioned stubs and mocks to test the following scenarios:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1. context 'when there is no response map and no reviewer'&lt;br /&gt;
2. context 'when there is a reviewer'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Using a similar approach we tested select_reviewer function. After running the above test, we found out that all the test cases passed resulting in '''''71%''''' coverage of review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
== '''Team''' ==&lt;br /&gt;
'''Members : '''&lt;br /&gt;
Harsh Shah, &lt;br /&gt;
Prachi Gupta, &lt;br /&gt;
Ramkumaar Kovil Kanthadai, &lt;br /&gt;
Raveena D'Costa.&lt;br /&gt;
&lt;br /&gt;
'''Mentor :''' Dr.Edward Gehringer&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Pull Request&lt;br /&gt;
* https://github.com/expertiza/expertiza/pull/1304&lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121596</id>
		<title>CSC/ECE 517 Fall 2018/E1855 let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121596"/>
		<updated>2018-12-18T05:45:52Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
The way Expertiza is set up right now is that only peers can review your work. However, there are cases when the course staff (Instructor/ TAs) would want to submit reviews as well. This project aims to implement this feature by allowing course staff to review the project on the same metrics as other students who review the project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
The current system does not allow instructors to submit reviews of student work. We will work upon the feature which will let them review using the same review form that students use to do reviews.&lt;br /&gt;
&lt;br /&gt;
=== Current scenario ===&lt;br /&gt;
&lt;br /&gt;
This is how some of the pages we are concerned with, currently look.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Submissions page for an assignment in Instructor View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Submissions_instr.jpeg | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A typical Scores table in a Student View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Grades_view_team_current.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions and Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
Following changes will be made to let staff perform reviews as well:&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Add a way for the instructors to perform a review.'''&lt;br /&gt;
&lt;br /&gt;
We have implemented links to ''Begin review'', ''Edit review'','' View review'' and ''Submit review'' in the assignment submissions view. &lt;br /&gt;
When the instructor/TA reviews a work for the first time, he/she is added as a participant and a review response mapping is created. &lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''View: ''' ''app/views/assignments/list_submissions.html.erb'' - To add links in the instructor view&lt;br /&gt;
* '''Controller: ''' ''app/controllers/review_mapping_controller.rb''  - Method: add_instructor_as_reviewer&lt;br /&gt;
  &lt;br /&gt;
In the second case, we can see a 'Begin review' link. This is the initial state when instructor review has not been added to the submission.&lt;br /&gt;
Once the instructor adds a review and submits it, we can see the 'Update review' link. If the deadline has passed, Update Review will change to View Review. In case he just saves the review, an 'Edit review' link will appear.&lt;br /&gt;
If the review deadline of one round is passed, the 'Edit review' link becomes 'Update review' link. This follows in line with what the student sees while performing a review. Similarly, just like students instructor would not able to edit the review once submitted. Instructor can update it till the final submission deadline passes.&lt;br /&gt;
&lt;br /&gt;
[[File:Latest_screen_instructor.JPG]]&lt;br /&gt;
[[File:Ins_TA_Review.png]]&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Add the instructor review in ''Your Scores'' table in case he has reviewed your work. Provide an icon to highlight the special nature of an instructors review.'''&lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''Assets: ''' ''app/assets/stylesheets/grades.scss'' - Icon to make an instructor's review distinct from other reviews&lt;br /&gt;
* '''View: ''' ''app/views/grades/view_team.html.erb'' - To modify the &amp;quot;Your scores&amp;quot; page to include an icon next to the peer review score indicating that the instructor's score is not included in the final peer review score.&lt;br /&gt;
* '''Models: ''' &lt;br /&gt;
** ''app/models/answer.rb'' - Method: compute_scores | Modification in logic to ensure instructor review scores are not counted in the overall score of the student.&lt;br /&gt;
** ''app/models/vm_question_response_score_cell.rb'' - Included a new variable called 'is_instructor_review' to identify an instructor review&lt;br /&gt;
** ''app/models/vm_question_response_row.rb'' - Change in average_score_for_row method to not include an instructor review score&lt;br /&gt;
** ''app/models/vm_question_response.rb'' - Modified the add_answer method to include the is_instructor_review to each row_score object&lt;br /&gt;
&lt;br /&gt;
A student should be able to make out if an instructor has reviewed his/his team's work. In case the instructor performs a review on the team's work, there will be an icon next to the instructor's review along with explicitly stating that it is an 'Instructor review'.&lt;br /&gt;
The average peer review score for the team has been modified to exclude the instructor's scores. Same has been taken into account for the average score calculated for each row.&lt;br /&gt;
&lt;br /&gt;
[[File:Score_hover.png]]&lt;br /&gt;
&lt;br /&gt;
Like shown in the above picture we can see a info button on which if we hover the text is shown.&lt;br /&gt;
&lt;br /&gt;
Possible icons :&lt;br /&gt;
 [[File:Instuctor.jpg]]  [[File:Instructor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
We added a test for a new method add_instructor_as_review&lt;br /&gt;
&lt;br /&gt;
1.Created a stub and mock to find the assignment team &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock:&lt;br /&gt;
let(:team) { double('AssignmentTeam', name: 'no one', id: 1, parent_id: 1) }&lt;br /&gt;
&lt;br /&gt;
Stub: &lt;br /&gt;
allow(AssignmentTeam).to receive(:find).with('1').and_return(team)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.Created a sub and mock to map the review with their response in ReviewResponseMap&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock: &lt;br /&gt;
let(:review_response_map) do double('ReviewResponseMap', id: 1, map_id: 1, assignment: assignment,reviewer: double('Participant', id: 1, name: 'reviewer'), reviewee: double('Participant', id: 2, name: 'reviewee'))  end&lt;br /&gt;
&lt;br /&gt;
Stub:&lt;br /&gt;
allow(ReviewResponseMap).to receive_message_chain(:where, :first).with(reviewee_id: 1, course_staff: true, reviewed_object_id: '1').with(no_args).and_return(nil)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3.Created a stub and mock to add current user as a participant in the assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock:&lt;br /&gt;
allow(AssignmentParticipant).to receive(:create).with(parent_id: 1, user_id: 1, can_submit: false, can_review: true, can_take_quiz: false, handle: 'handle').and_return(reviewer)&lt;br /&gt;
&lt;br /&gt;
Stub:&lt;br /&gt;
let(:participant) { double('AssignmentParticipant', id: 1, can_review: false, user: double('User', id: 1)) }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We use the above-mentioned stubs and mocks to test the following scenarios:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1. context 'when there is no response map and no reviewer'&lt;br /&gt;
2. context 'when there is a reviewer'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
After running the above test, we found out that all the test cases passed resulting in '''''71%''''' coverage of review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
== '''Team''' ==&lt;br /&gt;
'''Members : '''&lt;br /&gt;
Harsh Shah, &lt;br /&gt;
Prachi Gupta, &lt;br /&gt;
Ramkumaar Kovil Kanthadai, &lt;br /&gt;
Raveena D'Costa.&lt;br /&gt;
&lt;br /&gt;
'''Mentor :''' Dr.Edward Gehringer&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Pull Request&lt;br /&gt;
* https://github.com/expertiza/expertiza/pull/1304&lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121595</id>
		<title>CSC/ECE 517 Fall 2018/E1855 let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121595"/>
		<updated>2018-12-18T05:42:50Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
The way Expertiza is set up right now is that only peers can review your work. However, there are cases when the course staff (Instructor/ TAs) would want to submit reviews as well. This project aims to implement this feature by allowing course staff to review the project on the same metrics as other students who review the project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
The current system does not allow instructors to submit reviews of student work. We will work upon the feature which will let them review using the same review form that students use to do reviews.&lt;br /&gt;
&lt;br /&gt;
=== Current scenario ===&lt;br /&gt;
&lt;br /&gt;
This is how some of the pages we are concerned with, currently look.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Submissions page for an assignment in Instructor View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Submissions_instr.jpeg | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A typical Scores table in a Student View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Grades_view_team_current.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions and Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
Following changes will be made to let staff perform reviews as well:&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Add a way for the instructors to perform a review.'''&lt;br /&gt;
&lt;br /&gt;
We have implemented links to ''Begin review'', ''Edit review'','' View review'' and ''Submit review'' in the assignment submissions view. &lt;br /&gt;
When the instructor/TA reviews a work for the first time, he/she is added as a participant and a review response mapping is created. &lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''View: ''' ''app/views/assignments/list_submissions.html.erb'' - To add links in the instructor view&lt;br /&gt;
* '''Controller: ''' ''app/controllers/review_mapping_controller.rb''  - Method: add_instructor_as_reviewer&lt;br /&gt;
  &lt;br /&gt;
In the second case, we can see a 'Begin review' link. This is the initial state when instructor review has not been added to the submission.&lt;br /&gt;
Once the instructor adds a review and submits it, we can see the 'Update review' link. If the deadline has passed, Update Review will change to View Review. In case he just saves the review, an 'Edit review' link will appear.&lt;br /&gt;
If the review deadline of one round is passed, the 'Edit review' link becomes 'Update review' link. This follows in line with what the student sees while performing a review. Similarly, just like students instructor would not able to edit the review once submitted. Instructor can update it till the final submission deadline passes.&lt;br /&gt;
&lt;br /&gt;
[[File:Latest_screen_instructor.JPG]]&lt;br /&gt;
[[File:Ins_TA_Review.png]]&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Add the instructor review in ''Your Scores'' table in case he has reviewed your work. Provide an icon to highlight the special nature of an instructors review.'''&lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''Assets: ''' ''app/assets/stylesheets/grades.scss'' - Icon to make an instructor's review distinct from other reviews&lt;br /&gt;
* '''View: ''' ''app/views/grades/view_team.html.erb'' - To modify the &amp;quot;Your scores&amp;quot; page to include an icon next to the peer review score indicating that the instructor's score is not included in the final peer review score.&lt;br /&gt;
* '''Models: ''' &lt;br /&gt;
** ''app/models/answer.rb'' - Method: compute_scores | Modification in logic to ensure instructor review scores are not counted in the overall score of the student.&lt;br /&gt;
** ''app/models/vm_question_response_score_cell.rb'' - Included a new variable called 'is_instructor_review' to identify an instructor review&lt;br /&gt;
** ''app/models/vm_question_response_row.rb'' - Change in average_score_for_row method to not include an instructor review score&lt;br /&gt;
** ''app/models/vm_question_response.rb'' - Modified the add_answer method to include the is_instructor_review to each row_score object&lt;br /&gt;
&lt;br /&gt;
A student should be able to make out if an instructor has reviewed his/his team's work. In case the instructor performs a review on the team's work, there will be an icon next to the instructor's review along with explicitly stating that it is an 'Instructor review'.&lt;br /&gt;
The average peer review score for the team has been modified to exclude the instructor's scores. Same has been taken into account for the average score calculated for each row.&lt;br /&gt;
&lt;br /&gt;
[[File:Score_hover.png]]&lt;br /&gt;
&lt;br /&gt;
Like shown in the above picture we can see a info button on which if we hover the text is shown.&lt;br /&gt;
&lt;br /&gt;
Possible icons :&lt;br /&gt;
 [[File:Instuctor.jpg]]  [[File:Instructor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
We added a test for a new method add_instructor_as_review&lt;br /&gt;
&lt;br /&gt;
1.Created a stub and mock to find the assignment team &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock:&lt;br /&gt;
let(:team) { double('AssignmentTeam', name: 'no one', id: 1, parent_id: 1) }&lt;br /&gt;
&lt;br /&gt;
Stub: &lt;br /&gt;
allow(AssignmentTeam).to receive(:find).with('1').and_return(team)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.Created a sub and mock to map the review with their response in ReviewResponseMap&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock: &lt;br /&gt;
let(:review_response_map) do double('ReviewResponseMap', id: 1, map_id: 1, assignment: assignment,reviewer: double('Participant', id: 1, name: 'reviewer'), reviewee: double('Participant', id: 2, name: 'reviewee'))  end&lt;br /&gt;
&lt;br /&gt;
Stub:&lt;br /&gt;
allow(ReviewResponseMap).to receive_message_chain(:where, :first).with(reviewee_id: 1, course_staff: true, reviewed_object_id: '1').with(no_args).and_return(nil)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3.Created a stub and mock to add current user as a participant in the assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock:&lt;br /&gt;
allow(AssignmentParticipant).to receive(:create).with(parent_id: 1, user_id: 1, can_submit: false, can_review: true, can_take_quiz: false, handle: 'handle').and_return(reviewer)&lt;br /&gt;
&lt;br /&gt;
Stub:&lt;br /&gt;
let(:participant) { double('AssignmentParticipant', id: 1, can_review: false, user: double('User', id: 1)) }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We use the above-mentioned stubs and mocks to test the following scenarios:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
1. context 'when there is no response map and no reviewer'&lt;br /&gt;
2. context 'when there is a reviewer'&lt;br /&gt;
&lt;br /&gt;
After running the above test, we found out that all the test cases passed resulting in '''''71%''''' coverage of review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
== '''Team''' ==&lt;br /&gt;
'''Members : '''&lt;br /&gt;
Harsh Shah, &lt;br /&gt;
Prachi Gupta, &lt;br /&gt;
Ramkumaar Kovil Kanthadai, &lt;br /&gt;
Raveena D'Costa.&lt;br /&gt;
&lt;br /&gt;
'''Mentor :''' Dr.Edward Gehringer&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Pull Request&lt;br /&gt;
* https://github.com/expertiza/expertiza/pull/1304&lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121594</id>
		<title>CSC/ECE 517 Fall 2018/E1855 let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121594"/>
		<updated>2018-12-18T05:41:46Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
The way Expertiza is set up right now is that only peers can review your work. However, there are cases when the course staff (Instructor/ TAs) would want to submit reviews as well. This project aims to implement this feature by allowing course staff to review the project on the same metrics as other students who review the project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
The current system does not allow instructors to submit reviews of student work. We will work upon the feature which will let them review using the same review form that students use to do reviews.&lt;br /&gt;
&lt;br /&gt;
=== Current scenario ===&lt;br /&gt;
&lt;br /&gt;
This is how some of the pages we are concerned with, currently look.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Submissions page for an assignment in Instructor View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Submissions_instr.jpeg | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A typical Scores table in a Student View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Grades_view_team_current.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions and Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
Following changes will be made to let staff perform reviews as well:&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Add a way for the instructors to perform a review.'''&lt;br /&gt;
&lt;br /&gt;
We have implemented links to ''Begin review'', ''Edit review'','' View review'' and ''Submit review'' in the assignment submissions view. &lt;br /&gt;
When the instructor/TA reviews a work for the first time, he/she is added as a participant and a review response mapping is created. &lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''View: ''' ''app/views/assignments/list_submissions.html.erb'' - To add links in the instructor view&lt;br /&gt;
* '''Controller: ''' ''app/controllers/review_mapping_controller.rb''  - Method: add_instructor_as_reviewer&lt;br /&gt;
  &lt;br /&gt;
In the second case, we can see a 'Begin review' link. This is the initial state when instructor review has not been added to the submission.&lt;br /&gt;
Once the instructor adds a review and submits it, we can see the 'Update review' link. If the deadline has passed, Update Review will change to View Review. In case he just saves the review, an 'Edit review' link will appear.&lt;br /&gt;
If the review deadline of one round is passed, the 'Edit review' link becomes 'Update review' link. This follows in line with what the student sees while performing a review. Similarly, just like students instructor would not able to edit the review once submitted. Instructor can update it till the final submission deadline passes.&lt;br /&gt;
&lt;br /&gt;
[[File:Latest_screen_instructor.JPG]]&lt;br /&gt;
[[File:Ins_TA_Review.png]]&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Add the instructor review in ''Your Scores'' table in case he has reviewed your work. Provide an icon to highlight the special nature of an instructors review.'''&lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''Assets: ''' ''app/assets/stylesheets/grades.scss'' - Icon to make an instructor's review distinct from other reviews&lt;br /&gt;
* '''View: ''' ''app/views/grades/view_team.html.erb'' - To modify the &amp;quot;Your scores&amp;quot; page to include an icon next to the peer review score indicating that the instructor's score is not included in the final peer review score.&lt;br /&gt;
* '''Models: ''' &lt;br /&gt;
** ''app/models/answer.rb'' - Method: compute_scores | Modification in logic to ensure instructor review scores are not counted in the overall score of the student.&lt;br /&gt;
** ''app/models/vm_question_response_score_cell.rb'' - Included a new variable called 'is_instructor_review' to identify an instructor review&lt;br /&gt;
** ''app/models/vm_question_response_row.rb'' - Change in average_score_for_row method to not include an instructor review score&lt;br /&gt;
** ''app/models/vm_question_response.rb'' - Modified the add_answer method to include the is_instructor_review to each row_score object&lt;br /&gt;
&lt;br /&gt;
A student should be able to make out if an instructor has reviewed his/his team's work. In case the instructor performs a review on the team's work, there will be an icon next to the instructor's review along with explicitly stating that it is an 'Instructor review'.&lt;br /&gt;
The average peer review score for the team has been modified to exclude the instructor's scores. Same has been taken into account for the average score calculated for each row.&lt;br /&gt;
&lt;br /&gt;
[[File:Score_hover.png]]&lt;br /&gt;
&lt;br /&gt;
Like shown in the above picture we can see a info button on which if we hover the text is shown.&lt;br /&gt;
&lt;br /&gt;
Possible icons :&lt;br /&gt;
 [[File:Instuctor.jpg]]  [[File:Instructor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
We added a test for a new method add_instructor_as_review&lt;br /&gt;
&lt;br /&gt;
1.Created a stub and mock to find the assignment team &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock:&lt;br /&gt;
let(:team) { double('AssignmentTeam', name: 'no one', id: 1, parent_id: 1) }&lt;br /&gt;
&lt;br /&gt;
Stub: &lt;br /&gt;
allow(AssignmentTeam).to receive(:find).with('1').and_return(team)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.Created a sub and mock to map the review with their response in ReviewResponseMap&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock: &lt;br /&gt;
let(:review_response_map) do double('ReviewResponseMap', id: 1, map_id: 1, assignment: assignment,reviewer: double('Participant', id: 1, name: 'reviewer'), reviewee: double('Participant', id: 2, name: 'reviewee'))  end&lt;br /&gt;
&lt;br /&gt;
Stub:&lt;br /&gt;
allow(ReviewResponseMap).to receive_message_chain(:where, :first).with(reviewee_id: 1, course_staff: true, reviewed_object_id: '1').with(no_args).and_return(nil)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3.Created a stub and mock to add current user as a participant in the assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock:&lt;br /&gt;
allow(AssignmentParticipant).to receive(:create).with(parent_id: 1, user_id: 1, can_submit: false, can_review: true, can_take_quiz: false, handle: 'handle').and_return(reviewer)&lt;br /&gt;
&lt;br /&gt;
Stub:&lt;br /&gt;
let(:participant) { double('AssignmentParticipant', id: 1, can_review: false, user: double('User', id: 1)) }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We use the above-mentioned stubs and mocks to test the following scenarios:&lt;br /&gt;
# 'when there is no response map and no reviewer'&lt;br /&gt;
# 'when there is a reviewer'&lt;br /&gt;
&lt;br /&gt;
After running the above test, we found out that all the test cases passed resulting in ''71%'' coverage of review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
== '''Team''' ==&lt;br /&gt;
'''Members : '''&lt;br /&gt;
Harsh Shah, &lt;br /&gt;
Prachi Gupta, &lt;br /&gt;
Ramkumaar Kovil Kanthadai, &lt;br /&gt;
Raveena D'Costa.&lt;br /&gt;
&lt;br /&gt;
'''Mentor :''' Dr.Edward Gehringer&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Pull Request&lt;br /&gt;
* https://github.com/expertiza/expertiza/pull/1304&lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121593</id>
		<title>CSC/ECE 517 Fall 2018/E1855 let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121593"/>
		<updated>2018-12-18T05:41:17Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
The way Expertiza is set up right now is that only peers can review your work. However, there are cases when the course staff (Instructor/ TAs) would want to submit reviews as well. This project aims to implement this feature by allowing course staff to review the project on the same metrics as other students who review the project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
The current system does not allow instructors to submit reviews of student work. We will work upon the feature which will let them review using the same review form that students use to do reviews.&lt;br /&gt;
&lt;br /&gt;
=== Current scenario ===&lt;br /&gt;
&lt;br /&gt;
This is how some of the pages we are concerned with, currently look.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Submissions page for an assignment in Instructor View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Submissions_instr.jpeg | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A typical Scores table in a Student View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Grades_view_team_current.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions and Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
Following changes will be made to let staff perform reviews as well:&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Add a way for the instructors to perform a review.'''&lt;br /&gt;
&lt;br /&gt;
We have implemented links to ''Begin review'', ''Edit review'','' View review'' and ''Submit review'' in the assignment submissions view. &lt;br /&gt;
When the instructor/TA reviews a work for the first time, he/she is added as a participant and a review response mapping is created. &lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''View: ''' ''app/views/assignments/list_submissions.html.erb'' - To add links in the instructor view&lt;br /&gt;
* '''Controller: ''' ''app/controllers/review_mapping_controller.rb''  - Method: add_instructor_as_reviewer&lt;br /&gt;
  &lt;br /&gt;
In the second case, we can see a 'Begin review' link. This is the initial state when instructor review has not been added to the submission.&lt;br /&gt;
Once the instructor adds a review and submits it, we can see the 'Update review' link. If the deadline has passed, Update Review will change to View Review. In case he just saves the review, an 'Edit review' link will appear.&lt;br /&gt;
If the review deadline of one round is passed, the 'Edit review' link becomes 'Update review' link. This follows in line with what the student sees while performing a review. Similarly, just like students instructor would not able to edit the review once submitted. Instructor can update it till the final submission deadline passes.&lt;br /&gt;
&lt;br /&gt;
[[File:Latest_screen_instructor.JPG]]&lt;br /&gt;
[[File:Ins_TA_Review.png]]&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Add the instructor review in ''Your Scores'' table in case he has reviewed your work. Provide an icon to highlight the special nature of an instructors review.'''&lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''Assets: ''' ''app/assets/stylesheets/grades.scss'' - Icon to make an instructor's review distinct from other reviews&lt;br /&gt;
* '''View: ''' ''app/views/grades/view_team.html.erb'' - To modify the &amp;quot;Your scores&amp;quot; page to include an icon next to the peer review score indicating that the instructor's score is not included in the final peer review score.&lt;br /&gt;
* '''Models: ''' &lt;br /&gt;
** ''app/models/answer.rb'' - Method: compute_scores | Modification in logic to ensure instructor review scores are not counted in the overall score of the student.&lt;br /&gt;
** ''app/models/vm_question_response_score_cell.rb'' - Included a new variable called 'is_instructor_review' to identify an instructor review&lt;br /&gt;
** ''app/models/vm_question_response_row.rb'' - Change in average_score_for_row method to not include an instructor review score&lt;br /&gt;
** ''app/models/vm_question_response.rb'' - Modified the add_answer method to include the is_instructor_review to each row_score object&lt;br /&gt;
&lt;br /&gt;
A student should be able to make out if an instructor has reviewed his/his team's work. In case the instructor performs a review on the team's work, there will be an icon next to the instructor's review along with explicitly stating that it is an 'Instructor review'.&lt;br /&gt;
The average peer review score for the team has been modified to exclude the instructor's scores. Same has been taken into account for the average score calculated for each row.&lt;br /&gt;
&lt;br /&gt;
[[File:Score_hover.png]]&lt;br /&gt;
&lt;br /&gt;
Like shown in the above picture we can see a info button on which if we hover the text is shown.&lt;br /&gt;
&lt;br /&gt;
Possible icons :&lt;br /&gt;
 [[File:Instuctor.jpg]]  [[File:Instructor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
We added a test for a new method add_instructor_as_review&lt;br /&gt;
&lt;br /&gt;
1.Created a stub and mock to find the assignment team &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock:&lt;br /&gt;
let(:team) { double('AssignmentTeam', name: 'no one', id: 1, parent_id: 1) }&lt;br /&gt;
&lt;br /&gt;
Stub: &lt;br /&gt;
allow(AssignmentTeam).to receive(:find).with('1').and_return(team)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.Created a sub and mock to map the review with their response in ReviewResponseMap&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock: &lt;br /&gt;
let(:review_response_map) do double('ReviewResponseMap', id: 1, map_id: 1, assignment: assignment,reviewer: double('Participant', id: 1, name: 'reviewer'), reviewee: double('Participant', id: 2, name: 'reviewee'))  end&lt;br /&gt;
&lt;br /&gt;
Stub:&lt;br /&gt;
allow(ReviewResponseMap).to receive_message_chain(:where, :first).with(reviewee_id: 1, course_staff: true, reviewed_object_id: '1').with(no_args).and_return(nil)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3.Created a stub and mock to add current user as a participant in the assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock:&lt;br /&gt;
allow(AssignmentParticipant).to receive(:create).with(parent_id: 1, user_id: 1, can_submit: false, can_review: true, can_take_quiz: false, handle: 'handle').and_return(reviewer)&lt;br /&gt;
&lt;br /&gt;
Stub:&lt;br /&gt;
let(:participant) { double('AssignmentParticipant', id: 1, can_review: false, user: double('User', id: 1)) }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We use the above-mentioned stubs and mocks to test the following scenarios:&lt;br /&gt;
# 'when there is no response map and no reviewer'&lt;br /&gt;
# 'when there is a reviewer'&lt;br /&gt;
&lt;br /&gt;
After running the above test, we found out that all the test cases passed resulting in 71% coverage of review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
== '''Team''' ==&lt;br /&gt;
'''Members : '''&lt;br /&gt;
Harsh Shah, &lt;br /&gt;
Prachi Gupta, &lt;br /&gt;
Ramkumaar Kovil Kanthadai, &lt;br /&gt;
Raveena D'Costa.&lt;br /&gt;
&lt;br /&gt;
'''Mentor :''' Dr.Edward Gehringer&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Pull Request&lt;br /&gt;
* https://github.com/expertiza/expertiza/pull/1304&lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121592</id>
		<title>CSC/ECE 517 Fall 2018/E1855 let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121592"/>
		<updated>2018-12-18T05:40:27Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
The way Expertiza is set up right now is that only peers can review your work. However, there are cases when the course staff (Instructor/ TAs) would want to submit reviews as well. This project aims to implement this feature by allowing course staff to review the project on the same metrics as other students who review the project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
The current system does not allow instructors to submit reviews of student work. We will work upon the feature which will let them review using the same review form that students use to do reviews.&lt;br /&gt;
&lt;br /&gt;
=== Current scenario ===&lt;br /&gt;
&lt;br /&gt;
This is how some of the pages we are concerned with, currently look.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Submissions page for an assignment in Instructor View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Submissions_instr.jpeg | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A typical Scores table in a Student View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Grades_view_team_current.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions and Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
Following changes will be made to let staff perform reviews as well:&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Add a way for the instructors to perform a review.'''&lt;br /&gt;
&lt;br /&gt;
We have implemented links to ''Begin review'', ''Edit review'','' View review'' and ''Submit review'' in the assignment submissions view. &lt;br /&gt;
When the instructor/TA reviews a work for the first time, he/she is added as a participant and a review response mapping is created. &lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''View: ''' ''app/views/assignments/list_submissions.html.erb'' - To add links in the instructor view&lt;br /&gt;
* '''Controller: ''' ''app/controllers/review_mapping_controller.rb''  - Method: add_instructor_as_reviewer&lt;br /&gt;
  &lt;br /&gt;
In the second case, we can see a 'Begin review' link. This is the initial state when instructor review has not been added to the submission.&lt;br /&gt;
Once the instructor adds a review and submits it, we can see the 'Update review' link. If the deadline has passed, Update Review will change to View Review. In case he just saves the review, an 'Edit review' link will appear.&lt;br /&gt;
If the review deadline of one round is passed, the 'Edit review' link becomes 'Update review' link. This follows in line with what the student sees while performing a review. Similarly, just like students instructor would not able to edit the review once submitted. Instructor can update it till the final submission deadline passes.&lt;br /&gt;
&lt;br /&gt;
[[File:Latest_screen_instructor.JPG]]&lt;br /&gt;
[[File:Ins_TA_Review.png]]&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Add the instructor review in ''Your Scores'' table in case he has reviewed your work. Provide an icon to highlight the special nature of an instructors review.'''&lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''Assets: ''' ''app/assets/stylesheets/grades.scss'' - Icon to make an instructor's review distinct from other reviews&lt;br /&gt;
* '''View: ''' ''app/views/grades/view_team.html.erb'' - To modify the &amp;quot;Your scores&amp;quot; page to include an icon next to the peer review score indicating that the instructor's score is not included in the final peer review score.&lt;br /&gt;
* '''Models: ''' &lt;br /&gt;
** ''app/models/answer.rb'' - Method: compute_scores | Modification in logic to ensure instructor review scores are not counted in the overall score of the student.&lt;br /&gt;
** ''app/models/vm_question_response_score_cell.rb'' - Included a new variable called 'is_instructor_review' to identify an instructor review&lt;br /&gt;
** ''app/models/vm_question_response_row.rb'' - Change in average_score_for_row method to not include an instructor review score&lt;br /&gt;
** ''app/models/vm_question_response.rb'' - Modified the add_answer method to include the is_instructor_review to each row_score object&lt;br /&gt;
&lt;br /&gt;
A student should be able to make out if an instructor has reviewed his/his team's work. In case the instructor performs a review on the team's work, there will be an icon next to the instructor's review along with explicitly stating that it is an 'Instructor review'.&lt;br /&gt;
The average peer review score for the team has been modified to exclude the instructor's scores. Same has been taken into account for the average score calculated for each row.&lt;br /&gt;
&lt;br /&gt;
[[File:Score_hover.png]]&lt;br /&gt;
&lt;br /&gt;
Like shown in the above picture we can see a info button on which if we hover the text is shown.&lt;br /&gt;
&lt;br /&gt;
Possible icons :&lt;br /&gt;
 [[File:Instuctor.jpg]]  [[File:Instructor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
We added a test for a new method add_instructor_as_review&lt;br /&gt;
&lt;br /&gt;
1.Created a stub and mock to find the assignment team &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock:&lt;br /&gt;
let(:team) { double('AssignmentTeam', name: 'no one', id: 1, parent_id: 1) }&lt;br /&gt;
&lt;br /&gt;
Stub: &lt;br /&gt;
allow(AssignmentTeam).to receive(:find).with('1').and_return(team)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.Created a sub and mock to map the review with their response in ReviewResponseMap&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock: &lt;br /&gt;
let(:review_response_map) do double('ReviewResponseMap', id: 1, map_id: 1, assignment: assignment,reviewer: double('Participant', id: 1, name: 'reviewer'), reviewee: double('Participant', id: 2, name: 'reviewee'))  end&lt;br /&gt;
&lt;br /&gt;
Stub:&lt;br /&gt;
allow(ReviewResponseMap).to receive_message_chain(:where, :first).with(reviewee_id: 1, course_staff: true, reviewed_object_id: '1').with(no_args).and_return(nil)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3.Created a stub and mock to add current user as a participant in the assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock:&lt;br /&gt;
allow(AssignmentParticipant).to receive(:create).with(parent_id: 1, user_id: 1, can_submit: false, can_review: true, can_take_quiz: false, handle: 'handle').and_return(reviewer)&lt;br /&gt;
&lt;br /&gt;
Stub:&lt;br /&gt;
let(:participant) { double('AssignmentParticipant', id: 1, can_review: false, user: double('User', id: 1)) }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We use the above-mentioned stubs and mocks to test the following scenarios:&lt;br /&gt;
1.'when there is no response map and no reviewer'&lt;br /&gt;
2.'when there is a reviewer'&lt;br /&gt;
&lt;br /&gt;
After running the above test, we found out that all the test cases passed resulting in 71% coverage of review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
== '''Team''' ==&lt;br /&gt;
'''Members : '''&lt;br /&gt;
Harsh Shah, &lt;br /&gt;
Prachi Gupta, &lt;br /&gt;
Ramkumaar Kovil Kanthadai, &lt;br /&gt;
Raveena D'Costa.&lt;br /&gt;
&lt;br /&gt;
'''Mentor :''' Dr.Edward Gehringer&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Pull Request&lt;br /&gt;
* https://github.com/expertiza/expertiza/pull/1304&lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121591</id>
		<title>CSC/ECE 517 Fall 2018/E1855 let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121591"/>
		<updated>2018-12-18T05:23:00Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
The way Expertiza is set up right now is that only peers can review your work. However, there are cases when the course staff (Instructor/ TAs) would want to submit reviews as well. This project aims to implement this feature by allowing course staff to review the project on the same metrics as other students who review the project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
The current system does not allow instructors to submit reviews of student work. We will work upon the feature which will let them review using the same review form that students use to do reviews.&lt;br /&gt;
&lt;br /&gt;
=== Current scenario ===&lt;br /&gt;
&lt;br /&gt;
This is how some of the pages we are concerned with, currently look.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Submissions page for an assignment in Instructor View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Submissions_instr.jpeg | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A typical Scores table in a Student View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Grades_view_team_current.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions and Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
Following changes will be made to let staff perform reviews as well:&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Add a way for the instructors to perform a review.'''&lt;br /&gt;
&lt;br /&gt;
We have implemented links to ''Begin review'', ''Edit review'','' View review'' and ''Submit review'' in the assignment submissions view. &lt;br /&gt;
When the instructor/TA reviews a work for the first time, he/she is added as a participant and a review response mapping is created. &lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''View: ''' ''app/views/assignments/list_submissions.html.erb'' - To add links in the instructor view&lt;br /&gt;
* '''Controller: ''' ''app/controllers/review_mapping_controller.rb''  - Method: add_instructor_as_reviewer&lt;br /&gt;
  &lt;br /&gt;
In the second case, we can see a 'Begin review' link. This is the initial state when instructor review has not been added to the submission.&lt;br /&gt;
Once the instructor adds a review and submits it, we can see the 'Update review' link. If the deadline has passed, Update Review will change to View Review. In case he just saves the review, an 'Edit review' link will appear.&lt;br /&gt;
If the review deadline of one round is passed, the 'Edit review' link becomes 'Update review' link. This follows in line with what the student sees while performing a review. Similarly, just like students instructor would not able to edit the review once submitted. Instructor can update it till the final submission deadline passes.&lt;br /&gt;
&lt;br /&gt;
[[File:Latest_screen_instructor.JPG]]&lt;br /&gt;
[[File:Ins_TA_Review.png]]&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Add the instructor review in ''Your Scores'' table in case he has reviewed your work. Provide an icon to highlight the special nature of an instructors review.'''&lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''Assets: ''' ''app/assets/stylesheets/grades.scss'' - Icon to make an instructor's review distinct from other reviews&lt;br /&gt;
* '''View: ''' ''app/views/grades/view_team.html.erb'' - To modify the &amp;quot;Your scores&amp;quot; page to include an icon next to the peer review score indicating that the instructor's score is not included in the final peer review score.&lt;br /&gt;
* '''Models: ''' &lt;br /&gt;
** ''app/models/answer.rb'' - Method: compute_scores | Modification in logic to ensure instructor review scores are not counted in the overall score of the student.&lt;br /&gt;
** ''app/models/vm_question_response_score_cell.rb'' - Included a new variable called 'is_instructor_review' to identify an instructor review&lt;br /&gt;
** ''app/models/vm_question_response_row.rb'' - Change in average_score_for_row method to not include an instructor review score&lt;br /&gt;
** ''app/models/vm_question_response.rb'' - Modified the add_answer method to include the is_instructor_review to each row_score object&lt;br /&gt;
&lt;br /&gt;
A student should be able to make out if an instructor has reviewed his/his team's work. In case the instructor performs a review on the team's work, there will be an icon next to the instructor's review along with explicitly stating that it is an 'Instructor review'.&lt;br /&gt;
The average peer review score for the team has been modified to exclude the instructor's scores. Same has been taken into account for the average score calculated for each row.&lt;br /&gt;
&lt;br /&gt;
[[File:Score_hover.png]]&lt;br /&gt;
&lt;br /&gt;
Like shown in the above picture we can see a info button on which if we hover the text is shown.&lt;br /&gt;
&lt;br /&gt;
Possible icons :&lt;br /&gt;
 [[File:Instuctor.jpg]]  [[File:Instructor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
We added a test for a new method add_instructor_as_review&lt;br /&gt;
&lt;br /&gt;
1.Created a stub and mock to find the assignment team &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock:&lt;br /&gt;
let(:team) { double('AssignmentTeam', name: 'no one', id: 1, parent_id: 1) }&lt;br /&gt;
&lt;br /&gt;
Stub: &lt;br /&gt;
allow(AssignmentTeam).to receive(:find).with('1').and_return(team)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.Created a sub and mock to map the review with their response in ReviewResponseMap&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock: &lt;br /&gt;
let(:review_response_map) do double('ReviewResponseMap', id: 1, map_id: 1, assignment: assignment,reviewer: double('Participant', id: 1, name: 'reviewer'), reviewee: double('Participant', id: 2, name: 'reviewee'))  end&lt;br /&gt;
&lt;br /&gt;
Stub:&lt;br /&gt;
allow(ReviewResponseMap).to receive_message_chain(:where, :first).with(reviewee_id: 1, course_staff: true, reviewed_object_id: '1').with(no_args).and_return(nil)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3.Created a stub and mock to add current user as a participant in the assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock:&lt;br /&gt;
allow(AssignmentParticipant).to receive(:create).with(parent_id: 1, user_id: 1, can_submit: false, can_review: true, can_take_quiz: false, handle: 'handle').and_return(reviewer)&lt;br /&gt;
&lt;br /&gt;
Stub:&lt;br /&gt;
let(:participant) { double('AssignmentParticipant', id: 1, can_review: false, user: double('User', id: 1)) }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We use the above-mentioned stubs and mocks to test the function and found out that all the test cases passed resukting in 71% coverage of review_mapping_controller.rb&lt;br /&gt;
&lt;br /&gt;
== '''Team''' ==&lt;br /&gt;
'''Members : '''&lt;br /&gt;
Harsh Shah, &lt;br /&gt;
Prachi Gupta, &lt;br /&gt;
Ramkumaar Kovil Kanthadai, &lt;br /&gt;
Raveena D'Costa.&lt;br /&gt;
&lt;br /&gt;
'''Mentor :''' Dr.Edward Gehringer&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Pull Request&lt;br /&gt;
* https://github.com/expertiza/expertiza/pull/1304&lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121590</id>
		<title>CSC/ECE 517 Fall 2018/E1855 let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121590"/>
		<updated>2018-12-18T05:18:56Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
The way Expertiza is set up right now is that only peers can review your work. However, there are cases when the course staff (Instructor/ TAs) would want to submit reviews as well. This project aims to implement this feature by allowing course staff to review the project on the same metrics as other students who review the project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
The current system does not allow instructors to submit reviews of student work. We will work upon the feature which will let them review using the same review form that students use to do reviews.&lt;br /&gt;
&lt;br /&gt;
=== Current scenario ===&lt;br /&gt;
&lt;br /&gt;
This is how some of the pages we are concerned with, currently look.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Submissions page for an assignment in Instructor View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Submissions_instr.jpeg | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A typical Scores table in a Student View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Grades_view_team_current.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions and Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
Following changes will be made to let staff perform reviews as well:&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Add a way for the instructors to perform a review.'''&lt;br /&gt;
&lt;br /&gt;
We have implemented links to ''Begin review'', ''Edit review'','' View review'' and ''Submit review'' in the assignment submissions view. &lt;br /&gt;
When the instructor/TA reviews a work for the first time, he/she is added as a participant and a review response mapping is created. &lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''View: ''' ''app/views/assignments/list_submissions.html.erb'' - To add links in the instructor view&lt;br /&gt;
* '''Controller: ''' ''app/controllers/review_mapping_controller.rb''  - Method: add_instructor_as_reviewer&lt;br /&gt;
  &lt;br /&gt;
In the second case, we can see a 'Begin review' link. This is the initial state when instructor review has not been added to the submission.&lt;br /&gt;
Once the instructor adds a review and submits it, we can see the 'Update review' link. If the deadline has passed, Update Review will change to View Review. In case he just saves the review, an 'Edit review' link will appear.&lt;br /&gt;
If the review deadline of one round is passed, the 'Edit review' link becomes 'Update review' link. This follows in line with what the student sees while performing a review. Similarly, just like students instructor would not able to edit the review once submitted. Instructor can update it till the final submission deadline passes.&lt;br /&gt;
&lt;br /&gt;
[[File:Latest_screen_instructor.JPG]]&lt;br /&gt;
[[File:Ins_TA_Review.png]]&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Add the instructor review in ''Your Scores'' table in case he has reviewed your work. Provide an icon to highlight the special nature of an instructors review.'''&lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''Assets: ''' ''app/assets/stylesheets/grades.scss'' - Icon to make an instructor's review distinct from other reviews&lt;br /&gt;
* '''View: ''' ''app/views/grades/view_team.html.erb'' - To modify the &amp;quot;Your scores&amp;quot; page to include an icon next to the peer review score indicating that the instructor's score is not included in the final peer review score.&lt;br /&gt;
* '''Models: ''' &lt;br /&gt;
** ''app/models/answer.rb'' - Method: compute_scores | Modification in logic to ensure instructor review scores are not counted in the overall score of the student.&lt;br /&gt;
** ''app/models/vm_question_response_score_cell.rb'' - Included a new variable called 'is_instructor_review' to identify an instructor review&lt;br /&gt;
** ''app/models/vm_question_response_row.rb'' - Change in average_score_for_row method to not include an instructor review score&lt;br /&gt;
** ''app/models/vm_question_response.rb'' - Modified the add_answer method to include the is_instructor_review to each row_score object&lt;br /&gt;
&lt;br /&gt;
A student should be able to make out if an instructor has reviewed his/his team's work. In case the instructor performs a review on the team's work, there will be an icon next to the instructor's review along with explicitly stating that it is an 'Instructor review'.&lt;br /&gt;
The average peer review score for the team has been modified to exclude the instructor's scores. Same has been taken into account for the average score calculated for each row.&lt;br /&gt;
&lt;br /&gt;
[[File:Score_hover.png]]&lt;br /&gt;
&lt;br /&gt;
Like shown in the above picture we can see a info button on which if we hover the text is shown.&lt;br /&gt;
&lt;br /&gt;
Possible icons :&lt;br /&gt;
 [[File:Instuctor.jpg]]  [[File:Instructor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
We added a test for a new method add_instructor_as_review&lt;br /&gt;
&lt;br /&gt;
1.Created a stub and mock to find the assignment team &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock:&lt;br /&gt;
let(:team) { double('AssignmentTeam', name: 'no one', id: 1, parent_id: 1) }&lt;br /&gt;
&lt;br /&gt;
Stub: &lt;br /&gt;
allow(AssignmentTeam).to receive(:find).with('1').and_return(team)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.Created a sub and mock to map the review with their response in ReviewResponseMap&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock: &lt;br /&gt;
let(:review_response_map) do double('ReviewResponseMap', id: 1, map_id: 1, assignment: assignment,reviewer: double('Participant', id: 1, name: 'reviewer'), reviewee: double('Participant', id: 2, name: 'reviewee'))  end&lt;br /&gt;
&lt;br /&gt;
Stub:&lt;br /&gt;
allow(ReviewResponseMap).to receive_message_chain(:where, :first).with(reviewee_id: 1, course_staff: true, reviewed_object_id: '1').with(no_args).and_return(nil)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3.Created a stub and mock to add current user as a participant in the assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock:&lt;br /&gt;
 allow(AssignmentParticipant).to receive(:create).with(parent_id: 1, user_id: 1, can_submit: false, can_review: true, can_take_quiz: false, handle: 'handle').and_return(reviewer)&lt;br /&gt;
&lt;br /&gt;
Stub:&lt;br /&gt;
let(:participant) { double('AssignmentParticipant', id: 1, can_review: false, user: double('User', id: 1)) }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Features testing:''' Many of our changes are reflected on views (user interface). Following is the list of tests that we will conduct with rspec/capybara.&lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs perform a review for the submission of latest finished round if instructor/TAs has not started a review for the submission yet&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs save a review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs review a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs edit a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should allow instructor/TAs perform a review after the deadline for reviewing has passed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''More testing:''' &lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs update a review for the submission of latest finished round if instructor/TAs performed and saved a review for the previous round&amp;quot;&lt;br /&gt;
# it &amp;quot;should show &amp;quot;Instructor review&amp;quot; when a student views feedback on his/her submission if an instructor/TA has reviewed his/his team's work&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average peer review score for the team&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average score for each question in the review&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Team''' ==&lt;br /&gt;
'''Members : '''&lt;br /&gt;
Harsh Shah, &lt;br /&gt;
Prachi Gupta, &lt;br /&gt;
Ramkumaar Kovil Kanthadai, &lt;br /&gt;
Raveena D'Costa.&lt;br /&gt;
&lt;br /&gt;
'''Mentor :''' Dr.Edward Gehringer&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Pull Request&lt;br /&gt;
* https://github.com/expertiza/expertiza/pull/1304&lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121589</id>
		<title>CSC/ECE 517 Fall 2018/E1855 let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121589"/>
		<updated>2018-12-18T05:18:36Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
The way Expertiza is set up right now is that only peers can review your work. However, there are cases when the course staff (Instructor/ TAs) would want to submit reviews as well. This project aims to implement this feature by allowing course staff to review the project on the same metrics as other students who review the project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
The current system does not allow instructors to submit reviews of student work. We will work upon the feature which will let them review using the same review form that students use to do reviews.&lt;br /&gt;
&lt;br /&gt;
=== Current scenario ===&lt;br /&gt;
&lt;br /&gt;
This is how some of the pages we are concerned with, currently look.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Submissions page for an assignment in Instructor View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Submissions_instr.jpeg | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A typical Scores table in a Student View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Grades_view_team_current.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions and Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
Following changes will be made to let staff perform reviews as well:&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Add a way for the instructors to perform a review.'''&lt;br /&gt;
&lt;br /&gt;
We have implemented links to ''Begin review'', ''Edit review'','' View review'' and ''Submit review'' in the assignment submissions view. &lt;br /&gt;
When the instructor/TA reviews a work for the first time, he/she is added as a participant and a review response mapping is created. &lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''View: ''' ''app/views/assignments/list_submissions.html.erb'' - To add links in the instructor view&lt;br /&gt;
* '''Controller: ''' ''app/controllers/review_mapping_controller.rb''  - Method: add_instructor_as_reviewer&lt;br /&gt;
  &lt;br /&gt;
In the second case, we can see a 'Begin review' link. This is the initial state when instructor review has not been added to the submission.&lt;br /&gt;
Once the instructor adds a review and submits it, we can see the 'Update review' link. If the deadline has passed, Update Review will change to View Review. In case he just saves the review, an 'Edit review' link will appear.&lt;br /&gt;
If the review deadline of one round is passed, the 'Edit review' link becomes 'Update review' link. This follows in line with what the student sees while performing a review. Similarly, just like students instructor would not able to edit the review once submitted. Instructor can update it till the final submission deadline passes.&lt;br /&gt;
&lt;br /&gt;
[[File:Latest_screen_instructor.JPG]]&lt;br /&gt;
[[File:Ins_TA_Review.png]]&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Add the instructor review in ''Your Scores'' table in case he has reviewed your work. Provide an icon to highlight the special nature of an instructors review.'''&lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''Assets: ''' ''app/assets/stylesheets/grades.scss'' - Icon to make an instructor's review distinct from other reviews&lt;br /&gt;
* '''View: ''' ''app/views/grades/view_team.html.erb'' - To modify the &amp;quot;Your scores&amp;quot; page to include an icon next to the peer review score indicating that the instructor's score is not included in the final peer review score.&lt;br /&gt;
* '''Models: ''' &lt;br /&gt;
** ''app/models/answer.rb'' - Method: compute_scores | Modification in logic to ensure instructor review scores are not counted in the overall score of the student.&lt;br /&gt;
** ''app/models/vm_question_response_score_cell.rb'' - Included a new variable called 'is_instructor_review' to identify an instructor review&lt;br /&gt;
** ''app/models/vm_question_response_row.rb'' - Change in average_score_for_row method to not include an instructor review score&lt;br /&gt;
** ''app/models/vm_question_response.rb'' - Modified the add_answer method to include the is_instructor_review to each row_score object&lt;br /&gt;
&lt;br /&gt;
A student should be able to make out if an instructor has reviewed his/his team's work. In case the instructor performs a review on the team's work, there will be an icon next to the instructor's review along with explicitly stating that it is an 'Instructor review'.&lt;br /&gt;
The average peer review score for the team has been modified to exclude the instructor's scores. Same has been taken into account for the average score calculated for each row.&lt;br /&gt;
&lt;br /&gt;
[[File:Score_hover.png]]&lt;br /&gt;
&lt;br /&gt;
Like shown in the above picture we can see a info button on which if we hover the text is shown.&lt;br /&gt;
&lt;br /&gt;
Possible icons :&lt;br /&gt;
 [[File:Instuctor.jpg]]  [[File:Instructor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
We added a test for a new method add_instructor_as_review&lt;br /&gt;
&lt;br /&gt;
#Created a stub and mock to find the assignment team &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock:&lt;br /&gt;
let(:team) { double('AssignmentTeam', name: 'no one', id: 1, parent_id: 1) }&lt;br /&gt;
&lt;br /&gt;
Stub: &lt;br /&gt;
allow(AssignmentTeam).to receive(:find).with('1').and_return(team)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.Created a sub and mock to map the review with their response in ReviewResponseMap&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock: &lt;br /&gt;
let(:review_response_map) do double('ReviewResponseMap', id: 1, map_id: 1, assignment: assignment,reviewer: double('Participant', id: 1, name: 'reviewer'), reviewee: double('Participant', id: 2, name: 'reviewee'))  end&lt;br /&gt;
&lt;br /&gt;
Stub:&lt;br /&gt;
allow(ReviewResponseMap).to receive_message_chain(:where, :first).with(reviewee_id: 1, course_staff: true, reviewed_object_id: '1').with(no_args).and_return(nil)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3.Created a stub and mock to add current user as a participant in the assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock:&lt;br /&gt;
 allow(AssignmentParticipant).to receive(:create).with(parent_id: 1, user_id: 1, can_submit: false, can_review: true, can_take_quiz: false, handle: 'handle').and_return(reviewer)&lt;br /&gt;
&lt;br /&gt;
Stub:&lt;br /&gt;
let(:participant) { double('AssignmentParticipant', id: 1, can_review: false, user: double('User', id: 1)) }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Features testing:''' Many of our changes are reflected on views (user interface). Following is the list of tests that we will conduct with rspec/capybara.&lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs perform a review for the submission of latest finished round if instructor/TAs has not started a review for the submission yet&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs save a review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs review a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs edit a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should allow instructor/TAs perform a review after the deadline for reviewing has passed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''More testing:''' &lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs update a review for the submission of latest finished round if instructor/TAs performed and saved a review for the previous round&amp;quot;&lt;br /&gt;
# it &amp;quot;should show &amp;quot;Instructor review&amp;quot; when a student views feedback on his/her submission if an instructor/TA has reviewed his/his team's work&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average peer review score for the team&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average score for each question in the review&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Team''' ==&lt;br /&gt;
'''Members : '''&lt;br /&gt;
Harsh Shah, &lt;br /&gt;
Prachi Gupta, &lt;br /&gt;
Ramkumaar Kovil Kanthadai, &lt;br /&gt;
Raveena D'Costa.&lt;br /&gt;
&lt;br /&gt;
'''Mentor :''' Dr.Edward Gehringer&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Pull Request&lt;br /&gt;
* https://github.com/expertiza/expertiza/pull/1304&lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121588</id>
		<title>CSC/ECE 517 Fall 2018/E1855 let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121588"/>
		<updated>2018-12-18T05:18:11Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
The way Expertiza is set up right now is that only peers can review your work. However, there are cases when the course staff (Instructor/ TAs) would want to submit reviews as well. This project aims to implement this feature by allowing course staff to review the project on the same metrics as other students who review the project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
The current system does not allow instructors to submit reviews of student work. We will work upon the feature which will let them review using the same review form that students use to do reviews.&lt;br /&gt;
&lt;br /&gt;
=== Current scenario ===&lt;br /&gt;
&lt;br /&gt;
This is how some of the pages we are concerned with, currently look.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Submissions page for an assignment in Instructor View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Submissions_instr.jpeg | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A typical Scores table in a Student View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Grades_view_team_current.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions and Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
Following changes will be made to let staff perform reviews as well:&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Add a way for the instructors to perform a review.'''&lt;br /&gt;
&lt;br /&gt;
We have implemented links to ''Begin review'', ''Edit review'','' View review'' and ''Submit review'' in the assignment submissions view. &lt;br /&gt;
When the instructor/TA reviews a work for the first time, he/she is added as a participant and a review response mapping is created. &lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''View: ''' ''app/views/assignments/list_submissions.html.erb'' - To add links in the instructor view&lt;br /&gt;
* '''Controller: ''' ''app/controllers/review_mapping_controller.rb''  - Method: add_instructor_as_reviewer&lt;br /&gt;
  &lt;br /&gt;
In the second case, we can see a 'Begin review' link. This is the initial state when instructor review has not been added to the submission.&lt;br /&gt;
Once the instructor adds a review and submits it, we can see the 'Update review' link. If the deadline has passed, Update Review will change to View Review. In case he just saves the review, an 'Edit review' link will appear.&lt;br /&gt;
If the review deadline of one round is passed, the 'Edit review' link becomes 'Update review' link. This follows in line with what the student sees while performing a review. Similarly, just like students instructor would not able to edit the review once submitted. Instructor can update it till the final submission deadline passes.&lt;br /&gt;
&lt;br /&gt;
[[File:Latest_screen_instructor.JPG]]&lt;br /&gt;
[[File:Ins_TA_Review.png]]&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Add the instructor review in ''Your Scores'' table in case he has reviewed your work. Provide an icon to highlight the special nature of an instructors review.'''&lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''Assets: ''' ''app/assets/stylesheets/grades.scss'' - Icon to make an instructor's review distinct from other reviews&lt;br /&gt;
* '''View: ''' ''app/views/grades/view_team.html.erb'' - To modify the &amp;quot;Your scores&amp;quot; page to include an icon next to the peer review score indicating that the instructor's score is not included in the final peer review score.&lt;br /&gt;
* '''Models: ''' &lt;br /&gt;
** ''app/models/answer.rb'' - Method: compute_scores | Modification in logic to ensure instructor review scores are not counted in the overall score of the student.&lt;br /&gt;
** ''app/models/vm_question_response_score_cell.rb'' - Included a new variable called 'is_instructor_review' to identify an instructor review&lt;br /&gt;
** ''app/models/vm_question_response_row.rb'' - Change in average_score_for_row method to not include an instructor review score&lt;br /&gt;
** ''app/models/vm_question_response.rb'' - Modified the add_answer method to include the is_instructor_review to each row_score object&lt;br /&gt;
&lt;br /&gt;
A student should be able to make out if an instructor has reviewed his/his team's work. In case the instructor performs a review on the team's work, there will be an icon next to the instructor's review along with explicitly stating that it is an 'Instructor review'.&lt;br /&gt;
The average peer review score for the team has been modified to exclude the instructor's scores. Same has been taken into account for the average score calculated for each row.&lt;br /&gt;
&lt;br /&gt;
[[File:Score_hover.png]]&lt;br /&gt;
&lt;br /&gt;
Like shown in the above picture we can see a info button on which if we hover the text is shown.&lt;br /&gt;
&lt;br /&gt;
Possible icons :&lt;br /&gt;
 [[File:Instuctor.jpg]]  [[File:Instructor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
We added a test for a new method add_instructor_as_review&lt;br /&gt;
&lt;br /&gt;
# Created a stub and mock to find the assignment team &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock:&lt;br /&gt;
let(:team) { double('AssignmentTeam', name: 'no one', id: 1, parent_id: 1) }&lt;br /&gt;
&lt;br /&gt;
Stub: &lt;br /&gt;
allow(AssignmentTeam).to receive(:find).with('1').and_return(team)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Created a sub and mock to map the review with their response in ReviewResponseMap&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock: &lt;br /&gt;
let(:review_response_map) do double('ReviewResponseMap', id: 1, map_id: 1, assignment: assignment,reviewer: double('Participant', id: 1, name: 'reviewer'), reviewee: double('Participant', id: 2, name: 'reviewee'))  end&lt;br /&gt;
&lt;br /&gt;
Stub:&lt;br /&gt;
allow(ReviewResponseMap).to receive_message_chain(:where, :first).with(reviewee_id: 1, course_staff: true, reviewed_object_id: '1').with(no_args).and_return(nil)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#Created a stub and mock to add current user as a participant in the assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock:&lt;br /&gt;
 allow(AssignmentParticipant).to receive(:create).with(parent_id: 1, user_id: 1, can_submit: false, can_review: true, can_take_quiz: false, handle: 'handle').and_return(reviewer)&lt;br /&gt;
&lt;br /&gt;
Stub:&lt;br /&gt;
let(:participant) { double('AssignmentParticipant', id: 1, can_review: false, user: double('User', id: 1)) }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Features testing:''' Many of our changes are reflected on views (user interface). Following is the list of tests that we will conduct with rspec/capybara.&lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs perform a review for the submission of latest finished round if instructor/TAs has not started a review for the submission yet&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs save a review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs review a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs edit a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should allow instructor/TAs perform a review after the deadline for reviewing has passed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''More testing:''' &lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs update a review for the submission of latest finished round if instructor/TAs performed and saved a review for the previous round&amp;quot;&lt;br /&gt;
# it &amp;quot;should show &amp;quot;Instructor review&amp;quot; when a student views feedback on his/her submission if an instructor/TA has reviewed his/his team's work&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average peer review score for the team&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average score for each question in the review&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Team''' ==&lt;br /&gt;
'''Members : '''&lt;br /&gt;
Harsh Shah, &lt;br /&gt;
Prachi Gupta, &lt;br /&gt;
Ramkumaar Kovil Kanthadai, &lt;br /&gt;
Raveena D'Costa.&lt;br /&gt;
&lt;br /&gt;
'''Mentor :''' Dr.Edward Gehringer&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Pull Request&lt;br /&gt;
* https://github.com/expertiza/expertiza/pull/1304&lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121587</id>
		<title>CSC/ECE 517 Fall 2018/E1855 let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121587"/>
		<updated>2018-12-18T05:16:32Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
The way Expertiza is set up right now is that only peers can review your work. However, there are cases when the course staff (Instructor/ TAs) would want to submit reviews as well. This project aims to implement this feature by allowing course staff to review the project on the same metrics as other students who review the project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
The current system does not allow instructors to submit reviews of student work. We will work upon the feature which will let them review using the same review form that students use to do reviews.&lt;br /&gt;
&lt;br /&gt;
=== Current scenario ===&lt;br /&gt;
&lt;br /&gt;
This is how some of the pages we are concerned with, currently look.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Submissions page for an assignment in Instructor View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Submissions_instr.jpeg | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A typical Scores table in a Student View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Grades_view_team_current.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions and Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
Following changes will be made to let staff perform reviews as well:&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Add a way for the instructors to perform a review.'''&lt;br /&gt;
&lt;br /&gt;
We have implemented links to ''Begin review'', ''Edit review'','' View review'' and ''Submit review'' in the assignment submissions view. &lt;br /&gt;
When the instructor/TA reviews a work for the first time, he/she is added as a participant and a review response mapping is created. &lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''View: ''' ''app/views/assignments/list_submissions.html.erb'' - To add links in the instructor view&lt;br /&gt;
* '''Controller: ''' ''app/controllers/review_mapping_controller.rb''  - Method: add_instructor_as_reviewer&lt;br /&gt;
  &lt;br /&gt;
In the second case, we can see a 'Begin review' link. This is the initial state when instructor review has not been added to the submission.&lt;br /&gt;
Once the instructor adds a review and submits it, we can see the 'Update review' link. If the deadline has passed, Update Review will change to View Review. In case he just saves the review, an 'Edit review' link will appear.&lt;br /&gt;
If the review deadline of one round is passed, the 'Edit review' link becomes 'Update review' link. This follows in line with what the student sees while performing a review. Similarly, just like students instructor would not able to edit the review once submitted. Instructor can update it till the final submission deadline passes.&lt;br /&gt;
&lt;br /&gt;
[[File:Latest_screen_instructor.JPG]]&lt;br /&gt;
[[File:Ins_TA_Review.png]]&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Add the instructor review in ''Your Scores'' table in case he has reviewed your work. Provide an icon to highlight the special nature of an instructors review.'''&lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''Assets: ''' ''app/assets/stylesheets/grades.scss'' - Icon to make an instructor's review distinct from other reviews&lt;br /&gt;
* '''View: ''' ''app/views/grades/view_team.html.erb'' - To modify the &amp;quot;Your scores&amp;quot; page to include an icon next to the peer review score indicating that the instructor's score is not included in the final peer review score.&lt;br /&gt;
* '''Models: ''' &lt;br /&gt;
** ''app/models/answer.rb'' - Method: compute_scores | Modification in logic to ensure instructor review scores are not counted in the overall score of the student.&lt;br /&gt;
** ''app/models/vm_question_response_score_cell.rb'' - Included a new variable called 'is_instructor_review' to identify an instructor review&lt;br /&gt;
** ''app/models/vm_question_response_row.rb'' - Change in average_score_for_row method to not include an instructor review score&lt;br /&gt;
** ''app/models/vm_question_response.rb'' - Modified the add_answer method to include the is_instructor_review to each row_score object&lt;br /&gt;
&lt;br /&gt;
A student should be able to make out if an instructor has reviewed his/his team's work. In case the instructor performs a review on the team's work, there will be an icon next to the instructor's review along with explicitly stating that it is an 'Instructor review'.&lt;br /&gt;
The average peer review score for the team has been modified to exclude the instructor's scores. Same has been taken into account for the average score calculated for each row.&lt;br /&gt;
&lt;br /&gt;
[[File:Score_hover.png]]&lt;br /&gt;
&lt;br /&gt;
Like shown in the above picture we can see a info button on which if we hover the text is shown.&lt;br /&gt;
&lt;br /&gt;
Possible icons :&lt;br /&gt;
 [[File:Instuctor.jpg]]  [[File:Instructor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
We added a test for a new method add_instructor_as_review&lt;br /&gt;
&lt;br /&gt;
# Created a stub and mock to find the assignment team &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
'''Mock''' &lt;br /&gt;
let(:team) { double('AssignmentTeam', name: 'no one', id: 1, parent_id: 1) }&lt;br /&gt;
&lt;br /&gt;
'''Stub''' &lt;br /&gt;
allow(AssignmentTeam).to receive(:find).with('1').and_return(team)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Created a sub and mock to map the review with their response in ReviewResponseMap&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
'''Mock''' &lt;br /&gt;
let(:review_response_map) do double('ReviewResponseMap', id: 1, map_id: 1, assignment: assignment,reviewer: double('Participant', id: 1, name: 'reviewer'), reviewee: double('Participant', id: 2, name: 'reviewee'))  end&lt;br /&gt;
&lt;br /&gt;
'''Stub'''&lt;br /&gt;
allow(ReviewResponseMap).to receive_message_chain(:where, :first).with(reviewee_id: 1, course_staff: true, reviewed_object_id: '1').with(no_args).and_return(nil)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#Created a stub and mock to add current user as a participant in the assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
'''Mock'''&lt;br /&gt;
 allow(AssignmentParticipant).to receive(:create).with(parent_id: 1, user_id: 1, can_submit: false, can_review: true, can_take_quiz: false, handle: 'handle').and_return(reviewer)&lt;br /&gt;
&lt;br /&gt;
'''Stub'''&lt;br /&gt;
let(:participant) { double('AssignmentParticipant', id: 1, can_review: false, user: double('User', id: 1)) }&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Features testing:''' Many of our changes are reflected on views (user interface). Following is the list of tests that we will conduct with rspec/capybara.&lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs perform a review for the submission of latest finished round if instructor/TAs has not started a review for the submission yet&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs save a review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs review a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs edit a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should allow instructor/TAs perform a review after the deadline for reviewing has passed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''More testing:''' &lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs update a review for the submission of latest finished round if instructor/TAs performed and saved a review for the previous round&amp;quot;&lt;br /&gt;
# it &amp;quot;should show &amp;quot;Instructor review&amp;quot; when a student views feedback on his/her submission if an instructor/TA has reviewed his/his team's work&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average peer review score for the team&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average score for each question in the review&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Team''' ==&lt;br /&gt;
'''Members : '''&lt;br /&gt;
Harsh Shah, &lt;br /&gt;
Prachi Gupta, &lt;br /&gt;
Ramkumaar Kovil Kanthadai, &lt;br /&gt;
Raveena D'Costa.&lt;br /&gt;
&lt;br /&gt;
'''Mentor :''' Dr.Edward Gehringer&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Pull Request&lt;br /&gt;
* https://github.com/expertiza/expertiza/pull/1304&lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121586</id>
		<title>CSC/ECE 517 Fall 2018/E1855 let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121586"/>
		<updated>2018-12-18T05:10:57Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
The way Expertiza is set up right now is that only peers can review your work. However, there are cases when the course staff (Instructor/ TAs) would want to submit reviews as well. This project aims to implement this feature by allowing course staff to review the project on the same metrics as other students who review the project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
The current system does not allow instructors to submit reviews of student work. We will work upon the feature which will let them review using the same review form that students use to do reviews.&lt;br /&gt;
&lt;br /&gt;
=== Current scenario ===&lt;br /&gt;
&lt;br /&gt;
This is how some of the pages we are concerned with, currently look.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Submissions page for an assignment in Instructor View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Submissions_instr.jpeg | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A typical Scores table in a Student View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Grades_view_team_current.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions and Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
Following changes will be made to let staff perform reviews as well:&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Add a way for the instructors to perform a review.'''&lt;br /&gt;
&lt;br /&gt;
We have implemented links to ''Begin review'', ''Edit review'','' View review'' and ''Submit review'' in the assignment submissions view. &lt;br /&gt;
When the instructor/TA reviews a work for the first time, he/she is added as a participant and a review response mapping is created. &lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''View: ''' ''app/views/assignments/list_submissions.html.erb'' - To add links in the instructor view&lt;br /&gt;
* '''Controller: ''' ''app/controllers/review_mapping_controller.rb''  - Method: add_instructor_as_reviewer&lt;br /&gt;
  &lt;br /&gt;
In the second case, we can see a 'Begin review' link. This is the initial state when instructor review has not been added to the submission.&lt;br /&gt;
Once the instructor adds a review and submits it, we can see the 'Update review' link. If the deadline has passed, Update Review will change to View Review. In case he just saves the review, an 'Edit review' link will appear.&lt;br /&gt;
If the review deadline of one round is passed, the 'Edit review' link becomes 'Update review' link. This follows in line with what the student sees while performing a review. Similarly, just like students instructor would not able to edit the review once submitted. Instructor can update it till the final submission deadline passes.&lt;br /&gt;
&lt;br /&gt;
[[File:Latest_screen_instructor.JPG]]&lt;br /&gt;
[[File:Ins_TA_Review.png]]&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Add the instructor review in ''Your Scores'' table in case he has reviewed your work. Provide an icon to highlight the special nature of an instructors review.'''&lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''Assets: ''' ''app/assets/stylesheets/grades.scss'' - Icon to make an instructor's review distinct from other reviews&lt;br /&gt;
* '''View: ''' ''app/views/grades/view_team.html.erb'' - To modify the &amp;quot;Your scores&amp;quot; page to include an icon next to the peer review score indicating that the instructor's score is not included in the final peer review score.&lt;br /&gt;
* '''Models: ''' &lt;br /&gt;
** ''app/models/answer.rb'' - Method: compute_scores | Modification in logic to ensure instructor review scores are not counted in the overall score of the student.&lt;br /&gt;
** ''app/models/vm_question_response_score_cell.rb'' - Included a new variable called 'is_instructor_review' to identify an instructor review&lt;br /&gt;
** ''app/models/vm_question_response_row.rb'' - Change in average_score_for_row method to not include an instructor review score&lt;br /&gt;
** ''app/models/vm_question_response.rb'' - Modified the add_answer method to include the is_instructor_review to each row_score object&lt;br /&gt;
&lt;br /&gt;
A student should be able to make out if an instructor has reviewed his/his team's work. In case the instructor performs a review on the team's work, there will be an icon next to the instructor's review along with explicitly stating that it is an 'Instructor review'.&lt;br /&gt;
The average peer review score for the team has been modified to exclude the instructor's scores. Same has been taken into account for the average score calculated for each row.&lt;br /&gt;
&lt;br /&gt;
[[File:Score_hover.png]]&lt;br /&gt;
&lt;br /&gt;
Like shown in the above picture we can see a info button on which if we hover the text is shown.&lt;br /&gt;
&lt;br /&gt;
Possible icons :&lt;br /&gt;
 [[File:Instuctor.jpg]]  [[File:Instructor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
We added a test for a new method add_instructor_as_review&lt;br /&gt;
&lt;br /&gt;
# Created a stub and mock to find the assignment team &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock: let(:team) { double('AssignmentTeam', name: 'no one', id: 1, parent_id: 1) }&lt;br /&gt;
Stub: allow(AssignmentTeam).to receive(:find).with('1').and_return(team)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# Created a sub and mock to map the review with their response in ReviewResponseMap&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock: &lt;br /&gt;
let(:review_response_map) do&lt;br /&gt;
 double('ReviewResponseMap', id: 1, map_id: 1, assignment: assignment,reviewer: double('Participant', id: 1, name: 'reviewer'), reviewee: double('Participant', id: 2, name: 'reviewee'))&lt;br /&gt;
  end&lt;br /&gt;
Stub:  allow(ReviewResponseMap).to receive_message_chain(:where, :first).with(reviewee_id: 1, course_staff: true, reviewed_object_id: '1').with(no_args).and_return(nil)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Features testing:''' Many of our changes are reflected on views (user interface). Following is the list of tests that we will conduct with rspec/capybara.&lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs perform a review for the submission of latest finished round if instructor/TAs has not started a review for the submission yet&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs save a review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs review a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs edit a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should allow instructor/TAs perform a review after the deadline for reviewing has passed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''More testing:''' &lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs update a review for the submission of latest finished round if instructor/TAs performed and saved a review for the previous round&amp;quot;&lt;br /&gt;
# it &amp;quot;should show &amp;quot;Instructor review&amp;quot; when a student views feedback on his/her submission if an instructor/TA has reviewed his/his team's work&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average peer review score for the team&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average score for each question in the review&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Team''' ==&lt;br /&gt;
'''Members : '''&lt;br /&gt;
Harsh Shah, &lt;br /&gt;
Prachi Gupta, &lt;br /&gt;
Ramkumaar Kovil Kanthadai, &lt;br /&gt;
Raveena D'Costa.&lt;br /&gt;
&lt;br /&gt;
'''Mentor :''' Dr.Edward Gehringer&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Pull Request&lt;br /&gt;
* https://github.com/expertiza/expertiza/pull/1304&lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121583</id>
		<title>CSC/ECE 517 Fall 2018/E1855 let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121583"/>
		<updated>2018-12-18T05:07:24Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
The way Expertiza is set up right now is that only peers can review your work. However, there are cases when the course staff (Instructor/ TAs) would want to submit reviews as well. This project aims to implement this feature by allowing course staff to review the project on the same metrics as other students who review the project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
The current system does not allow instructors to submit reviews of student work. We will work upon the feature which will let them review using the same review form that students use to do reviews.&lt;br /&gt;
&lt;br /&gt;
=== Current scenario ===&lt;br /&gt;
&lt;br /&gt;
This is how some of the pages we are concerned with, currently look.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Submissions page for an assignment in Instructor View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Submissions_instr.jpeg | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A typical Scores table in a Student View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Grades_view_team_current.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions and Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
Following changes will be made to let staff perform reviews as well:&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Add a way for the instructors to perform a review.'''&lt;br /&gt;
&lt;br /&gt;
We have implemented links to ''Begin review'', ''Edit review'','' View review'' and ''Submit review'' in the assignment submissions view. &lt;br /&gt;
When the instructor/TA reviews a work for the first time, he/she is added as a participant and a review response mapping is created. &lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''View: ''' ''app/views/assignments/list_submissions.html.erb'' - To add links in the instructor view&lt;br /&gt;
* '''Controller: ''' ''app/controllers/review_mapping_controller.rb''  - Method: add_instructor_as_reviewer&lt;br /&gt;
  &lt;br /&gt;
In the second case, we can see a 'Begin review' link. This is the initial state when instructor review has not been added to the submission.&lt;br /&gt;
Once the instructor adds a review and submits it, we can see the 'Update review' link. If the deadline has passed, Update Review will change to View Review. In case he just saves the review, an 'Edit review' link will appear.&lt;br /&gt;
If the review deadline of one round is passed, the 'Edit review' link becomes 'Update review' link. This follows in line with what the student sees while performing a review. Similarly, just like students instructor would not able to edit the review once submitted. Instructor can update it till the final submission deadline passes.&lt;br /&gt;
&lt;br /&gt;
[[File:Latest_screen_instructor.JPG]]&lt;br /&gt;
[[File:Ins_TA_Review.png]]&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Add the instructor review in ''Your Scores'' table in case he has reviewed your work. Provide an icon to highlight the special nature of an instructors review.'''&lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''Assets: ''' ''app/assets/stylesheets/grades.scss'' - Icon to make an instructor's review distinct from other reviews&lt;br /&gt;
* '''View: ''' ''app/views/grades/view_team.html.erb'' - To modify the &amp;quot;Your scores&amp;quot; page to include an icon next to the peer review score indicating that the instructor's score is not included in the final peer review score.&lt;br /&gt;
* '''Models: ''' &lt;br /&gt;
** ''app/models/answer.rb'' - Method: compute_scores | Modification in logic to ensure instructor review scores are not counted in the overall score of the student.&lt;br /&gt;
** ''app/models/vm_question_response_score_cell.rb'' - Included a new variable called 'is_instructor_review' to identify an instructor review&lt;br /&gt;
** ''app/models/vm_question_response_row.rb'' - Change in average_score_for_row method to not include an instructor review score&lt;br /&gt;
** ''app/models/vm_question_response.rb'' - Modified the add_answer method to include the is_instructor_review to each row_score object&lt;br /&gt;
&lt;br /&gt;
A student should be able to make out if an instructor has reviewed his/his team's work. In case the instructor performs a review on the team's work, there will be an icon next to the instructor's review along with explicitly stating that it is an 'Instructor review'.&lt;br /&gt;
The average peer review score for the team has been modified to exclude the instructor's scores. Same has been taken into account for the average score calculated for each row.&lt;br /&gt;
&lt;br /&gt;
[[File:Score_hover.png]]&lt;br /&gt;
&lt;br /&gt;
Like shown in the above picture we can see a info button on which if we hover the text is shown.&lt;br /&gt;
&lt;br /&gt;
Possible icons :&lt;br /&gt;
 [[File:Instuctor.jpg]]  [[File:Instructor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
we added a test for a new method add_instructor_as_review&lt;br /&gt;
1. we created a stub and mock to find the assignment team &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock: let(:team) { double('AssignmentTeam', name: 'no one', id: 1, parent_id: 1) }&lt;br /&gt;
Stub: allow(AssignmentTeam).to receive(:find).with('1').and_return(team)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Features testing:''' Many of our changes are reflected on views (user interface). Following is the list of tests that we will conduct with rspec/capybara.&lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs perform a review for the submission of latest finished round if instructor/TAs has not started a review for the submission yet&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs save a review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs review a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs edit a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should allow instructor/TAs perform a review after the deadline for reviewing has passed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''More testing:''' &lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs update a review for the submission of latest finished round if instructor/TAs performed and saved a review for the previous round&amp;quot;&lt;br /&gt;
# it &amp;quot;should show &amp;quot;Instructor review&amp;quot; when a student views feedback on his/her submission if an instructor/TA has reviewed his/his team's work&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average peer review score for the team&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average score for each question in the review&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Team''' ==&lt;br /&gt;
'''Members : '''&lt;br /&gt;
Harsh Shah, &lt;br /&gt;
Prachi Gupta, &lt;br /&gt;
Ramkumaar Kovil Kanthadai, &lt;br /&gt;
Raveena D'Costa.&lt;br /&gt;
&lt;br /&gt;
'''Mentor :''' Dr.Edward Gehringer&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Pull Request&lt;br /&gt;
* https://github.com/expertiza/expertiza/pull/1304&lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121582</id>
		<title>CSC/ECE 517 Fall 2018/E1855 let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121582"/>
		<updated>2018-12-18T05:06:58Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
The way Expertiza is set up right now is that only peers can review your work. However, there are cases when the course staff (Instructor/ TAs) would want to submit reviews as well. This project aims to implement this feature by allowing course staff to review the project on the same metrics as other students who review the project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
The current system does not allow instructors to submit reviews of student work. We will work upon the feature which will let them review using the same review form that students use to do reviews.&lt;br /&gt;
&lt;br /&gt;
=== Current scenario ===&lt;br /&gt;
&lt;br /&gt;
This is how some of the pages we are concerned with, currently look.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Submissions page for an assignment in Instructor View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Submissions_instr.jpeg | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A typical Scores table in a Student View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Grades_view_team_current.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions and Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
Following changes will be made to let staff perform reviews as well:&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Add a way for the instructors to perform a review.'''&lt;br /&gt;
&lt;br /&gt;
We have implemented links to ''Begin review'', ''Edit review'','' View review'' and ''Submit review'' in the assignment submissions view. &lt;br /&gt;
When the instructor/TA reviews a work for the first time, he/she is added as a participant and a review response mapping is created. &lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''View: ''' ''app/views/assignments/list_submissions.html.erb'' - To add links in the instructor view&lt;br /&gt;
* '''Controller: ''' ''app/controllers/review_mapping_controller.rb''  - Method: add_instructor_as_reviewer&lt;br /&gt;
  &lt;br /&gt;
In the second case, we can see a 'Begin review' link. This is the initial state when instructor review has not been added to the submission.&lt;br /&gt;
Once the instructor adds a review and submits it, we can see the 'Update review' link. If the deadline has passed, Update Review will change to View Review. In case he just saves the review, an 'Edit review' link will appear.&lt;br /&gt;
If the review deadline of one round is passed, the 'Edit review' link becomes 'Update review' link. This follows in line with what the student sees while performing a review. Similarly, just like students instructor would not able to edit the review once submitted. Instructor can update it till the final submission deadline passes.&lt;br /&gt;
&lt;br /&gt;
[[File:Latest_screen_instructor.JPG]]&lt;br /&gt;
[[File:Ins_TA_Review.png]]&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Add the instructor review in ''Your Scores'' table in case he has reviewed your work. Provide an icon to highlight the special nature of an instructors review.'''&lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''Assets: ''' ''app/assets/stylesheets/grades.scss'' - Icon to make an instructor's review distinct from other reviews&lt;br /&gt;
* '''View: ''' ''app/views/grades/view_team.html.erb'' - To modify the &amp;quot;Your scores&amp;quot; page to include an icon next to the peer review score indicating that the instructor's score is not included in the final peer review score.&lt;br /&gt;
* '''Models: ''' &lt;br /&gt;
** ''app/models/answer.rb'' - Method: compute_scores | Modification in logic to ensure instructor review scores are not counted in the overall score of the student.&lt;br /&gt;
** ''app/models/vm_question_response_score_cell.rb'' - Included a new variable called 'is_instructor_review' to identify an instructor review&lt;br /&gt;
** ''app/models/vm_question_response_row.rb'' - Change in average_score_for_row method to not include an instructor review score&lt;br /&gt;
** ''app/models/vm_question_response.rb'' - Modified the add_answer method to include the is_instructor_review to each row_score object&lt;br /&gt;
&lt;br /&gt;
A student should be able to make out if an instructor has reviewed his/his team's work. In case the instructor performs a review on the team's work, there will be an icon next to the instructor's review along with explicitly stating that it is an 'Instructor review'.&lt;br /&gt;
The average peer review score for the team has been modified to exclude the instructor's scores. Same has been taken into account for the average score calculated for each row.&lt;br /&gt;
&lt;br /&gt;
[[File:Score_hover.png]]&lt;br /&gt;
&lt;br /&gt;
Like shown in the above picture we can see a info button on which if we hover the text is shown.&lt;br /&gt;
&lt;br /&gt;
Possible icons :&lt;br /&gt;
 [[File:Instuctor.jpg]]  [[File:Instructor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
we added a test for a new method add_instructor_as_review&lt;br /&gt;
1. we created a stub and mock to find the assignment team &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mock:&lt;br /&gt;
let(:team) { double('AssignmentTeam', name: 'no one', id: 1, parent_id: 1) }&lt;br /&gt;
Stub:&lt;br /&gt;
allow(AssignmentTeam).to receive(:find).with('1').and_return(team)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Features testing:''' Many of our changes are reflected on views (user interface). Following is the list of tests that we will conduct with rspec/capybara.&lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs perform a review for the submission of latest finished round if instructor/TAs has not started a review for the submission yet&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs save a review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs review a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs edit a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should allow instructor/TAs perform a review after the deadline for reviewing has passed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''More testing:''' &lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs update a review for the submission of latest finished round if instructor/TAs performed and saved a review for the previous round&amp;quot;&lt;br /&gt;
# it &amp;quot;should show &amp;quot;Instructor review&amp;quot; when a student views feedback on his/her submission if an instructor/TA has reviewed his/his team's work&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average peer review score for the team&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average score for each question in the review&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Team''' ==&lt;br /&gt;
'''Members : '''&lt;br /&gt;
Harsh Shah, &lt;br /&gt;
Prachi Gupta, &lt;br /&gt;
Ramkumaar Kovil Kanthadai, &lt;br /&gt;
Raveena D'Costa.&lt;br /&gt;
&lt;br /&gt;
'''Mentor :''' Dr.Edward Gehringer&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Pull Request&lt;br /&gt;
* https://github.com/expertiza/expertiza/pull/1304&lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121580</id>
		<title>CSC/ECE 517 Fall 2018/E1855 let course staff as well as students do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_students_do_reviews&amp;diff=121580"/>
		<updated>2018-12-18T05:06:09Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
The way Expertiza is set up right now is that only peers can review your work. However, there are cases when the course staff (Instructor/ TAs) would want to submit reviews as well. This project aims to implement this feature by allowing course staff to review the project on the same metrics as other students who review the project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
The current system does not allow instructors to submit reviews of student work. We will work upon the feature which will let them review using the same review form that students use to do reviews.&lt;br /&gt;
&lt;br /&gt;
=== Current scenario ===&lt;br /&gt;
&lt;br /&gt;
This is how some of the pages we are concerned with, currently look.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Submissions page for an assignment in Instructor View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Submissions_instr.jpeg | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A typical Scores table in a Student View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Grades_view_team_current.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions and Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
Following changes will be made to let staff perform reviews as well:&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Add a way for the instructors to perform a review.'''&lt;br /&gt;
&lt;br /&gt;
We have implemented links to ''Begin review'', ''Edit review'','' View review'' and ''Submit review'' in the assignment submissions view. &lt;br /&gt;
When the instructor/TA reviews a work for the first time, he/she is added as a participant and a review response mapping is created. &lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''View: ''' ''app/views/assignments/list_submissions.html.erb'' - To add links in the instructor view&lt;br /&gt;
* '''Controller: ''' ''app/controllers/review_mapping_controller.rb''  - Method: add_instructor_as_reviewer&lt;br /&gt;
  &lt;br /&gt;
In the second case, we can see a 'Begin review' link. This is the initial state when instructor review has not been added to the submission.&lt;br /&gt;
Once the instructor adds a review and submits it, we can see the 'Update review' link. If the deadline has passed, Update Review will change to View Review. In case he just saves the review, an 'Edit review' link will appear.&lt;br /&gt;
If the review deadline of one round is passed, the 'Edit review' link becomes 'Update review' link. This follows in line with what the student sees while performing a review. Similarly, just like students instructor would not able to edit the review once submitted. Instructor can update it till the final submission deadline passes.&lt;br /&gt;
&lt;br /&gt;
[[File:Latest_screen_instructor.JPG]]&lt;br /&gt;
[[File:Ins_TA_Review.png]]&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Add the instructor review in ''Your Scores'' table in case he has reviewed your work. Provide an icon to highlight the special nature of an instructors review.'''&lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''Assets: ''' ''app/assets/stylesheets/grades.scss'' - Icon to make an instructor's review distinct from other reviews&lt;br /&gt;
* '''View: ''' ''app/views/grades/view_team.html.erb'' - To modify the &amp;quot;Your scores&amp;quot; page to include an icon next to the peer review score indicating that the instructor's score is not included in the final peer review score.&lt;br /&gt;
* '''Models: ''' &lt;br /&gt;
** ''app/models/answer.rb'' - Method: compute_scores | Modification in logic to ensure instructor review scores are not counted in the overall score of the student.&lt;br /&gt;
** ''app/models/vm_question_response_score_cell.rb'' - Included a new variable called 'is_instructor_review' to identify an instructor review&lt;br /&gt;
** ''app/models/vm_question_response_row.rb'' - Change in average_score_for_row method to not include an instructor review score&lt;br /&gt;
** ''app/models/vm_question_response.rb'' - Modified the add_answer method to include the is_instructor_review to each row_score object&lt;br /&gt;
&lt;br /&gt;
A student should be able to make out if an instructor has reviewed his/his team's work. In case the instructor performs a review on the team's work, there will be an icon next to the instructor's review along with explicitly stating that it is an 'Instructor review'.&lt;br /&gt;
The average peer review score for the team has been modified to exclude the instructor's scores. Same has been taken into account for the average score calculated for each row.&lt;br /&gt;
&lt;br /&gt;
[[File:Score_hover.png]]&lt;br /&gt;
&lt;br /&gt;
Like shown in the above picture we can see a info button on which if we hover the text is shown.&lt;br /&gt;
&lt;br /&gt;
Possible icons :&lt;br /&gt;
 [[File:Instuctor.jpg]]  [[File:Instructor1.jpg]]&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
we added a test for a new method add_instructor_as_review&lt;br /&gt;
1. we created a stub and mock to find the assignment team &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let(:team) { double('AssignmentTeam', name: 'no one', id: 1, parent_id: 1) }&lt;br /&gt;
allow(AssignmentTeam).to receive(:find).with('1').and_return(team)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Features testing:''' Many of our changes are reflected on views (user interface). Following is the list of tests that we will conduct with rspec/capybara.&lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs perform a review for the submission of latest finished round if instructor/TAs has not started a review for the submission yet&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs save a review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs review a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs edit a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should allow instructor/TAs perform a review after the deadline for reviewing has passed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''More testing:''' &lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs update a review for the submission of latest finished round if instructor/TAs performed and saved a review for the previous round&amp;quot;&lt;br /&gt;
# it &amp;quot;should show &amp;quot;Instructor review&amp;quot; when a student views feedback on his/her submission if an instructor/TA has reviewed his/his team's work&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average peer review score for the team&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average score for each question in the review&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''Team''' ==&lt;br /&gt;
'''Members : '''&lt;br /&gt;
Harsh Shah, &lt;br /&gt;
Prachi Gupta, &lt;br /&gt;
Ramkumaar Kovil Kanthadai, &lt;br /&gt;
Raveena D'Costa.&lt;br /&gt;
&lt;br /&gt;
'''Mentor :''' Dr.Edward Gehringer&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Pull Request&lt;br /&gt;
* https://github.com/expertiza/expertiza/pull/1304&lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_users_do_reviews&amp;diff=120323</id>
		<title>CSC/ECE 517 Fall 2018/E1855 let course staff as well as users do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_users_do_reviews&amp;diff=120323"/>
		<updated>2018-11-20T18:07:23Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Proposed Solutions and Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
The way Expertiza is set up right now is that only peers can review your work. However, there are cases when the course staff (Instructor/ TAs) would want to submit reviews as well. This project aims to implement this feature by allowing course staff to review the project on the same metrics as other students who review the project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
The current system does not allow instructors to submit reviews of student work. We will work upon the feature which will let them review using the same review form that students use to do reviews.&lt;br /&gt;
&lt;br /&gt;
=== Current scenario ===&lt;br /&gt;
&lt;br /&gt;
This is how some of the pages we are concerned with, currently look.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Submissions page for an assignment in Instructor View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Submissions_instr.jpeg | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A typical Scores table in a Student View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Grades_view_team_current.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions and Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
Following changes will be made to let staff perform reviews as well:&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Add a way for the instructors to perform a review.'''&lt;br /&gt;
&lt;br /&gt;
We are planning to implement links to ''Begin review'', ''Edit review'','' View review'' and ''Submit review'' in the assignment submissions view. &lt;br /&gt;
When the instructor/TA reviews a work for the first time, he/she is added as a participant and a review response mapping is created. &lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''View: ''' ''app/views/assignments/list_submissions.html.erb'' - To add links in the instructor view&lt;br /&gt;
* '''Controller: ''' ''app/controllers/review_mapping_controller.rb''  - Method: add_instructor_as_reviewer&lt;br /&gt;
  &lt;br /&gt;
In the second case, we can see a 'Begin review' link. This is the initial state when instructor review has not been added to the submission.&lt;br /&gt;
Once the instructor adds a review and submits it, we can see the 'View review'. In case he just saves the review, an 'Edit review' link will appear.&lt;br /&gt;
If the review deadline of one round is passed, the 'Edit review' link becomes 'Update review' link. This follows in line with what the student sees while performing a review. Similarly, just like students instructor would not able to edit or update the review.&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Add the instructor review in ''Your Scores'' table in case he has reviewed your work. Provide an icon to highlight the special nature of an instructors review.'''&lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''Assets: ''' ''app/assets/stylesheets/grades.scss'' - Icon to make an instructor's review distinct from other reviews&lt;br /&gt;
* '''View: ''' ''app/views/grades/view_team.html.erb'' - To modify the &amp;quot;Your scores&amp;quot; page to include an icon next to the peer review score indicating that the instructor's score is not included in the final peer review score.&lt;br /&gt;
* '''Models: ''' &lt;br /&gt;
** ''app/models/answer.rb'' - Method: compute_scores | Modification in logic to ensure instructor review scores are not counted in the overall score of the student.&lt;br /&gt;
** ''app/models/vm_question_response_score_cell.rb'' - Included a new variable called 'is_instructor_review' to identify an instructor review&lt;br /&gt;
** ''app/models/vm_question_response_row.rb'' - Change in average_score_for_row method to not include an instructor review score&lt;br /&gt;
** ''app/models/vm_question_response.rb'' - Modified the add_answer method to include the is_instructor_review to each row_score object&lt;br /&gt;
&lt;br /&gt;
A student should be able to make out if an instructor has reviewed his/his team's work. In case the instructor performs a review on the team's work, there will be an icon next to the instructor's review along with explicitly stating that it is an 'Instructor review'.&lt;br /&gt;
The average peer review score for the team has been modified to exclude the instructor's scores. Same has been taken into account for the average score calculated for each row.&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
&lt;br /&gt;
'''Features testing:''' Many of our changes are reflected on views (user interface). Following is the list of tests that we will conduct with rspec/capybara.&lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs perform a review for the submission of latest finished round if instructor/TAs has not started a review for the submission yet&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs save a review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs review a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs edit a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should allow instructor/TAs perform a review after the deadline for reviewing has passed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''More testing:''' &lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs update a review for the submission of latest finished round if instructor/TAs performed and saved a review for the previous round&amp;quot;&lt;br /&gt;
# it &amp;quot;should show &amp;quot;Instructor review&amp;quot; when a student views feedback on his/her submission if an instructor/TA has reviewed his/his team's work&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average peer review score for the team&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average score for each question in the review&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_users_do_reviews&amp;diff=120314</id>
		<title>CSC/ECE 517 Fall 2018/E1855 let course staff as well as users do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_users_do_reviews&amp;diff=120314"/>
		<updated>2018-11-20T18:02:44Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Proposed Solutions and Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
The way Expertiza is set up right now is that only peers can review your work. However, there are cases when the course staff (Instructor/ TAs) would want to submit reviews as well. This project aims to implement this feature by allowing course staff to review the project on the same metrics as other students who review the project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
The current system does not allow instructors to submit reviews of student work. We will work upon the feature which will let them review using the same review form that students use to do reviews.&lt;br /&gt;
&lt;br /&gt;
=== Current scenario ===&lt;br /&gt;
&lt;br /&gt;
This is how some of the pages we are concerned with, currently look.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Submissions page for an assignment in Instructor View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Submissions_instr.jpeg | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A typical Scores table in a Student View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Grades_view_team_current.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions and Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
Following changes will be made to let staff perform reviews as well:&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Add a way for the instructors to perform a review.'''&lt;br /&gt;
&lt;br /&gt;
We are planning to implement links to ''Begin review'', ''Edit review'','' View review'' and ''Submit review'' in the assignment submissions view. &lt;br /&gt;
When the instructor/TA reviews a work for the first time, he/she is added as a participant and a review response mapping is created. &lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''View: ''' ''app/views/assignments/list_submissions.html.erb'' - To add links in the instructor view&lt;br /&gt;
* '''Controller: ''' ''app/controllers/review_mapping_controller.rb''  - Method: add_instructor_as_reviewer&lt;br /&gt;
  &lt;br /&gt;
In the second case, we can see a 'Begin review' link. This is the initial state when instructor review has not been added to the submission.&lt;br /&gt;
Once the instructor adds a review and submits it, we can see the 'View review'. In case he just saves the review, an 'Edit review' link will appear.&lt;br /&gt;
If the review deadline of one round is passed, the 'Edit review' link becomes 'Update review' link. This follows in line with what the student sees while performing a review. Similiarly, just like the students instructor would not able to edit or update the review.&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Add the instructor review in ''Your Scores'' table in case he has reviewed your work. Provide a highlight/way to make it look distinct.'''&lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''Assets: ''' ''app/assets/stylesheets/grades.scss'' - To make an instructor performed review distinct from other reviews&lt;br /&gt;
* '''View: ''' ''app/views/grades/view_team.html.erb'' - Modified the &amp;quot;Others work&amp;quot; page to include the instructor review as well as ensure the score is not used.&lt;br /&gt;
* '''Models: ''' &lt;br /&gt;
** ''app/models/answer.rb'' - Method: compute_scores | Modification in logic to ensure instructor review scores are not counted in the overall score of the student.&lt;br /&gt;
** ''app/models/vm_question_response_score_cell.rb'' - Included a new variable called 'is_instructor_review' to identify an instructor review&lt;br /&gt;
** ''app/models/vm_question_response_row.rb'' - Change in average_score_for_row method to not include an instructor review score&lt;br /&gt;
** ''app/models/vm_question_response.rb'' - Modified the add_answer method to include the is_instructor_review to each row_score object&lt;br /&gt;
&lt;br /&gt;
A student should be able to make out if an instructor has reviewed his/his team's work. In case the instructor performs a review on the team's work, it will highlight the instructor's review with a golden border as seen in the round two score table along with explicitly stating that it is an 'Instructor review'.&lt;br /&gt;
The average peer review score for the team has been modified to exclude the instructor's scores. Same has been taken into account for the average score calculated for each row.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Additional Files modified:&lt;br /&gt;
* '''Controllers: '''&lt;br /&gt;
** ''app/controllers/response_controller.rb'' - Change in re-directions in case of an instructor taking him back to the submissions page.&lt;br /&gt;
* '''Models: '''&lt;br /&gt;
** ''app/models/assignment.rb'' - Method: number_of_current_round_for_instructor | To allow an instructor to review an assignment even after the due date&lt;br /&gt;
** ''app/models/course.rb'' - Method: is_ta_or_instructor? | To identify whether the user is a TA or an instructor of the current course&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
&lt;br /&gt;
'''Features testing:''' Many of our changes are reflected on views (user interface). Following is the list of tests that we will conduct with rspec/capybara.&lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs perform a review for the submission of latest finished round if instructor/TAs has not started a review for the submission yet&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs save a review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs review a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs edit a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should allow instructor/TAs perform a review after the deadline for reviewing has passed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''More testing:''' &lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs update a review for the submission of latest finished round if instructor/TAs performed and saved a review for the previous round&amp;quot;&lt;br /&gt;
# it &amp;quot;should show &amp;quot;Instructor review&amp;quot; when a student views feedback on his/her submission if an instructor/TA has reviewed his/his team's work&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average peer review score for the team&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average score for each question in the review&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_users_do_reviews&amp;diff=120313</id>
		<title>CSC/ECE 517 Fall 2018/E1855 let course staff as well as users do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_users_do_reviews&amp;diff=120313"/>
		<updated>2018-11-20T18:02:24Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Proposed Solutions and Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
The way Expertiza is set up right now is that only peers can review your work. However, there are cases when the course staff (Instructor/ TAs) would want to submit reviews as well. This project aims to implement this feature by allowing course staff to review the project on the same metrics as other students who review the project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
The current system does not allow instructors to submit reviews of student work. We will work upon the feature which will let them review using the same review form that students use to do reviews.&lt;br /&gt;
&lt;br /&gt;
=== Current scenario ===&lt;br /&gt;
&lt;br /&gt;
This is how some of the pages we are concerned with, currently look.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Submissions page for an assignment in Instructor View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Submissions_instr.jpeg | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A typical Scores table in a Student View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Grades_view_team_current.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions and Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
Following changes will be made to let staff perform reviews as well:&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Add a way for the instructors to perform a review.'''&lt;br /&gt;
&lt;br /&gt;
We are planning to implement links to ''Begin review'', ''Edit review'','' View review'' and ''Submit review'' in the assignment submissions view. &lt;br /&gt;
When the instructor/TA reviews a work for the first time, he/she is added as a participant and a review response mapping is created. &lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''View: ''' ''app/views/assignments/list_submissions.html.erb'' - To add links in the instructor view&lt;br /&gt;
* '''Controller: ''' ''app/controllers/review_mapping_controller.rb''  - Method: add_instructor_as_reviewer&lt;br /&gt;
  &lt;br /&gt;
In the second case, we can see a 'Begin review' link. This is the initial state when instructor review has not been added to the submission.&lt;br /&gt;
Once the instructor adds a review and submits it, we can see the 'View review'. In case he just saves the review, an 'Edit review' link will appear.&lt;br /&gt;
If the review deadline of one round is passed, the 'Edit review' link becomes 'Update review' link. This follows in line with what the student sees while performing a review. Similiarly, just like the students instructor would not able to edit or update the review.&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Add the instructor review in ''Your Scores'' table in case he has reviewed your work. Provide a highlight/way to make it look distinct.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''Assets: ''' ''app/assets/stylesheets/grades.scss'' - To make an instructor performed review distinct from other reviews&lt;br /&gt;
* '''View: ''' ''app/views/grades/view_team.html.erb'' - Modified the &amp;quot;Others work&amp;quot; page to include the instructor review as well as ensure the score is not used.&lt;br /&gt;
* '''Models: ''' &lt;br /&gt;
** ''app/models/answer.rb'' - Method: compute_scores | Modification in logic to ensure instructor review scores are not counted in the overall score of the student.&lt;br /&gt;
** ''app/models/vm_question_response_score_cell.rb'' - Included a new variable called 'is_instructor_review' to identify an instructor review&lt;br /&gt;
** ''app/models/vm_question_response_row.rb'' - Change in average_score_for_row method to not include an instructor review score&lt;br /&gt;
** ''app/models/vm_question_response.rb'' - Modified the add_answer method to include the is_instructor_review to each row_score object&lt;br /&gt;
&lt;br /&gt;
A student should be able to make out if an instructor has reviewed his/his team's work. In case the instructor performs a review on the team's work, it will highlight the instructor's review with a golden border as seen in the round two score table along with explicitly stating that it is an 'Instructor review'.&lt;br /&gt;
The average peer review score for the team has been modified to exclude the instructor's scores. Same has been taken into account for the average score calculated for each row.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Additional Files modified:&lt;br /&gt;
* '''Controllers: '''&lt;br /&gt;
** ''app/controllers/response_controller.rb'' - Change in re-directions in case of an instructor taking him back to the submissions page.&lt;br /&gt;
* '''Models: '''&lt;br /&gt;
** ''app/models/assignment.rb'' - Method: number_of_current_round_for_instructor | To allow an instructor to review an assignment even after the due date&lt;br /&gt;
** ''app/models/course.rb'' - Method: is_ta_or_instructor? | To identify whether the user is a TA or an instructor of the current course&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
&lt;br /&gt;
'''Features testing:''' Many of our changes are reflected on views (user interface). Following is the list of tests that we will conduct with rspec/capybara.&lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs perform a review for the submission of latest finished round if instructor/TAs has not started a review for the submission yet&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs save a review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs review a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs edit a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should allow instructor/TAs perform a review after the deadline for reviewing has passed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''More testing:''' &lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs update a review for the submission of latest finished round if instructor/TAs performed and saved a review for the previous round&amp;quot;&lt;br /&gt;
# it &amp;quot;should show &amp;quot;Instructor review&amp;quot; when a student views feedback on his/her submission if an instructor/TA has reviewed his/his team's work&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average peer review score for the team&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average score for each question in the review&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_users_do_reviews&amp;diff=120311</id>
		<title>CSC/ECE 517 Fall 2018/E1855 let course staff as well as users do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_users_do_reviews&amp;diff=120311"/>
		<updated>2018-11-20T17:42:06Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
The way Expertiza is set up right now is that only peers can review your work. However, there are cases when the course staff (Instructor/ TAs) would want to submit reviews as well. This project aims to implement this feature by allowing course staff to review the project on the same metrics as other students who review the project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
The current system does not allow instructors to submit reviews of student work. We will work upon the feature which will let them review using the same review form that students use to do reviews.&lt;br /&gt;
&lt;br /&gt;
=== Current scenario ===&lt;br /&gt;
&lt;br /&gt;
This is how some of the pages we are concerned with, currently look.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Submissions page for an assignment in Instructor View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Submissions_instr.jpeg | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A typical Scores table in a Student View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Grades_view_team_current.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions and Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
We performed the following changes to let staff perform reviews as well:&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Add a way for the instructors to perform a review.'''&lt;br /&gt;
&lt;br /&gt;
To do this, we added links for performing/viewing/editing/updating a review in the assignment submissions view. &lt;br /&gt;
When the instructor/TA reviews a work for the first time, he is added as a participant and a review response mapping is created. &lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''View: ''' ''app/views/assignments/list_submissions.html.erb'' - To add links in the instructor view&lt;br /&gt;
* '''Controller: ''' ''app/controllers/review_mapping_controller.rb''  - Method: add_instructor_as_reviewer&lt;br /&gt;
  &lt;br /&gt;
In the second case, we can see a 'Perform review' link. This is the initial state when instructor review has not been added to the submission.&lt;br /&gt;
Once the instructor adds a review and submits it, we can see the 'View review'. In case he just saves the review, an 'Edit review' link will appear.&lt;br /&gt;
If the review deadline of one round is passed, the 'Edit review' link becomes 'Update review' link. This follows in line with what the student sees while performing a review. However, the course staff will be allowed to perform a review even if the deadline for reviewing has passed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Add the instructor review in ''Your Scores'' table in case he has reviewed your work. Provide a highlight/way to make it look distinct.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''Assets: ''' ''app/assets/stylesheets/grades.scss'' - To make an instructor performed review distinct from other reviews&lt;br /&gt;
* '''View: ''' ''app/views/grades/view_team.html.erb'' - Modified the &amp;quot;Others work&amp;quot; page to include the instructor review as well as ensure the score is not used.&lt;br /&gt;
* '''Models: ''' &lt;br /&gt;
** ''app/models/answer.rb'' - Method: compute_scores | Modification in logic to ensure instructor review scores are not counted in the overall score of the student.&lt;br /&gt;
** ''app/models/vm_question_response_score_cell.rb'' - Included a new variable called 'is_instructor_review' to identify an instructor review&lt;br /&gt;
** ''app/models/vm_question_response_row.rb'' - Change in average_score_for_row method to not include an instructor review score&lt;br /&gt;
** ''app/models/vm_question_response.rb'' - Modified the add_answer method to include the is_instructor_review to each row_score object&lt;br /&gt;
&lt;br /&gt;
A student should be able to make out if an instructor has reviewed his/his team's work. In case the instructor performs a review on the team's work, it will highlight the instructor's review with a golden border as seen in the round two score table along with explicitly stating that it is an 'Instructor review'.&lt;br /&gt;
The average peer review score for the team has been modified to exclude the instructor's scores. Same has been taken into account for the average score calculated for each row.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Additional Files modified:&lt;br /&gt;
* '''Controllers: '''&lt;br /&gt;
** ''app/controllers/response_controller.rb'' - Change in re-directions in case of an instructor taking him back to the submissions page.&lt;br /&gt;
* '''Models: '''&lt;br /&gt;
** ''app/models/assignment.rb'' - Method: number_of_current_round_for_instructor | To allow an instructor to review an assignment even after the due date&lt;br /&gt;
** ''app/models/course.rb'' - Method: is_ta_or_instructor? | To identify whether the user is a TA or an instructor of the current course&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
&lt;br /&gt;
'''Features testing:''' Many of our changes are reflected on views (user interface). Following is the list of tests that we will conduct with rspec/capybara.&lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs perform a review for the submission of latest finished round if instructor/TAs has not started a review for the submission yet&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs save a review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs review a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs edit a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should allow instructor/TAs perform a review after the deadline for reviewing has passed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''More testing:''' &lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs update a review for the submission of latest finished round if instructor/TAs performed and saved a review for the previous round&amp;quot;&lt;br /&gt;
# it &amp;quot;should show &amp;quot;Instructor review&amp;quot; when a student views feedback on his/her submission if an instructor/TA has reviewed his/his team's work&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average peer review score for the team&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average score for each question in the review&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_users_do_reviews&amp;diff=120310</id>
		<title>CSC/ECE 517 Fall 2018/E1855 let course staff as well as users do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_users_do_reviews&amp;diff=120310"/>
		<updated>2018-11-20T17:39:20Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Problem Statement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
The way Expertiza is set up right now is that only peers can review your work. However, there are cases when the course staff (Instructor/ TAs) would want to submit reviews as well. This project aims to implement this feature by allowing course staff to review the project on the same metrics as other students who review the project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
The current system does not allow instructors to submit reviews of student work. We will work upon the feature which will let them review using the same review form that students use to do reviews.&lt;br /&gt;
&lt;br /&gt;
=== Current scenario ===&lt;br /&gt;
&lt;br /&gt;
This is how some of the pages we are concerned with, currently look.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Submissions page for an assignment in Instructor View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Submissions_instr.jpeg | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A typical Scores table in a Student View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Grades_view_team_current.png | center]]&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions and Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
We performed the following changes to let staff perform reviews as well:&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Add a way for the instructors to perform a review.'''&lt;br /&gt;
&lt;br /&gt;
To do this, we added links for performing/viewing/editing/updating a review in the assignment submissions view. &lt;br /&gt;
When the instructor/TA reviews a work for the first time, he is added as a participant and a review response mapping is created. &lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''View: ''' ''app/views/assignments/list_submissions.html.erb'' - To add links in the instructor view&lt;br /&gt;
* '''Controller: ''' ''app/controllers/review_mapping_controller.rb''  - Method: add_instructor_as_reviewer&lt;br /&gt;
  &lt;br /&gt;
In the second case, we can see a 'Perform review' link. This is the initial state when instructor review has not been added to the submission.&lt;br /&gt;
Once the instructor adds a review and submits it, we can see the 'View review'. In case he just saves the review, an 'Edit review' link will appear.&lt;br /&gt;
If the review deadline of one round is passed, the 'Edit review' link becomes 'Update review' link. This follows in line with what the student sees while performing a review. However, the course staff will be allowed to perform a review even if the deadline for reviewing has passed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Add the instructor review in ''Your Scores'' table in case he has reviewed your work. Provide a highlight/way to make it look distinct.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''Assets: ''' ''app/assets/stylesheets/grades.scss'' - To make an instructor performed review distinct from other reviews&lt;br /&gt;
* '''View: ''' ''app/views/grades/view_team.html.erb'' - Modified the &amp;quot;Others work&amp;quot; page to include the instructor review as well as ensure the score is not used.&lt;br /&gt;
* '''Models: ''' &lt;br /&gt;
** ''app/models/answer.rb'' - Method: compute_scores | Modification in logic to ensure instructor review scores are not counted in the overall score of the student.&lt;br /&gt;
** ''app/models/vm_question_response_score_cell.rb'' - Included a new variable called 'is_instructor_review' to identify an instructor review&lt;br /&gt;
** ''app/models/vm_question_response_row.rb'' - Change in average_score_for_row method to not include an instructor review score&lt;br /&gt;
** ''app/models/vm_question_response.rb'' - Modified the add_answer method to include the is_instructor_review to each row_score object&lt;br /&gt;
&lt;br /&gt;
A student should be able to make out if an instructor has reviewed his/his team's work. In case the instructor performs a review on the team's work, it will highlight the instructor's review with a golden border as seen in the round two score table along with explicitly stating that it is an 'Instructor review'.&lt;br /&gt;
The average peer review score for the team has been modified to exclude the instructor's scores. Same has been taken into account for the average score calculated for each row.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Additional Files modified:&lt;br /&gt;
* '''Controllers: '''&lt;br /&gt;
** ''app/controllers/response_controller.rb'' - Change in re-directions in case of an instructor taking him back to the submissions page.&lt;br /&gt;
* '''Models: '''&lt;br /&gt;
** ''app/models/assignment.rb'' - Method: number_of_current_round_for_instructor | To allow an instructor to review an assignment even after the due date&lt;br /&gt;
** ''app/models/course.rb'' - Method: is_ta_or_instructor? | To identify whether the user is a TA or an instructor of the current course&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
&lt;br /&gt;
'''Features testing:''' Many of our changes are reflected on views (user interface). Following is the list of tests that are conducted with rspec/capybara.&lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs perform a review for the submission of latest finished round if instructor/TAs has not started a review for the submission yet&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs save a review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs review a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs edit a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should allow instructor/TAs perform a review after the deadline for reviewing has passed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''More testing:''' &lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs update a review for the submission of latest finished round if instructor/TAs performed and saved a review for the previous round&amp;quot;&lt;br /&gt;
# it &amp;quot;should show &amp;quot;Instructor review&amp;quot; when a student views feedback on his/her submission if an instructor/TA has reviewed his/his team's work&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average peer review score for the team&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average score for each question in the review&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_users_do_reviews&amp;diff=120301</id>
		<title>CSC/ECE 517 Fall 2018/E1855 let course staff as well as users do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_users_do_reviews&amp;diff=120301"/>
		<updated>2018-11-20T17:25:31Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Proposed Solutions and Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
The way Expertiza is set up right now is that only peers can review your work. However, there are cases when the course staff (Instructor/ TAs) would want to submit reviews as well. This project aims to implement this feature by allowing course staff to review the project on the same metrics as other students who review the project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However there are some problems with this:&lt;br /&gt;
* Sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development.&lt;br /&gt;
* The reviewer might not know how well they are reviewing the peers work. They might not entirely know as to what tone to use or what suggestions to put forward.&lt;br /&gt;
&lt;br /&gt;
By letting course staff perform reviews as well, the reviewer and the reviewee are both benefited, which can improve the overall learning experience.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Current scenario ===&lt;br /&gt;
&lt;br /&gt;
This is how some of the pages we are concerned with, currently look.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Submissions page for an assignment in Instructor View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Submissions_instr.jpeg | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A typical Scores table in a Student View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Grades_view_team_current.png | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions and Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
We performed the following changes to let staff perform reviews as well:&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Add a way for the instructors to perform a review.'''&lt;br /&gt;
&lt;br /&gt;
To do this, we added links for performing/viewing/editing/updating a review in the assignment submissions view. &lt;br /&gt;
When the instructor/TA reviews a work for the first time, he is added as a participant and a review response mapping is created. &lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''View: ''' ''app/views/assignments/list_submissions.html.erb'' - To add links in the instructor view&lt;br /&gt;
* '''Controller: ''' ''app/controllers/review_mapping_controller.rb''  - Method: add_instructor_as_reviewer&lt;br /&gt;
  &lt;br /&gt;
In the second case, we can see a 'Perform review' link. This is the initial state when instructor review has not been added to the submission.&lt;br /&gt;
Once the instructor adds a review and submits it, we can see the 'View review'. In case he just saves the review, an 'Edit review' link will appear.&lt;br /&gt;
If the review deadline of one round is passed, the 'Edit review' link becomes 'Update review' link. This follows in line with what the student sees while performing a review. However, the course staff will be allowed to perform a review even if the deadline for reviewing has passed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Add the instructor review in ''Your Scores'' table in case he has reviewed your work. Provide a highlight/way to make it look distinct.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''Assets: ''' ''app/assets/stylesheets/grades.scss'' - To make an instructor performed review distinct from other reviews&lt;br /&gt;
* '''View: ''' ''app/views/grades/view_team.html.erb'' - Modified the &amp;quot;Others work&amp;quot; page to include the instructor review as well as ensure the score is not used.&lt;br /&gt;
* '''Models: ''' &lt;br /&gt;
** ''app/models/answer.rb'' - Method: compute_scores | Modification in logic to ensure instructor review scores are not counted in the overall score of the student.&lt;br /&gt;
** ''app/models/vm_question_response_score_cell.rb'' - Included a new variable called 'is_instructor_review' to identify an instructor review&lt;br /&gt;
** ''app/models/vm_question_response_row.rb'' - Change in average_score_for_row method to not include an instructor review score&lt;br /&gt;
** ''app/models/vm_question_response.rb'' - Modified the add_answer method to include the is_instructor_review to each row_score object&lt;br /&gt;
&lt;br /&gt;
A student should be able to make out if an instructor has reviewed his/his team's work. In case the instructor performs a review on the team's work, it will highlight the instructor's review with a golden border as seen in the round two score table along with explicitly stating that it is an 'Instructor review'.&lt;br /&gt;
The average peer review score for the team has been modified to exclude the instructor's scores. Same has been taken into account for the average score calculated for each row.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Additional Files modified:&lt;br /&gt;
* '''Controllers: '''&lt;br /&gt;
** ''app/controllers/response_controller.rb'' - Change in re-directions in case of an instructor taking him back to the submissions page.&lt;br /&gt;
* '''Models: '''&lt;br /&gt;
** ''app/models/assignment.rb'' - Method: number_of_current_round_for_instructor | To allow an instructor to review an assignment even after the due date&lt;br /&gt;
** ''app/models/course.rb'' - Method: is_ta_or_instructor? | To identify whether the user is a TA or an instructor of the current course&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
&lt;br /&gt;
'''Features testing:''' Many of our changes are reflected on views (user interface). Following is the list of tests that are conducted with rspec/capybara.&lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs perform a review for the submission of latest finished round if instructor/TAs has not started a review for the submission yet&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs save a review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs review a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs edit a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should allow instructor/TAs perform a review after the deadline for reviewing has passed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''More testing:''' &lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs update a review for the submission of latest finished round if instructor/TAs performed and saved a review for the previous round&amp;quot;&lt;br /&gt;
# it &amp;quot;should show &amp;quot;Instructor review&amp;quot; when a student views feedback on his/her submission if an instructor/TA has reviewed his/his team's work&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average peer review score for the team&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average score for each question in the review&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_users_do_reviews&amp;diff=120300</id>
		<title>CSC/ECE 517 Fall 2018/E1855 let course staff as well as users do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_users_do_reviews&amp;diff=120300"/>
		<updated>2018-11-20T17:24:15Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Proposed Solutions and Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
The way Expertiza is set up right now is that only peers can review your work. However, there are cases when the course staff (Instructor/ TAs) would want to submit reviews as well. This project aims to implement this feature by allowing course staff to review the project on the same metrics as other students who review the project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However there are some problems with this:&lt;br /&gt;
* Sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development.&lt;br /&gt;
* The reviewer might not know how well they are reviewing the peers work. They might not entirely know as to what tone to use or what suggestions to put forward.&lt;br /&gt;
&lt;br /&gt;
By letting course staff perform reviews as well, the reviewer and the reviewee are both benefited, which can improve the overall learning experience.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Current scenario ===&lt;br /&gt;
&lt;br /&gt;
This is how some of the pages we are concerned with, currently look.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Submissions page for an assignment in Instructor View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Submissions_instr.jpeg | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A typical Scores table in a Student View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Grades_view_team_current.png | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions and Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
We performed the following changes to let staff perform reviews as well:&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Add a way for the instructors to perform a review.'''&lt;br /&gt;
&lt;br /&gt;
To do this, we added links for performing/viewing/editing/updating a review in the assignment submissions view. &lt;br /&gt;
When the instructor/TA reviews a work for the first time, he is added as a participant and a review response mapping is created. &lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''View: ''' ''app/views/assignments/list_submissions.html.erb'' - To add links in the instructor view&lt;br /&gt;
* '''Controller: ''' ''app/controllers/review_mapping_controller.rb''  - Method: add_instructor_as_reviewer&lt;br /&gt;
  &lt;br /&gt;
[[File:Instructor review view.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the second case, we can see a 'Perform review' link. This is the initial state when instructor review has not been added to the submission.&lt;br /&gt;
Once the instructor adds a review and submits it, we can see the 'View review'. In case he just saves the review, an 'Edit review' link will appear.&lt;br /&gt;
If the review deadline of one round is passed, the 'Edit review' link becomes 'Update review' link. This follows in line with what the student sees while performing a review. However, the course staff will be allowed to perform a review even if the deadline for reviewing has passed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Add the instructor review in ''Your Scores'' table in case he has reviewed your work. Provide a highlight/way to make it look distinct.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''Assets: ''' ''app/assets/stylesheets/grades.scss'' - To make an instructor performed review distinct from other reviews&lt;br /&gt;
* '''View: ''' ''app/views/grades/view_team.html.erb'' - Modified the &amp;quot;Others work&amp;quot; page to include the instructor review as well as ensure the score is not used.&lt;br /&gt;
* '''Models: ''' &lt;br /&gt;
** ''app/models/answer.rb'' - Method: compute_scores | Modification in logic to ensure instructor review scores are not counted in the overall score of the student.&lt;br /&gt;
** ''app/models/vm_question_response_score_cell.rb'' - Included a new variable called 'is_instructor_review' to identify an instructor review&lt;br /&gt;
** ''app/models/vm_question_response_row.rb'' - Change in average_score_for_row method to not include an instructor review score&lt;br /&gt;
** ''app/models/vm_question_response.rb'' - Modified the add_answer method to include the is_instructor_review to each row_score object&lt;br /&gt;
&lt;br /&gt;
Code snippet from the add_answer method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  participant= Participant.find(ResponseMap.find(Response.find(response_id).map_id).reviewer_id)&lt;br /&gt;
  user_id = participant.user_id&lt;br /&gt;
  course =  Course.find(@assignment.course_id)&lt;br /&gt;
  row.score_row.push(VmQuestionResponseScoreCell.new(answer.answer, color_code, answer.comments,&lt;br /&gt;
                     course.is_ta_or_instructor?(user_id), vm_tag_prompts))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A student should be able to make out if an instructor has reviewed his/his team's work. In case the instructor performs a review on the team's work, it will highlight the instructor's review with a golden border as seen in the round two score table along with explicitly stating that it is an 'Instructor review'.&lt;br /&gt;
The average peer review score for the team has been modified to exclude the instructor's scores. Same has been taken into account for the average score calculated for each row.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Additional Files modified:&lt;br /&gt;
* '''Controllers: '''&lt;br /&gt;
** ''app/controllers/response_controller.rb'' - Change in re-directions in case of an instructor taking him back to the submissions page.&lt;br /&gt;
* '''Models: '''&lt;br /&gt;
** ''app/models/assignment.rb'' - Method: number_of_current_round_for_instructor | To allow an instructor to review an assignment even after the due date&lt;br /&gt;
** ''app/models/course.rb'' - Method: is_ta_or_instructor? | To identify whether the user is a TA or an instructor of the current course&lt;br /&gt;
&lt;br /&gt;
Code snippet from the model:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def is_ta_or_instructor?(user_id)&lt;br /&gt;
    instructors = TaMapping.where(course_id: self.id).collect { |x| x.ta_id}&lt;br /&gt;
    instructors.push(self.instructor_id)&lt;br /&gt;
    return user_id.in?(instructors)&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
&lt;br /&gt;
'''Features testing:''' Many of our changes are reflected on views (user interface). Following is the list of tests that are conducted with rspec/capybara.&lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs perform a review for the submission of latest finished round if instructor/TAs has not started a review for the submission yet&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs save a review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs review a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs edit a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should allow instructor/TAs perform a review after the deadline for reviewing has passed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''More testing:''' &lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs update a review for the submission of latest finished round if instructor/TAs performed and saved a review for the previous round&amp;quot;&lt;br /&gt;
# it &amp;quot;should show &amp;quot;Instructor review&amp;quot; when a student views feedback on his/her submission if an instructor/TA has reviewed his/his team's work&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average peer review score for the team&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average score for each question in the review&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_users_do_reviews&amp;diff=120298</id>
		<title>CSC/ECE 517 Fall 2018/E1855 let course staff as well as users do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_users_do_reviews&amp;diff=120298"/>
		<updated>2018-11-20T17:21:37Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Proposed Solutions and Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
The way Expertiza is set up right now is that only peers can review your work. However, there are cases when the course staff (Instructor/ TAs) would want to submit reviews as well. This project aims to implement this feature by allowing course staff to review the project on the same metrics as other students who review the project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However there are some problems with this:&lt;br /&gt;
* Sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development.&lt;br /&gt;
* The reviewer might not know how well they are reviewing the peers work. They might not entirely know as to what tone to use or what suggestions to put forward.&lt;br /&gt;
&lt;br /&gt;
By letting course staff perform reviews as well, the reviewer and the reviewee are both benefited, which can improve the overall learning experience.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Current scenario ===&lt;br /&gt;
&lt;br /&gt;
This is how some of the pages we are concerned with, currently look.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Submissions page for an assignment in Instructor View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Submissions_instr.jpeg | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A typical Scores table in a Student View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Grades_view_team_current.png | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions and Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
We performed the following changes to let staff perform reviews as well:&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Add a way for the instructors to perform a review.'''&lt;br /&gt;
&lt;br /&gt;
To do this, we added links for performing/viewing/editing/updating a review in the assignment submissions view. &lt;br /&gt;
When the instructor/TA reviews a work for the first time, he is added as a participant and a review response mapping is created. &lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''View: ''' ''app/views/assignments/list_submissions.html.erb'' - To add links in the instructor view&lt;br /&gt;
* '''Controller: ''' ''app/controllers/review_mapping_controller.rb''  - Method: add_instructor_as_reviewer&lt;br /&gt;
&lt;br /&gt;
Code snippet from the controller:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def add_instructor_as_reviewer&lt;br /&gt;
    assignment_team = AssignmentTeam.find(params[:team_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment_team.parent_id).first&lt;br /&gt;
    if reviewer.nil?&lt;br /&gt;
      reviewer = AssignmentParticipant.create(parent_id: assignment_team.parent_id, user_id: session[:user].id, can_submit: false, can_review: true,&lt;br /&gt;
                                              can_take_quiz: false, handle: 'handle')&lt;br /&gt;
&lt;br /&gt;
    end&lt;br /&gt;
    @review_map_id=ReviewResponseMap.where(reviewee_id: assignment_team.id, reviewer_id: reviewer.id,&lt;br /&gt;
                             reviewed_object_id: params[:assignment_id]).first&lt;br /&gt;
    @review_map_id=assignment_team.assign_reviewer(reviewer) if @review_map_id.nil?&lt;br /&gt;
    redirect_to controller: 'response', action: 'new', id: @review_map_id.map_id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
[[File:Instructor review view.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the second case, we can see a 'Perform review' link. This is the initial state when instructor review has not been added to the submission.&lt;br /&gt;
Once the instructor adds a review and submits it, we can see the 'View review'. In case he just saves the review, an 'Edit review' link will appear.&lt;br /&gt;
If the review deadline of one round is passed, the 'Edit review' link becomes 'Update review' link. This follows in line with what the student sees while performing a review. However, the course staff will be allowed to perform a review even if the deadline for reviewing has passed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Add the instructor review in ''Your Scores'' table in case he has reviewed your work. Provide a highlight/way to make it look distinct.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''Assets: ''' ''app/assets/stylesheets/grades.scss'' - To make an instructor performed review distinct from other reviews&lt;br /&gt;
* '''View: ''' ''app/views/grades/view_team.html.erb'' - Modified the &amp;quot;Others work&amp;quot; page to include the instructor review as well as ensure the score is not used.&lt;br /&gt;
* '''Models: ''' &lt;br /&gt;
** ''app/models/answer.rb'' - Method: compute_scores | Modification in logic to ensure instructor review scores are not counted in the overall score of the student.&lt;br /&gt;
** ''app/models/vm_question_response_score_cell.rb'' - Included a new variable called 'is_instructor_review' to identify an instructor review&lt;br /&gt;
** ''app/models/vm_question_response_row.rb'' - Change in average_score_for_row method to not include an instructor review score&lt;br /&gt;
** ''app/models/vm_question_response.rb'' - Modified the add_answer method to include the is_instructor_review to each row_score object&lt;br /&gt;
&lt;br /&gt;
Code snippet from the add_answer method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  participant= Participant.find(ResponseMap.find(Response.find(response_id).map_id).reviewer_id)&lt;br /&gt;
  user_id = participant.user_id&lt;br /&gt;
  course =  Course.find(@assignment.course_id)&lt;br /&gt;
  row.score_row.push(VmQuestionResponseScoreCell.new(answer.answer, color_code, answer.comments,&lt;br /&gt;
                     course.is_ta_or_instructor?(user_id), vm_tag_prompts))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A student should be able to make out if an instructor has reviewed his/his team's work. In case the instructor performs a review on the team's work, it will highlight the instructor's review with a golden border as seen in the round two score table along with explicitly stating that it is an 'Instructor review'.&lt;br /&gt;
The average peer review score for the team has been modified to exclude the instructor's scores. Same has been taken into account for the average score calculated for each row.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Additional Files modified:&lt;br /&gt;
* '''Controllers: '''&lt;br /&gt;
** ''app/controllers/response_controller.rb'' - Change in re-directions in case of an instructor taking him back to the submissions page.&lt;br /&gt;
* '''Models: '''&lt;br /&gt;
** ''app/models/assignment.rb'' - Method: number_of_current_round_for_instructor | To allow an instructor to review an assignment even after the due date&lt;br /&gt;
** ''app/models/course.rb'' - Method: is_ta_or_instructor? | To identify whether the user is a TA or an instructor of the current course&lt;br /&gt;
&lt;br /&gt;
Code snippet from the model:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def is_ta_or_instructor?(user_id)&lt;br /&gt;
    instructors = TaMapping.where(course_id: self.id).collect { |x| x.ta_id}&lt;br /&gt;
    instructors.push(self.instructor_id)&lt;br /&gt;
    return user_id.in?(instructors)&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
&lt;br /&gt;
'''Features testing:''' Many of our changes are reflected on views (user interface). Following is the list of tests that are conducted with rspec/capybara.&lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs perform a review for the submission of latest finished round if instructor/TAs has not started a review for the submission yet&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs save a review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs review a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs edit a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should allow instructor/TAs perform a review after the deadline for reviewing has passed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''More testing:''' &lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs update a review for the submission of latest finished round if instructor/TAs performed and saved a review for the previous round&amp;quot;&lt;br /&gt;
# it &amp;quot;should show &amp;quot;Instructor review&amp;quot; when a student views feedback on his/her submission if an instructor/TA has reviewed his/his team's work&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average peer review score for the team&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average score for each question in the review&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_users_do_reviews&amp;diff=120297</id>
		<title>CSC/ECE 517 Fall 2018/E1855 let course staff as well as users do reviews</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1855_let_course_staff_as_well_as_users_do_reviews&amp;diff=120297"/>
		<updated>2018-11-20T17:21:01Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== '''Introduction''' ==&lt;br /&gt;
&lt;br /&gt;
The way Expertiza is set up right now is that only peers can review your work. However, there are cases when the course staff (Instructor/ TAs) would want to submit reviews as well. This project aims to implement this feature by allowing course staff to review the project on the same metrics as other students who review the project. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Problem Statement''' ==&lt;br /&gt;
&lt;br /&gt;
Peer review is a great way for students to learn about how well they have developed their application. However there are some problems with this:&lt;br /&gt;
* Sometimes, the peer reviews may not be thorough and the team/person's work reviewed might not reflect the actual status of the development.&lt;br /&gt;
* The reviewer might not know how well they are reviewing the peers work. They might not entirely know as to what tone to use or what suggestions to put forward.&lt;br /&gt;
&lt;br /&gt;
By letting course staff perform reviews as well, the reviewer and the reviewee are both benefited, which can improve the overall learning experience.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Current scenario ===&lt;br /&gt;
&lt;br /&gt;
This is how some of the pages we are concerned with, currently look.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== Submissions page for an assignment in Instructor View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Submissions_instr.jpeg | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== A typical Scores table in a Student View ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File: Grades_view_team_current.png | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''Proposed Solutions and Implementation''' ==&lt;br /&gt;
&lt;br /&gt;
We performed the following changes to let staff perform reviews as well:&lt;br /&gt;
&lt;br /&gt;
'''Step 1: Add a way for the instructors to perform a review.'''&lt;br /&gt;
&lt;br /&gt;
To do this, we added links for performing/viewing/editing/updating a review in the assignment submissions view. &lt;br /&gt;
When the instructor/TA reviews a work for the first time, he is added as a participant and a review response mapping is created. &lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''View: ''' ''app/views/assignments/list_submissions.html.erb'' - To add links in the instructor view&lt;br /&gt;
* '''Controller: ''' ''app/controllers/review_mapping_controller.rb''  - Method: add_instructor_as_reviewer&lt;br /&gt;
&lt;br /&gt;
Code snippet from the controller:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def add_instructor_as_reviewer&lt;br /&gt;
    assignment_team = AssignmentTeam.find(params[:team_id])&lt;br /&gt;
    reviewer = AssignmentParticipant.where(user_id: params[:reviewer_id], parent_id: assignment_team.parent_id).first&lt;br /&gt;
    if reviewer.nil?&lt;br /&gt;
      reviewer = AssignmentParticipant.create(parent_id: assignment_team.parent_id, user_id: session[:user].id, can_submit: false, can_review: true,&lt;br /&gt;
                                              can_take_quiz: false, handle: 'handle')&lt;br /&gt;
&lt;br /&gt;
    end&lt;br /&gt;
    @review_map_id=ReviewResponseMap.where(reviewee_id: assignment_team.id, reviewer_id: reviewer.id,&lt;br /&gt;
                             reviewed_object_id: params[:assignment_id]).first&lt;br /&gt;
    @review_map_id=assignment_team.assign_reviewer(reviewer) if @review_map_id.nil?&lt;br /&gt;
    redirect_to controller: 'response', action: 'new', id: @review_map_id.map_id&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  &lt;br /&gt;
[[File:Instructor review view.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In the second case, we can see a 'Perform review' link. This is the initial state when instructor review has not been added to the submission.&lt;br /&gt;
Once the instructor adds a review and submits it, we can see the 'View review'. In case he just saves the review, an 'Edit review' link will appear.&lt;br /&gt;
If the review deadline of one round is passed, the 'Edit review' link becomes 'Update review' link. This follows in line with what the student sees while performing a review. However, the course staff will be allowed to perform a review even if the deadline for reviewing has passed.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Step 2: Add the instructor review in ''Your Scores'' table in case he has reviewed your work. Provide a highlight/way to make it look distinct.'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Files edited:&lt;br /&gt;
* '''Assets: ''' ''app/assets/stylesheets/grades.scss'' - To make an instructor performed review distinct from other reviews&lt;br /&gt;
* '''View: ''' ''app/views/grades/view_team.html.erb'' - Modified the &amp;quot;Others work&amp;quot; page to include the instructor review as well as ensure the score is not used.&lt;br /&gt;
* '''Models: ''' &lt;br /&gt;
** ''app/models/answer.rb'' - Method: compute_scores | Modification in logic to ensure instructor review scores are not counted in the overall score of the student.&lt;br /&gt;
** ''app/models/vm_question_response_score_cell.rb'' - Included a new variable called 'is_instructor_review' to identify an instructor review&lt;br /&gt;
** ''app/models/vm_question_response_row.rb'' - Change in average_score_for_row method to not include an instructor review score&lt;br /&gt;
** ''app/models/vm_question_response.rb'' - Modified the add_answer method to include the is_instructor_review to each row_score object&lt;br /&gt;
&lt;br /&gt;
Code snippet from the add_answer method:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  participant= Participant.find(ResponseMap.find(Response.find(response_id).map_id).reviewer_id)&lt;br /&gt;
  user_id = participant.user_id&lt;br /&gt;
  course =  Course.find(@assignment.course_id)&lt;br /&gt;
  row.score_row.push(VmQuestionResponseScoreCell.new(answer.answer, color_code, answer.comments,&lt;br /&gt;
                     course.is_ta_or_instructor?(user_id), vm_tag_prompts))&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:View_team.PNG | center]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
A student should be able to make out if an instructor has reviewed his/his team's work. In case the instructor performs a review on the team's work, it will highlight the instructor's review with a golden border as seen in the round two score table along with explicitly stating that it is an 'Instructor review'.&lt;br /&gt;
The average peer review score for the team has been modified to exclude the instructor's scores. Same has been taken into account for the average score calculated for each row.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Additional Files modified:&lt;br /&gt;
* '''Controllers: '''&lt;br /&gt;
** ''app/controllers/response_controller.rb'' - Change in re-directions in case of an instructor taking him back to the submissions page.&lt;br /&gt;
* '''Models: '''&lt;br /&gt;
** ''app/models/assignment.rb'' - Method: number_of_current_round_for_instructor | To allow an instructor to review an assignment even after the due date&lt;br /&gt;
** ''app/models/course.rb'' - Method: is_ta_or_instructor? | To identify whether the user is a TA or an instructor of the current course&lt;br /&gt;
&lt;br /&gt;
Code snippet from the model:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def is_ta_or_instructor?(user_id)&lt;br /&gt;
    instructors = TaMapping.where(course_id: self.id).collect { |x| x.ta_id}&lt;br /&gt;
    instructors.push(self.instructor_id)&lt;br /&gt;
    return user_id.in?(instructors)&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== '''Test Plan''' ==&lt;br /&gt;
&lt;br /&gt;
'''Features testing:''' Many of our changes are reflected on views (user interface). Following is the list of tests that are conducted with rspec/capybara.&lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs perform a review for the submission of latest finished round if instructor/TAs has not started a review for the submission yet&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs save a review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs review a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should let instructor/TAs edit a previously saved review&amp;quot;&lt;br /&gt;
# it &amp;quot;should allow instructor/TAs perform a review after the deadline for reviewing has passed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
'''More testing:''' &lt;br /&gt;
&lt;br /&gt;
# it &amp;quot;should let instructor/TAs update a review for the submission of latest finished round if instructor/TAs performed and saved a review for the previous round&amp;quot;&lt;br /&gt;
# it &amp;quot;should show &amp;quot;Instructor review&amp;quot; when a student views feedback on his/her submission if an instructor/TA has reviewed his/his team's work&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average peer review score for the team&amp;quot;&lt;br /&gt;
# it &amp;quot;should exclude the instructor's/TA's review score when calculating the average score for each question in the review&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== '''References''' ==&lt;br /&gt;
&lt;br /&gt;
Expertiza&lt;br /&gt;
* https://expertiza.ncsu.edu/ &lt;br /&gt;
&lt;br /&gt;
Expertiza Github&lt;br /&gt;
* https://github.com/expertiza/expertiza&lt;br /&gt;
&lt;br /&gt;
Expertiza Documentation&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/Expertiza_documentation&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118871</id>
		<title>E1829 OSS project Duke Blue Fix import glitches</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118871"/>
		<updated>2018-11-08T20:13:18Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made to Fix import glitches.&lt;br /&gt;
&lt;br /&gt;
== '''Background''' ==&lt;br /&gt;
The import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc. from their learning management system. Being able to import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''The problems and their goal'''==&lt;br /&gt;
&lt;br /&gt;
=== '''Issue #329''' ===&lt;br /&gt;
Rename existing team when there is a conflict&lt;br /&gt;
&lt;br /&gt;
-&amp;gt;When importing teams there are different options to handle conflicting team names. We added an option rename EXISTING team when a conflict exists.&lt;br /&gt;
[[File:Fix328.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== '''Issue #328'''===&lt;br /&gt;
Merge teams when there is a conflict&lt;br /&gt;
-&amp;gt;When importing teams, and a conflict exists there is an option to merge the two teams by inserting the new members into an existing team.&lt;br /&gt;
[[File:Fix328r.jpg]]&lt;br /&gt;
&lt;br /&gt;
==='''Issue #181'''===&lt;br /&gt;
Validate file when importing participants&lt;br /&gt;
If one attempts to import users or participants, and does not specify the file to import from, a  NoMethodError error occurs. &lt;br /&gt;
-&amp;gt;The error has been handled by validating the file before importing the teams, thus the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
[[File:Fix181.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Issue #918''' ===&lt;br /&gt;
&lt;br /&gt;
Import of topics chokes on special characters&lt;br /&gt;
It seems that non-ASCII characters in the description (e.g., a curly apostrophe, and perhaps also an en-dash) caused a SQL error in inserting the description string into the database.&lt;br /&gt;
-&amp;gt;While importing the participants, the user can include special characters in the project description and is successfully stored in the database:&lt;br /&gt;
[[File:Topics_import.jpg]]&lt;br /&gt;
&lt;br /&gt;
==='''Issue #183'''===&lt;br /&gt;
Count of fields wrong in import&lt;br /&gt;
When importing participants (or users), it is typical not to specify a password, but rather to have the system generate it. But if you do that, Expertiza reports that each record in the file you are importing does not have enough records.&lt;br /&gt;
-&amp;gt;When the user tries to upload the file to import participants, password record should be made optional and let the user upload without password record:&lt;br /&gt;
[[File:Skip_password.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Use Case Diagram ==&lt;br /&gt;
[[File:OODD.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Implementation  ==&lt;br /&gt;
==='''Issue #328'''===&lt;br /&gt;
#We search the database to see if there is an existing team with the same name. In such a case we save the old team in the ‘team’ variable and set the team_exists flag to true.&lt;br /&gt;
#We then cal the handle_dups method which handles the case if value chosen by the user is ‘insert into existing team’, inside the code this value is represented as ‘insert’. &lt;br /&gt;
#Then the import_team_members function is called&lt;br /&gt;
#We get the user through his/her name&lt;br /&gt;
#If a user isn’t registered, we get a nil object and raise an ImportError&lt;br /&gt;
#Else we add the user to the team if he/she isn’t already in the team&lt;br /&gt;
#The add_member function only works till the team isn’t filled to its maximum capacity&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 if handle_dups==&amp;quot;insert&amp;quot;&lt;br /&gt;
      team.import_team_members(row_hash)&lt;br /&gt;
      return nil&lt;br /&gt;
&lt;br /&gt;
def import_team_members(starting_index = 0, row_hash)&lt;br /&gt;
    starting_index&lt;br /&gt;
    index = 0&lt;br /&gt;
    row_hash[:teammembers].each do |teammember|&lt;br /&gt;
      next if index &amp;lt; starting_index # not sure this will work, hash is not ordered like array&lt;br /&gt;
      user = User.find_by(name: teammember.to_s)&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        raise ImportError, &amp;quot;The user '#{teammember.to_s}' was not found. &amp;lt;a href='/users/new'&amp;gt;Create&amp;lt;/a&amp;gt; this user?&amp;quot;&lt;br /&gt;
      else&lt;br /&gt;
        add_member(user) if TeamsUser.find_by(team_id: id, user_id: user.id).nil?&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Issue 329'''===&lt;br /&gt;
#We included a new option in the duplicate handler field.&lt;br /&gt;
#We added a new handler in the handleDuplicates method to handle the given option as shown in the below screenshot.&lt;br /&gt;
#We leveraged the existing generateTeam() method and sent the existing team id to this method and replaced the existing team’s team name as follows:&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     if handle_dups == &amp;quot;rename_existing&amp;quot; # rename: rename existing team&lt;br /&gt;
       if teamtype.is_a?(CourseTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Course.find(id).name)) # update the old team name&lt;br /&gt;
      elsif  teamtype.is_a?(AssignmentTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Assignment.find(id).name)) # update the old team name&lt;br /&gt;
      end&lt;br /&gt;
      #team.update(name:self.generate_team_name(Assignment.find(id).name))&lt;br /&gt;
      return name # send the new team name&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Issue 181'''===&lt;br /&gt;
#We validate the file before importing the teams. Thus, the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
&lt;br /&gt;
==='''Issue 183'''===&lt;br /&gt;
#In the import method in user.rb file, there is a validation to check if the record length is less than 3 which is exclusive of password&lt;br /&gt;
#If the record length is greater than 3, it indicates that there is a password in the record and we save the password in the database&lt;br /&gt;
#If the length is equal to 3 then new system password is generated and saved for the user&lt;br /&gt;
In file app/models/user.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    def self.import(row_hash, _row_header, session, id = nil)&lt;br /&gt;
      raise ArgumentError, &amp;quot;Only #{row_hash.length} column(s) is(are) found.It must contain at least username, full name, email.&amp;quot; if row_hash.length &amp;lt; 3&lt;br /&gt;
      user = User.find_by_name(row_hash[:name])&lt;br /&gt;
      puts &amp;quot;inside import&amp;quot;&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        attributes = ImportFileHelper.define_attributes(row_hash)&lt;br /&gt;
        user = ImportFileHelper.create_new_user(attributes, session)&lt;br /&gt;
      if(row_hash.length&amp;gt;3)&lt;br /&gt;
        user.password=row_hash[:password]&lt;br /&gt;
        user.save&lt;br /&gt;
      else&lt;br /&gt;
        password = user.reset_password&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==='''Issue #918'''===&lt;br /&gt;
#Sql allows unicode values to be stored in the database.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
----&lt;br /&gt;
'''Issue 918'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Click on import topics&lt;br /&gt;
# Upload a file in the format given on the page, in place of topic description insert non-ASCII characters and upload&lt;br /&gt;
#Click on the import button.&lt;br /&gt;
#on the summary page, you should be able to see topic uploaded along with its description containing non-ASCII characters&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# on import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the rename the new team and import option.&lt;br /&gt;
#Upload a file containing the already existing team name.&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with a new name assigned and the new team with the name uploaded.&lt;br /&gt;
&lt;br /&gt;
'''Issue 328'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#On the import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the insert any new team members into the existing team option.&lt;br /&gt;
#Upload a file containing the already existing team name and new team members&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with additional team members&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Upload a file in the format given on the page without password field &lt;br /&gt;
#Click on import participant button&lt;br /&gt;
#You should be able to successfully import the participants&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Click on import participant button without uploading a file.&lt;br /&gt;
#You should be able to see a prompt error to upload a file and then import&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#[http://152.46.16.54:8080/  Deployed link]&lt;br /&gt;
#[https://github.com/ppvasude/expertiza  GitHub Repository]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1267  GitHub Pull Request]&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118870</id>
		<title>E1829 OSS project Duke Blue Fix import glitches</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118870"/>
		<updated>2018-11-08T20:12:42Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Headline text */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made to Fix import glitches.&lt;br /&gt;
&lt;br /&gt;
== '''Background''' ==&lt;br /&gt;
The import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc. from their learning management system. Being able to import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''The problems and their goal'''==&lt;br /&gt;
&lt;br /&gt;
=== '''Issue #329''' ===&lt;br /&gt;
Rename existing team when there is a conflict&lt;br /&gt;
&lt;br /&gt;
-&amp;gt;When importing teams there are different options to handle conflicting team names. We added an option rename EXISTING team when a conflict exists.&lt;br /&gt;
[[File:Fix328.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== '''Issue #328'''===&lt;br /&gt;
Merge teams when there is a conflict&lt;br /&gt;
-&amp;gt;When importing teams, and a conflict exists there is an option to merge the two teams by inserting the new members into an existing team.&lt;br /&gt;
[[File:Fix328r.jpg]]&lt;br /&gt;
&lt;br /&gt;
==='''Issue #181'''===&lt;br /&gt;
Validate file when importing participants&lt;br /&gt;
If one attempts to import users or participants, and does not specify the file to import from, a  NoMethodError error occurs. &lt;br /&gt;
-&amp;gt;The error has been handled by validating the file before importing the teams, thus the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
[[File:Fix181.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Issue #918''' ===&lt;br /&gt;
&lt;br /&gt;
Import of topics chokes on special characters&lt;br /&gt;
It seems that non-ASCII characters in the description (e.g., a curly apostrophe, and perhaps also an en-dash) caused a SQL error in inserting the description string into the database.&lt;br /&gt;
-&amp;gt;While importing the participants, the user can include special characters in the project description and is successfully stored in the database:&lt;br /&gt;
[[File:Topics_import.jpg]]&lt;br /&gt;
&lt;br /&gt;
==='''Issue #183'''===&lt;br /&gt;
Count of fields wrong in import&lt;br /&gt;
When importing participants (or users), it is typical not to specify a password, but rather to have the system generate it. But if you do that, Expertiza reports that each record in the file you are importing does not have enough records.&lt;br /&gt;
-&amp;gt;When the user tries to upload the file to import participants, password record should be made optional and let the user upload without password record:&lt;br /&gt;
[[File:Skip_password.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Use Case Diagram ==&lt;br /&gt;
[[File:OODD.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Implementation  ==&lt;br /&gt;
==='''Issue #328'''===&lt;br /&gt;
#We search the database to see if there is an existing team with the same name. In such a case we save the old team in the ‘team’ variable and set the team_exists flag to true.&lt;br /&gt;
#We then cal the handle_dups method which handles the case if value chosen by the user is ‘insert into existing team’, inside the code this value is represented as ‘insert’. &lt;br /&gt;
#Then the import_team_members function is called&lt;br /&gt;
#We get the user through his/her name&lt;br /&gt;
#If a user isn’t registered, we get a nil object and raise an ImportError&lt;br /&gt;
#Else we add the user to the team if he/she isn’t already in the team&lt;br /&gt;
#The add_member function only works till the team isn’t filled to its maximum capacity&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 if handle_dups==&amp;quot;insert&amp;quot;&lt;br /&gt;
      team.import_team_members(row_hash)&lt;br /&gt;
      return nil&lt;br /&gt;
&lt;br /&gt;
def import_team_members(starting_index = 0, row_hash)&lt;br /&gt;
    starting_index&lt;br /&gt;
    index = 0&lt;br /&gt;
    row_hash[:teammembers].each do |teammember|&lt;br /&gt;
      next if index &amp;lt; starting_index # not sure this will work, hash is not ordered like array&lt;br /&gt;
      user = User.find_by(name: teammember.to_s)&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        raise ImportError, &amp;quot;The user '#{teammember.to_s}' was not found. &amp;lt;a href='/users/new'&amp;gt;Create&amp;lt;/a&amp;gt; this user?&amp;quot;&lt;br /&gt;
      else&lt;br /&gt;
        add_member(user) if TeamsUser.find_by(team_id: id, user_id: user.id).nil?&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Issue 329'''===&lt;br /&gt;
#We included a new option in the duplicate handler field.&lt;br /&gt;
#We added a new handler in the handleDuplicates method to handle the given option as shown in the below screenshot.&lt;br /&gt;
#We leveraged the existing generateTeam() method and sent the existing team id to this method and replaced the existing team’s team name as follows:&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     if handle_dups == &amp;quot;rename_existing&amp;quot; # rename: rename existing team&lt;br /&gt;
       if teamtype.is_a?(CourseTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Course.find(id).name)) # update the old team name&lt;br /&gt;
      elsif  teamtype.is_a?(AssignmentTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Assignment.find(id).name)) # update the old team name&lt;br /&gt;
      end&lt;br /&gt;
      #team.update(name:self.generate_team_name(Assignment.find(id).name))&lt;br /&gt;
      return name # send the new team name&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Issue 181'''===&lt;br /&gt;
#We validate the file before importing the teams. Thus, the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
&lt;br /&gt;
==='''Issue 183'''===&lt;br /&gt;
#In the import method in user.rb file, there is a validation to check if the record length is less than 3 which is exclusive of password&lt;br /&gt;
#If the record length is greater than 3, it indicates that there is a password in the record and we save the password in the database&lt;br /&gt;
#If the length is equal to 3 then new system password is generated and saved for the user&lt;br /&gt;
In file app/models/user.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    def self.import(row_hash, _row_header, session, id = nil)&lt;br /&gt;
      raise ArgumentError, &amp;quot;Only #{row_hash.length} column(s) is(are) found.It must contain at least username, full name, email.&amp;quot; if row_hash.length &amp;lt; 3&lt;br /&gt;
      user = User.find_by_name(row_hash[:name])&lt;br /&gt;
      puts &amp;quot;inside import&amp;quot;&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        attributes = ImportFileHelper.define_attributes(row_hash)&lt;br /&gt;
        user = ImportFileHelper.create_new_user(attributes, session)&lt;br /&gt;
      if(row_hash.length&amp;gt;3)&lt;br /&gt;
        user.password=row_hash[:password]&lt;br /&gt;
        user.save&lt;br /&gt;
      else&lt;br /&gt;
        password = user.reset_password&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==='''Issue #918'''===&lt;br /&gt;
#Sql allows unicode values to be stored in the database.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
----&lt;br /&gt;
'''Issue 918'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Click on import topics&lt;br /&gt;
# Upload a file in the format given on the page, in place of topic description insert non-ASCII characters and upload&lt;br /&gt;
#Click on the import button.&lt;br /&gt;
#on the summary page, you should be able to see topic uploaded along with its description containing non-ASCII characters&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# on import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the rename the new team and import option.&lt;br /&gt;
#Upload a file containing the already existing team name.&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with a new name assigned and the new team with the name uploaded.&lt;br /&gt;
&lt;br /&gt;
'''Issue 328'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#On the import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the insert any new team members into the existing team option.&lt;br /&gt;
#Upload a file containing the already existing team name and new team members&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with additional team members&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Upload a file in the format given on the page without password field &lt;br /&gt;
#Click on import participant button&lt;br /&gt;
#You should be able to successfully import the participants&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Click on import participant button without uploading a file.&lt;br /&gt;
#You should be able to see a prompt error to upload a file and then import&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#[http://152.46.16.54:8080/ Deployed link]&lt;br /&gt;
#[https://github.com/ppvasude/expertiza  GitHub Repository]&lt;br /&gt;
#[ https://github.com/expertiza/expertiza/pull/1267  GitHub Pull Request]&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118869</id>
		<title>E1829 OSS project Duke Blue Fix import glitches</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118869"/>
		<updated>2018-11-08T20:10:23Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made to Fix import glitches.&lt;br /&gt;
&lt;br /&gt;
== '''Background''' ==&lt;br /&gt;
The import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc. from their learning management system. Being able to import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''The problems and their goal'''==&lt;br /&gt;
&lt;br /&gt;
=== '''Issue #329''' ===&lt;br /&gt;
Rename existing team when there is a conflict&lt;br /&gt;
&lt;br /&gt;
-&amp;gt;When importing teams there are different options to handle conflicting team names. We added an option rename EXISTING team when a conflict exists.&lt;br /&gt;
[[File:Fix328.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== '''Issue #328'''===&lt;br /&gt;
Merge teams when there is a conflict&lt;br /&gt;
-&amp;gt;When importing teams, and a conflict exists there is an option to merge the two teams by inserting the new members into an existing team.&lt;br /&gt;
[[File:Fix328r.jpg]]&lt;br /&gt;
&lt;br /&gt;
==='''Issue #181'''===&lt;br /&gt;
Validate file when importing participants&lt;br /&gt;
If one attempts to import users or participants, and does not specify the file to import from, a  NoMethodError error occurs. &lt;br /&gt;
-&amp;gt;The error has been handled by validating the file before importing the teams, thus the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
[[File:Fix181.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Issue #918''' ===&lt;br /&gt;
&lt;br /&gt;
Import of topics chokes on special characters&lt;br /&gt;
It seems that non-ASCII characters in the description (e.g., a curly apostrophe, and perhaps also an en-dash) caused a SQL error in inserting the description string into the database.&lt;br /&gt;
-&amp;gt;While importing the participants, the user can include special characters in the project description and is successfully stored in the database:&lt;br /&gt;
[[File:Topics_import.jpg]]&lt;br /&gt;
&lt;br /&gt;
==='''Issue #183'''===&lt;br /&gt;
Count of fields wrong in import&lt;br /&gt;
When importing participants (or users), it is typical not to specify a password, but rather to have the system generate it. But if you do that, Expertiza reports that each record in the file you are importing does not have enough records.&lt;br /&gt;
-&amp;gt;When the user tries to upload the file to import participants, password record should be made optional and let the user upload without password record:&lt;br /&gt;
[[File:Skip_password.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Use Case Diagram ==&lt;br /&gt;
[[File:OODD.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Implementation  ==&lt;br /&gt;
==='''Issue #328'''===&lt;br /&gt;
#We search the database to see if there is an existing team with the same name. In such a case we save the old team in the ‘team’ variable and set the team_exists flag to true.&lt;br /&gt;
#We then cal the handle_dups method which handles the case if value chosen by the user is ‘insert into existing team’, inside the code this value is represented as ‘insert’. &lt;br /&gt;
#Then the import_team_members function is called&lt;br /&gt;
#We get the user through his/her name&lt;br /&gt;
#If a user isn’t registered, we get a nil object and raise an ImportError&lt;br /&gt;
#Else we add the user to the team if he/she isn’t already in the team&lt;br /&gt;
#The add_member function only works till the team isn’t filled to its maximum capacity&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 if handle_dups==&amp;quot;insert&amp;quot;&lt;br /&gt;
      team.import_team_members(row_hash)&lt;br /&gt;
      return nil&lt;br /&gt;
&lt;br /&gt;
def import_team_members(starting_index = 0, row_hash)&lt;br /&gt;
    starting_index&lt;br /&gt;
    index = 0&lt;br /&gt;
    row_hash[:teammembers].each do |teammember|&lt;br /&gt;
      next if index &amp;lt; starting_index # not sure this will work, hash is not ordered like array&lt;br /&gt;
      user = User.find_by(name: teammember.to_s)&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        raise ImportError, &amp;quot;The user '#{teammember.to_s}' was not found. &amp;lt;a href='/users/new'&amp;gt;Create&amp;lt;/a&amp;gt; this user?&amp;quot;&lt;br /&gt;
      else&lt;br /&gt;
        add_member(user) if TeamsUser.find_by(team_id: id, user_id: user.id).nil?&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Issue 329'''===&lt;br /&gt;
#We included a new option in the duplicate handler field.&lt;br /&gt;
#We added a new handler in the handleDuplicates method to handle the given option as shown in the below screenshot.&lt;br /&gt;
#We leveraged the existing generateTeam() method and sent the existing team id to this method and replaced the existing team’s team name as follows:&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     if handle_dups == &amp;quot;rename_existing&amp;quot; # rename: rename existing team&lt;br /&gt;
       if teamtype.is_a?(CourseTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Course.find(id).name)) # update the old team name&lt;br /&gt;
      elsif  teamtype.is_a?(AssignmentTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Assignment.find(id).name)) # update the old team name&lt;br /&gt;
      end&lt;br /&gt;
      #team.update(name:self.generate_team_name(Assignment.find(id).name))&lt;br /&gt;
      return name # send the new team name&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Issue 181'''===&lt;br /&gt;
#We validate the file before importing the teams. Thus, the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
&lt;br /&gt;
==='''Issue 183'''===&lt;br /&gt;
#In the import method in user.rb file, there is a validation to check if the record length is less than 3 which is exclusive of password&lt;br /&gt;
#If the record length is greater than 3, it indicates that there is a password in the record and we save the password in the database&lt;br /&gt;
#If the length is equal to 3 then new system password is generated and saved for the user&lt;br /&gt;
In file app/models/user.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    def self.import(row_hash, _row_header, session, id = nil)&lt;br /&gt;
      raise ArgumentError, &amp;quot;Only #{row_hash.length} column(s) is(are) found.It must contain at least username, full name, email.&amp;quot; if row_hash.length &amp;lt; 3&lt;br /&gt;
      user = User.find_by_name(row_hash[:name])&lt;br /&gt;
      puts &amp;quot;inside import&amp;quot;&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        attributes = ImportFileHelper.define_attributes(row_hash)&lt;br /&gt;
        user = ImportFileHelper.create_new_user(attributes, session)&lt;br /&gt;
      if(row_hash.length&amp;gt;3)&lt;br /&gt;
        user.password=row_hash[:password]&lt;br /&gt;
        user.save&lt;br /&gt;
      else&lt;br /&gt;
        password = user.reset_password&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==='''Issue #918'''===&lt;br /&gt;
#Sql allows unicode values to be stored in the database.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
----&lt;br /&gt;
'''Issue 918'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Click on import topics&lt;br /&gt;
# Upload a file in the format given on the page, in place of topic description insert non-ASCII characters and upload&lt;br /&gt;
#Click on the import button.&lt;br /&gt;
#on the summary page, you should be able to see topic uploaded along with its description containing non-ASCII characters&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# on import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the rename the new team and import option.&lt;br /&gt;
#Upload a file containing the already existing team name.&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with a new name assigned and the new team with the name uploaded.&lt;br /&gt;
&lt;br /&gt;
'''Issue 328'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#On the import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the insert any new team members into the existing team option.&lt;br /&gt;
#Upload a file containing the already existing team name and new team members&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with additional team members&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Upload a file in the format given on the page without password field &lt;br /&gt;
#Click on import participant button&lt;br /&gt;
#You should be able to successfully import the participants&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Click on import participant button without uploading a file.&lt;br /&gt;
#You should be able to see a prompt error to upload a file and then import&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&lt;br /&gt;
#[http://152.46.16.54:8080/ Deployed link]&lt;br /&gt;
#[https://github.com/ppvasude/expertiza  GitHub Repository]&lt;br /&gt;
#[ https://github.com/expertiza/expertiza/pull/1267  GitHub Pull Request]&lt;br /&gt;
&lt;br /&gt;
== Headline text ==&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118868</id>
		<title>E1829 OSS project Duke Blue Fix import glitches</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118868"/>
		<updated>2018-11-08T19:12:36Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made to Fix import glitches.&lt;br /&gt;
&lt;br /&gt;
== '''Background''' ==&lt;br /&gt;
The import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc. from their learning management system. Being able to import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''The problems and their goal'''==&lt;br /&gt;
&lt;br /&gt;
=== '''Issue #329''' ===&lt;br /&gt;
Rename existing team when there is a conflict&lt;br /&gt;
&lt;br /&gt;
-&amp;gt;When importing teams there are different options to handle conflicting team names. We added an option rename EXISTING team when a conflict exists.&lt;br /&gt;
[[File:Fix328.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== '''Issue #328'''===&lt;br /&gt;
Merge teams when there is a conflict&lt;br /&gt;
-&amp;gt;When importing teams, and a conflict exists there is an option to merge the two teams by inserting the new members into an existing team.&lt;br /&gt;
[[File:Fix328r.jpg]]&lt;br /&gt;
&lt;br /&gt;
==='''Issue #181'''===&lt;br /&gt;
Validate file when importing participants&lt;br /&gt;
If one attempts to import users or participants, and does not specify the file to import from, a  NoMethodError error occurs. &lt;br /&gt;
-&amp;gt;The error has been handled by validating the file before importing the teams, thus the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
[[File:Fix181.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Issue #918''' ===&lt;br /&gt;
&lt;br /&gt;
Import of topics chokes on special characters&lt;br /&gt;
It seems that non-ASCII characters in the description (e.g., a curly apostrophe, and perhaps also an en-dash) caused a SQL error in inserting the description string into the database.&lt;br /&gt;
-&amp;gt;While importing the participants, the user can include special characters in the project description and is successfully stored in the database:&lt;br /&gt;
[[File:Topics_import.jpg]]&lt;br /&gt;
&lt;br /&gt;
==='''Issue #183'''===&lt;br /&gt;
Count of fields wrong in import&lt;br /&gt;
When importing participants (or users), it is typical not to specify a password, but rather to have the system generate it. But if you do that, Expertiza reports that each record in the file you are importing does not have enough records.&lt;br /&gt;
-&amp;gt;When the user tries to upload the file to import participants, password record should be made optional and let the user upload without password record:&lt;br /&gt;
[[File:Skip_password.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Use Case Diagram ==&lt;br /&gt;
[[File:OODD.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Implementation  ==&lt;br /&gt;
==='''Issue #328'''===&lt;br /&gt;
#We search the database to see if there is an existing team with the same name. In such a case we save the old team in the ‘team’ variable and set the team_exists flag to true.&lt;br /&gt;
#We then cal the handle_dups method which handles the case if value chosen by the user is ‘insert into existing team’, inside the code this value is represented as ‘insert’. &lt;br /&gt;
#Then the import_team_members function is called&lt;br /&gt;
#We get the user through his/her name&lt;br /&gt;
#If a user isn’t registered, we get a nil object and raise an ImportError&lt;br /&gt;
#Else we add the user to the team if he/she isn’t already in the team&lt;br /&gt;
#The add_member function only works till the team isn’t filled to its maximum capacity&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 if handle_dups==&amp;quot;insert&amp;quot;&lt;br /&gt;
      team.import_team_members(row_hash)&lt;br /&gt;
      return nil&lt;br /&gt;
&lt;br /&gt;
def import_team_members(starting_index = 0, row_hash)&lt;br /&gt;
    starting_index&lt;br /&gt;
    index = 0&lt;br /&gt;
    row_hash[:teammembers].each do |teammember|&lt;br /&gt;
      next if index &amp;lt; starting_index # not sure this will work, hash is not ordered like array&lt;br /&gt;
      user = User.find_by(name: teammember.to_s)&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        raise ImportError, &amp;quot;The user '#{teammember.to_s}' was not found. &amp;lt;a href='/users/new'&amp;gt;Create&amp;lt;/a&amp;gt; this user?&amp;quot;&lt;br /&gt;
      else&lt;br /&gt;
        add_member(user) if TeamsUser.find_by(team_id: id, user_id: user.id).nil?&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Issue 329'''===&lt;br /&gt;
#We included a new option in the duplicate handler field.&lt;br /&gt;
#We added a new handler in the handleDuplicates method to handle the given option as shown in the below screenshot.&lt;br /&gt;
#We leveraged the existing generateTeam() method and sent the existing team id to this method and replaced the existing team’s team name as follows:&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     if handle_dups == &amp;quot;rename_existing&amp;quot; # rename: rename existing team&lt;br /&gt;
       if teamtype.is_a?(CourseTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Course.find(id).name)) # update the old team name&lt;br /&gt;
      elsif  teamtype.is_a?(AssignmentTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Assignment.find(id).name)) # update the old team name&lt;br /&gt;
      end&lt;br /&gt;
      #team.update(name:self.generate_team_name(Assignment.find(id).name))&lt;br /&gt;
      return name # send the new team name&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Issue 181'''===&lt;br /&gt;
#We validate the file before importing the teams. Thus, the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
&lt;br /&gt;
==='''Issue 183'''===&lt;br /&gt;
#In the import method in user.rb file, there is a validation to check if the record length is less than 3 which is exclusive of password&lt;br /&gt;
#If the record length is greater than 3, it indicates that there is a password in the record and we save the password in the database&lt;br /&gt;
#If the length is equal to 3 then new system password is generated and saved for the user&lt;br /&gt;
In file app/models/user.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    def self.import(row_hash, _row_header, session, id = nil)&lt;br /&gt;
      raise ArgumentError, &amp;quot;Only #{row_hash.length} column(s) is(are) found.It must contain at least username, full name, email.&amp;quot; if row_hash.length &amp;lt; 3&lt;br /&gt;
      user = User.find_by_name(row_hash[:name])&lt;br /&gt;
      puts &amp;quot;inside import&amp;quot;&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        attributes = ImportFileHelper.define_attributes(row_hash)&lt;br /&gt;
        user = ImportFileHelper.create_new_user(attributes, session)&lt;br /&gt;
      if(row_hash.length&amp;gt;3)&lt;br /&gt;
        user.password=row_hash[:password]&lt;br /&gt;
        user.save&lt;br /&gt;
      else&lt;br /&gt;
        password = user.reset_password&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==='''Issue #918'''===&lt;br /&gt;
#Sql allows unicode values to be stored in the database.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
----&lt;br /&gt;
'''Issue 918'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Click on import topics&lt;br /&gt;
# Upload a file in the format given on the page, in place of topic description insert non-ASCII characters and upload&lt;br /&gt;
#Click on the import button.&lt;br /&gt;
#on the summary page, you should be able to see topic uploaded along with its description containing non-ASCII characters&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# on import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the rename the new team and import option.&lt;br /&gt;
#Upload a file containing the already existing team name.&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with a new name assigned and the new team with the name uploaded.&lt;br /&gt;
&lt;br /&gt;
'''Issue 328'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#On the import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the insert any new team members into the existing team option.&lt;br /&gt;
#Upload a file containing the already existing team name and new team members&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with additional team members&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Upload a file in the format given on the page without password field &lt;br /&gt;
#Click on import participant button&lt;br /&gt;
#You should be able to successfully import the participants&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Click on import participant button without uploading a file.&lt;br /&gt;
#You should be able to see a prompt error to upload a file and then import&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118867</id>
		<title>E1829 OSS project Duke Blue Fix import glitches</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118867"/>
		<updated>2018-11-08T19:10:36Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made to Fix import glitches.&lt;br /&gt;
&lt;br /&gt;
== '''Background''' ==&lt;br /&gt;
The import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc. from their learning management system. Being able to import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''The problems and their goal'''==&lt;br /&gt;
&lt;br /&gt;
=== '''Issue #329''' ===&lt;br /&gt;
Rename existing team when there is a conflict&lt;br /&gt;
&lt;br /&gt;
-&amp;gt;When importing teams there are different options to handle conflicting team names. We added an option rename EXISTING team when a conflict exists.&lt;br /&gt;
[[File:Fix328.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== '''Issue #328'''===&lt;br /&gt;
Merge teams when there is a conflict&lt;br /&gt;
-&amp;gt;When importing teams, and a conflict exists there is an option to merge the two teams by inserting the new members into an existing team.&lt;br /&gt;
[[File:Fix328r.jpg]]&lt;br /&gt;
&lt;br /&gt;
==='''Issue #181'''===&lt;br /&gt;
Validate file when importing participants&lt;br /&gt;
If one attempts to import users or participants, and does not specify the file to import from, a  NoMethodError error occurs. &lt;br /&gt;
-&amp;gt;The error has been handled by validating the file before importing the teams, thus the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
[[File:Fix181.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Issue #918''' ===&lt;br /&gt;
&lt;br /&gt;
Import of topics chokes on special characters&lt;br /&gt;
It seems that non-ASCII characters in the description (e.g., a curly apostrophe, and perhaps also an en-dash) caused a SQL error in inserting the description string into the database.&lt;br /&gt;
-&amp;gt;While importing the participants, the user can include special characters in the project description and is successfully stored in the database:&lt;br /&gt;
[[File:Topics_import.jpg]]&lt;br /&gt;
&lt;br /&gt;
==='''Issue #183'''===&lt;br /&gt;
Count of fields wrong in import&lt;br /&gt;
When importing participants (or users), it is typical not to specify a password, but rather to have the system generate it. But if you do that, Expertiza reports that each record in the file you are importing does not have enough records.&lt;br /&gt;
-&amp;gt;When the user tries to upload the file to import participants, password record should be made optional and let the user upload without password record:&lt;br /&gt;
[[File:Skip_password.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Use Case Diagram ==&lt;br /&gt;
[[File:OODD.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Implementation  ==&lt;br /&gt;
==='''Issue #328'''===&lt;br /&gt;
#We search the database to see if there is an existing team with the same name. In such a case we save the old team in the ‘team’ variable and set the team_exists flag to true.&lt;br /&gt;
#We then cal the handle_dups method which handles the case if value chosen by the user is ‘insert into existing team’, inside the code this value is represented as ‘insert’. &lt;br /&gt;
#Then the import_team_members function is called&lt;br /&gt;
#We get the user through his/her name&lt;br /&gt;
#If a user isn’t registered, we get a nil object and raise an ImportError&lt;br /&gt;
#Else we add the user to the team if he/she isn’t already in the team&lt;br /&gt;
#The add_member function only works till the team isn’t filled to its maximum capacity&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 if handle_dups==&amp;quot;insert&amp;quot;&lt;br /&gt;
      team.import_team_members(row_hash)&lt;br /&gt;
      return nil&lt;br /&gt;
&lt;br /&gt;
def import_team_members(starting_index = 0, row_hash)&lt;br /&gt;
    starting_index&lt;br /&gt;
    index = 0&lt;br /&gt;
    row_hash[:teammembers].each do |teammember|&lt;br /&gt;
      next if index &amp;lt; starting_index # not sure this will work, hash is not ordered like array&lt;br /&gt;
      user = User.find_by(name: teammember.to_s)&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        raise ImportError, &amp;quot;The user '#{teammember.to_s}' was not found. &amp;lt;a href='/users/new'&amp;gt;Create&amp;lt;/a&amp;gt; this user?&amp;quot;&lt;br /&gt;
      else&lt;br /&gt;
        add_member(user) if TeamsUser.find_by(team_id: id, user_id: user.id).nil?&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Issue 329'''===&lt;br /&gt;
#We included a new option in the duplicate handler field.&lt;br /&gt;
#We added a new handler in the handleDuplicates method to handle the given option as shown in the below screenshot.&lt;br /&gt;
#We leveraged the existing generateTeam() method and sent the existing team id to this method and replaced the existing team’s team name as follows:&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     if handle_dups == &amp;quot;rename_existing&amp;quot; # rename: rename existing team&lt;br /&gt;
       if teamtype.is_a?(CourseTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Course.find(id).name)) # update the old team name&lt;br /&gt;
      elsif  teamtype.is_a?(AssignmentTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Assignment.find(id).name)) # update the old team name&lt;br /&gt;
      end&lt;br /&gt;
      #team.update(name:self.generate_team_name(Assignment.find(id).name))&lt;br /&gt;
      return name # send the new team name&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Issue 181'''===&lt;br /&gt;
#We validate the file before importing the teams. Thus, the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
&lt;br /&gt;
==='''Issue 183'''===&lt;br /&gt;
#In the import method in user.rb file, there is a validation to check if the record length is less than 3 which is exclusive of password&lt;br /&gt;
#If the record length is greater than 3, it indicates that there is a password in the record and we save the password in the database&lt;br /&gt;
#If the length is equal to 3 then new system password is generated and saved for the user&lt;br /&gt;
In file app/models/user.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    def self.import(row_hash, _row_header, session, id = nil)&lt;br /&gt;
      raise ArgumentError, &amp;quot;Only #{row_hash.length} column(s) is(are) found.It must contain at least username, full name, email.&amp;quot; if row_hash.length &amp;lt; 3&lt;br /&gt;
      user = User.find_by_name(row_hash[:name])&lt;br /&gt;
      puts &amp;quot;inside import&amp;quot;&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        attributes = ImportFileHelper.define_attributes(row_hash)&lt;br /&gt;
        user = ImportFileHelper.create_new_user(attributes, session)&lt;br /&gt;
      if(row_hash.length&amp;gt;3)&lt;br /&gt;
        user.password=row_hash[:password]&lt;br /&gt;
        user.save&lt;br /&gt;
      else&lt;br /&gt;
        password = user.reset_password&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==='''Issue #918'''===&lt;br /&gt;
#Sql allows unicode values to be stored in the database.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
To check the issue resolved, please follow the steps&lt;br /&gt;
'''Issue 918'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Click on import topics&lt;br /&gt;
# Upload a file in the format given on the page, in place of topic description insert non-ASCII characters and upload&lt;br /&gt;
#Click on the import button.&lt;br /&gt;
#on the summary page, you should be able to see topic uploaded along with its description containing non-ASCII characters&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# on import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the rename the new team and import option.&lt;br /&gt;
#Upload a file containing the already existing team name.&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with a new name assigned and the new team with the name uploaded.&lt;br /&gt;
&lt;br /&gt;
'''Issue 328'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#On the import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the insert any new team members into the existing team option.&lt;br /&gt;
#Upload a file containing the already existing team name and new team members&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with additional team members&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Upload a file in the format given on the page without password field &lt;br /&gt;
#Click on import participant button&lt;br /&gt;
#You should be able to successfully import the participants&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Click on import participant button without uploading a file.&lt;br /&gt;
#You should be able to see a prompt error to upload a file and then import&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118866</id>
		<title>E1829 OSS project Duke Blue Fix import glitches</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118866"/>
		<updated>2018-11-08T19:09:18Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made to Fix import glitches.&lt;br /&gt;
&lt;br /&gt;
== '''Background''' ==&lt;br /&gt;
The import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc. from their learning management system. Being able to import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''The problems and their goal'''==&lt;br /&gt;
&lt;br /&gt;
=== '''Issue #329''' ===&lt;br /&gt;
Rename existing team when there is a conflict&lt;br /&gt;
&lt;br /&gt;
-&amp;gt;When importing teams there are different options to handle conflicting team names. We added an option rename EXISTING team when a conflict exists.&lt;br /&gt;
[[File:Fix328.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== '''Issue #328'''===&lt;br /&gt;
Merge teams when there is a conflict&lt;br /&gt;
-&amp;gt;When importing teams, and a conflict exists there is an option to merge the two teams by inserting the new members into an existing team.&lt;br /&gt;
[[File:Fix328r.jpg]]&lt;br /&gt;
&lt;br /&gt;
==='''Issue #181'''===&lt;br /&gt;
Validate file when importing participants&lt;br /&gt;
If one attempts to import users or participants, and does not specify the file to import from, a  NoMethodError error occurs. &lt;br /&gt;
-&amp;gt;The error has been handled by validating the file before importing the teams, thus the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
[[File:Fix181.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Issue #918''' ===&lt;br /&gt;
&lt;br /&gt;
Import of topics chokes on special characters&lt;br /&gt;
It seems that non-ASCII characters in the description (e.g., a curly apostrophe, and perhaps also an en-dash) caused a SQL error in inserting the description string into the database.&lt;br /&gt;
-&amp;gt;While importing the participants, the user can include special characters in the project description and is successfully stored in the database:&lt;br /&gt;
[[File:Topics_import.jpg]]&lt;br /&gt;
&lt;br /&gt;
==='''Issue #183'''===&lt;br /&gt;
Count of fields wrong in import&lt;br /&gt;
When importing participants (or users), it is typical not to specify a password, but rather to have the system generate it. But if you do that, Expertiza reports that each record in the file you are importing does not have enough records.&lt;br /&gt;
-&amp;gt;When the user tries to upload the file to import participants, password record should be made optional and let the user upload without password record:&lt;br /&gt;
[[File:Skip_password.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Use Case Diagram ==&lt;br /&gt;
[[File:OODD.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Implementation  ==&lt;br /&gt;
==='''Issue #328'''===&lt;br /&gt;
#We search the database to see if there is an existing team with the same name. In such a case we save the old team in the ‘team’ variable and set the team_exists flag to true.&lt;br /&gt;
#We then cal the handle_dups method which handles the case if value chosen by the user is ‘insert into existing team’, inside the code this value is represented as ‘insert’. &lt;br /&gt;
#Then the import_team_members function is called&lt;br /&gt;
#We get the user through his/her name&lt;br /&gt;
#If a user isn’t registered, we get a nil object and raise an ImportError&lt;br /&gt;
#Else we add the user to the team if he/she isn’t already in the team&lt;br /&gt;
#The add_member function only works till the team isn’t filled to its maximum capacity&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 if handle_dups==&amp;quot;insert&amp;quot;&lt;br /&gt;
      team.import_team_members(row_hash)&lt;br /&gt;
      return nil&lt;br /&gt;
&lt;br /&gt;
def import_team_members(starting_index = 0, row_hash)&lt;br /&gt;
    starting_index&lt;br /&gt;
    index = 0&lt;br /&gt;
    row_hash[:teammembers].each do |teammember|&lt;br /&gt;
      next if index &amp;lt; starting_index # not sure this will work, hash is not ordered like array&lt;br /&gt;
      user = User.find_by(name: teammember.to_s)&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        raise ImportError, &amp;quot;The user '#{teammember.to_s}' was not found. &amp;lt;a href='/users/new'&amp;gt;Create&amp;lt;/a&amp;gt; this user?&amp;quot;&lt;br /&gt;
      else&lt;br /&gt;
        add_member(user) if TeamsUser.find_by(team_id: id, user_id: user.id).nil?&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==='''Issue 329'''===&lt;br /&gt;
#We included a new option in the duplicate handler field.&lt;br /&gt;
#We added a new handler in the handleDuplicates method to handle the given option as shown in the below screenshot.&lt;br /&gt;
#We leveraged the existing generateTeam() method and sent the existing team id to this method and replaced the existing team’s team name as follows:&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     if handle_dups == &amp;quot;rename_existing&amp;quot; # rename: rename existing team&lt;br /&gt;
       if teamtype.is_a?(CourseTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Course.find(id).name)) # update the old team name&lt;br /&gt;
      elsif  teamtype.is_a?(AssignmentTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Assignment.find(id).name)) # update the old team name&lt;br /&gt;
      end&lt;br /&gt;
      #team.update(name:self.generate_team_name(Assignment.find(id).name))&lt;br /&gt;
      return name # send the new team name&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Issue 181'''===&lt;br /&gt;
#We validate the file before importing the teams. Thus, the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
&lt;br /&gt;
==='''Issue 183'''===&lt;br /&gt;
#In the import method in user.rb file, there is a validation to check if the record length is less than 3 which is exclusive of password&lt;br /&gt;
#If the record length is greater than 3, it indicates that there is a password in the record and we save the password in the database&lt;br /&gt;
#If the length is equal to 3 then new system password is generated and saved for the user&lt;br /&gt;
In file app/models/user.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    def self.import(row_hash, _row_header, session, id = nil)&lt;br /&gt;
      raise ArgumentError, &amp;quot;Only #{row_hash.length} column(s) is(are) found.It must contain at least username, full name, email.&amp;quot; if row_hash.length &amp;lt; 3&lt;br /&gt;
      user = User.find_by_name(row_hash[:name])&lt;br /&gt;
      puts &amp;quot;inside import&amp;quot;&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        attributes = ImportFileHelper.define_attributes(row_hash)&lt;br /&gt;
        user = ImportFileHelper.create_new_user(attributes, session)&lt;br /&gt;
      if(row_hash.length&amp;gt;3)&lt;br /&gt;
        user.password=row_hash[:password]&lt;br /&gt;
        user.save&lt;br /&gt;
      else&lt;br /&gt;
        password = user.reset_password&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
==='''Issue #918'''===&lt;br /&gt;
#Sql allows unicode values to be stored in the database.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
----&lt;br /&gt;
To check the issue resolved, please follow the steps&lt;br /&gt;
'''Issue 918'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Click on import topics&lt;br /&gt;
# Upload a file in the format given on the page, in place of topic description insert non-ASCII characters and upload&lt;br /&gt;
#Click on the import button.&lt;br /&gt;
#on the summary page, you should be able to see topic uploaded along with its description containing non-ASCII characters&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# on import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the rename the new team and import option.&lt;br /&gt;
#Upload a file containing the already existing team name.&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with a new name assigned and the new team with the name uploaded.&lt;br /&gt;
&lt;br /&gt;
'''Issue 328'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#On the import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the insert any new team members into the existing team option.&lt;br /&gt;
#Upload a file containing the already existing team name and new team members&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with additional team members&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Upload a file in the format given on the page without password field &lt;br /&gt;
#Click on import participant button&lt;br /&gt;
#You should be able to successfully import the participants&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Click on import participant button without uploading a file.&lt;br /&gt;
#You should be able to see a prompt error to upload a file and then import&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118865</id>
		<title>E1829 OSS project Duke Blue Fix import glitches</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118865"/>
		<updated>2018-11-08T19:08:18Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Use Case Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made to Fix import glitches.&lt;br /&gt;
&lt;br /&gt;
== '''Background''' ==&lt;br /&gt;
The import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc. from their learning management system. Being able to import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''The problems and their goal'''==&lt;br /&gt;
&lt;br /&gt;
=== '''Issue #329''' ===&lt;br /&gt;
Rename existing team when there is a conflict&lt;br /&gt;
&lt;br /&gt;
-&amp;gt;When importing teams there are different options to handle conflicting team names. We added an option rename EXISTING team when a conflict exists.&lt;br /&gt;
[[File:Fix328.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== '''Issue #328'''===&lt;br /&gt;
Merge teams when there is a conflict&lt;br /&gt;
-&amp;gt;When importing teams, and a conflict exists there is an option to merge the two teams by inserting the new members into an existing team.&lt;br /&gt;
[[File:Fix328r.jpg]]&lt;br /&gt;
&lt;br /&gt;
==='''Issue #181'''===&lt;br /&gt;
Validate file when importing participants&lt;br /&gt;
If one attempts to import users or participants, and does not specify the file to import from, a  NoMethodError error occurs. &lt;br /&gt;
-&amp;gt;The error has been handled by validating the file before importing the teams, thus the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
[[File:Fix181.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Issue #918''' ===&lt;br /&gt;
&lt;br /&gt;
Import of topics chokes on special characters&lt;br /&gt;
It seems that non-ASCII characters in the description (e.g., a curly apostrophe, and perhaps also an en-dash) caused a SQL error in inserting the description string into the database.&lt;br /&gt;
-&amp;gt;While importing the participants, the user can include special characters in the project description and is successfully stored in the database:&lt;br /&gt;
[[File:Topics_import.jpg]]&lt;br /&gt;
&lt;br /&gt;
==='''Issue #183'''===&lt;br /&gt;
Count of fields wrong in import&lt;br /&gt;
When importing participants (or users), it is typical not to specify a password, but rather to have the system generate it. But if you do that, Expertiza reports that each record in the file you are importing does not have enough records.&lt;br /&gt;
-&amp;gt;When the user tries to upload the file to import participants, password record should be made optional and let the user upload without password record:&lt;br /&gt;
[[File:Skip_password.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Use Case Diagram ==&lt;br /&gt;
[[File:OODD.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Implementation  ==&lt;br /&gt;
'''Issue #328'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
#We search the database to see if there is an existing team with the same name. In such a case we save the old team in the ‘team’ variable and set the team_exists flag to true.&lt;br /&gt;
#We then cal the handle_dups method which handles the case if value chosen by the user is ‘insert into existing team’, inside the code this value is represented as ‘insert’. &lt;br /&gt;
#Then the import_team_members function is called&lt;br /&gt;
#We get the user through his/her name&lt;br /&gt;
#If a user isn’t registered, we get a nil object and raise an ImportError&lt;br /&gt;
#Else we add the user to the team if he/she isn’t already in the team&lt;br /&gt;
#The add_member function only works till the team isn’t filled to its maximum capacity&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 if handle_dups==&amp;quot;insert&amp;quot;&lt;br /&gt;
      team.import_team_members(row_hash)&lt;br /&gt;
      return nil&lt;br /&gt;
&lt;br /&gt;
def import_team_members(starting_index = 0, row_hash)&lt;br /&gt;
    starting_index&lt;br /&gt;
    index = 0&lt;br /&gt;
    row_hash[:teammembers].each do |teammember|&lt;br /&gt;
      next if index &amp;lt; starting_index # not sure this will work, hash is not ordered like array&lt;br /&gt;
      user = User.find_by(name: teammember.to_s)&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        raise ImportError, &amp;quot;The user '#{teammember.to_s}' was not found. &amp;lt;a href='/users/new'&amp;gt;Create&amp;lt;/a&amp;gt; this user?&amp;quot;&lt;br /&gt;
      else&lt;br /&gt;
        add_member(user) if TeamsUser.find_by(team_id: id, user_id: user.id).nil?&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#We included a new option in the duplicate handler field.&lt;br /&gt;
#We added a new handler in the handleDuplicates method to handle the given option as shown in the below screenshot.&lt;br /&gt;
#We leveraged the existing generateTeam() method and sent the existing team id to this method and replaced the existing team’s team name as follows:&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     if handle_dups == &amp;quot;rename_existing&amp;quot; # rename: rename existing team&lt;br /&gt;
       if teamtype.is_a?(CourseTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Course.find(id).name)) # update the old team name&lt;br /&gt;
      elsif  teamtype.is_a?(AssignmentTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Assignment.find(id).name)) # update the old team name&lt;br /&gt;
      end&lt;br /&gt;
      #team.update(name:self.generate_team_name(Assignment.find(id).name))&lt;br /&gt;
      return name # send the new team name&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#We validate the file before importing the teams. Thus, the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#In the import method in user.rb file, there is a validation to check if the record length is less than 3 which is exclusive of password&lt;br /&gt;
#If the record length is greater than 3, it indicates that there is a password in the record and we save the password in the database&lt;br /&gt;
#If the length is equal to 3 then new system password is generated and saved for the user&lt;br /&gt;
In file app/models/user.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    def self.import(row_hash, _row_header, session, id = nil)&lt;br /&gt;
      raise ArgumentError, &amp;quot;Only #{row_hash.length} column(s) is(are) found.It must contain at least username, full name, email.&amp;quot; if row_hash.length &amp;lt; 3&lt;br /&gt;
      user = User.find_by_name(row_hash[:name])&lt;br /&gt;
      puts &amp;quot;inside import&amp;quot;&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        attributes = ImportFileHelper.define_attributes(row_hash)&lt;br /&gt;
        user = ImportFileHelper.create_new_user(attributes, session)&lt;br /&gt;
      if(row_hash.length&amp;gt;3)&lt;br /&gt;
        user.password=row_hash[:password]&lt;br /&gt;
        user.save&lt;br /&gt;
      else&lt;br /&gt;
        password = user.reset_password&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Issue #918''' Import of topics chokes on special characters&lt;br /&gt;
#Sql allows unicode values to be stored in the database.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
----&lt;br /&gt;
To check the issue resolved, please follow the steps&lt;br /&gt;
'''Issue 918'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Click on import topics&lt;br /&gt;
# Upload a file in the format given on the page, in place of topic description insert non-ASCII characters and upload&lt;br /&gt;
#Click on the import button.&lt;br /&gt;
#on the summary page, you should be able to see topic uploaded along with its description containing non-ASCII characters&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# on import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the rename the new team and import option.&lt;br /&gt;
#Upload a file containing the already existing team name.&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with a new name assigned and the new team with the name uploaded.&lt;br /&gt;
&lt;br /&gt;
'''Issue 328'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#On the import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the insert any new team members into the existing team option.&lt;br /&gt;
#Upload a file containing the already existing team name and new team members&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with additional team members&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Upload a file in the format given on the page without password field &lt;br /&gt;
#Click on import participant button&lt;br /&gt;
#You should be able to successfully import the participants&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Click on import participant button without uploading a file.&lt;br /&gt;
#You should be able to see a prompt error to upload a file and then import&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118864</id>
		<title>E1829 OSS project Duke Blue Fix import glitches</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118864"/>
		<updated>2018-11-08T19:07:57Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* The problems and their goal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made to Fix import glitches.&lt;br /&gt;
&lt;br /&gt;
== '''Background''' ==&lt;br /&gt;
The import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc. from their learning management system. Being able to import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''The problems and their goal'''==&lt;br /&gt;
&lt;br /&gt;
=== '''Issue #329''' ===&lt;br /&gt;
Rename existing team when there is a conflict&lt;br /&gt;
&lt;br /&gt;
-&amp;gt;When importing teams there are different options to handle conflicting team names. We added an option rename EXISTING team when a conflict exists.&lt;br /&gt;
[[File:Fix328.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== '''Issue #328'''===&lt;br /&gt;
Merge teams when there is a conflict&lt;br /&gt;
-&amp;gt;When importing teams, and a conflict exists there is an option to merge the two teams by inserting the new members into an existing team.&lt;br /&gt;
[[File:Fix328r.jpg]]&lt;br /&gt;
&lt;br /&gt;
==='''Issue #181'''===&lt;br /&gt;
Validate file when importing participants&lt;br /&gt;
If one attempts to import users or participants, and does not specify the file to import from, a  NoMethodError error occurs. &lt;br /&gt;
-&amp;gt;The error has been handled by validating the file before importing the teams, thus the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
[[File:Fix181.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==='''Issue #918''' ===&lt;br /&gt;
&lt;br /&gt;
Import of topics chokes on special characters&lt;br /&gt;
It seems that non-ASCII characters in the description (e.g., a curly apostrophe, and perhaps also an en-dash) caused a SQL error in inserting the description string into the database.&lt;br /&gt;
-&amp;gt;While importing the participants, the user can include special characters in the project description and is successfully stored in the database:&lt;br /&gt;
[[File:Topics_import.jpg]]&lt;br /&gt;
&lt;br /&gt;
==='''Issue #183'''===&lt;br /&gt;
Count of fields wrong in import&lt;br /&gt;
When importing participants (or users), it is typical not to specify a password, but rather to have the system generate it. But if you do that, Expertiza reports that each record in the file you are importing does not have enough records.&lt;br /&gt;
-&amp;gt;When the user tries to upload the file to import participants, password record should be made optional and let the user upload without password record:&lt;br /&gt;
[[File:Skip_password.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Use Case Diagram ==&lt;br /&gt;
----&lt;br /&gt;
[[File:OODD.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Implementation  ==&lt;br /&gt;
'''Issue #328'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
#We search the database to see if there is an existing team with the same name. In such a case we save the old team in the ‘team’ variable and set the team_exists flag to true.&lt;br /&gt;
#We then cal the handle_dups method which handles the case if value chosen by the user is ‘insert into existing team’, inside the code this value is represented as ‘insert’. &lt;br /&gt;
#Then the import_team_members function is called&lt;br /&gt;
#We get the user through his/her name&lt;br /&gt;
#If a user isn’t registered, we get a nil object and raise an ImportError&lt;br /&gt;
#Else we add the user to the team if he/she isn’t already in the team&lt;br /&gt;
#The add_member function only works till the team isn’t filled to its maximum capacity&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 if handle_dups==&amp;quot;insert&amp;quot;&lt;br /&gt;
      team.import_team_members(row_hash)&lt;br /&gt;
      return nil&lt;br /&gt;
&lt;br /&gt;
def import_team_members(starting_index = 0, row_hash)&lt;br /&gt;
    starting_index&lt;br /&gt;
    index = 0&lt;br /&gt;
    row_hash[:teammembers].each do |teammember|&lt;br /&gt;
      next if index &amp;lt; starting_index # not sure this will work, hash is not ordered like array&lt;br /&gt;
      user = User.find_by(name: teammember.to_s)&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        raise ImportError, &amp;quot;The user '#{teammember.to_s}' was not found. &amp;lt;a href='/users/new'&amp;gt;Create&amp;lt;/a&amp;gt; this user?&amp;quot;&lt;br /&gt;
      else&lt;br /&gt;
        add_member(user) if TeamsUser.find_by(team_id: id, user_id: user.id).nil?&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#We included a new option in the duplicate handler field.&lt;br /&gt;
#We added a new handler in the handleDuplicates method to handle the given option as shown in the below screenshot.&lt;br /&gt;
#We leveraged the existing generateTeam() method and sent the existing team id to this method and replaced the existing team’s team name as follows:&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     if handle_dups == &amp;quot;rename_existing&amp;quot; # rename: rename existing team&lt;br /&gt;
       if teamtype.is_a?(CourseTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Course.find(id).name)) # update the old team name&lt;br /&gt;
      elsif  teamtype.is_a?(AssignmentTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Assignment.find(id).name)) # update the old team name&lt;br /&gt;
      end&lt;br /&gt;
      #team.update(name:self.generate_team_name(Assignment.find(id).name))&lt;br /&gt;
      return name # send the new team name&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#We validate the file before importing the teams. Thus, the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#In the import method in user.rb file, there is a validation to check if the record length is less than 3 which is exclusive of password&lt;br /&gt;
#If the record length is greater than 3, it indicates that there is a password in the record and we save the password in the database&lt;br /&gt;
#If the length is equal to 3 then new system password is generated and saved for the user&lt;br /&gt;
In file app/models/user.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    def self.import(row_hash, _row_header, session, id = nil)&lt;br /&gt;
      raise ArgumentError, &amp;quot;Only #{row_hash.length} column(s) is(are) found.It must contain at least username, full name, email.&amp;quot; if row_hash.length &amp;lt; 3&lt;br /&gt;
      user = User.find_by_name(row_hash[:name])&lt;br /&gt;
      puts &amp;quot;inside import&amp;quot;&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        attributes = ImportFileHelper.define_attributes(row_hash)&lt;br /&gt;
        user = ImportFileHelper.create_new_user(attributes, session)&lt;br /&gt;
      if(row_hash.length&amp;gt;3)&lt;br /&gt;
        user.password=row_hash[:password]&lt;br /&gt;
        user.save&lt;br /&gt;
      else&lt;br /&gt;
        password = user.reset_password&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Issue #918''' Import of topics chokes on special characters&lt;br /&gt;
#Sql allows unicode values to be stored in the database.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
----&lt;br /&gt;
To check the issue resolved, please follow the steps&lt;br /&gt;
'''Issue 918'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Click on import topics&lt;br /&gt;
# Upload a file in the format given on the page, in place of topic description insert non-ASCII characters and upload&lt;br /&gt;
#Click on the import button.&lt;br /&gt;
#on the summary page, you should be able to see topic uploaded along with its description containing non-ASCII characters&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# on import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the rename the new team and import option.&lt;br /&gt;
#Upload a file containing the already existing team name.&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with a new name assigned and the new team with the name uploaded.&lt;br /&gt;
&lt;br /&gt;
'''Issue 328'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#On the import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the insert any new team members into the existing team option.&lt;br /&gt;
#Upload a file containing the already existing team name and new team members&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with additional team members&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Upload a file in the format given on the page without password field &lt;br /&gt;
#Click on import participant button&lt;br /&gt;
#You should be able to successfully import the participants&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Click on import participant button without uploading a file.&lt;br /&gt;
#You should be able to see a prompt error to upload a file and then import&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118863</id>
		<title>E1829 OSS project Duke Blue Fix import glitches</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118863"/>
		<updated>2018-11-08T19:04:52Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Issue #328= */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made to Fix import glitches.&lt;br /&gt;
&lt;br /&gt;
== '''Background''' ==&lt;br /&gt;
The import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc. from their learning management system. Being able to import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''The problems and their goal'''==&lt;br /&gt;
&lt;br /&gt;
=== '''Issue #329''' ===&lt;br /&gt;
Rename existing team when there is a conflict&lt;br /&gt;
&lt;br /&gt;
-&amp;gt;When importing teams there are different options to handle conflicting team names. We added an option rename EXISTING team when a conflict exists.&lt;br /&gt;
[[File:Fix328.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== '''Issue #328'''===&lt;br /&gt;
Merge teams when there is a conflict&lt;br /&gt;
-&amp;gt;When importing teams, and a conflict exists there is an option to merge the two teams by inserting the new members into an existing team.&lt;br /&gt;
[[File:Fix328r.jpg]]&lt;br /&gt;
&lt;br /&gt;
==='''Issue #181'''===&lt;br /&gt;
Validate file when importing participants&lt;br /&gt;
If one attempts to import users or participants, and does not specify the file to import from, a  NoMethodError error occurs. &lt;br /&gt;
-&amp;gt;The error has been handled by validating the file before importing the teams, thus the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
[[File:Fix181.jpg]]&lt;br /&gt;
&lt;br /&gt;
==='''Issue #918'''=== Import of topics chokes on special characters&lt;br /&gt;
It seems that non-ASCII characters in the description (e.g., a curly apostrophe, and perhaps also an en-dash) caused a SQL error in inserting the description string into the database.&lt;br /&gt;
-&amp;gt;While importing the participants, the user can include special characters in the project description and is successfully stored in the database:&lt;br /&gt;
[[File:Topics_import.jpg]]&lt;br /&gt;
&lt;br /&gt;
==='''Issue #183'''===&lt;br /&gt;
Count of fields wrong in import&lt;br /&gt;
When importing participants (or users), it is typical not to specify a password, but rather to have the system generate it. But if you do that, Expertiza reports that each record in the file you are importing does not have enough records.&lt;br /&gt;
-&amp;gt;When the user tries to upload the file to import participants, password record should be made optional and let the user upload without password record:&lt;br /&gt;
[[File:Skip_password.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Use Case Diagram ==&lt;br /&gt;
----&lt;br /&gt;
[[File:OODD.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Implementation  ==&lt;br /&gt;
'''Issue #328'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
#We search the database to see if there is an existing team with the same name. In such a case we save the old team in the ‘team’ variable and set the team_exists flag to true.&lt;br /&gt;
#We then cal the handle_dups method which handles the case if value chosen by the user is ‘insert into existing team’, inside the code this value is represented as ‘insert’. &lt;br /&gt;
#Then the import_team_members function is called&lt;br /&gt;
#We get the user through his/her name&lt;br /&gt;
#If a user isn’t registered, we get a nil object and raise an ImportError&lt;br /&gt;
#Else we add the user to the team if he/she isn’t already in the team&lt;br /&gt;
#The add_member function only works till the team isn’t filled to its maximum capacity&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 if handle_dups==&amp;quot;insert&amp;quot;&lt;br /&gt;
      team.import_team_members(row_hash)&lt;br /&gt;
      return nil&lt;br /&gt;
&lt;br /&gt;
def import_team_members(starting_index = 0, row_hash)&lt;br /&gt;
    starting_index&lt;br /&gt;
    index = 0&lt;br /&gt;
    row_hash[:teammembers].each do |teammember|&lt;br /&gt;
      next if index &amp;lt; starting_index # not sure this will work, hash is not ordered like array&lt;br /&gt;
      user = User.find_by(name: teammember.to_s)&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        raise ImportError, &amp;quot;The user '#{teammember.to_s}' was not found. &amp;lt;a href='/users/new'&amp;gt;Create&amp;lt;/a&amp;gt; this user?&amp;quot;&lt;br /&gt;
      else&lt;br /&gt;
        add_member(user) if TeamsUser.find_by(team_id: id, user_id: user.id).nil?&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#We included a new option in the duplicate handler field.&lt;br /&gt;
#We added a new handler in the handleDuplicates method to handle the given option as shown in the below screenshot.&lt;br /&gt;
#We leveraged the existing generateTeam() method and sent the existing team id to this method and replaced the existing team’s team name as follows:&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     if handle_dups == &amp;quot;rename_existing&amp;quot; # rename: rename existing team&lt;br /&gt;
       if teamtype.is_a?(CourseTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Course.find(id).name)) # update the old team name&lt;br /&gt;
      elsif  teamtype.is_a?(AssignmentTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Assignment.find(id).name)) # update the old team name&lt;br /&gt;
      end&lt;br /&gt;
      #team.update(name:self.generate_team_name(Assignment.find(id).name))&lt;br /&gt;
      return name # send the new team name&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#We validate the file before importing the teams. Thus, the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#In the import method in user.rb file, there is a validation to check if the record length is less than 3 which is exclusive of password&lt;br /&gt;
#If the record length is greater than 3, it indicates that there is a password in the record and we save the password in the database&lt;br /&gt;
#If the length is equal to 3 then new system password is generated and saved for the user&lt;br /&gt;
In file app/models/user.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    def self.import(row_hash, _row_header, session, id = nil)&lt;br /&gt;
      raise ArgumentError, &amp;quot;Only #{row_hash.length} column(s) is(are) found.It must contain at least username, full name, email.&amp;quot; if row_hash.length &amp;lt; 3&lt;br /&gt;
      user = User.find_by_name(row_hash[:name])&lt;br /&gt;
      puts &amp;quot;inside import&amp;quot;&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        attributes = ImportFileHelper.define_attributes(row_hash)&lt;br /&gt;
        user = ImportFileHelper.create_new_user(attributes, session)&lt;br /&gt;
      if(row_hash.length&amp;gt;3)&lt;br /&gt;
        user.password=row_hash[:password]&lt;br /&gt;
        user.save&lt;br /&gt;
      else&lt;br /&gt;
        password = user.reset_password&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Issue #918''' Import of topics chokes on special characters&lt;br /&gt;
#Sql allows unicode values to be stored in the database.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
----&lt;br /&gt;
To check the issue resolved, please follow the steps&lt;br /&gt;
'''Issue 918'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Click on import topics&lt;br /&gt;
# Upload a file in the format given on the page, in place of topic description insert non-ASCII characters and upload&lt;br /&gt;
#Click on the import button.&lt;br /&gt;
#on the summary page, you should be able to see topic uploaded along with its description containing non-ASCII characters&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# on import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the rename the new team and import option.&lt;br /&gt;
#Upload a file containing the already existing team name.&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with a new name assigned and the new team with the name uploaded.&lt;br /&gt;
&lt;br /&gt;
'''Issue 328'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#On the import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the insert any new team members into the existing team option.&lt;br /&gt;
#Upload a file containing the already existing team name and new team members&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with additional team members&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Upload a file in the format given on the page without password field &lt;br /&gt;
#Click on import participant button&lt;br /&gt;
#You should be able to successfully import the participants&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Click on import participant button without uploading a file.&lt;br /&gt;
#You should be able to see a prompt error to upload a file and then import&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118862</id>
		<title>E1829 OSS project Duke Blue Fix import glitches</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118862"/>
		<updated>2018-11-08T19:04:10Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* The problems and their goal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made to Fix import glitches.&lt;br /&gt;
&lt;br /&gt;
== '''Background''' ==&lt;br /&gt;
The import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc. from their learning management system. Being able to import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''The problems and their goal'''==&lt;br /&gt;
&lt;br /&gt;
=== '''Issue #329''' ===&lt;br /&gt;
Rename existing team when there is a conflict&lt;br /&gt;
&lt;br /&gt;
-&amp;gt;When importing teams there are different options to handle conflicting team names. We added an option rename EXISTING team when a conflict exists.&lt;br /&gt;
[[File:Fix328.jpg]]&lt;br /&gt;
&lt;br /&gt;
=== '''Issue #328'''====&lt;br /&gt;
Merge teams when there is a conflict&lt;br /&gt;
-&amp;gt;When importing teams, and a conflict exists there is an option to merge the two teams by inserting the new members into an existing team.&lt;br /&gt;
[[File:Fix328r.jpg]]&lt;br /&gt;
&lt;br /&gt;
==='''Issue #181'''===&lt;br /&gt;
Validate file when importing participants&lt;br /&gt;
If one attempts to import users or participants, and does not specify the file to import from, a  NoMethodError error occurs. &lt;br /&gt;
-&amp;gt;The error has been handled by validating the file before importing the teams, thus the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
[[File:Fix181.jpg]]&lt;br /&gt;
&lt;br /&gt;
==='''Issue #918'''=== Import of topics chokes on special characters&lt;br /&gt;
It seems that non-ASCII characters in the description (e.g., a curly apostrophe, and perhaps also an en-dash) caused a SQL error in inserting the description string into the database.&lt;br /&gt;
-&amp;gt;While importing the participants, the user can include special characters in the project description and is successfully stored in the database:&lt;br /&gt;
[[File:Topics_import.jpg]]&lt;br /&gt;
&lt;br /&gt;
==='''Issue #183'''===&lt;br /&gt;
Count of fields wrong in import&lt;br /&gt;
When importing participants (or users), it is typical not to specify a password, but rather to have the system generate it. But if you do that, Expertiza reports that each record in the file you are importing does not have enough records.&lt;br /&gt;
-&amp;gt;When the user tries to upload the file to import participants, password record should be made optional and let the user upload without password record:&lt;br /&gt;
[[File:Skip_password.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Use Case Diagram ==&lt;br /&gt;
----&lt;br /&gt;
[[File:OODD.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Implementation  ==&lt;br /&gt;
'''Issue #328'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
#We search the database to see if there is an existing team with the same name. In such a case we save the old team in the ‘team’ variable and set the team_exists flag to true.&lt;br /&gt;
#We then cal the handle_dups method which handles the case if value chosen by the user is ‘insert into existing team’, inside the code this value is represented as ‘insert’. &lt;br /&gt;
#Then the import_team_members function is called&lt;br /&gt;
#We get the user through his/her name&lt;br /&gt;
#If a user isn’t registered, we get a nil object and raise an ImportError&lt;br /&gt;
#Else we add the user to the team if he/she isn’t already in the team&lt;br /&gt;
#The add_member function only works till the team isn’t filled to its maximum capacity&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 if handle_dups==&amp;quot;insert&amp;quot;&lt;br /&gt;
      team.import_team_members(row_hash)&lt;br /&gt;
      return nil&lt;br /&gt;
&lt;br /&gt;
def import_team_members(starting_index = 0, row_hash)&lt;br /&gt;
    starting_index&lt;br /&gt;
    index = 0&lt;br /&gt;
    row_hash[:teammembers].each do |teammember|&lt;br /&gt;
      next if index &amp;lt; starting_index # not sure this will work, hash is not ordered like array&lt;br /&gt;
      user = User.find_by(name: teammember.to_s)&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        raise ImportError, &amp;quot;The user '#{teammember.to_s}' was not found. &amp;lt;a href='/users/new'&amp;gt;Create&amp;lt;/a&amp;gt; this user?&amp;quot;&lt;br /&gt;
      else&lt;br /&gt;
        add_member(user) if TeamsUser.find_by(team_id: id, user_id: user.id).nil?&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#We included a new option in the duplicate handler field.&lt;br /&gt;
#We added a new handler in the handleDuplicates method to handle the given option as shown in the below screenshot.&lt;br /&gt;
#We leveraged the existing generateTeam() method and sent the existing team id to this method and replaced the existing team’s team name as follows:&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     if handle_dups == &amp;quot;rename_existing&amp;quot; # rename: rename existing team&lt;br /&gt;
       if teamtype.is_a?(CourseTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Course.find(id).name)) # update the old team name&lt;br /&gt;
      elsif  teamtype.is_a?(AssignmentTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Assignment.find(id).name)) # update the old team name&lt;br /&gt;
      end&lt;br /&gt;
      #team.update(name:self.generate_team_name(Assignment.find(id).name))&lt;br /&gt;
      return name # send the new team name&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#We validate the file before importing the teams. Thus, the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#In the import method in user.rb file, there is a validation to check if the record length is less than 3 which is exclusive of password&lt;br /&gt;
#If the record length is greater than 3, it indicates that there is a password in the record and we save the password in the database&lt;br /&gt;
#If the length is equal to 3 then new system password is generated and saved for the user&lt;br /&gt;
In file app/models/user.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    def self.import(row_hash, _row_header, session, id = nil)&lt;br /&gt;
      raise ArgumentError, &amp;quot;Only #{row_hash.length} column(s) is(are) found.It must contain at least username, full name, email.&amp;quot; if row_hash.length &amp;lt; 3&lt;br /&gt;
      user = User.find_by_name(row_hash[:name])&lt;br /&gt;
      puts &amp;quot;inside import&amp;quot;&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        attributes = ImportFileHelper.define_attributes(row_hash)&lt;br /&gt;
        user = ImportFileHelper.create_new_user(attributes, session)&lt;br /&gt;
      if(row_hash.length&amp;gt;3)&lt;br /&gt;
        user.password=row_hash[:password]&lt;br /&gt;
        user.save&lt;br /&gt;
      else&lt;br /&gt;
        password = user.reset_password&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Issue #918''' Import of topics chokes on special characters&lt;br /&gt;
#Sql allows unicode values to be stored in the database.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
----&lt;br /&gt;
To check the issue resolved, please follow the steps&lt;br /&gt;
'''Issue 918'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Click on import topics&lt;br /&gt;
# Upload a file in the format given on the page, in place of topic description insert non-ASCII characters and upload&lt;br /&gt;
#Click on the import button.&lt;br /&gt;
#on the summary page, you should be able to see topic uploaded along with its description containing non-ASCII characters&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# on import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the rename the new team and import option.&lt;br /&gt;
#Upload a file containing the already existing team name.&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with a new name assigned and the new team with the name uploaded.&lt;br /&gt;
&lt;br /&gt;
'''Issue 328'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#On the import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the insert any new team members into the existing team option.&lt;br /&gt;
#Upload a file containing the already existing team name and new team members&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with additional team members&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Upload a file in the format given on the page without password field &lt;br /&gt;
#Click on import participant button&lt;br /&gt;
#You should be able to successfully import the participants&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Click on import participant button without uploading a file.&lt;br /&gt;
#You should be able to see a prompt error to upload a file and then import&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118861</id>
		<title>E1829 OSS project Duke Blue Fix import glitches</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118861"/>
		<updated>2018-11-08T19:02:24Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* The problems and their goal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made to Fix import glitches.&lt;br /&gt;
&lt;br /&gt;
== '''Background''' ==&lt;br /&gt;
The import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc. from their learning management system. Being able to import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== '''The problems and their goal'''==&lt;br /&gt;
&lt;br /&gt;
=== '''Issue #329''' ===&lt;br /&gt;
Rename existing team when there is a conflict&lt;br /&gt;
&lt;br /&gt;
-&amp;gt;When importing teams there are different options to handle conflicting team names. We added an option rename EXISTING team when a conflict exists.&lt;br /&gt;
[[File:Fix328.jpg]]&lt;br /&gt;
* '''Issue #328''': Merge teams when there is a conflict&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When importing teams, and a conflict exists there is an option to merge the two teams by inserting the new members into an existing team.&lt;br /&gt;
[[File:Fix328r.jpg]]&lt;br /&gt;
==='''Issue #181'''===&lt;br /&gt;
Validate file when importing participants&lt;br /&gt;
If one attempts to import users or participants, and does not specify the file to import from, a  NoMethodError error occurs. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;The error has been handled by validating the file before importing the teams, thus the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
[[File:Fix181.jpg]]&lt;br /&gt;
==='''Issue #918'''=== Import of topics chokes on special characters&lt;br /&gt;
It seems that non-ASCII characters in the description (e.g., a curly apostrophe, and perhaps also an en-dash) caused a SQL error in inserting the description string into the database.&lt;br /&gt;
&lt;br /&gt;
-&amp;gt;While importing the participants, the user can include special characters in the project description and is successfully stored in the database:&lt;br /&gt;
[[File:Topics_import.jpg]]&lt;br /&gt;
==='''Issue #183'''===&lt;br /&gt;
Count of fields wrong in import&lt;br /&gt;
When importing participants (or users), it is typical not to specify a password, but rather to have the system generate it. But if you do that, Expertiza reports that each record in the file you are importing does not have enough records.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When the user tries to upload the file to import participants, password record should be made optional and let the user upload without password record:&lt;br /&gt;
[[File:Skip_password.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Use Case Diagram ==&lt;br /&gt;
----&lt;br /&gt;
[[File:OODD.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Implementation  ==&lt;br /&gt;
'''Issue #328'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
#We search the database to see if there is an existing team with the same name. In such a case we save the old team in the ‘team’ variable and set the team_exists flag to true.&lt;br /&gt;
#We then cal the handle_dups method which handles the case if value chosen by the user is ‘insert into existing team’, inside the code this value is represented as ‘insert’. &lt;br /&gt;
#Then the import_team_members function is called&lt;br /&gt;
#We get the user through his/her name&lt;br /&gt;
#If a user isn’t registered, we get a nil object and raise an ImportError&lt;br /&gt;
#Else we add the user to the team if he/she isn’t already in the team&lt;br /&gt;
#The add_member function only works till the team isn’t filled to its maximum capacity&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 if handle_dups==&amp;quot;insert&amp;quot;&lt;br /&gt;
      team.import_team_members(row_hash)&lt;br /&gt;
      return nil&lt;br /&gt;
&lt;br /&gt;
def import_team_members(starting_index = 0, row_hash)&lt;br /&gt;
    starting_index&lt;br /&gt;
    index = 0&lt;br /&gt;
    row_hash[:teammembers].each do |teammember|&lt;br /&gt;
      next if index &amp;lt; starting_index # not sure this will work, hash is not ordered like array&lt;br /&gt;
      user = User.find_by(name: teammember.to_s)&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        raise ImportError, &amp;quot;The user '#{teammember.to_s}' was not found. &amp;lt;a href='/users/new'&amp;gt;Create&amp;lt;/a&amp;gt; this user?&amp;quot;&lt;br /&gt;
      else&lt;br /&gt;
        add_member(user) if TeamsUser.find_by(team_id: id, user_id: user.id).nil?&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#We included a new option in the duplicate handler field.&lt;br /&gt;
#We added a new handler in the handleDuplicates method to handle the given option as shown in the below screenshot.&lt;br /&gt;
#We leveraged the existing generateTeam() method and sent the existing team id to this method and replaced the existing team’s team name as follows:&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     if handle_dups == &amp;quot;rename_existing&amp;quot; # rename: rename existing team&lt;br /&gt;
       if teamtype.is_a?(CourseTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Course.find(id).name)) # update the old team name&lt;br /&gt;
      elsif  teamtype.is_a?(AssignmentTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Assignment.find(id).name)) # update the old team name&lt;br /&gt;
      end&lt;br /&gt;
      #team.update(name:self.generate_team_name(Assignment.find(id).name))&lt;br /&gt;
      return name # send the new team name&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#We validate the file before importing the teams. Thus, the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#In the import method in user.rb file, there is a validation to check if the record length is less than 3 which is exclusive of password&lt;br /&gt;
#If the record length is greater than 3, it indicates that there is a password in the record and we save the password in the database&lt;br /&gt;
#If the length is equal to 3 then new system password is generated and saved for the user&lt;br /&gt;
In file app/models/user.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    def self.import(row_hash, _row_header, session, id = nil)&lt;br /&gt;
      raise ArgumentError, &amp;quot;Only #{row_hash.length} column(s) is(are) found.It must contain at least username, full name, email.&amp;quot; if row_hash.length &amp;lt; 3&lt;br /&gt;
      user = User.find_by_name(row_hash[:name])&lt;br /&gt;
      puts &amp;quot;inside import&amp;quot;&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        attributes = ImportFileHelper.define_attributes(row_hash)&lt;br /&gt;
        user = ImportFileHelper.create_new_user(attributes, session)&lt;br /&gt;
      if(row_hash.length&amp;gt;3)&lt;br /&gt;
        user.password=row_hash[:password]&lt;br /&gt;
        user.save&lt;br /&gt;
      else&lt;br /&gt;
        password = user.reset_password&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Issue #918''' Import of topics chokes on special characters&lt;br /&gt;
#Sql allows unicode values to be stored in the database.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
----&lt;br /&gt;
To check the issue resolved, please follow the steps&lt;br /&gt;
'''Issue 918'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Click on import topics&lt;br /&gt;
# Upload a file in the format given on the page, in place of topic description insert non-ASCII characters and upload&lt;br /&gt;
#Click on the import button.&lt;br /&gt;
#on the summary page, you should be able to see topic uploaded along with its description containing non-ASCII characters&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# on import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the rename the new team and import option.&lt;br /&gt;
#Upload a file containing the already existing team name.&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with a new name assigned and the new team with the name uploaded.&lt;br /&gt;
&lt;br /&gt;
'''Issue 328'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#On the import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the insert any new team members into the existing team option.&lt;br /&gt;
#Upload a file containing the already existing team name and new team members&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with additional team members&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Upload a file in the format given on the page without password field &lt;br /&gt;
#Click on import participant button&lt;br /&gt;
#You should be able to successfully import the participants&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Click on import participant button without uploading a file.&lt;br /&gt;
#You should be able to see a prompt error to upload a file and then import&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118860</id>
		<title>E1829 OSS project Duke Blue Fix import glitches</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118860"/>
		<updated>2018-11-08T19:01:32Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* The problems and their goal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made to Fix import glitches.&lt;br /&gt;
&lt;br /&gt;
== '''Background''' ==&lt;br /&gt;
The import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc. from their learning management system. Being able to import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The problems and their goal==&lt;br /&gt;
&lt;br /&gt;
=== '''Issue #329''' ===&lt;br /&gt;
Rename existing team when there is a conflict&lt;br /&gt;
&lt;br /&gt;
-&amp;gt;When importing teams there are different options to handle conflicting team names. We added an option rename EXISTING team when a conflict exists.&lt;br /&gt;
[[File:Fix328.jpg]]&lt;br /&gt;
* '''Issue #328''': Merge teams when there is a conflict&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When importing teams, and a conflict exists there is an option to merge the two teams by inserting the new members into an existing team.&lt;br /&gt;
[[File:Fix328r.jpg]]&lt;br /&gt;
==='''Issue #181'''===&lt;br /&gt;
Validate file when importing participants&lt;br /&gt;
If one attempts to import users or participants, and does not specify the file to import from, a  NoMethodError error occurs. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;The error has been handled by validating the file before importing the teams, thus the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
[[File:Fix181.jpg]]&lt;br /&gt;
* '''Issue #918''': Import of topics chokes on special characters&lt;br /&gt;
It seems that non-ASCII characters in the description (e.g., a curly apostrophe, and perhaps also an en-dash) caused a SQL error in inserting the description string into the database.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;While importing the participants, the user can include special characters in the project description and is successfully stored in the database:&lt;br /&gt;
[[File:Topics_import.jpg]]&lt;br /&gt;
==='''Issue #183'''===&lt;br /&gt;
Count of fields wrong in import&lt;br /&gt;
When importing participants (or users), it is typical not to specify a password, but rather to have the system generate it. But if you do that, Expertiza reports that each record in the file you are importing does not have enough records.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When the user tries to upload the file to import participants, password record should be made optional and let the user upload without password record:&lt;br /&gt;
[[File:Skip_password.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Use Case Diagram ==&lt;br /&gt;
----&lt;br /&gt;
[[File:OODD.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Implementation  ==&lt;br /&gt;
'''Issue #328'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
#We search the database to see if there is an existing team with the same name. In such a case we save the old team in the ‘team’ variable and set the team_exists flag to true.&lt;br /&gt;
#We then cal the handle_dups method which handles the case if value chosen by the user is ‘insert into existing team’, inside the code this value is represented as ‘insert’. &lt;br /&gt;
#Then the import_team_members function is called&lt;br /&gt;
#We get the user through his/her name&lt;br /&gt;
#If a user isn’t registered, we get a nil object and raise an ImportError&lt;br /&gt;
#Else we add the user to the team if he/she isn’t already in the team&lt;br /&gt;
#The add_member function only works till the team isn’t filled to its maximum capacity&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 if handle_dups==&amp;quot;insert&amp;quot;&lt;br /&gt;
      team.import_team_members(row_hash)&lt;br /&gt;
      return nil&lt;br /&gt;
&lt;br /&gt;
def import_team_members(starting_index = 0, row_hash)&lt;br /&gt;
    starting_index&lt;br /&gt;
    index = 0&lt;br /&gt;
    row_hash[:teammembers].each do |teammember|&lt;br /&gt;
      next if index &amp;lt; starting_index # not sure this will work, hash is not ordered like array&lt;br /&gt;
      user = User.find_by(name: teammember.to_s)&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        raise ImportError, &amp;quot;The user '#{teammember.to_s}' was not found. &amp;lt;a href='/users/new'&amp;gt;Create&amp;lt;/a&amp;gt; this user?&amp;quot;&lt;br /&gt;
      else&lt;br /&gt;
        add_member(user) if TeamsUser.find_by(team_id: id, user_id: user.id).nil?&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#We included a new option in the duplicate handler field.&lt;br /&gt;
#We added a new handler in the handleDuplicates method to handle the given option as shown in the below screenshot.&lt;br /&gt;
#We leveraged the existing generateTeam() method and sent the existing team id to this method and replaced the existing team’s team name as follows:&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     if handle_dups == &amp;quot;rename_existing&amp;quot; # rename: rename existing team&lt;br /&gt;
       if teamtype.is_a?(CourseTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Course.find(id).name)) # update the old team name&lt;br /&gt;
      elsif  teamtype.is_a?(AssignmentTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Assignment.find(id).name)) # update the old team name&lt;br /&gt;
      end&lt;br /&gt;
      #team.update(name:self.generate_team_name(Assignment.find(id).name))&lt;br /&gt;
      return name # send the new team name&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#We validate the file before importing the teams. Thus, the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#In the import method in user.rb file, there is a validation to check if the record length is less than 3 which is exclusive of password&lt;br /&gt;
#If the record length is greater than 3, it indicates that there is a password in the record and we save the password in the database&lt;br /&gt;
#If the length is equal to 3 then new system password is generated and saved for the user&lt;br /&gt;
In file app/models/user.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    def self.import(row_hash, _row_header, session, id = nil)&lt;br /&gt;
      raise ArgumentError, &amp;quot;Only #{row_hash.length} column(s) is(are) found.It must contain at least username, full name, email.&amp;quot; if row_hash.length &amp;lt; 3&lt;br /&gt;
      user = User.find_by_name(row_hash[:name])&lt;br /&gt;
      puts &amp;quot;inside import&amp;quot;&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        attributes = ImportFileHelper.define_attributes(row_hash)&lt;br /&gt;
        user = ImportFileHelper.create_new_user(attributes, session)&lt;br /&gt;
      if(row_hash.length&amp;gt;3)&lt;br /&gt;
        user.password=row_hash[:password]&lt;br /&gt;
        user.save&lt;br /&gt;
      else&lt;br /&gt;
        password = user.reset_password&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Issue #918''' Import of topics chokes on special characters&lt;br /&gt;
#Sql allows unicode values to be stored in the database.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
----&lt;br /&gt;
To check the issue resolved, please follow the steps&lt;br /&gt;
'''Issue 918'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Click on import topics&lt;br /&gt;
# Upload a file in the format given on the page, in place of topic description insert non-ASCII characters and upload&lt;br /&gt;
#Click on the import button.&lt;br /&gt;
#on the summary page, you should be able to see topic uploaded along with its description containing non-ASCII characters&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# on import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the rename the new team and import option.&lt;br /&gt;
#Upload a file containing the already existing team name.&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with a new name assigned and the new team with the name uploaded.&lt;br /&gt;
&lt;br /&gt;
'''Issue 328'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#On the import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the insert any new team members into the existing team option.&lt;br /&gt;
#Upload a file containing the already existing team name and new team members&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with additional team members&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Upload a file in the format given on the page without password field &lt;br /&gt;
#Click on import participant button&lt;br /&gt;
#You should be able to successfully import the participants&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Click on import participant button without uploading a file.&lt;br /&gt;
#You should be able to see a prompt error to upload a file and then import&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118859</id>
		<title>E1829 OSS project Duke Blue Fix import glitches</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118859"/>
		<updated>2018-11-08T18:59:28Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made to Fix import glitches.&lt;br /&gt;
&lt;br /&gt;
== '''Background''' ==&lt;br /&gt;
The import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc. from their learning management system. Being able to import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The problems and their goal==&lt;br /&gt;
&lt;br /&gt;
=== '''Issue #329''' ===&lt;br /&gt;
Rename existing team when there is a conflict&lt;br /&gt;
&lt;br /&gt;
-&amp;gt;When importing teams there are different options to handle conflicting team names. We added an option rename EXISTING team when a conflict exists.&lt;br /&gt;
[[File:Fix328.jpg]]&lt;br /&gt;
* '''Issue #328''': Merge teams when there is a conflict&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When importing teams, and a conflict exists there is an option to merge the two teams by inserting the new members into an existing team.&lt;br /&gt;
[[File:Fix328r.jpg]]&lt;br /&gt;
* '''Issue #181''': Validate file when importing participants&lt;br /&gt;
If one attempts to import users or participants, and does not specify the file to import from, a  NoMethodError error occurs. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;The error has been handled by validating the file before importing the teams, thus the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
[[File:Fix181.jpg]]&lt;br /&gt;
* '''Issue #918''': Import of topics chokes on special characters&lt;br /&gt;
It seems that non-ASCII characters in the description (e.g., a curly apostrophe, and perhaps also an en-dash) caused a SQL error in inserting the description string into the database.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;While importing the participants, the user can include special characters in the project description and is successfully stored in the database:&lt;br /&gt;
[[File:Topics_import.jpg]]&lt;br /&gt;
* '''Issue #183''':  Count of fields wrong in import&lt;br /&gt;
When importing participants (or users), it is typical not to specify a password, but rather to have the system generate it. But if you do that, Expertiza reports that each record in the file you are importing does not have enough records.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When the user tries to upload the file to import participants, password record should be made optional and let the user upload without password record:&lt;br /&gt;
[[File:Skip_password.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Use Case Diagram ==&lt;br /&gt;
----&lt;br /&gt;
[[File:OODD.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Implementation  ==&lt;br /&gt;
'''Issue #328'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
#We search the database to see if there is an existing team with the same name. In such a case we save the old team in the ‘team’ variable and set the team_exists flag to true.&lt;br /&gt;
#We then cal the handle_dups method which handles the case if value chosen by the user is ‘insert into existing team’, inside the code this value is represented as ‘insert’. &lt;br /&gt;
#Then the import_team_members function is called&lt;br /&gt;
#We get the user through his/her name&lt;br /&gt;
#If a user isn’t registered, we get a nil object and raise an ImportError&lt;br /&gt;
#Else we add the user to the team if he/she isn’t already in the team&lt;br /&gt;
#The add_member function only works till the team isn’t filled to its maximum capacity&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 if handle_dups==&amp;quot;insert&amp;quot;&lt;br /&gt;
      team.import_team_members(row_hash)&lt;br /&gt;
      return nil&lt;br /&gt;
&lt;br /&gt;
def import_team_members(starting_index = 0, row_hash)&lt;br /&gt;
    starting_index&lt;br /&gt;
    index = 0&lt;br /&gt;
    row_hash[:teammembers].each do |teammember|&lt;br /&gt;
      next if index &amp;lt; starting_index # not sure this will work, hash is not ordered like array&lt;br /&gt;
      user = User.find_by(name: teammember.to_s)&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        raise ImportError, &amp;quot;The user '#{teammember.to_s}' was not found. &amp;lt;a href='/users/new'&amp;gt;Create&amp;lt;/a&amp;gt; this user?&amp;quot;&lt;br /&gt;
      else&lt;br /&gt;
        add_member(user) if TeamsUser.find_by(team_id: id, user_id: user.id).nil?&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#We included a new option in the duplicate handler field.&lt;br /&gt;
#We added a new handler in the handleDuplicates method to handle the given option as shown in the below screenshot.&lt;br /&gt;
#We leveraged the existing generateTeam() method and sent the existing team id to this method and replaced the existing team’s team name as follows:&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     if handle_dups == &amp;quot;rename_existing&amp;quot; # rename: rename existing team&lt;br /&gt;
       if teamtype.is_a?(CourseTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Course.find(id).name)) # update the old team name&lt;br /&gt;
      elsif  teamtype.is_a?(AssignmentTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Assignment.find(id).name)) # update the old team name&lt;br /&gt;
      end&lt;br /&gt;
      #team.update(name:self.generate_team_name(Assignment.find(id).name))&lt;br /&gt;
      return name # send the new team name&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#We validate the file before importing the teams. Thus, the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#In the import method in user.rb file, there is a validation to check if the record length is less than 3 which is exclusive of password&lt;br /&gt;
#If the record length is greater than 3, it indicates that there is a password in the record and we save the password in the database&lt;br /&gt;
#If the length is equal to 3 then new system password is generated and saved for the user&lt;br /&gt;
In file app/models/user.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    def self.import(row_hash, _row_header, session, id = nil)&lt;br /&gt;
      raise ArgumentError, &amp;quot;Only #{row_hash.length} column(s) is(are) found.It must contain at least username, full name, email.&amp;quot; if row_hash.length &amp;lt; 3&lt;br /&gt;
      user = User.find_by_name(row_hash[:name])&lt;br /&gt;
      puts &amp;quot;inside import&amp;quot;&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        attributes = ImportFileHelper.define_attributes(row_hash)&lt;br /&gt;
        user = ImportFileHelper.create_new_user(attributes, session)&lt;br /&gt;
      if(row_hash.length&amp;gt;3)&lt;br /&gt;
        user.password=row_hash[:password]&lt;br /&gt;
        user.save&lt;br /&gt;
      else&lt;br /&gt;
        password = user.reset_password&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Issue #918''' Import of topics chokes on special characters&lt;br /&gt;
#Sql allows unicode values to be stored in the database.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
----&lt;br /&gt;
To check the issue resolved, please follow the steps&lt;br /&gt;
'''Issue 918'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Click on import topics&lt;br /&gt;
# Upload a file in the format given on the page, in place of topic description insert non-ASCII characters and upload&lt;br /&gt;
#Click on the import button.&lt;br /&gt;
#on the summary page, you should be able to see topic uploaded along with its description containing non-ASCII characters&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# on import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the rename the new team and import option.&lt;br /&gt;
#Upload a file containing the already existing team name.&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with a new name assigned and the new team with the name uploaded.&lt;br /&gt;
&lt;br /&gt;
'''Issue 328'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#On the import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the insert any new team members into the existing team option.&lt;br /&gt;
#Upload a file containing the already existing team name and new team members&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with additional team members&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Upload a file in the format given on the page without password field &lt;br /&gt;
#Click on import participant button&lt;br /&gt;
#You should be able to successfully import the participants&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Click on import participant button without uploading a file.&lt;br /&gt;
#You should be able to see a prompt error to upload a file and then import&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118858</id>
		<title>E1829 OSS project Duke Blue Fix import glitches</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118858"/>
		<updated>2018-11-08T18:58:13Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made to Fix import glitches.&lt;br /&gt;
&lt;br /&gt;
== '''Background''' ==&lt;br /&gt;
The import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc. from their learning management system. Being able to import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The problems and their goal==&lt;br /&gt;
&lt;br /&gt;
=== '''Issue #329''' ===&lt;br /&gt;
Rename existing team when there is a conflict&lt;br /&gt;
&lt;br /&gt;
-&amp;gt;When importing teams there are different options to handle conflicting team names. We added an option rename EXISTING team when a conflict exists.&lt;br /&gt;
[[File:Fix328.jpg]]&lt;br /&gt;
* '''Issue #328''': Merge teams when there is a conflict&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When importing teams, and a conflict exists there is an option to merge the two teams by inserting the new members into an existing team.&lt;br /&gt;
[[File:Fix328r.jpg]]&lt;br /&gt;
* '''Issue #181''': Validate file when importing participants&lt;br /&gt;
If one attempts to import users or participants, and does not specify the file to import from, a  NoMethodError error occurs. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;The error has been handled by validating the file before importing the teams, thus the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
[[File:Fix181.jpg]]&lt;br /&gt;
* '''Issue #918''': Import of topics chokes on special characters&lt;br /&gt;
It seems that non-ASCII characters in the description (e.g., a curly apostrophe, and perhaps also an en-dash) caused a SQL error in inserting the description string into the database.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;While importing the participants, the user can include special characters in the project description and is successfully stored in the database:&lt;br /&gt;
[[File:Topics_import.jpg]]&lt;br /&gt;
* '''Issue #183''':  Count of fields wrong in import&lt;br /&gt;
When importing participants (or users), it is typical not to specify a password, but rather to have the system generate it. But if you do that, Expertiza reports that each record in the file you are importing does not have enough records.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When the user tries to upload the file to import participants, password record should be made optional and let the user upload without password record:&lt;br /&gt;
[[File:Skip_password.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Use Case Diagram ==&lt;br /&gt;
----&lt;br /&gt;
[[File:OODD.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Implementation  ==&lt;br /&gt;
'''Issue #328'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
#We search the database to see if there is an existing team with the same name. In such a case we save the old team in the ‘team’ variable and set the team_exists flag to true.&lt;br /&gt;
#We then cal the handle_dups method which handles the case if value chosen by the user is ‘insert into existing team’, inside the code this value is represented as ‘insert’. &lt;br /&gt;
#Then the import_team_members function is called&lt;br /&gt;
#We get the user through his/her name&lt;br /&gt;
#If a user isn’t registered, we get a nil object and raise an ImportError&lt;br /&gt;
#Else we add the user to the team if he/she isn’t already in the team&lt;br /&gt;
#The add_member function only works till the team isn’t filled to its maximum capacity&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 if handle_dups==&amp;quot;insert&amp;quot;&lt;br /&gt;
      team.import_team_members(row_hash)&lt;br /&gt;
      return nil&lt;br /&gt;
&lt;br /&gt;
def import_team_members(starting_index = 0, row_hash)&lt;br /&gt;
    starting_index&lt;br /&gt;
    index = 0&lt;br /&gt;
    row_hash[:teammembers].each do |teammember|&lt;br /&gt;
      next if index &amp;lt; starting_index # not sure this will work, hash is not ordered like array&lt;br /&gt;
      user = User.find_by(name: teammember.to_s)&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        raise ImportError, &amp;quot;The user '#{teammember.to_s}' was not found. &amp;lt;a href='/users/new'&amp;gt;Create&amp;lt;/a&amp;gt; this user?&amp;quot;&lt;br /&gt;
      else&lt;br /&gt;
        add_member(user) if TeamsUser.find_by(team_id: id, user_id: user.id).nil?&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#We included a new option in the duplicate handler field.&lt;br /&gt;
#We added a new handler in the handleDuplicates method to handle the given option as shown in the below screenshot.&lt;br /&gt;
#We leveraged the existing generateTeam() method and sent the existing team id to this method and replaced the existing team’s team name as follows:&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     if handle_dups == &amp;quot;rename_existing&amp;quot; # rename: rename existing team&lt;br /&gt;
       if teamtype.is_a?(CourseTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Course.find(id).name)) # update the old team name&lt;br /&gt;
      elsif  teamtype.is_a?(AssignmentTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Assignment.find(id).name)) # update the old team name&lt;br /&gt;
      end&lt;br /&gt;
      #team.update(name:self.generate_team_name(Assignment.find(id).name))&lt;br /&gt;
      return name # send the new team name&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#We validate the file before importing the teams. Thus, the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#In the import method in user.rb file, there is a validation to check if the record length is less than 3 which is exclusive of password&lt;br /&gt;
#If the record length is greater than 3, it indicates that there is a password in the record and we save the password in the database&lt;br /&gt;
#If the length is equal to 3 then new system password is generated and saved for the user&lt;br /&gt;
In file app/models/user.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
    def self.import(row_hash, _row_header, session, id = nil)&lt;br /&gt;
    raise ArgumentError, &amp;quot;Only #{row_hash.length} column(s) is(are) found.&lt;br /&gt;
      It must contain at least username, full name, email.&amp;quot; if row_hash.length &amp;lt; 3&lt;br /&gt;
    user = User.find_by_name(row_hash[:name])&lt;br /&gt;
    puts &amp;quot;inside import&amp;quot;&lt;br /&gt;
    if user.nil?&lt;br /&gt;
      attributes = ImportFileHelper.define_attributes(row_hash)&lt;br /&gt;
      user = ImportFileHelper.create_new_user(attributes, session)&lt;br /&gt;
      if(row_hash.length&amp;gt;3)&lt;br /&gt;
        user.password=row_hash[:password]&lt;br /&gt;
        user.save&lt;br /&gt;
      else&lt;br /&gt;
        password = user.reset_password&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
'''Issue #918''' Import of topics chokes on special characters&lt;br /&gt;
#Sql allows unicode values to be stored in the database.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
----&lt;br /&gt;
To check the issue resolved, please follow the steps&lt;br /&gt;
'''Issue 918'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Click on import topics&lt;br /&gt;
# Upload a file in the format given on the page, in place of topic description insert non-ASCII characters and upload&lt;br /&gt;
#Click on the import button.&lt;br /&gt;
#on the summary page, you should be able to see topic uploaded along with its description containing non-ASCII characters&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# on import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the rename the new team and import option.&lt;br /&gt;
#Upload a file containing the already existing team name.&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with a new name assigned and the new team with the name uploaded.&lt;br /&gt;
&lt;br /&gt;
'''Issue 328'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#On the import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the insert any new team members into the existing team option.&lt;br /&gt;
#Upload a file containing the already existing team name and new team members&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with additional team members&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Upload a file in the format given on the page without password field &lt;br /&gt;
#Click on import participant button&lt;br /&gt;
#You should be able to successfully import the participants&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Click on import participant button without uploading a file.&lt;br /&gt;
#You should be able to see a prompt error to upload a file and then import&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118857</id>
		<title>E1829 OSS project Duke Blue Fix import glitches</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118857"/>
		<updated>2018-11-08T18:52:02Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* The problems and their goal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made to Fix import glitches.&lt;br /&gt;
&lt;br /&gt;
== '''Background''' ==&lt;br /&gt;
The import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc. from their learning management system. Being able to import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The problems and their goal==&lt;br /&gt;
&lt;br /&gt;
=== '''Issue #329''' ===&lt;br /&gt;
Rename existing team when there is a conflict&lt;br /&gt;
&lt;br /&gt;
-&amp;gt;When importing teams there are different options to handle conflicting team names. We added an option rename EXISTING team when a conflict exists.&lt;br /&gt;
[[File:Fix328.jpg]]&lt;br /&gt;
* '''Issue #328''': Merge teams when there is a conflict&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When importing teams, and a conflict exists there is an option to merge the two teams by inserting the new members into an existing team.&lt;br /&gt;
[[File:Fix328r.jpg]]&lt;br /&gt;
* '''Issue #181''': Validate file when importing participants&lt;br /&gt;
If one attempts to import users or participants, and does not specify the file to import from, a  NoMethodError error occurs. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;The error has been handled by validating the file before importing the teams, thus the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
[[File:Fix181.jpg]]&lt;br /&gt;
* '''Issue #918''': Import of topics chokes on special characters&lt;br /&gt;
It seems that non-ASCII characters in the description (e.g., a curly apostrophe, and perhaps also an en-dash) caused a SQL error in inserting the description string into the database.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;While importing the participants, the user can include special characters in the project description and is successfully stored in the database:&lt;br /&gt;
[[File:Topics_import.jpg]]&lt;br /&gt;
* '''Issue #183''':  Count of fields wrong in import&lt;br /&gt;
When importing participants (or users), it is typical not to specify a password, but rather to have the system generate it. But if you do that, Expertiza reports that each record in the file you are importing does not have enough records.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When the user tries to upload the file to import participants, password record should be made optional and let the user upload without password record:&lt;br /&gt;
[[File:Skip_password.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Use Case Diagram ==&lt;br /&gt;
----&lt;br /&gt;
[[File:OODD.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Implementation  ==&lt;br /&gt;
'''Issue #328'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
#We search the database to see if there is an existing team with the same name. In such a case we save the old team in the ‘team’ variable and set the team_exists flag to true.&lt;br /&gt;
#We then cal the handle_dups method which handles the case if value chosen by the user is ‘insert into existing team’, inside the code this value is represented as ‘insert’. &lt;br /&gt;
#Then the import_team_members function is called&lt;br /&gt;
#We get the user through his/her name&lt;br /&gt;
#If a user isn’t registered, we get a nil object and raise an ImportError&lt;br /&gt;
#Else we add the user to the team if he/she isn’t already in the team&lt;br /&gt;
#The add_member function only works till the team isn’t filled to its maximum capacity&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 if handle_dups==&amp;quot;insert&amp;quot;&lt;br /&gt;
      team.import_team_members(row_hash)&lt;br /&gt;
      return nil&lt;br /&gt;
&lt;br /&gt;
def import_team_members(starting_index = 0, row_hash)&lt;br /&gt;
    starting_index&lt;br /&gt;
    index = 0&lt;br /&gt;
    row_hash[:teammembers].each do |teammember|&lt;br /&gt;
      next if index &amp;lt; starting_index # not sure this will work, hash is not ordered like array&lt;br /&gt;
      user = User.find_by(name: teammember.to_s)&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        raise ImportError, &amp;quot;The user '#{teammember.to_s}' was not found. &amp;lt;a href='/users/new'&amp;gt;Create&amp;lt;/a&amp;gt; this user?&amp;quot;&lt;br /&gt;
      else&lt;br /&gt;
        add_member(user) if TeamsUser.find_by(team_id: id, user_id: user.id).nil?&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#We included a new option in the duplicate handler field.&lt;br /&gt;
#We added a new handler in the handleDuplicates method to handle the given option as shown in the below screenshot.&lt;br /&gt;
#We leveraged the existing generateTeam() method and sent the existing team id to this method and replaced the existing team’s team name as follows:&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     if handle_dups == &amp;quot;rename_existing&amp;quot; # rename: rename existing team&lt;br /&gt;
       if teamtype.is_a?(CourseTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Course.find(id).name)) # update the old team name&lt;br /&gt;
      elsif  teamtype.is_a?(AssignmentTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Assignment.find(id).name)) # update the old team name&lt;br /&gt;
      end&lt;br /&gt;
      #team.update(name:self.generate_team_name(Assignment.find(id).name))&lt;br /&gt;
      return name # send the new team name&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#We validate the file before importing the teams. Thus, the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
&lt;br /&gt;
'''Issue #918''' Import of topics chokes on special characters&lt;br /&gt;
#Sql allows unicode values to be stored in the database.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
----&lt;br /&gt;
To check the issue resolved, please follow the steps&lt;br /&gt;
'''Issue 918'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Click on import topics&lt;br /&gt;
# Upload a file in the format given on the page, in place of topic description insert non-ASCII characters and upload&lt;br /&gt;
#Click on the import button.&lt;br /&gt;
#on the summary page, you should be able to see topic uploaded along with its description containing non-ASCII characters&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# on import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the rename the new team and import option.&lt;br /&gt;
#Upload a file containing the already existing team name.&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with a new name assigned and the new team with the name uploaded.&lt;br /&gt;
&lt;br /&gt;
'''Issue 328'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#On the import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the insert any new team members into the existing team option.&lt;br /&gt;
#Upload a file containing the already existing team name and new team members&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with additional team members&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Upload a file in the format given on the page without password field &lt;br /&gt;
#Click on import participant button&lt;br /&gt;
#You should be able to successfully import the participants&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Click on import participant button without uploading a file.&lt;br /&gt;
#You should be able to see a prompt error to upload a file and then import&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118856</id>
		<title>E1829 OSS project Duke Blue Fix import glitches</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118856"/>
		<updated>2018-11-08T18:49:46Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Issue #329 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made to Fix import glitches.&lt;br /&gt;
&lt;br /&gt;
== '''Background''' ==&lt;br /&gt;
The import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc. from their learning management system. Being able to import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The problems and their goal==&lt;br /&gt;
&lt;br /&gt;
=== '''Issue #329''' ===&lt;br /&gt;
----&lt;br /&gt;
Rename existing team when there is a conflict&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-&amp;gt;When importing teams there are different options to handle conflicting team names. We added an option rename EXISTING team when a conflict exists.&lt;br /&gt;
[[File:Fix328.jpg]]&lt;br /&gt;
* '''Issue #328''': Merge teams when there is a conflict&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When importing teams, and a conflict exists there is an option to merge the two teams by inserting the new members into an existing team.&lt;br /&gt;
[[File:Fix328r.jpg]]&lt;br /&gt;
* '''Issue #181''': Validate file when importing participants&lt;br /&gt;
If one attempts to import users or participants, and does not specify the file to import from, a  NoMethodError error occurs. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;The error has been handled by validating the file before importing the teams, thus the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
[[File:Fix181.jpg]]&lt;br /&gt;
* '''Issue #918''': Import of topics chokes on special characters&lt;br /&gt;
It seems that non-ASCII characters in the description (e.g., a curly apostrophe, and perhaps also an en-dash) caused a SQL error in inserting the description string into the database.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;While importing the participants, the user can include special characters in the project description and is successfully stored in the database:&lt;br /&gt;
[[File:Topics_import.jpg]]&lt;br /&gt;
* '''Issue #183''':  Count of fields wrong in import&lt;br /&gt;
When importing participants (or users), it is typical not to specify a password, but rather to have the system generate it. But if you do that, Expertiza reports that each record in the file you are importing does not have enough records.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When the user tries to upload the file to import participants, password record should be made optional and let the user upload without password record:&lt;br /&gt;
[[File:Skip_password.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Use Case Diagram ==&lt;br /&gt;
----&lt;br /&gt;
[[File:OODD.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Implementation  ==&lt;br /&gt;
'''Issue #328'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
#We search the database to see if there is an existing team with the same name. In such a case we save the old team in the ‘team’ variable and set the team_exists flag to true.&lt;br /&gt;
#We then cal the handle_dups method which handles the case if value chosen by the user is ‘insert into existing team’, inside the code this value is represented as ‘insert’. &lt;br /&gt;
#Then the import_team_members function is called&lt;br /&gt;
#We get the user through his/her name&lt;br /&gt;
#If a user isn’t registered, we get a nil object and raise an ImportError&lt;br /&gt;
#Else we add the user to the team if he/she isn’t already in the team&lt;br /&gt;
#The add_member function only works till the team isn’t filled to its maximum capacity&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 if handle_dups==&amp;quot;insert&amp;quot;&lt;br /&gt;
      team.import_team_members(row_hash)&lt;br /&gt;
      return nil&lt;br /&gt;
&lt;br /&gt;
def import_team_members(starting_index = 0, row_hash)&lt;br /&gt;
    starting_index&lt;br /&gt;
    index = 0&lt;br /&gt;
    row_hash[:teammembers].each do |teammember|&lt;br /&gt;
      next if index &amp;lt; starting_index # not sure this will work, hash is not ordered like array&lt;br /&gt;
      user = User.find_by(name: teammember.to_s)&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        raise ImportError, &amp;quot;The user '#{teammember.to_s}' was not found. &amp;lt;a href='/users/new'&amp;gt;Create&amp;lt;/a&amp;gt; this user?&amp;quot;&lt;br /&gt;
      else&lt;br /&gt;
        add_member(user) if TeamsUser.find_by(team_id: id, user_id: user.id).nil?&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#We included a new option in the duplicate handler field.&lt;br /&gt;
#We added a new handler in the handleDuplicates method to handle the given option as shown in the below screenshot.&lt;br /&gt;
#We leveraged the existing generateTeam() method and sent the existing team id to this method and replaced the existing team’s team name as follows:&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     if handle_dups == &amp;quot;rename_existing&amp;quot; # rename: rename existing team&lt;br /&gt;
       if teamtype.is_a?(CourseTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Course.find(id).name)) # update the old team name&lt;br /&gt;
      elsif  teamtype.is_a?(AssignmentTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Assignment.find(id).name)) # update the old team name&lt;br /&gt;
      end&lt;br /&gt;
      #team.update(name:self.generate_team_name(Assignment.find(id).name))&lt;br /&gt;
      return name # send the new team name&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#We validate the file before importing the teams. Thus, the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
&lt;br /&gt;
'''Issue #918''' Import of topics chokes on special characters&lt;br /&gt;
#Sql allows unicode values to be stored in the database.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
----&lt;br /&gt;
To check the issue resolved, please follow the steps&lt;br /&gt;
'''Issue 918'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Click on import topics&lt;br /&gt;
# Upload a file in the format given on the page, in place of topic description insert non-ASCII characters and upload&lt;br /&gt;
#Click on the import button.&lt;br /&gt;
#on the summary page, you should be able to see topic uploaded along with its description containing non-ASCII characters&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# on import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the rename the new team and import option.&lt;br /&gt;
#Upload a file containing the already existing team name.&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with a new name assigned and the new team with the name uploaded.&lt;br /&gt;
&lt;br /&gt;
'''Issue 328'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#On the import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the insert any new team members into the existing team option.&lt;br /&gt;
#Upload a file containing the already existing team name and new team members&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with additional team members&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Upload a file in the format given on the page without password field &lt;br /&gt;
#Click on import participant button&lt;br /&gt;
#You should be able to successfully import the participants&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Click on import participant button without uploading a file.&lt;br /&gt;
#You should be able to see a prompt error to upload a file and then import&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118855</id>
		<title>E1829 OSS project Duke Blue Fix import glitches</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118855"/>
		<updated>2018-11-08T18:49:07Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* The problems and their goal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made to Fix import glitches.&lt;br /&gt;
&lt;br /&gt;
== '''Background''' ==&lt;br /&gt;
The import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc. from their learning management system. Being able to import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The problems and their goal==&lt;br /&gt;
&lt;br /&gt;
== '''Issue #329''' ==&lt;br /&gt;
----&lt;br /&gt;
Rename existing team when there is a conflict&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
-&amp;gt;When importing teams there are different options to handle conflicting team names. We added an option rename EXISTING team when a conflict exists.&lt;br /&gt;
[[File:Fix328.jpg]]&lt;br /&gt;
* '''Issue #328''': Merge teams when there is a conflict&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When importing teams, and a conflict exists there is an option to merge the two teams by inserting the new members into an existing team.&lt;br /&gt;
[[File:Fix328r.jpg]]&lt;br /&gt;
* '''Issue #181''': Validate file when importing participants&lt;br /&gt;
If one attempts to import users or participants, and does not specify the file to import from, a  NoMethodError error occurs. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;The error has been handled by validating the file before importing the teams, thus the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
[[File:Fix181.jpg]]&lt;br /&gt;
* '''Issue #918''': Import of topics chokes on special characters&lt;br /&gt;
It seems that non-ASCII characters in the description (e.g., a curly apostrophe, and perhaps also an en-dash) caused a SQL error in inserting the description string into the database.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;While importing the participants, the user can include special characters in the project description and is successfully stored in the database:&lt;br /&gt;
[[File:Topics_import.jpg]]&lt;br /&gt;
* '''Issue #183''':  Count of fields wrong in import&lt;br /&gt;
When importing participants (or users), it is typical not to specify a password, but rather to have the system generate it. But if you do that, Expertiza reports that each record in the file you are importing does not have enough records.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When the user tries to upload the file to import participants, password record should be made optional and let the user upload without password record:&lt;br /&gt;
[[File:Skip_password.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Use Case Diagram ==&lt;br /&gt;
----&lt;br /&gt;
[[File:OODD.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Implementation  ==&lt;br /&gt;
'''Issue #328'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
#We search the database to see if there is an existing team with the same name. In such a case we save the old team in the ‘team’ variable and set the team_exists flag to true.&lt;br /&gt;
#We then cal the handle_dups method which handles the case if value chosen by the user is ‘insert into existing team’, inside the code this value is represented as ‘insert’. &lt;br /&gt;
#Then the import_team_members function is called&lt;br /&gt;
#We get the user through his/her name&lt;br /&gt;
#If a user isn’t registered, we get a nil object and raise an ImportError&lt;br /&gt;
#Else we add the user to the team if he/she isn’t already in the team&lt;br /&gt;
#The add_member function only works till the team isn’t filled to its maximum capacity&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 if handle_dups==&amp;quot;insert&amp;quot;&lt;br /&gt;
      team.import_team_members(row_hash)&lt;br /&gt;
      return nil&lt;br /&gt;
&lt;br /&gt;
def import_team_members(starting_index = 0, row_hash)&lt;br /&gt;
    starting_index&lt;br /&gt;
    index = 0&lt;br /&gt;
    row_hash[:teammembers].each do |teammember|&lt;br /&gt;
      next if index &amp;lt; starting_index # not sure this will work, hash is not ordered like array&lt;br /&gt;
      user = User.find_by(name: teammember.to_s)&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        raise ImportError, &amp;quot;The user '#{teammember.to_s}' was not found. &amp;lt;a href='/users/new'&amp;gt;Create&amp;lt;/a&amp;gt; this user?&amp;quot;&lt;br /&gt;
      else&lt;br /&gt;
        add_member(user) if TeamsUser.find_by(team_id: id, user_id: user.id).nil?&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#We included a new option in the duplicate handler field.&lt;br /&gt;
#We added a new handler in the handleDuplicates method to handle the given option as shown in the below screenshot.&lt;br /&gt;
#We leveraged the existing generateTeam() method and sent the existing team id to this method and replaced the existing team’s team name as follows:&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     if handle_dups == &amp;quot;rename_existing&amp;quot; # rename: rename existing team&lt;br /&gt;
       if teamtype.is_a?(CourseTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Course.find(id).name)) # update the old team name&lt;br /&gt;
      elsif  teamtype.is_a?(AssignmentTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Assignment.find(id).name)) # update the old team name&lt;br /&gt;
      end&lt;br /&gt;
      #team.update(name:self.generate_team_name(Assignment.find(id).name))&lt;br /&gt;
      return name # send the new team name&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#We validate the file before importing the teams. Thus, the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
&lt;br /&gt;
'''Issue #918''' Import of topics chokes on special characters&lt;br /&gt;
#Sql allows unicode values to be stored in the database.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
----&lt;br /&gt;
To check the issue resolved, please follow the steps&lt;br /&gt;
'''Issue 918'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Click on import topics&lt;br /&gt;
# Upload a file in the format given on the page, in place of topic description insert non-ASCII characters and upload&lt;br /&gt;
#Click on the import button.&lt;br /&gt;
#on the summary page, you should be able to see topic uploaded along with its description containing non-ASCII characters&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# on import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the rename the new team and import option.&lt;br /&gt;
#Upload a file containing the already existing team name.&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with a new name assigned and the new team with the name uploaded.&lt;br /&gt;
&lt;br /&gt;
'''Issue 328'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#On the import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the insert any new team members into the existing team option.&lt;br /&gt;
#Upload a file containing the already existing team name and new team members&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with additional team members&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Upload a file in the format given on the page without password field &lt;br /&gt;
#Click on import participant button&lt;br /&gt;
#You should be able to successfully import the participants&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Click on import participant button without uploading a file.&lt;br /&gt;
#You should be able to see a prompt error to upload a file and then import&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118853</id>
		<title>E1829 OSS project Duke Blue Fix import glitches</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118853"/>
		<updated>2018-11-08T18:47:22Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made to Fix import glitches.&lt;br /&gt;
&lt;br /&gt;
== '''Background''' ==&lt;br /&gt;
The import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc. from their learning management system. Being able to import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The problems and their goal==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #329''': Rename existing team when there is a conflict&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When importing teams there are different options to handle conflicting team names. We added an option rename EXISTING team when a conflict exists.&lt;br /&gt;
[[File:Fix328.jpg]]&lt;br /&gt;
* '''Issue #328''': Merge teams when there is a conflict&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When importing teams, and a conflict exists there is an option to merge the two teams by inserting the new members into an existing team.&lt;br /&gt;
[[File:Fix328r.jpg]]&lt;br /&gt;
* '''Issue #181''': Validate file when importing participants&lt;br /&gt;
If one attempts to import users or participants, and does not specify the file to import from, a  NoMethodError error occurs. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;The error has been handled by validating the file before importing the teams, thus the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
[[File:Fix181.jpg]]&lt;br /&gt;
* '''Issue #918''': Import of topics chokes on special characters&lt;br /&gt;
It seems that non-ASCII characters in the description (e.g., a curly apostrophe, and perhaps also an en-dash) caused a SQL error in inserting the description string into the database.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;While importing the participants, the user can include special characters in the project description and is successfully stored in the database:&lt;br /&gt;
[[File:Topics_import.jpg]]&lt;br /&gt;
* '''Issue #183''':  Count of fields wrong in import&lt;br /&gt;
When importing participants (or users), it is typical not to specify a password, but rather to have the system generate it. But if you do that, Expertiza reports that each record in the file you are importing does not have enough records.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When the user tries to upload the file to import participants, password record should be made optional and let the user upload without password record:&lt;br /&gt;
[[File:Skip_password.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Use Case Diagram ==&lt;br /&gt;
----&lt;br /&gt;
[[File:OODD.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Implementation  ==&lt;br /&gt;
'''Issue #328'''&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
#We search the database to see if there is an existing team with the same name. In such a case we save the old team in the ‘team’ variable and set the team_exists flag to true.&lt;br /&gt;
#We then cal the handle_dups method which handles the case if value chosen by the user is ‘insert into existing team’, inside the code this value is represented as ‘insert’. &lt;br /&gt;
#Then the import_team_members function is called&lt;br /&gt;
#We get the user through his/her name&lt;br /&gt;
#If a user isn’t registered, we get a nil object and raise an ImportError&lt;br /&gt;
#Else we add the user to the team if he/she isn’t already in the team&lt;br /&gt;
#The add_member function only works till the team isn’t filled to its maximum capacity&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 if handle_dups==&amp;quot;insert&amp;quot;&lt;br /&gt;
      team.import_team_members(row_hash)&lt;br /&gt;
      return nil&lt;br /&gt;
&lt;br /&gt;
def import_team_members(starting_index = 0, row_hash)&lt;br /&gt;
    starting_index&lt;br /&gt;
    index = 0&lt;br /&gt;
    row_hash[:teammembers].each do |teammember|&lt;br /&gt;
      next if index &amp;lt; starting_index # not sure this will work, hash is not ordered like array&lt;br /&gt;
      user = User.find_by(name: teammember.to_s)&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        raise ImportError, &amp;quot;The user '#{teammember.to_s}' was not found. &amp;lt;a href='/users/new'&amp;gt;Create&amp;lt;/a&amp;gt; this user?&amp;quot;&lt;br /&gt;
      else&lt;br /&gt;
        add_member(user) if TeamsUser.find_by(team_id: id, user_id: user.id).nil?&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#We included a new option in the duplicate handler field.&lt;br /&gt;
#We added a new handler in the handleDuplicates method to handle the given option as shown in the below screenshot.&lt;br /&gt;
#We leveraged the existing generateTeam() method and sent the existing team id to this method and replaced the existing team’s team name as follows:&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     if handle_dups == &amp;quot;rename_existing&amp;quot; # rename: rename existing team&lt;br /&gt;
       if teamtype.is_a?(CourseTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Course.find(id).name)) # update the old team name&lt;br /&gt;
      elsif  teamtype.is_a?(AssignmentTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Assignment.find(id).name)) # update the old team name&lt;br /&gt;
      end&lt;br /&gt;
      #team.update(name:self.generate_team_name(Assignment.find(id).name))&lt;br /&gt;
      return name # send the new team name&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#We validate the file before importing the teams. Thus, the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
&lt;br /&gt;
'''Issue #918''' Import of topics chokes on special characters&lt;br /&gt;
#Sql allows unicode values to be stored in the database.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
----&lt;br /&gt;
To check the issue resolved, please follow the steps&lt;br /&gt;
'''Issue 918'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Click on import topics&lt;br /&gt;
# Upload a file in the format given on the page, in place of topic description insert non-ASCII characters and upload&lt;br /&gt;
#Click on the import button.&lt;br /&gt;
#on the summary page, you should be able to see topic uploaded along with its description containing non-ASCII characters&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# on import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the rename the new team and import option.&lt;br /&gt;
#Upload a file containing the already existing team name.&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with a new name assigned and the new team with the name uploaded.&lt;br /&gt;
&lt;br /&gt;
'''Issue 328'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#On the import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the insert any new team members into the existing team option.&lt;br /&gt;
#Upload a file containing the already existing team name and new team members&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with additional team members&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Upload a file in the format given on the page without password field &lt;br /&gt;
#Click on import participant button&lt;br /&gt;
#You should be able to successfully import the participants&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Click on import participant button without uploading a file.&lt;br /&gt;
#You should be able to see a prompt error to upload a file and then import&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118852</id>
		<title>E1829 OSS project Duke Blue Fix import glitches</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118852"/>
		<updated>2018-11-08T18:42:39Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made to Fix import glitches.&lt;br /&gt;
&lt;br /&gt;
== '''Background''' ==&lt;br /&gt;
The import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc. from their learning management system. Being able to import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The problems and their goal==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #329''': Rename existing team when there is a conflict&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When importing teams there are different options to handle conflicting team names. We added an option rename EXISTING team when a conflict exists.&lt;br /&gt;
[[File:Fix328.jpg]]&lt;br /&gt;
* '''Issue #328''': Merge teams when there is a conflict&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When importing teams, and a conflict exists there is an option to merge the two teams by inserting the new members into an existing team.&lt;br /&gt;
[[File:Fix328r.jpg]]&lt;br /&gt;
* '''Issue #181''': Validate file when importing participants&lt;br /&gt;
If one attempts to import users or participants, and does not specify the file to import from, a  NoMethodError error occurs. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;The error has been handled by validating the file before importing the teams, thus the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
[[File:Fix181.jpg]]&lt;br /&gt;
* '''Issue #918''': Import of topics chokes on special characters&lt;br /&gt;
It seems that non-ASCII characters in the description (e.g., a curly apostrophe, and perhaps also an en-dash) caused a SQL error in inserting the description string into the database.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;While importing the participants, the user can include special characters in the project description and is successfully stored in the database:&lt;br /&gt;
[[File:Topics_import.jpg]]&lt;br /&gt;
* '''Issue #183''':  Count of fields wrong in import&lt;br /&gt;
When importing participants (or users), it is typical not to specify a password, but rather to have the system generate it. But if you do that, Expertiza reports that each record in the file you are importing does not have enough records.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When the user tries to upload the file to import participants, password record should be made optional and let the user upload without password record:&lt;br /&gt;
[[File:Skip_password.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Use Case Diagram ==&lt;br /&gt;
----&lt;br /&gt;
[[File:OODD.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Implementation  ==&lt;br /&gt;
'''Issue #328'''&lt;br /&gt;
#We search the database to see if there is an existing team with the same name. In such a case we save the old team in the ‘team’ variable and set the team_exists flag to true.&lt;br /&gt;
#We then cal the handle_dups method which handles the case if value chosen by the user is ‘insert into existing team’, inside the code this value is represented as ‘insert’. &lt;br /&gt;
#Then the import_team_members function is called&lt;br /&gt;
#We get the user through his/her name&lt;br /&gt;
#If a user isn’t registered, we get a nil object and raise an ImportError&lt;br /&gt;
#Else we add the user to the team if he/she isn’t already in the team&lt;br /&gt;
#The add_member function only works till the team isn’t filled to its maximum capacity&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 if handle_dups==&amp;quot;insert&amp;quot;&lt;br /&gt;
      team.import_team_members(row_hash)&lt;br /&gt;
      return nil&lt;br /&gt;
&lt;br /&gt;
def import_team_members(starting_index = 0, row_hash)&lt;br /&gt;
    starting_index&lt;br /&gt;
    index = 0&lt;br /&gt;
    row_hash[:teammembers].each do |teammember|&lt;br /&gt;
      next if index &amp;lt; starting_index # not sure this will work, hash is not ordered like array&lt;br /&gt;
      user = User.find_by(name: teammember.to_s)&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        raise ImportError, &amp;quot;The user '#{teammember.to_s}' was not found. &amp;lt;a href='/users/new'&amp;gt;Create&amp;lt;/a&amp;gt; this user?&amp;quot;&lt;br /&gt;
      else&lt;br /&gt;
        add_member(user) if TeamsUser.find_by(team_id: id, user_id: user.id).nil?&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#We included a new option in the duplicate handler field.&lt;br /&gt;
#We added a new handler in the handleDuplicates method to handle the given option as shown in the below screenshot.&lt;br /&gt;
#We leveraged the existing generateTeam() method and sent the existing team id to this method and replaced the existing team’s team name as follows:&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     if handle_dups == &amp;quot;rename_existing&amp;quot; # rename: rename existing team&lt;br /&gt;
       if teamtype.is_a?(CourseTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Course.find(id).name)) # update the old team name&lt;br /&gt;
      elsif  teamtype.is_a?(AssignmentTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Assignment.find(id).name)) # update the old team name&lt;br /&gt;
      end&lt;br /&gt;
      #team.update(name:self.generate_team_name(Assignment.find(id).name))&lt;br /&gt;
      return name # send the new team name&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#We validate the file before importing the teams. Thus, the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
&lt;br /&gt;
'''Issue #918''' Import of topics chokes on special characters&lt;br /&gt;
#Sql allows unicode values to be stored in the database.&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
----&lt;br /&gt;
To check the issue resolved, please follow the steps&lt;br /&gt;
'''Issue 918'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Click on import topics&lt;br /&gt;
# Upload a file in the format given on the page, in place of topic description insert non-ASCII characters and upload&lt;br /&gt;
#Click on the import button.&lt;br /&gt;
#on the summary page, you should be able to see topic uploaded along with its description containing non-ASCII characters&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# on import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the rename the new team and import option.&lt;br /&gt;
#Upload a file containing the already existing team name.&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with a new name assigned and the new team with the name uploaded.&lt;br /&gt;
&lt;br /&gt;
'''Issue 328'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#On the import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the insert any new team members into the existing team option.&lt;br /&gt;
#Upload a file containing the already existing team name and new team members&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with additional team members&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Upload a file in the format given on the page without password field &lt;br /&gt;
#Click on import participant button&lt;br /&gt;
#You should be able to successfully import the participants&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Click on import participant button without uploading a file.&lt;br /&gt;
#You should be able to see a prompt error to upload a file and then import&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118851</id>
		<title>E1829 OSS project Duke Blue Fix import glitches</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118851"/>
		<updated>2018-11-08T18:40:48Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made to Fix import glitches.&lt;br /&gt;
&lt;br /&gt;
== '''Background''' ==&lt;br /&gt;
The import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc. from their learning management system. Being able to import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The problems and their goal==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #329''': Rename existing team when there is a conflict&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When importing teams there are different options to handle conflicting team names. We added an option rename EXISTING team when a conflict exists.&lt;br /&gt;
[[File:Fix328.jpg]]&lt;br /&gt;
* '''Issue #328''': Merge teams when there is a conflict&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When importing teams, and a conflict exists there is an option to merge the two teams by inserting the new members into an existing team.&lt;br /&gt;
[[File:Fix328r.jpg]]&lt;br /&gt;
* '''Issue #181''': Validate file when importing participants&lt;br /&gt;
If one attempts to import users or participants, and does not specify the file to import from, a  NoMethodError error occurs. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;The error has been handled by validating the file before importing the teams, thus the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
[[File:Fix181.jpg]]&lt;br /&gt;
* '''Issue #918''': Import of topics chokes on special characters&lt;br /&gt;
It seems that non-ASCII characters in the description (e.g., a curly apostrophe, and perhaps also an en-dash) caused a SQL error in inserting the description string into the database.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;While importing the participants, the user can include special characters in the project description and is successfully stored in the database:&lt;br /&gt;
[[File:Topics_import.jpg]]&lt;br /&gt;
* '''Issue #183''':  Count of fields wrong in import&lt;br /&gt;
When importing participants (or users), it is typical not to specify a password, but rather to have the system generate it. But if you do that, Expertiza reports that each record in the file you are importing does not have enough records.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When the user tries to upload the file to import participants, password record should be made optional and let the user upload without password record:&lt;br /&gt;
[[File:Skip_password.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Use Case Diagram ==&lt;br /&gt;
----&lt;br /&gt;
[[File:OODD.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Implementation  ==&lt;br /&gt;
'''Issue #328'''&lt;br /&gt;
#We search the database to see if there is an existing team with the same name. In such a case we save the old team in the ‘team’ variable and set the team_exists flag to true.&lt;br /&gt;
#We then cal the handle_dups method which handles the case if value chosen by the user is ‘insert into existing team’, inside the code this value is represented as ‘insert’. &lt;br /&gt;
#Then the import_team_members function is called&lt;br /&gt;
#We get the user through his/her name&lt;br /&gt;
#If a user isn’t registered, we get a nil object and raise an ImportError&lt;br /&gt;
#Else we add the user to the team if he/she isn’t already in the team&lt;br /&gt;
#The add_member function only works till the team isn’t filled to its maximum capacity&lt;br /&gt;
&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     if handle_dups == &amp;quot;rename_existing&amp;quot; # rename: rename existing team&lt;br /&gt;
       if teamtype.is_a?(CourseTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Course.find(id).name)) # update the old team name&lt;br /&gt;
      elsif  teamtype.is_a?(AssignmentTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Assignment.find(id).name)) # update the old team name&lt;br /&gt;
      end&lt;br /&gt;
      #team.update(name:self.generate_team_name(Assignment.find(id).name))&lt;br /&gt;
      return name # send the new team name&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#We included a new option in the duplicate handler field.&lt;br /&gt;
#We added a new handler in the handleDuplicates method to handle the given option as shown in the below screenshot.&lt;br /&gt;
#We leveraged the existing generateTeam() method and sent the existing team id to this method and replaced the existing team’s team name as follows:&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#We validate the file before importing the teams. Thus, the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
&lt;br /&gt;
'''Issue #918''' Import of topics chokes on special characters&lt;br /&gt;
#Sql allows unicode values to be stored in the database.&lt;br /&gt;
&lt;br /&gt;
== Code Snippet ==&lt;br /&gt;
----&lt;br /&gt;
'''Issue #329''' &lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     if handle_dups == &amp;quot;rename_existing&amp;quot; # rename: rename existing team&lt;br /&gt;
       if teamtype.is_a?(CourseTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Course.find(id).name)) # update the old team name&lt;br /&gt;
      elsif  teamtype.is_a?(AssignmentTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Assignment.find(id).name)) # update the old team name&lt;br /&gt;
      end&lt;br /&gt;
      #team.update(name:self.generate_team_name(Assignment.find(id).name))&lt;br /&gt;
      return name # send the new team name&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue #328'''&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 if handle_dups==&amp;quot;insert&amp;quot;&lt;br /&gt;
      team.import_team_members(row_hash)&lt;br /&gt;
      return nil&lt;br /&gt;
&lt;br /&gt;
def import_team_members(starting_index = 0, row_hash)&lt;br /&gt;
    starting_index&lt;br /&gt;
    index = 0&lt;br /&gt;
    row_hash[:teammembers].each do |teammember|&lt;br /&gt;
      next if index &amp;lt; starting_index # not sure this will work, hash is not ordered like array&lt;br /&gt;
      user = User.find_by(name: teammember.to_s)&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        raise ImportError, &amp;quot;The user '#{teammember.to_s}' was not found. &amp;lt;a href='/users/new'&amp;gt;Create&amp;lt;/a&amp;gt; this user?&amp;quot;&lt;br /&gt;
      else&lt;br /&gt;
        add_member(user) if TeamsUser.find_by(team_id: id, user_id: user.id).nil?&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
----&lt;br /&gt;
To check the issue resolved, please follow the steps&lt;br /&gt;
'''Issue 918'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Click on import topics&lt;br /&gt;
# Upload a file in the format given on the page, in place of topic description insert non-ASCII characters and upload&lt;br /&gt;
#Click on the import button.&lt;br /&gt;
#on the summary page, you should be able to see topic uploaded along with its description containing non-ASCII characters&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# on import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the rename the new team and import option.&lt;br /&gt;
#Upload a file containing the already existing team name.&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with a new name assigned and the new team with the name uploaded.&lt;br /&gt;
&lt;br /&gt;
'''Issue 328'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#On the import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the insert any new team members into the existing team option.&lt;br /&gt;
#Upload a file containing the already existing team name and new team members&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with additional team members&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Upload a file in the format given on the page without password field &lt;br /&gt;
#Click on import participant button&lt;br /&gt;
#You should be able to successfully import the participants&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Click on import participant button without uploading a file.&lt;br /&gt;
#You should be able to see a prompt error to upload a file and then import&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118850</id>
		<title>E1829 OSS project Duke Blue Fix import glitches</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118850"/>
		<updated>2018-11-08T18:39:29Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* The problems and their goal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made to Fix import glitches.&lt;br /&gt;
&lt;br /&gt;
== '''Background''' ==&lt;br /&gt;
The import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc. from their learning management system. Being able to import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The problems and their goal==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #329''': Rename existing team when there is a conflict&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When importing teams there are different options to handle conflicting team names. We added an option rename EXISTING team when a conflict exists.&lt;br /&gt;
[[File:Fix328.jpg]]&lt;br /&gt;
* '''Issue #328''': Merge teams when there is a conflict&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When importing teams, and a conflict exists there is an option to merge the two teams by inserting the new members into an existing team.&lt;br /&gt;
[[File:Fix328r.jpg]]&lt;br /&gt;
* '''Issue #181''': Validate file when importing participants&lt;br /&gt;
If one attempts to import users or participants, and does not specify the file to import from, a  NoMethodError error occurs. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;The error has been handled by validating the file before importing the teams, thus the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
[[File:Fix181.jpg]]&lt;br /&gt;
* '''Issue #918''': Import of topics chokes on special characters&lt;br /&gt;
It seems that non-ASCII characters in the description (e.g., a curly apostrophe, and perhaps also an en-dash) caused a SQL error in inserting the description string into the database.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;While importing the participants, the user can include special characters in the project description and is successfully stored in the database:&lt;br /&gt;
[[File:Topics_import.jpg]]&lt;br /&gt;
* '''Issue #183''':  Count of fields wrong in import&lt;br /&gt;
When importing participants (or users), it is typical not to specify a password, but rather to have the system generate it. But if you do that, Expertiza reports that each record in the file you are importing does not have enough records.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When the user tries to upload the file to import participants, password record should be made optional and let the user upload without password record:&lt;br /&gt;
[[File:Skip_password.jpg]]&lt;br /&gt;
&lt;br /&gt;
== Use Case Diagram ==&lt;br /&gt;
----&lt;br /&gt;
[[File:OODD.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Implementation  ==&lt;br /&gt;
'''Issue #328'''&lt;br /&gt;
#We search the database to see if there is an existing team with the same name. In such a case we save the old team in the ‘team’ variable and set the team_exists flag to true.&lt;br /&gt;
#We then cal the handle_dups method which handles the case if value chosen by the user is ‘insert into existing team’, inside the code this value is represented as ‘insert’. &lt;br /&gt;
#Then the import_team_members function is called&lt;br /&gt;
#We get the user through his/her name&lt;br /&gt;
#If a user isn’t registered, we get a nil object and raise an ImportError&lt;br /&gt;
#Else we add the user to the team if he/she isn’t already in the team&lt;br /&gt;
#The add_member function only works till the team isn’t filled to its maximum capacity&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#We included a new option in the duplicate handler field.&lt;br /&gt;
#We added a new handler in the handleDuplicates method to handle the given option as shown in the below screenshot.&lt;br /&gt;
#We leveraged the existing generateTeam() method and sent the existing team id to this method and replaced the existing team’s team name as follows:&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#We validate the file before importing the teams. Thus, the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
&lt;br /&gt;
'''Issue #918''' Import of topics chokes on special characters&lt;br /&gt;
#Sql allows unicode values to be stored in the database.&lt;br /&gt;
&lt;br /&gt;
== Code Snippet ==&lt;br /&gt;
----&lt;br /&gt;
'''Issue #329''' &lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     if handle_dups == &amp;quot;rename_existing&amp;quot; # rename: rename existing team&lt;br /&gt;
       if teamtype.is_a?(CourseTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Course.find(id).name)) # update the old team name&lt;br /&gt;
      elsif  teamtype.is_a?(AssignmentTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Assignment.find(id).name)) # update the old team name&lt;br /&gt;
      end&lt;br /&gt;
      #team.update(name:self.generate_team_name(Assignment.find(id).name))&lt;br /&gt;
      return name # send the new team name&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue #328'''&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 if handle_dups==&amp;quot;insert&amp;quot;&lt;br /&gt;
      team.import_team_members(row_hash)&lt;br /&gt;
      return nil&lt;br /&gt;
&lt;br /&gt;
def import_team_members(starting_index = 0, row_hash)&lt;br /&gt;
    starting_index&lt;br /&gt;
    index = 0&lt;br /&gt;
    row_hash[:teammembers].each do |teammember|&lt;br /&gt;
      next if index &amp;lt; starting_index # not sure this will work, hash is not ordered like array&lt;br /&gt;
      user = User.find_by(name: teammember.to_s)&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        raise ImportError, &amp;quot;The user '#{teammember.to_s}' was not found. &amp;lt;a href='/users/new'&amp;gt;Create&amp;lt;/a&amp;gt; this user?&amp;quot;&lt;br /&gt;
      else&lt;br /&gt;
        add_member(user) if TeamsUser.find_by(team_id: id, user_id: user.id).nil?&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
----&lt;br /&gt;
To check the issue resolved, please follow the steps&lt;br /&gt;
'''Issue 918'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Click on import topics&lt;br /&gt;
# Upload a file in the format given on the page, in place of topic description insert non-ASCII characters and upload&lt;br /&gt;
#Click on the import button.&lt;br /&gt;
#on the summary page, you should be able to see topic uploaded along with its description containing non-ASCII characters&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# on import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the rename the new team and import option.&lt;br /&gt;
#Upload a file containing the already existing team name.&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with a new name assigned and the new team with the name uploaded.&lt;br /&gt;
&lt;br /&gt;
'''Issue 328'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#On the import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the insert any new team members into the existing team option.&lt;br /&gt;
#Upload a file containing the already existing team name and new team members&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with additional team members&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Upload a file in the format given on the page without password field &lt;br /&gt;
#Click on import participant button&lt;br /&gt;
#You should be able to successfully import the participants&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Click on import participant button without uploading a file.&lt;br /&gt;
#You should be able to see a prompt error to upload a file and then import&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118847</id>
		<title>E1829 OSS project Duke Blue Fix import glitches</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118847"/>
		<updated>2018-11-08T18:36:26Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* The problems and their goal */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made to Fix import glitches.&lt;br /&gt;
&lt;br /&gt;
== '''Background''' ==&lt;br /&gt;
The import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc. from their learning management system. Being able to import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The problems and their goal==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #329''': Rename existing team when there is a conflict&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When importing teams there are different options to handle conflicting team names. We added an option rename EXISTING team when a conflict exists.&lt;br /&gt;
[[File:Fix328.jpg]]&lt;br /&gt;
* '''Issue #328''': Merge teams when there is a conflict&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When importing teams, and a conflict exists there is an option to merge the two teams by inserting the new members into an existing team.&lt;br /&gt;
[[File:Fix328r.jpg]]&lt;br /&gt;
* '''Issue #181''': Validate file when importing participants&lt;br /&gt;
If one attempts to import users or participants, and does not specify the file to import from, a  NoMethodError error occurs. &lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;The error has been handled by validating the file before importing the teams, thus the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
[[File:Fix181.jpg]]&lt;br /&gt;
* '''Issue #918''': Import of topics chokes on special characters&lt;br /&gt;
It seems that non-ASCII characters in the description (e.g., a curly apostrophe, and perhaps also an en-dash) caused a SQL error in inserting the description string into the database.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;While importing the participants, the user can include special characters in the project description and is successfully stored in the database:&lt;br /&gt;
[[File:Topics_import.jpg]]&lt;br /&gt;
* '''Issue #183''':  Count of fields wrong in import&lt;br /&gt;
When importing participants (or users), it is typical not to specify a password, but rather to have the system generate it. But if you do that, Expertiza reports that each record in the file you are importing does not have enough records.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
-&amp;gt;When the user tries to upload the file to import participants, password record should be made optional and let the user upload without password record:&lt;br /&gt;
***insert image here***&lt;br /&gt;
&lt;br /&gt;
== Use Case Diagram ==&lt;br /&gt;
----&lt;br /&gt;
[[File:OODD.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Implementation  ==&lt;br /&gt;
'''Issue #328'''&lt;br /&gt;
#We search the database to see if there is an existing team with the same name. In such a case we save the old team in the ‘team’ variable and set the team_exists flag to true.&lt;br /&gt;
#We then cal the handle_dups method which handles the case if value chosen by the user is ‘insert into existing team’, inside the code this value is represented as ‘insert’. &lt;br /&gt;
#Then the import_team_members function is called&lt;br /&gt;
#We get the user through his/her name&lt;br /&gt;
#If a user isn’t registered, we get a nil object and raise an ImportError&lt;br /&gt;
#Else we add the user to the team if he/she isn’t already in the team&lt;br /&gt;
#The add_member function only works till the team isn’t filled to its maximum capacity&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#We included a new option in the duplicate handler field.&lt;br /&gt;
#We added a new handler in the handleDuplicates method to handle the given option as shown in the below screenshot.&lt;br /&gt;
#We leveraged the existing generateTeam() method and sent the existing team id to this method and replaced the existing team’s team name as follows:&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#We validate the file before importing the teams. Thus,the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
&lt;br /&gt;
== Code Snippet ==&lt;br /&gt;
----&lt;br /&gt;
'''Issue #329''' &lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     if handle_dups == &amp;quot;rename_existing&amp;quot; # rename: rename existing team&lt;br /&gt;
       if teamtype.is_a?(CourseTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Course.find(id).name)) # update the old team name&lt;br /&gt;
      elsif  teamtype.is_a?(AssignmentTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Assignment.find(id).name)) # update the old team name&lt;br /&gt;
      end&lt;br /&gt;
      #team.update(name:self.generate_team_name(Assignment.find(id).name))&lt;br /&gt;
      return name # send the new team name&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue #328'''&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 if handle_dups==&amp;quot;insert&amp;quot;&lt;br /&gt;
      team.import_team_members(row_hash)&lt;br /&gt;
      return nil&lt;br /&gt;
&lt;br /&gt;
def import_team_members(starting_index = 0, row_hash)&lt;br /&gt;
    starting_index&lt;br /&gt;
    index = 0&lt;br /&gt;
    row_hash[:teammembers].each do |teammember|&lt;br /&gt;
      next if index &amp;lt; starting_index # not sure this will work, hash is not ordered like array&lt;br /&gt;
      user = User.find_by(name: teammember.to_s)&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        raise ImportError, &amp;quot;The user '#{teammember.to_s}' was not found. &amp;lt;a href='/users/new'&amp;gt;Create&amp;lt;/a&amp;gt; this user?&amp;quot;&lt;br /&gt;
      else&lt;br /&gt;
        add_member(user) if TeamsUser.find_by(team_id: id, user_id: user.id).nil?&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
----&lt;br /&gt;
To check the issue resolved, please follow the steps&lt;br /&gt;
'''Issue 918'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Click on import topics&lt;br /&gt;
# Upload a file in the format given on the page, in place of topic description insert non-ASCII characters and upload&lt;br /&gt;
#Click on the import button.&lt;br /&gt;
#on the summary page, you should be able to see topic uploaded along with its description containing non-ASCII characters&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# on import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the rename the new team and import option.&lt;br /&gt;
#Upload a file containing the already existing team name.&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with a new name assigned and the new team with the name uploaded.&lt;br /&gt;
&lt;br /&gt;
'''Issue 328'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#On the import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the insert any new team members into the existing team option.&lt;br /&gt;
#Upload a file containing the already existing team name and new team members&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with additional team members&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Upload a file in the format given on the page without password field &lt;br /&gt;
#Click on import participant button&lt;br /&gt;
#You should be able to successfully import the participants&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Click on import participant button without uploading a file.&lt;br /&gt;
#You should be able to see a prompt error to upload a file and then import&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118843</id>
		<title>E1829 OSS project Duke Blue Fix import glitches</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1829_OSS_project_Duke_Blue_Fix_import_glitches&amp;diff=118843"/>
		<updated>2018-11-08T18:24:23Z</updated>

		<summary type="html">&lt;p&gt;Pgupta24: /* Use Case Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This wiki page is for the description of changes made to Fix import glitches.&lt;br /&gt;
&lt;br /&gt;
== '''Background''' ==&lt;br /&gt;
The import feature is the most helpful feature for instructors to set up assignments. The instructors usually have a list of students, teams, etc. from their learning management system. Being able to import these into expertiza saves a lot of time when setting up an assignment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== The problems and their results after resolving them==&lt;br /&gt;
&lt;br /&gt;
* '''Issue #329''': When importing teams there are different options to handle conflicting team names. We added an option rename EXISTING team when a conflict exists.&lt;br /&gt;
[[File:Fix328.jpg]]&lt;br /&gt;
* '''Issue #328''': When importing teams, and a conflict exists there is an option to merge the two teams by inserting the new members into an existing team.&lt;br /&gt;
[[File:Fix328r.jpg]]&lt;br /&gt;
* '''Issue #181''': If one attempts to import users or participants, and does not specify the file to import from, a  NoMethodError error occurs. the error has been handled by validating the file before importing the teams, thus the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
[[File:Fix181.jpg]]&lt;br /&gt;
* '''Issue #918''': Import of topics chokes on special characters&lt;br /&gt;
While importing the participants, the user can include special characters in the project description and is successfully stored in the database:&lt;br /&gt;
***insert image here ***&lt;br /&gt;
* '''Issue #183''':  Count of fields wrong in import&lt;br /&gt;
When the user tries to upload the file to import participants, password record should be made optional and let the user upload without password record:&lt;br /&gt;
***insert image here***&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Use Case Diagram ==&lt;br /&gt;
----&lt;br /&gt;
[[File:OODD.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Implementation  ==&lt;br /&gt;
'''Issue #328'''&lt;br /&gt;
#We search the database to see if there is an existing team with the same name. In such a case we save the old team in the ‘team’ variable and set the team_exists flag to true.&lt;br /&gt;
#We then cal the handle_dups method which handles the case if value chosen by the user is ‘insert into existing team’, inside the code this value is represented as ‘insert’. &lt;br /&gt;
#Then the import_team_members function is called&lt;br /&gt;
#We get the user through his/her name&lt;br /&gt;
#If a user isn’t registered, we get a nil object and raise an ImportError&lt;br /&gt;
#Else we add the user to the team if he/she isn’t already in the team&lt;br /&gt;
#The add_member function only works till the team isn’t filled to its maximum capacity&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#We included a new option in the duplicate handler field.&lt;br /&gt;
#We added a new handler in the handleDuplicates method to handle the given option as shown in the below screenshot.&lt;br /&gt;
#We leveraged the existing generateTeam() method and sent the existing team id to this method and replaced the existing team’s team name as follows:&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#We validate the file before importing the teams. Thus,the file needs to mandatorily be uploaded in order to import team.&lt;br /&gt;
&lt;br /&gt;
== Code Snippet ==&lt;br /&gt;
----&lt;br /&gt;
'''Issue #329''' &lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     if handle_dups == &amp;quot;rename_existing&amp;quot; # rename: rename existing team&lt;br /&gt;
       if teamtype.is_a?(CourseTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Course.find(id).name)) # update the old team name&lt;br /&gt;
      elsif  teamtype.is_a?(AssignmentTeam)&lt;br /&gt;
        team.update(name:self.generate_team_name(Assignment.find(id).name)) # update the old team name&lt;br /&gt;
      end&lt;br /&gt;
      #team.update(name:self.generate_team_name(Assignment.find(id).name))&lt;br /&gt;
      return name # send the new team name&lt;br /&gt;
    end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Issue #328'''&lt;br /&gt;
In file app/models/team.rb&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 if handle_dups==&amp;quot;insert&amp;quot;&lt;br /&gt;
      team.import_team_members(row_hash)&lt;br /&gt;
      return nil&lt;br /&gt;
&lt;br /&gt;
def import_team_members(starting_index = 0, row_hash)&lt;br /&gt;
    starting_index&lt;br /&gt;
    index = 0&lt;br /&gt;
    row_hash[:teammembers].each do |teammember|&lt;br /&gt;
      next if index &amp;lt; starting_index # not sure this will work, hash is not ordered like array&lt;br /&gt;
      user = User.find_by(name: teammember.to_s)&lt;br /&gt;
      if user.nil?&lt;br /&gt;
        raise ImportError, &amp;quot;The user '#{teammember.to_s}' was not found. &amp;lt;a href='/users/new'&amp;gt;Create&amp;lt;/a&amp;gt; this user?&amp;quot;&lt;br /&gt;
      else&lt;br /&gt;
        add_member(user) if TeamsUser.find_by(team_id: id, user_id: user.id).nil?&lt;br /&gt;
      end&lt;br /&gt;
      index += 1&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
----&lt;br /&gt;
To check the issue resolved, please follow the steps&lt;br /&gt;
'''Issue 918'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# Click on import topics&lt;br /&gt;
# Upload a file in the format given on the page, in place of topic description insert non-ASCII characters and upload&lt;br /&gt;
#Click on the import button.&lt;br /&gt;
#on the summary page, you should be able to see topic uploaded along with its description containing non-ASCII characters&lt;br /&gt;
&lt;br /&gt;
'''Issue 329'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
# on import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the rename the new team and import option.&lt;br /&gt;
#Upload a file containing the already existing team name.&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with a new name assigned and the new team with the name uploaded.&lt;br /&gt;
&lt;br /&gt;
'''Issue 328'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#On the import team form page, in the field &amp;quot;If a duplicate team name is found in the rooster&amp;quot; select the insert any new team members into the existing team option.&lt;br /&gt;
#Upload a file containing the already existing team name and new team members&lt;br /&gt;
#Click on import team button&lt;br /&gt;
#On the summary page, you should be able to see the existing team with additional team members&lt;br /&gt;
&lt;br /&gt;
'''Issue 183'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Upload a file in the format given on the page without password field &lt;br /&gt;
#Click on import participant button&lt;br /&gt;
#You should be able to successfully import the participants&lt;br /&gt;
&lt;br /&gt;
'''Issue 181'''&lt;br /&gt;
#Login as an instructor with the following credential&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Username: instructor6&lt;br /&gt;
Password: password&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
#Click on import participant button without uploading a file.&lt;br /&gt;
#You should be able to see a prompt error to upload a file and then import&lt;/div&gt;</summary>
		<author><name>Pgupta24</name></author>
	</entry>
</feed>