<?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=Wwu24</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=Wwu24"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Wwu24"/>
	<updated>2026-08-12T14:03:10Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Jjj259.png&amp;diff=121630</id>
		<title>File:Jjj259.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Jjj259.png&amp;diff=121630"/>
		<updated>2018-12-18T18:21:08Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: uploaded a new version of &amp;amp;quot;File:Jjj259.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=121627</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=121627"/>
		<updated>2018-12-18T18:19:30Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /*  Result  */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==''' Introduction '''==&lt;br /&gt;
&lt;br /&gt;
=== Background ===&lt;br /&gt;
One of the fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answering these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
One of the problems for the review system is that for each assignment, different topics are included. Students can choose the one topic they like, and those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, the topic can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have the same rubric, which may lead to unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assigning different rubies for different projects in a specified appointment.&lt;br /&gt;
&lt;br /&gt;
==''' Analysis &amp;amp; Plan '''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To realize such purpose, we have the following tasks need to be done:&lt;br /&gt;
&lt;br /&gt;
===Check Box===&lt;br /&gt;
For current design, the rubric used for a specified assignment is set at the following page. To make sure users can choose to set different rubrics for different projects, we need first add a checkbox at this page. Therefore, users can use this box to indicate if they want to use the same rubric for all the projects or set some different rubrics for some projects.&lt;br /&gt;
&lt;br /&gt;
[[File:2018F1873rubric.png]]&lt;br /&gt;
&lt;br /&gt;
===Dropdown List===&lt;br /&gt;
To make sure users can choose rubrics for each project, we should add a new dropdown list beside each project in the following page. The number of dropdown list should decide by review round number. Therefore, each time users choose to identify different rubrics for different projects, the list will appear and users can choose proper rubrics. The default rubric set at last page will be overwritten in this case. &lt;br /&gt;
&lt;br /&gt;
[[File:2018F1873project.png]]&lt;br /&gt;
&lt;br /&gt;
===Controller===&lt;br /&gt;
Make changes to the controller so that these functions can work. Most of our logic control codes will be written in ''helpers/sign_up_sheet_helper.rb''.&lt;br /&gt;
&lt;br /&gt;
logic flowchart:&lt;br /&gt;
&lt;br /&gt;
[[File:umlj.png]]&lt;br /&gt;
&lt;br /&gt;
===Database===&lt;br /&gt;
Add questionnaire_id in sign_up_topics table to make sure the projects can always relate to correct rubrics&lt;br /&gt;
&lt;br /&gt;
[[File:379jjj.png]]&lt;br /&gt;
&lt;br /&gt;
===Test===&lt;br /&gt;
Test what we changed to make sure it works as intended and not influence the original system.&lt;br /&gt;
&lt;br /&gt;
==''' Implement Steps '''==&lt;br /&gt;
&lt;br /&gt;
=== Task 1  Add checkbox===&lt;br /&gt;
1. edit the file views/assignments/edit/_rubrics.html.erb&lt;br /&gt;
&lt;br /&gt;
2. add a checkbox at the top of the page which says &amp;quot;Vary rubric by topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
3. set the default state for this checkbox as unchecked&lt;br /&gt;
&lt;br /&gt;
===Task 2 Add dropdown list===&lt;br /&gt;
1. edit the file views/assignment/edit/_general.html.erb&lt;br /&gt;
&lt;br /&gt;
2. add a variable to indicate if the checkbox said in Task 1 is checked&lt;br /&gt;
&lt;br /&gt;
3. create a new file under views/sign_up_sheet called &amp;quot;_rubrics_list.html.erb&amp;quot; to store the code for the dropdown list&lt;br /&gt;
&lt;br /&gt;
4. edit the file views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
&lt;br /&gt;
5. add the code to render the dropdown list&lt;br /&gt;
&lt;br /&gt;
6. making a judgment before rendering the dropdown list, only if the checkbox in Task 1ist checked to render the page&lt;br /&gt;
&lt;br /&gt;
===Task 3 Change controllers===&lt;br /&gt;
Change the update method in sign_up_sheet_controller.rb to make sure when new rubric is chosen for a specific topic, it can be stored in the database properly&lt;br /&gt;
&lt;br /&gt;
===Task 4 Create migration===&lt;br /&gt;
1. create a new migration to add questionnaire_id in sign_up_topics&lt;br /&gt;
&lt;br /&gt;
2. the questionnaire_id is a foreign key which references to questionnaires&lt;br /&gt;
&lt;br /&gt;
3. change the file models/sign_up_topic.rb, and add the relations with the questionnaire, the relation between them is one-to-one&lt;br /&gt;
&lt;br /&gt;
===Task 5 Test the changes===&lt;br /&gt;
1. make a test plan for the features that need to be tested&lt;br /&gt;
&lt;br /&gt;
2. follow the test plan to write automatic test codes&lt;br /&gt;
&lt;br /&gt;
3. evaluate the results and refactor codes&lt;br /&gt;
&lt;br /&gt;
==''' Test plan '''==&lt;br /&gt;
We mainly use cucumber and capybara to test UI, and the following are detailed plans&lt;br /&gt;
&lt;br /&gt;
===Test checkbox===&lt;br /&gt;
1. go to the rubrics page under the assignment&lt;br /&gt;
&lt;br /&gt;
2. we can see the checkbox says &amp;quot;Vary rubric by topic&amp;quot; shows on this page&lt;br /&gt;
&lt;br /&gt;
3. the initial state of the checkbox is unchecked&lt;br /&gt;
&lt;br /&gt;
===Test dropdown list===&lt;br /&gt;
====Scenario 1====&lt;br /&gt;
1. the checkbox &amp;quot;Vary rubric by topic&amp;quot; is unchecked&lt;br /&gt;
&lt;br /&gt;
2. go to the topics page under assignment&lt;br /&gt;
&lt;br /&gt;
3.there are no dropdown lists beside topics&lt;br /&gt;
====Scenario 2====&lt;br /&gt;
1. the checkbox &amp;quot;Vary rubric by topic&amp;quot; is checked&lt;br /&gt;
&lt;br /&gt;
2. go to the topics page under assignment&lt;br /&gt;
&lt;br /&gt;
3. the table to show the topics have a row called &amp;quot;rubrics&amp;quot;&lt;br /&gt;
&lt;br /&gt;
4. under this title, each topic has a dropdown list&lt;br /&gt;
&lt;br /&gt;
==''' Result '''==&lt;br /&gt;
[[File:Www11.png]]&lt;br /&gt;
[[File:Jjj259.png]]&lt;br /&gt;
===Test===&lt;br /&gt;
Instead of testing UI, we did some unit tests using Rspec.&lt;br /&gt;
&lt;br /&gt;
For testing update_topic_questionnaires.&lt;br /&gt;
*when attributes are nil&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it 'returns false' do&lt;br /&gt;
  expect(assignment_form.update_topic_questionnaires(nil)).to be false&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*when attributes are not nil and at least one topic_questionnaire's id is nil or blank&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let(:attributes) { [topic_questionnaire, topic_questionnaire2] }&lt;br /&gt;
before(:each) do&lt;br /&gt;
  allow(topic_questionnaire).to receive(:[]).with(:id).and_return(nil)&lt;br /&gt;
  allow(topic_questionnaire2).to receive(:[]).with(:id).and_return(1)&lt;br /&gt;
  allow(TopicQuestionnaire).to receive(:where).with(sign_up_topic_id: SignUpTopic.where(assignment_id: 1)).and_return([])&lt;br /&gt;
  allow(TopicQuestionnaire).to receive(:new).with(topic_questionnaire).and_return(topic_questionnaire)&lt;br /&gt;
  allow(TopicQuestionnaire).to receive(:find).with(1).and_return(topic_questionnaire2)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*when both save and update_attributes method do not work&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it 'changes @has_errors value to true and returns attributes (args)' do&lt;br /&gt;
  allow(topic_questionnaire).to receive(:save).and_return(false)&lt;br /&gt;
  allow(topic_questionnaire2).to receive(:update_attributes).with(topic_questionnaire2).and_return(false)&lt;br /&gt;
  expect(assignment_form.update_topic_questionnaires(attributes)).to eq(attributes)&lt;br /&gt;
  expect(assignment_form.instance_variable_get(:@has_errors)).to be true&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*when both save and update_attributes method work well&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it 'returns attributes (args) and @has_errors value is nil' do&lt;br /&gt;
  allow(topic_questionnaire).to receive(:save).and_return(true)&lt;br /&gt;
  allow(topic_questionnaire2).to receive(:update_attributes).with(topic_questionnaire2).and_return(true)&lt;br /&gt;
  expect(assignment_form.update_topic_questionnaires(attributes)).to eq(attributes)&lt;br /&gt;
  expect(assignment_form.instance_variable_get(:@has_errors)).to be nil&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For testing review_by_rounds, check the number of rounds which decides the rounds of the questionnaire that each assignment needs.&lt;br /&gt;
*when used in round is nil&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it 'returns false' do&lt;br /&gt;
  expect(@review_by_rounds).to be nil&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Jjj259.png&amp;diff=121626</id>
		<title>File:Jjj259.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Jjj259.png&amp;diff=121626"/>
		<updated>2018-12-18T18:18:37Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=121625</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=121625"/>
		<updated>2018-12-18T18:17:21Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Database */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==''' Introduction '''==&lt;br /&gt;
&lt;br /&gt;
=== Background ===&lt;br /&gt;
One of the fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answering these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
One of the problems for the review system is that for each assignment, different topics are included. Students can choose the one topic they like, and those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, the topic can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have the same rubric, which may lead to unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assigning different rubies for different projects in a specified appointment.&lt;br /&gt;
&lt;br /&gt;
==''' Analysis &amp;amp; Plan '''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To realize such purpose, we have the following tasks need to be done:&lt;br /&gt;
&lt;br /&gt;
===Check Box===&lt;br /&gt;
For current design, the rubric used for a specified assignment is set at the following page. To make sure users can choose to set different rubrics for different projects, we need first add a checkbox at this page. Therefore, users can use this box to indicate if they want to use the same rubric for all the projects or set some different rubrics for some projects.&lt;br /&gt;
&lt;br /&gt;
[[File:2018F1873rubric.png]]&lt;br /&gt;
&lt;br /&gt;
===Dropdown List===&lt;br /&gt;
To make sure users can choose rubrics for each project, we should add a new dropdown list beside each project in the following page. The number of dropdown list should decide by review round number. Therefore, each time users choose to identify different rubrics for different projects, the list will appear and users can choose proper rubrics. The default rubric set at last page will be overwritten in this case. &lt;br /&gt;
&lt;br /&gt;
[[File:2018F1873project.png]]&lt;br /&gt;
&lt;br /&gt;
===Controller===&lt;br /&gt;
Make changes to the controller so that these functions can work. Most of our logic control codes will be written in ''helpers/sign_up_sheet_helper.rb''.&lt;br /&gt;
&lt;br /&gt;
logic flowchart:&lt;br /&gt;
&lt;br /&gt;
[[File:umlj.png]]&lt;br /&gt;
&lt;br /&gt;
===Database===&lt;br /&gt;
Add questionnaire_id in sign_up_topics table to make sure the projects can always relate to correct rubrics&lt;br /&gt;
&lt;br /&gt;
[[File:379jjj.png]]&lt;br /&gt;
&lt;br /&gt;
===Test===&lt;br /&gt;
Test what we changed to make sure it works as intended and not influence the original system.&lt;br /&gt;
&lt;br /&gt;
==''' Implement Steps '''==&lt;br /&gt;
&lt;br /&gt;
=== Task 1  Add checkbox===&lt;br /&gt;
1. edit the file views/assignments/edit/_rubrics.html.erb&lt;br /&gt;
&lt;br /&gt;
2. add a checkbox at the top of the page which says &amp;quot;Vary rubric by topic&amp;quot;&lt;br /&gt;
&lt;br /&gt;
3. set the default state for this checkbox as unchecked&lt;br /&gt;
&lt;br /&gt;
===Task 2 Add dropdown list===&lt;br /&gt;
1. edit the file views/assignment/edit/_general.html.erb&lt;br /&gt;
&lt;br /&gt;
2. add a variable to indicate if the checkbox said in Task 1 is checked&lt;br /&gt;
&lt;br /&gt;
3. create a new file under views/sign_up_sheet called &amp;quot;_rubrics_list.html.erb&amp;quot; to store the code for the dropdown list&lt;br /&gt;
&lt;br /&gt;
4. edit the file views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
&lt;br /&gt;
5. add the code to render the dropdown list&lt;br /&gt;
&lt;br /&gt;
6. making a judgment before rendering the dropdown list, only if the checkbox in Task 1ist checked to render the page&lt;br /&gt;
&lt;br /&gt;
===Task 3 Change controllers===&lt;br /&gt;
Change the update method in sign_up_sheet_controller.rb to make sure when new rubric is chosen for a specific topic, it can be stored in the database properly&lt;br /&gt;
&lt;br /&gt;
===Task 4 Create migration===&lt;br /&gt;
1. create a new migration to add questionnaire_id in sign_up_topics&lt;br /&gt;
&lt;br /&gt;
2. the questionnaire_id is a foreign key which references to questionnaires&lt;br /&gt;
&lt;br /&gt;
3. change the file models/sign_up_topic.rb, and add the relations with the questionnaire, the relation between them is one-to-one&lt;br /&gt;
&lt;br /&gt;
===Task 5 Test the changes===&lt;br /&gt;
1. make a test plan for the features that need to be tested&lt;br /&gt;
&lt;br /&gt;
2. follow the test plan to write automatic test codes&lt;br /&gt;
&lt;br /&gt;
3. evaluate the results and refactor codes&lt;br /&gt;
&lt;br /&gt;
==''' Test plan '''==&lt;br /&gt;
We mainly use cucumber and capybara to test UI, and the following are detailed plans&lt;br /&gt;
&lt;br /&gt;
===Test checkbox===&lt;br /&gt;
1. go to the rubrics page under the assignment&lt;br /&gt;
&lt;br /&gt;
2. we can see the checkbox says &amp;quot;Vary rubric by topic&amp;quot; shows on this page&lt;br /&gt;
&lt;br /&gt;
3. the initial state of the checkbox is unchecked&lt;br /&gt;
&lt;br /&gt;
===Test dropdown list===&lt;br /&gt;
====Scenario 1====&lt;br /&gt;
1. the checkbox &amp;quot;Vary rubric by topic&amp;quot; is unchecked&lt;br /&gt;
&lt;br /&gt;
2. go to the topics page under assignment&lt;br /&gt;
&lt;br /&gt;
3.there are no dropdown lists beside topics&lt;br /&gt;
====Scenario 2====&lt;br /&gt;
1. the checkbox &amp;quot;Vary rubric by topic&amp;quot; is checked&lt;br /&gt;
&lt;br /&gt;
2. go to the topics page under assignment&lt;br /&gt;
&lt;br /&gt;
3. the table to show the topics have a row called &amp;quot;rubrics&amp;quot;&lt;br /&gt;
&lt;br /&gt;
4. under this title, each topic has a dropdown list&lt;br /&gt;
&lt;br /&gt;
==''' Result '''==&lt;br /&gt;
[[File:Www11.png]]&lt;br /&gt;
&lt;br /&gt;
===Test===&lt;br /&gt;
Instead of testing UI, we did some unit tests using Rspec.&lt;br /&gt;
&lt;br /&gt;
For testing update_topic_questionnaires.&lt;br /&gt;
*when attributes are nil&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it 'returns false' do&lt;br /&gt;
  expect(assignment_form.update_topic_questionnaires(nil)).to be false&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*when attributes are not nil and at least one topic_questionnaire's id is nil or blank&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
let(:attributes) { [topic_questionnaire, topic_questionnaire2] }&lt;br /&gt;
before(:each) do&lt;br /&gt;
  allow(topic_questionnaire).to receive(:[]).with(:id).and_return(nil)&lt;br /&gt;
  allow(topic_questionnaire2).to receive(:[]).with(:id).and_return(1)&lt;br /&gt;
  allow(TopicQuestionnaire).to receive(:where).with(sign_up_topic_id: SignUpTopic.where(assignment_id: 1)).and_return([])&lt;br /&gt;
  allow(TopicQuestionnaire).to receive(:new).with(topic_questionnaire).and_return(topic_questionnaire)&lt;br /&gt;
  allow(TopicQuestionnaire).to receive(:find).with(1).and_return(topic_questionnaire2)&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*when both save and update_attributes method do not work&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it 'changes @has_errors value to true and returns attributes (args)' do&lt;br /&gt;
  allow(topic_questionnaire).to receive(:save).and_return(false)&lt;br /&gt;
  allow(topic_questionnaire2).to receive(:update_attributes).with(topic_questionnaire2).and_return(false)&lt;br /&gt;
  expect(assignment_form.update_topic_questionnaires(attributes)).to eq(attributes)&lt;br /&gt;
  expect(assignment_form.instance_variable_get(:@has_errors)).to be true&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
*when both save and update_attributes method work well&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it 'returns attributes (args) and @has_errors value is nil' do&lt;br /&gt;
  allow(topic_questionnaire).to receive(:save).and_return(true)&lt;br /&gt;
  allow(topic_questionnaire2).to receive(:update_attributes).with(topic_questionnaire2).and_return(true)&lt;br /&gt;
  expect(assignment_form.update_topic_questionnaires(attributes)).to eq(attributes)&lt;br /&gt;
  expect(assignment_form.instance_variable_get(:@has_errors)).to be nil&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For testing review_by_rounds, check the number of rounds which decides the rounds of the questionnaire that each assignment needs.&lt;br /&gt;
*when used in round is nil&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
it 'returns false' do&lt;br /&gt;
  expect(@review_by_rounds).to be nil&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:379jjj.png&amp;diff=121624</id>
		<title>File:379jjj.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:379jjj.png&amp;diff=121624"/>
		<updated>2018-12-18T18:16:49Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Www11.png&amp;diff=121620</id>
		<title>File:Www11.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Www11.png&amp;diff=121620"/>
		<updated>2018-12-18T18:08:50Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: uploaded a new version of &amp;amp;quot;File:Www11.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Www11.png&amp;diff=121613</id>
		<title>File:Www11.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Www11.png&amp;diff=121613"/>
		<updated>2018-12-18T18:03:31Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: uploaded a new version of &amp;amp;quot;File:Www11.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Www11.png&amp;diff=121611</id>
		<title>File:Www11.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Www11.png&amp;diff=121611"/>
		<updated>2018-12-18T18:02:13Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: uploaded a new version of &amp;amp;quot;File:Www11.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119511</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119511"/>
		<updated>2018-11-12T21:39:59Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Test checkbox */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
There is problem that for each assignment, it includes several different topics and students can choose from these topics as they like. Those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, these projects can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have one same rubric, which may lead unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assign different rubies for different projects in a specified appointment.&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
To realize such purpose, we have the following tasks need to be done:&lt;br /&gt;
&lt;br /&gt;
1. For current design, the rubric used for a specified assignment is set at the following page. To make sure users can choose to set different rubrics for different projects, we need first add a checkbox at this page. Therefore, users can use this box to indicate if they want to use the same rubric for all the projects or set some different rubrics for some projects.&lt;br /&gt;
[[File:2018F1873rubric.png]]&lt;br /&gt;
&lt;br /&gt;
2.To make sure users can choose rubrics for each project, we should add a new dropdown list beside each project in the following page. Therefore, each time users choose to identify different rubrics fro different projects, the list will appear and users can choose proper rubrics. The default rubric set at last page will be overwritten in this case.&lt;br /&gt;
[[File:2018F1873project.png]]&lt;br /&gt;
&lt;br /&gt;
3.Make changes to the controller so that these functions can work.&lt;br /&gt;
&lt;br /&gt;
4. Add questionnaire_id in sign_up_topics table to make sure the projects can always relate to correct rubrics&lt;br /&gt;
&lt;br /&gt;
5. Test what we changed to make sure it works as intended and not influence the original system.&lt;br /&gt;
&lt;br /&gt;
== Technical design ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1  Add checkbox===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. edit the file views/assignments/edit/_rubrics.html.erb&lt;br /&gt;
2. add a checkbox at the top of the page which says &amp;quot;Vary rubric by topic&amp;quot;&lt;br /&gt;
3. set the default state for this checkbox as unchecked&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 2 Add dropdown list===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. edit the file views/assignment/edit/_general.html.erb&lt;br /&gt;
2. add a variable to indicate if the checkbox said in Task 1 is checked&lt;br /&gt;
3. create a new file under views/sign_up_sheet called &amp;quot;_rubrics_list.html.erb&amp;quot; to store the code for the dropdown list&lt;br /&gt;
4. edit the file views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
5. add the code to render the dropdown list&lt;br /&gt;
6. making a judgment before render the dropdown list, only if the checkbox in Task 1is checked render the page&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3 Change controllers===&lt;br /&gt;
&amp;lt;pre&amp;gt;change update method in sign_up_sheet_controller.rb to make sure when new rubric is chosen for a specific topic, it can be stored in the database properly&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4 Create migration===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. create a new migration to add questionnaire_id in sign_up_topics&lt;br /&gt;
2. the questionnaire_id is a foreign key which references to questionnaires&lt;br /&gt;
3. change the file models/sign_up_topic.rb, and add the relations with questionnaire, the relation between them is one-to-one&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5 Test the changes===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. make a test plan for the features that need to be tested&lt;br /&gt;
2. follow the test plan to write automatic test codes&lt;br /&gt;
3. evaluate the results and refactor codes&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Test plan =&lt;br /&gt;
We mainly use cucumber and capybara to test UI, and the following are detailed plans&lt;br /&gt;
&lt;br /&gt;
==Test checkbox==&lt;br /&gt;
&amp;lt;pre&amp;gt;1. go to the rubrics page under the assignment&lt;br /&gt;
2. we can see the checkbox says &amp;quot;Vary rubric by topic&amp;quot; shows on this page&lt;br /&gt;
3. the initial state of the checkbox is unchecked&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test dropdown list==&lt;br /&gt;
===Scenario 1===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. the checkbox &amp;quot;Vary rubric by topic&amp;quot; is unchecked&lt;br /&gt;
2. go to the topics page under assignment&lt;br /&gt;
3.there are no dropdown lists beside topics&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Scenario 2===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. the checkbox &amp;quot;Vary rubric by topic&amp;quot; is checked&lt;br /&gt;
2. go to the topics page under assignment&lt;br /&gt;
3. the table to show the topics have a row called &amp;quot;rubrics&amp;quot;&lt;br /&gt;
4. under this title, each topic has a dropdown list&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119510</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119510"/>
		<updated>2018-11-12T21:39:41Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Test dropdown list= */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
There is problem that for each assignment, it includes several different topics and students can choose from these topics as they like. Those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, these projects can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have one same rubric, which may lead unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assign different rubies for different projects in a specified appointment.&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
To realize such purpose, we have the following tasks need to be done:&lt;br /&gt;
&lt;br /&gt;
1. For current design, the rubric used for a specified assignment is set at the following page. To make sure users can choose to set different rubrics for different projects, we need first add a checkbox at this page. Therefore, users can use this box to indicate if they want to use the same rubric for all the projects or set some different rubrics for some projects.&lt;br /&gt;
[[File:2018F1873rubric.png]]&lt;br /&gt;
&lt;br /&gt;
2.To make sure users can choose rubrics for each project, we should add a new dropdown list beside each project in the following page. Therefore, each time users choose to identify different rubrics fro different projects, the list will appear and users can choose proper rubrics. The default rubric set at last page will be overwritten in this case.&lt;br /&gt;
[[File:2018F1873project.png]]&lt;br /&gt;
&lt;br /&gt;
3.Make changes to the controller so that these functions can work.&lt;br /&gt;
&lt;br /&gt;
4. Add questionnaire_id in sign_up_topics table to make sure the projects can always relate to correct rubrics&lt;br /&gt;
&lt;br /&gt;
5. Test what we changed to make sure it works as intended and not influence the original system.&lt;br /&gt;
&lt;br /&gt;
== Technical design ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1  Add checkbox===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. edit the file views/assignments/edit/_rubrics.html.erb&lt;br /&gt;
2. add a checkbox at the top of the page which says &amp;quot;Vary rubric by topic&amp;quot;&lt;br /&gt;
3. set the default state for this checkbox as unchecked&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 2 Add dropdown list===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. edit the file views/assignment/edit/_general.html.erb&lt;br /&gt;
2. add a variable to indicate if the checkbox said in Task 1 is checked&lt;br /&gt;
3. create a new file under views/sign_up_sheet called &amp;quot;_rubrics_list.html.erb&amp;quot; to store the code for the dropdown list&lt;br /&gt;
4. edit the file views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
5. add the code to render the dropdown list&lt;br /&gt;
6. making a judgment before render the dropdown list, only if the checkbox in Task 1is checked render the page&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3 Change controllers===&lt;br /&gt;
&amp;lt;pre&amp;gt;change update method in sign_up_sheet_controller.rb to make sure when new rubric is chosen for a specific topic, it can be stored in the database properly&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4 Create migration===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. create a new migration to add questionnaire_id in sign_up_topics&lt;br /&gt;
2. the questionnaire_id is a foreign key which references to questionnaires&lt;br /&gt;
3. change the file models/sign_up_topic.rb, and add the relations with questionnaire, the relation between them is one-to-one&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5 Test the changes===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. make a test plan for the features that need to be tested&lt;br /&gt;
2. follow the test plan to write automatic test codes&lt;br /&gt;
3. evaluate the results and refactor codes&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Test plan =&lt;br /&gt;
We mainly use cucumber and capybara to test UI, and the following are detailed plans&lt;br /&gt;
&lt;br /&gt;
==Test checkbox==&lt;br /&gt;
1. go to the rubrics page under the assignment&lt;br /&gt;
2. we can see the checkbox says &amp;quot;Vary rubric by topic&amp;quot; shows on this page&lt;br /&gt;
3. the initial state of the checkbox is unchecked&lt;br /&gt;
&lt;br /&gt;
==Test dropdown list==&lt;br /&gt;
===Scenario 1===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. the checkbox &amp;quot;Vary rubric by topic&amp;quot; is unchecked&lt;br /&gt;
2. go to the topics page under assignment&lt;br /&gt;
3.there are no dropdown lists beside topics&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Scenario 2===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. the checkbox &amp;quot;Vary rubric by topic&amp;quot; is checked&lt;br /&gt;
2. go to the topics page under assignment&lt;br /&gt;
3. the table to show the topics have a row called &amp;quot;rubrics&amp;quot;&lt;br /&gt;
4. under this title, each topic has a dropdown list&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119509</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119509"/>
		<updated>2018-11-12T21:39:30Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Test dropdown list= */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
There is problem that for each assignment, it includes several different topics and students can choose from these topics as they like. Those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, these projects can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have one same rubric, which may lead unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assign different rubies for different projects in a specified appointment.&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
To realize such purpose, we have the following tasks need to be done:&lt;br /&gt;
&lt;br /&gt;
1. For current design, the rubric used for a specified assignment is set at the following page. To make sure users can choose to set different rubrics for different projects, we need first add a checkbox at this page. Therefore, users can use this box to indicate if they want to use the same rubric for all the projects or set some different rubrics for some projects.&lt;br /&gt;
[[File:2018F1873rubric.png]]&lt;br /&gt;
&lt;br /&gt;
2.To make sure users can choose rubrics for each project, we should add a new dropdown list beside each project in the following page. Therefore, each time users choose to identify different rubrics fro different projects, the list will appear and users can choose proper rubrics. The default rubric set at last page will be overwritten in this case.&lt;br /&gt;
[[File:2018F1873project.png]]&lt;br /&gt;
&lt;br /&gt;
3.Make changes to the controller so that these functions can work.&lt;br /&gt;
&lt;br /&gt;
4. Add questionnaire_id in sign_up_topics table to make sure the projects can always relate to correct rubrics&lt;br /&gt;
&lt;br /&gt;
5. Test what we changed to make sure it works as intended and not influence the original system.&lt;br /&gt;
&lt;br /&gt;
== Technical design ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1  Add checkbox===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. edit the file views/assignments/edit/_rubrics.html.erb&lt;br /&gt;
2. add a checkbox at the top of the page which says &amp;quot;Vary rubric by topic&amp;quot;&lt;br /&gt;
3. set the default state for this checkbox as unchecked&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 2 Add dropdown list===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. edit the file views/assignment/edit/_general.html.erb&lt;br /&gt;
2. add a variable to indicate if the checkbox said in Task 1 is checked&lt;br /&gt;
3. create a new file under views/sign_up_sheet called &amp;quot;_rubrics_list.html.erb&amp;quot; to store the code for the dropdown list&lt;br /&gt;
4. edit the file views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
5. add the code to render the dropdown list&lt;br /&gt;
6. making a judgment before render the dropdown list, only if the checkbox in Task 1is checked render the page&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3 Change controllers===&lt;br /&gt;
&amp;lt;pre&amp;gt;change update method in sign_up_sheet_controller.rb to make sure when new rubric is chosen for a specific topic, it can be stored in the database properly&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4 Create migration===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. create a new migration to add questionnaire_id in sign_up_topics&lt;br /&gt;
2. the questionnaire_id is a foreign key which references to questionnaires&lt;br /&gt;
3. change the file models/sign_up_topic.rb, and add the relations with questionnaire, the relation between them is one-to-one&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5 Test the changes===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. make a test plan for the features that need to be tested&lt;br /&gt;
2. follow the test plan to write automatic test codes&lt;br /&gt;
3. evaluate the results and refactor codes&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Test plan =&lt;br /&gt;
We mainly use cucumber and capybara to test UI, and the following are detailed plans&lt;br /&gt;
&lt;br /&gt;
==Test checkbox==&lt;br /&gt;
1. go to the rubrics page under the assignment&lt;br /&gt;
2. we can see the checkbox says &amp;quot;Vary rubric by topic&amp;quot; shows on this page&lt;br /&gt;
3. the initial state of the checkbox is unchecked&lt;br /&gt;
&lt;br /&gt;
==Test dropdown list===&lt;br /&gt;
===Scenario 1===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. the checkbox &amp;quot;Vary rubric by topic&amp;quot; is unchecked&lt;br /&gt;
2. go to the topics page under assignment&lt;br /&gt;
3.there are no dropdown lists beside topics&amp;lt;/pre&amp;gt;&lt;br /&gt;
===Scenario 2===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. the checkbox &amp;quot;Vary rubric by topic&amp;quot; is checked&lt;br /&gt;
2. go to the topics page under assignment&lt;br /&gt;
3. the table to show the topics have a row called &amp;quot;rubrics&amp;quot;&lt;br /&gt;
4. under this title, each topic has a dropdown list&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119508</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119508"/>
		<updated>2018-11-12T21:38:41Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Test plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
There is problem that for each assignment, it includes several different topics and students can choose from these topics as they like. Those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, these projects can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have one same rubric, which may lead unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assign different rubies for different projects in a specified appointment.&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
To realize such purpose, we have the following tasks need to be done:&lt;br /&gt;
&lt;br /&gt;
1. For current design, the rubric used for a specified assignment is set at the following page. To make sure users can choose to set different rubrics for different projects, we need first add a checkbox at this page. Therefore, users can use this box to indicate if they want to use the same rubric for all the projects or set some different rubrics for some projects.&lt;br /&gt;
[[File:2018F1873rubric.png]]&lt;br /&gt;
&lt;br /&gt;
2.To make sure users can choose rubrics for each project, we should add a new dropdown list beside each project in the following page. Therefore, each time users choose to identify different rubrics fro different projects, the list will appear and users can choose proper rubrics. The default rubric set at last page will be overwritten in this case.&lt;br /&gt;
[[File:2018F1873project.png]]&lt;br /&gt;
&lt;br /&gt;
3.Make changes to the controller so that these functions can work.&lt;br /&gt;
&lt;br /&gt;
4. Add questionnaire_id in sign_up_topics table to make sure the projects can always relate to correct rubrics&lt;br /&gt;
&lt;br /&gt;
5. Test what we changed to make sure it works as intended and not influence the original system.&lt;br /&gt;
&lt;br /&gt;
== Technical design ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1  Add checkbox===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. edit the file views/assignments/edit/_rubrics.html.erb&lt;br /&gt;
2. add a checkbox at the top of the page which says &amp;quot;Vary rubric by topic&amp;quot;&lt;br /&gt;
3. set the default state for this checkbox as unchecked&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 2 Add dropdown list===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. edit the file views/assignment/edit/_general.html.erb&lt;br /&gt;
2. add a variable to indicate if the checkbox said in Task 1 is checked&lt;br /&gt;
3. create a new file under views/sign_up_sheet called &amp;quot;_rubrics_list.html.erb&amp;quot; to store the code for the dropdown list&lt;br /&gt;
4. edit the file views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
5. add the code to render the dropdown list&lt;br /&gt;
6. making a judgment before render the dropdown list, only if the checkbox in Task 1is checked render the page&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3 Change controllers===&lt;br /&gt;
&amp;lt;pre&amp;gt;change update method in sign_up_sheet_controller.rb to make sure when new rubric is chosen for a specific topic, it can be stored in the database properly&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4 Create migration===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. create a new migration to add questionnaire_id in sign_up_topics&lt;br /&gt;
2. the questionnaire_id is a foreign key which references to questionnaires&lt;br /&gt;
3. change the file models/sign_up_topic.rb, and add the relations with questionnaire, the relation between them is one-to-one&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5 Test the changes===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. make a test plan for the features that need to be tested&lt;br /&gt;
2. follow the test plan to write automatic test codes&lt;br /&gt;
3. evaluate the results and refactor codes&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Test plan =&lt;br /&gt;
We mainly use cucumber and capybara to test UI, and the following are detailed plans&lt;br /&gt;
&lt;br /&gt;
==Test checkbox==&lt;br /&gt;
1. go to the rubrics page under the assignment&lt;br /&gt;
2. we can see the checkbox says &amp;quot;Vary rubric by topic&amp;quot; shows on this page&lt;br /&gt;
3. the initial state of the checkbox is unchecked&lt;br /&gt;
&lt;br /&gt;
==Test dropdown list===&lt;br /&gt;
===Scenario 1===&lt;br /&gt;
1. the checkbox &amp;quot;Vary rubric by topic&amp;quot; is unchecked&lt;br /&gt;
2. go to the topics page under assignment&lt;br /&gt;
3.there are no dropdown lists beside topics&lt;br /&gt;
===Scenario 2===&lt;br /&gt;
1. the checkbox &amp;quot;Vary rubric by topic&amp;quot; is checked&lt;br /&gt;
2. go to the topics page under assignment&lt;br /&gt;
3. the table to show the topics have a row called &amp;quot;rubrics&amp;quot;&lt;br /&gt;
4. under this title, each topic has a dropdown list&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119505</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119505"/>
		<updated>2018-11-12T21:31:37Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Test plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
There is problem that for each assignment, it includes several different topics and students can choose from these topics as they like. Those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, these projects can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have one same rubric, which may lead unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assign different rubies for different projects in a specified appointment.&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
To realize such purpose, we have the following tasks need to be done:&lt;br /&gt;
&lt;br /&gt;
1. For current design, the rubric used for a specified assignment is set at the following page. To make sure users can choose to set different rubrics for different projects, we need first add a checkbox at this page. Therefore, users can use this box to indicate if they want to use the same rubric for all the projects or set some different rubrics for some projects.&lt;br /&gt;
[[File:2018F1873rubric.png]]&lt;br /&gt;
&lt;br /&gt;
2.To make sure users can choose rubrics for each project, we should add a new dropdown list beside each project in the following page. Therefore, each time users choose to identify different rubrics fro different projects, the list will appear and users can choose proper rubrics. The default rubric set at last page will be overwritten in this case.&lt;br /&gt;
[[File:2018F1873project.png]]&lt;br /&gt;
&lt;br /&gt;
3.Make changes to the controller so that these functions can work.&lt;br /&gt;
&lt;br /&gt;
4. Add questionnaire_id in sign_up_topics table to make sure the projects can always relate to correct rubrics&lt;br /&gt;
&lt;br /&gt;
5. Test what we changed to make sure it works as intended and not influence the original system.&lt;br /&gt;
&lt;br /&gt;
== Technical design ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1  Add checkbox===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. edit the file views/assignments/edit/_rubrics.html.erb&lt;br /&gt;
2. add a checkbox at the top of the page which says &amp;quot;Vary rubric by topic&amp;quot;&lt;br /&gt;
3. set the default state for this checkbox as unchecked&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 2 Add dropdown list===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. edit the file views/assignment/edit/_general.html.erb&lt;br /&gt;
2. add a variable to indicate if the checkbox said in Task 1 is checked&lt;br /&gt;
3. create a new file under views/sign_up_sheet called &amp;quot;_rubrics_list.html.erb&amp;quot; to store the code for the dropdown list&lt;br /&gt;
4. edit the file views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
5. add the code to render the dropdown list&lt;br /&gt;
6. making a judgment before render the dropdown list, only if the checkbox in Task 1is checked render the page&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3 Change controllers===&lt;br /&gt;
&amp;lt;pre&amp;gt;change update method in sign_up_sheet_controller.rb to make sure when new rubric is chosen for a specific topic, it can be stored in the database properly&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4 Create migration===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. create a new migration to add questionnaire_id in sign_up_topics&lt;br /&gt;
2. the questionnaire_id is a foreign key which references to questionnaires&lt;br /&gt;
3. change the file models/sign_up_topic.rb, and add the relations with questionnaire, the relation between them is one-to-one&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5 Test the changes===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. make a test plan for the features that need to be tested&lt;br /&gt;
2. follow the test plan to write automatic test codes&lt;br /&gt;
3. evaluate the results and refactor codes&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Test plan =&lt;br /&gt;
We mainly use cucumber and capybara to test UI, and the following are detailed plans&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119503</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119503"/>
		<updated>2018-11-12T21:31:18Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Test plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
There is problem that for each assignment, it includes several different topics and students can choose from these topics as they like. Those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, these projects can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have one same rubric, which may lead unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assign different rubies for different projects in a specified appointment.&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
To realize such purpose, we have the following tasks need to be done:&lt;br /&gt;
&lt;br /&gt;
1. For current design, the rubric used for a specified assignment is set at the following page. To make sure users can choose to set different rubrics for different projects, we need first add a checkbox at this page. Therefore, users can use this box to indicate if they want to use the same rubric for all the projects or set some different rubrics for some projects.&lt;br /&gt;
[[File:2018F1873rubric.png]]&lt;br /&gt;
&lt;br /&gt;
2.To make sure users can choose rubrics for each project, we should add a new dropdown list beside each project in the following page. Therefore, each time users choose to identify different rubrics fro different projects, the list will appear and users can choose proper rubrics. The default rubric set at last page will be overwritten in this case.&lt;br /&gt;
[[File:2018F1873project.png]]&lt;br /&gt;
&lt;br /&gt;
3.Make changes to the controller so that these functions can work.&lt;br /&gt;
&lt;br /&gt;
4. Add questionnaire_id in sign_up_topics table to make sure the projects can always relate to correct rubrics&lt;br /&gt;
&lt;br /&gt;
5. Test what we changed to make sure it works as intended and not influence the original system.&lt;br /&gt;
&lt;br /&gt;
== Technical design ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1  Add checkbox===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. edit the file views/assignments/edit/_rubrics.html.erb&lt;br /&gt;
2. add a checkbox at the top of the page which says &amp;quot;Vary rubric by topic&amp;quot;&lt;br /&gt;
3. set the default state for this checkbox as unchecked&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 2 Add dropdown list===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. edit the file views/assignment/edit/_general.html.erb&lt;br /&gt;
2. add a variable to indicate if the checkbox said in Task 1 is checked&lt;br /&gt;
3. create a new file under views/sign_up_sheet called &amp;quot;_rubrics_list.html.erb&amp;quot; to store the code for the dropdown list&lt;br /&gt;
4. edit the file views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
5. add the code to render the dropdown list&lt;br /&gt;
6. making a judgment before render the dropdown list, only if the checkbox in Task 1is checked render the page&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3 Change controllers===&lt;br /&gt;
&amp;lt;pre&amp;gt;change update method in sign_up_sheet_controller.rb to make sure when new rubric is chosen for a specific topic, it can be stored in the database properly&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4 Create migration===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. create a new migration to add questionnaire_id in sign_up_topics&lt;br /&gt;
2. the questionnaire_id is a foreign key which references to questionnaires&lt;br /&gt;
3. change the file models/sign_up_topic.rb, and add the relations with questionnaire, the relation between them is one-to-one&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5 Test the changes===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. make a test plan for the features that need to be tested&lt;br /&gt;
2. follow the test plan to write automatic test codes&lt;br /&gt;
3. evaluate the results and refactor codes&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Test plan =&lt;br /&gt;
We mainly use�������� cucumber and capybara to test UI, and the following are detailed plans&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119498</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119498"/>
		<updated>2018-11-12T21:27:07Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
There is problem that for each assignment, it includes several different topics and students can choose from these topics as they like. Those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, these projects can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have one same rubric, which may lead unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assign different rubies for different projects in a specified appointment.&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
To realize such purpose, we have the following tasks need to be done:&lt;br /&gt;
&lt;br /&gt;
1. For current design, the rubric used for a specified assignment is set at the following page. To make sure users can choose to set different rubrics for different projects, we need first add a checkbox at this page. Therefore, users can use this box to indicate if they want to use the same rubric for all the projects or set some different rubrics for some projects.&lt;br /&gt;
[[File:2018F1873rubric.png]]&lt;br /&gt;
&lt;br /&gt;
2.To make sure users can choose rubrics for each project, we should add a new dropdown list beside each project in the following page. Therefore, each time users choose to identify different rubrics fro different projects, the list will appear and users can choose proper rubrics. The default rubric set at last page will be overwritten in this case.&lt;br /&gt;
[[File:2018F1873project.png]]&lt;br /&gt;
&lt;br /&gt;
3.Make changes to the controller so that these functions can work.&lt;br /&gt;
&lt;br /&gt;
4. Add questionnaire_id in sign_up_topics table to make sure the projects can always relate to correct rubrics&lt;br /&gt;
&lt;br /&gt;
5. Test what we changed to make sure it works as intended and not influence the original system.&lt;br /&gt;
&lt;br /&gt;
== Technical design ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1  Add checkbox===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. edit the file views/assignments/edit/_rubrics.html.erb&lt;br /&gt;
2. add a checkbox at the top of the page which says &amp;quot;Vary rubric by topic&amp;quot;&lt;br /&gt;
3. set the default state for this checkbox as unchecked&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 2 Add dropdown list===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. edit the file views/assignment/edit/_general.html.erb&lt;br /&gt;
2. add a variable to indicate if the checkbox said in Task 1 is checked&lt;br /&gt;
3. create a new file under views/sign_up_sheet called &amp;quot;_rubrics_list.html.erb&amp;quot; to store the code for the dropdown list&lt;br /&gt;
4. edit the file views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
5. add the code to render the dropdown list&lt;br /&gt;
6. making a judgment before render the dropdown list, only if the checkbox in Task 1is checked render the page&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3 Change controllers===&lt;br /&gt;
&amp;lt;pre&amp;gt;change update method in sign_up_sheet_controller.rb to make sure when new rubric is chosen for a specific topic, it can be stored in the database properly&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4 Create migration===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. create a new migration to add questionnaire_id in sign_up_topics&lt;br /&gt;
2. the questionnaire_id is a foreign key which references to questionnaires&lt;br /&gt;
3. change the file models/sign_up_topic.rb, and add the relations with questionnaire, the relation between them is one-to-one&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5 Test the changes===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. make a test plan for the features that need to be tested&lt;br /&gt;
2. follow the test plan to write automatic test codes&lt;br /&gt;
3. evaluate the results and refactor codes&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
= Test plan =&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119496</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119496"/>
		<updated>2018-11-12T21:26:26Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Task 3 Change controllers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
There is problem that for each assignment, it includes several different topics and students can choose from these topics as they like. Those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, these projects can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have one same rubric, which may lead unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assign different rubies for different projects in a specified appointment.&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
To realize such purpose, we have the following tasks need to be done:&lt;br /&gt;
&lt;br /&gt;
1. For current design, the rubric used for a specified assignment is set at the following page. To make sure users can choose to set different rubrics for different projects, we need first add a checkbox at this page. Therefore, users can use this box to indicate if they want to use the same rubric for all the projects or set some different rubrics for some projects.&lt;br /&gt;
[[File:2018F1873rubric.png]]&lt;br /&gt;
&lt;br /&gt;
2.To make sure users can choose rubrics for each project, we should add a new dropdown list beside each project in the following page. Therefore, each time users choose to identify different rubrics fro different projects, the list will appear and users can choose proper rubrics. The default rubric set at last page will be overwritten in this case.&lt;br /&gt;
[[File:2018F1873project.png]]&lt;br /&gt;
&lt;br /&gt;
3.Make changes to the controller so that these functions can work.&lt;br /&gt;
&lt;br /&gt;
4. Add questionnaire_id in sign_up_topics table to make sure the projects can always relate to correct rubrics&lt;br /&gt;
&lt;br /&gt;
5. Test what we changed to make sure it works as intended and not influence the original system.&lt;br /&gt;
&lt;br /&gt;
== Technical design ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1  Add checkbox===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. edit the file views/assignments/edit/_rubrics.html.erb&lt;br /&gt;
2. add a checkbox at the top of the page which says &amp;quot;Vary rubric by topic&amp;quot;&lt;br /&gt;
3. set the default state for this checkbox as unchecked&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 2 Add dropdown list===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. edit the file views/assignment/edit/_general.html.erb&lt;br /&gt;
2. add a variable to indicate if the checkbox said in Task 1 is checked&lt;br /&gt;
3. create a new file under views/sign_up_sheet called &amp;quot;_rubrics_list.html.erb&amp;quot; to store the code for the dropdown list&lt;br /&gt;
4. edit the file views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
5. add the code to render the dropdown list&lt;br /&gt;
6. making a judgment before render the dropdown list, only if the checkbox in Task 1is checked render the page&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3 Change controllers===&lt;br /&gt;
&amp;lt;pre&amp;gt;change update method in sign_up_sheet_controller.rb to make sure when new rubric is chosen for a specific topic, it can be stored in the database properly&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 4 Create migration===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. create a new migration to add questionnaire_id in sign_up_topics&lt;br /&gt;
2. the questionnaire_id is a foreign key which references to questionnaires&lt;br /&gt;
3. change the file models/sign_up_topic.rb, and add the relations with questionnaire, the relation between them is one-to-one&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5 Test the changes===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. make a test plan for the features that need to be tested&lt;br /&gt;
2. follow the test plan to write automatic test codes&lt;br /&gt;
3. evaluate the results and refactor codes&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119492</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119492"/>
		<updated>2018-11-12T21:20:03Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Task 4 Create migration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
There is problem that for each assignment, it includes several different topics and students can choose from these topics as they like. Those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, these projects can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have one same rubric, which may lead unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assign different rubies for different projects in a specified appointment.&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
To realize such purpose, we have the following tasks need to be done:&lt;br /&gt;
&lt;br /&gt;
1. For current design, the rubric used for a specified assignment is set at the following page. To make sure users can choose to set different rubrics for different projects, we need first add a checkbox at this page. Therefore, users can use this box to indicate if they want to use the same rubric for all the projects or set some different rubrics for some projects.&lt;br /&gt;
[[File:2018F1873rubric.png]]&lt;br /&gt;
&lt;br /&gt;
2.To make sure users can choose rubrics for each project, we should add a new dropdown list beside each project in the following page. Therefore, each time users choose to identify different rubrics fro different projects, the list will appear and users can choose proper rubrics. The default rubric set at last page will be overwritten in this case.&lt;br /&gt;
[[File:2018F1873project.png]]&lt;br /&gt;
&lt;br /&gt;
3.Make changes to the controller so that these functions can work.&lt;br /&gt;
&lt;br /&gt;
4. Add questionnaire_id in sign_up_topics table to make sure the projects can always relate to correct rubrics&lt;br /&gt;
&lt;br /&gt;
5. Test what we changed to make sure it works as intended and not influence the original system.&lt;br /&gt;
&lt;br /&gt;
== Technical design ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1  Add checkbox===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. edit the file views/assignments/edit/_rubrics.html.erb&lt;br /&gt;
2. add a checkbox at the top of the page which says &amp;quot;Vary rubric by topic&amp;quot;&lt;br /&gt;
3. set the default state for this checkbox as unchecked&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 2 Add dropdown list===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. edit the file views/assignment/edit/_general.html.erb&lt;br /&gt;
2. add a variable to indicate if the checkbox said in Task 1 is checked&lt;br /&gt;
3. create a new file under views/sign_up_sheet called &amp;quot;_rubrics_list.html.erb&amp;quot; to store the code for the dropdown list&lt;br /&gt;
4. edit the file views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
5. add the code to render the dropdown list&lt;br /&gt;
6. making a judgment before render the dropdown list, only if the checkbox in Task 1is checked render the page&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3 Change controllers===&lt;br /&gt;
&lt;br /&gt;
===Task 4 Create migration===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. create a new migration to add questionnaire_id in sign_up_topics&lt;br /&gt;
2. the questionnaire_id is a foreign key which references to questionnaires&lt;br /&gt;
3. change the file models/sign_up_topic.rb, and add the relations with questionnaire, the relation between them is one-to-one&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 5 Test the changes===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. make a test plan for the features that need to be tested&lt;br /&gt;
2. follow the test plan to write automatic test codes&lt;br /&gt;
3. evaluate the results and refactor codes&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119490</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119490"/>
		<updated>2018-11-12T21:14:43Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Task 4 Create migration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
There is problem that for each assignment, it includes several different topics and students can choose from these topics as they like. Those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, these projects can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have one same rubric, which may lead unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assign different rubies for different projects in a specified appointment.&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
To realize such purpose, we have the following tasks need to be done:&lt;br /&gt;
&lt;br /&gt;
1. For current design, the rubric used for a specified assignment is set at the following page. To make sure users can choose to set different rubrics for different projects, we need first add a checkbox at this page. Therefore, users can use this box to indicate if they want to use the same rubric for all the projects or set some different rubrics for some projects.&lt;br /&gt;
[[File:2018F1873rubric.png]]&lt;br /&gt;
&lt;br /&gt;
2.To make sure users can choose rubrics for each project, we should add a new dropdown list beside each project in the following page. Therefore, each time users choose to identify different rubrics fro different projects, the list will appear and users can choose proper rubrics. The default rubric set at last page will be overwritten in this case.&lt;br /&gt;
[[File:2018F1873project.png]]&lt;br /&gt;
&lt;br /&gt;
3.Make changes to the controller so that these functions can work.&lt;br /&gt;
&lt;br /&gt;
4. Add questionnaire_id in sign_up_topics table to make sure the projects can always relate to correct rubrics&lt;br /&gt;
&lt;br /&gt;
5. Test what we changed to make sure it works as intended and not influence the original system.&lt;br /&gt;
&lt;br /&gt;
== Technical design ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1  Add checkbox===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. edit the file views/assignments/edit/_rubrics.html.erb&lt;br /&gt;
2. add a checkbox at the top of the page which says &amp;quot;Vary rubric by topic&amp;quot;&lt;br /&gt;
3. set the default state for this checkbox as unchecked&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 2 Add dropdown list===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. edit the file views/assignment/edit/_general.html.erb&lt;br /&gt;
2. add a variable to indicate if the checkbox said in Task 1 is checked&lt;br /&gt;
3. create a new file under views/sign_up_sheet called &amp;quot;_rubrics_list.html.erb&amp;quot; to store the code for the dropdown list&lt;br /&gt;
4. edit the file views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
5. add the code to render the dropdown list&lt;br /&gt;
6. making a judgment before render the dropdown list, only if the checkbox in Task 1is checked render the page&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3 Change controllers===&lt;br /&gt;
&lt;br /&gt;
===Task 4 Create migration===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. create a new migration to add questionnaire_id in sign_up_topics&lt;br /&gt;
2. the questionnaire_id is a foreign key which references to questionnaires&lt;br /&gt;
3. change the file models/sign_up_topic.rb, and add the relations with questionnaire, the relation between them is one-to-one&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119489</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119489"/>
		<updated>2018-11-12T21:14:20Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Task 4 Create migration */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
There is problem that for each assignment, it includes several different topics and students can choose from these topics as they like. Those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, these projects can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have one same rubric, which may lead unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assign different rubies for different projects in a specified appointment.&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
To realize such purpose, we have the following tasks need to be done:&lt;br /&gt;
&lt;br /&gt;
1. For current design, the rubric used for a specified assignment is set at the following page. To make sure users can choose to set different rubrics for different projects, we need first add a checkbox at this page. Therefore, users can use this box to indicate if they want to use the same rubric for all the projects or set some different rubrics for some projects.&lt;br /&gt;
[[File:2018F1873rubric.png]]&lt;br /&gt;
&lt;br /&gt;
2.To make sure users can choose rubrics for each project, we should add a new dropdown list beside each project in the following page. Therefore, each time users choose to identify different rubrics fro different projects, the list will appear and users can choose proper rubrics. The default rubric set at last page will be overwritten in this case.&lt;br /&gt;
[[File:2018F1873project.png]]&lt;br /&gt;
&lt;br /&gt;
3.Make changes to the controller so that these functions can work.&lt;br /&gt;
&lt;br /&gt;
4. Add questionnaire_id in sign_up_topics table to make sure the projects can always relate to correct rubrics&lt;br /&gt;
&lt;br /&gt;
5. Test what we changed to make sure it works as intended and not influence the original system.&lt;br /&gt;
&lt;br /&gt;
== Technical design ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1  Add checkbox===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. edit the file views/assignments/edit/_rubrics.html.erb&lt;br /&gt;
2. add a checkbox at the top of the page which says &amp;quot;Vary rubric by topic&amp;quot;&lt;br /&gt;
3. set the default state for this checkbox as unchecked&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 2 Add dropdown list===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. edit the file views/assignment/edit/_general.html.erb&lt;br /&gt;
2. add a variable to indicate if the checkbox said in Task 1 is checked&lt;br /&gt;
3. create a new file under views/sign_up_sheet called &amp;quot;_rubrics_list.html.erb&amp;quot; to store the code for the dropdown list&lt;br /&gt;
4. edit the file views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
5. add the code to render the dropdown list&lt;br /&gt;
6. making a judgment before render the dropdown list, only if the checkbox in Task 1is checked render the page&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3 Change controllers===&lt;br /&gt;
&lt;br /&gt;
===Task 4 Create migration===&lt;br /&gt;
1. create a new migration to add questionnaire_id in sign_up_topics&lt;br /&gt;
2. the questionnaire_id is a foreign key which references to questionnaires&lt;br /&gt;
3. change the file models/sign_up_topic.rb, and add the relations with questionnaire, the relation between them is one-to-one&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119486</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119486"/>
		<updated>2018-11-12T21:09:39Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Task 3 change controllers */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
There is problem that for each assignment, it includes several different topics and students can choose from these topics as they like. Those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, these projects can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have one same rubric, which may lead unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assign different rubies for different projects in a specified appointment.&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
To realize such purpose, we have the following tasks need to be done:&lt;br /&gt;
&lt;br /&gt;
1. For current design, the rubric used for a specified assignment is set at the following page. To make sure users can choose to set different rubrics for different projects, we need first add a checkbox at this page. Therefore, users can use this box to indicate if they want to use the same rubric for all the projects or set some different rubrics for some projects.&lt;br /&gt;
[[File:2018F1873rubric.png]]&lt;br /&gt;
&lt;br /&gt;
2.To make sure users can choose rubrics for each project, we should add a new dropdown list beside each project in the following page. Therefore, each time users choose to identify different rubrics fro different projects, the list will appear and users can choose proper rubrics. The default rubric set at last page will be overwritten in this case.&lt;br /&gt;
[[File:2018F1873project.png]]&lt;br /&gt;
&lt;br /&gt;
3.Make changes to the controller so that these functions can work.&lt;br /&gt;
&lt;br /&gt;
4. Add questionnaire_id in sign_up_topics table to make sure the projects can always relate to correct rubrics&lt;br /&gt;
&lt;br /&gt;
5. Test what we changed to make sure it works as intended and not influence the original system.&lt;br /&gt;
&lt;br /&gt;
== Technical design ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1  Add checkbox===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. edit the file views/assignments/edit/_rubrics.html.erb&lt;br /&gt;
2. add a checkbox at the top of the page which says &amp;quot;Vary rubric by topic&amp;quot;&lt;br /&gt;
3. set the default state for this checkbox as unchecked&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 2 Add dropdown list===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. edit the file views/assignment/edit/_general.html.erb&lt;br /&gt;
2. add a variable to indicate if the checkbox said in Task 1 is checked&lt;br /&gt;
3. create a new file under views/sign_up_sheet called &amp;quot;_rubrics_list.html.erb&amp;quot; to store the code for the dropdown list&lt;br /&gt;
4. edit the file views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
5. add the code to render the dropdown list&lt;br /&gt;
6. making a judgment before render the dropdown list, only if the checkbox in Task 1is checked render the page&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3 Change controllers===&lt;br /&gt;
&lt;br /&gt;
===Task 4 Create migration===&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119485</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119485"/>
		<updated>2018-11-12T21:08:55Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Task 3 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
There is problem that for each assignment, it includes several different topics and students can choose from these topics as they like. Those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, these projects can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have one same rubric, which may lead unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assign different rubies for different projects in a specified appointment.&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
To realize such purpose, we have the following tasks need to be done:&lt;br /&gt;
&lt;br /&gt;
1. For current design, the rubric used for a specified assignment is set at the following page. To make sure users can choose to set different rubrics for different projects, we need first add a checkbox at this page. Therefore, users can use this box to indicate if they want to use the same rubric for all the projects or set some different rubrics for some projects.&lt;br /&gt;
[[File:2018F1873rubric.png]]&lt;br /&gt;
&lt;br /&gt;
2.To make sure users can choose rubrics for each project, we should add a new dropdown list beside each project in the following page. Therefore, each time users choose to identify different rubrics fro different projects, the list will appear and users can choose proper rubrics. The default rubric set at last page will be overwritten in this case.&lt;br /&gt;
[[File:2018F1873project.png]]&lt;br /&gt;
&lt;br /&gt;
3.Make changes to the controller so that these functions can work.&lt;br /&gt;
&lt;br /&gt;
4. Add questionnaire_id in sign_up_topics table to make sure the projects can always relate to correct rubrics&lt;br /&gt;
&lt;br /&gt;
5. Test what we changed to make sure it works as intended and not influence the original system.&lt;br /&gt;
&lt;br /&gt;
== Technical design ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1  Add checkbox===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. edit the file views/assignments/edit/_rubrics.html.erb&lt;br /&gt;
2. add a checkbox at the top of the page which says &amp;quot;Vary rubric by topic&amp;quot;&lt;br /&gt;
3. set the default state for this checkbox as unchecked&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 2 Add dropdown list===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. edit the file views/assignment/edit/_general.html.erb&lt;br /&gt;
2. add a variable to indicate if the checkbox said in Task 1 is checked&lt;br /&gt;
3. create a new file under views/sign_up_sheet called &amp;quot;_rubrics_list.html.erb&amp;quot; to store the code for the dropdown list&lt;br /&gt;
4. edit the file views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
5. add the code to render the dropdown list&lt;br /&gt;
6. making a judgment before render the dropdown list, only if the checkbox in Task 1is checked render the page&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3 change controllers===&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119483</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119483"/>
		<updated>2018-11-12T21:06:26Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Technical design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
There is problem that for each assignment, it includes several different topics and students can choose from these topics as they like. Those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, these projects can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have one same rubric, which may lead unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assign different rubies for different projects in a specified appointment.&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
To realize such purpose, we have the following tasks need to be done:&lt;br /&gt;
&lt;br /&gt;
1. For current design, the rubric used for a specified assignment is set at the following page. To make sure users can choose to set different rubrics for different projects, we need first add a checkbox at this page. Therefore, users can use this box to indicate if they want to use the same rubric for all the projects or set some different rubrics for some projects.&lt;br /&gt;
[[File:2018F1873rubric.png]]&lt;br /&gt;
&lt;br /&gt;
2.To make sure users can choose rubrics for each project, we should add a new dropdown list beside each project in the following page. Therefore, each time users choose to identify different rubrics fro different projects, the list will appear and users can choose proper rubrics. The default rubric set at last page will be overwritten in this case.&lt;br /&gt;
[[File:2018F1873project.png]]&lt;br /&gt;
&lt;br /&gt;
3.Make changes to the controller so that these functions can work.&lt;br /&gt;
&lt;br /&gt;
4. Add questionnaire_id in sign_up_topics table to make sure the projects can always relate to correct rubrics&lt;br /&gt;
&lt;br /&gt;
5. Test what we changed to make sure it works as intended and not influence the original system.&lt;br /&gt;
&lt;br /&gt;
== Technical design ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1  Add checkbox===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. edit the file views/assignments/edit/_rubrics.html.erb&lt;br /&gt;
2. add a checkbox at the top of the page which says &amp;quot;Vary rubric by topic&amp;quot;&lt;br /&gt;
3. set the default state for this checkbox as unchecked&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 2 Add dropdown list===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. edit the file views/assignment/edit/_general.html.erb&lt;br /&gt;
2. add a variable to indicate if the checkbox said in Task 1 is checked&lt;br /&gt;
3. create a new file under views/sign_up_sheet called &amp;quot;_rubrics_list.html.erb&amp;quot; to store the code for the dropdown list&lt;br /&gt;
4. edit the file views/sign_up_sheet/_table_line.html.erb&lt;br /&gt;
5. add the code to render the dropdown list&lt;br /&gt;
6. making a judgment before render the dropdown list, only if the checkbox in Task 1is checked render the page&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Task 3===&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119460</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119460"/>
		<updated>2018-11-12T20:41:11Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
There is problem that for each assignment, it includes several different topics and students can choose from these topics as they like. Those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, these projects can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have one same rubric, which may lead unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assign different rubies for different projects in a specified appointment.&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
To realize such purpose, we have the following tasks need to be done:&lt;br /&gt;
&lt;br /&gt;
1. For current design, the rubric used for a specified assignment is set at the following page. To make sure users can choose to set different rubrics for different projects, we need first add a checkbox at this page. Therefore, users can use this box to indicate if they want to use the same rubric for all the projects or set some different rubrics for some projects.&lt;br /&gt;
[[File:2018F1873rubric.png]]&lt;br /&gt;
&lt;br /&gt;
2.To make sure users can choose rubrics for each project, we should add a new dropdown list beside each project in the following page. Therefore, each time users choose to identify different rubrics fro different projects, the list will appear and users can choose proper rubrics. The default rubric set at last page will be overwritten in this case.&lt;br /&gt;
[[File:2018F1873project.png]]&lt;br /&gt;
&lt;br /&gt;
3.Make changes to the controller so that these functions can work.&lt;br /&gt;
&lt;br /&gt;
4. Add questionnaire_id in sign_up_topics table to make sure the projects can always relate to correct rubrics&lt;br /&gt;
&lt;br /&gt;
5. Test what we changed to make sure it works as intended and not influence the original system.&lt;br /&gt;
&lt;br /&gt;
== Technical design ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1  Add checkbox===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. add a checkbox at the top of the page which says &amp;quot;Vary rubric by topic&amp;quot;&lt;br /&gt;
2. set the default state for this checkbox as unchecked&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119459</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119459"/>
		<updated>2018-11-12T20:40:40Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
There is problem that for each assignment, it includes several different topics and students can choose from these topics as they like. Those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, these projects can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have one same rubric, which may lead unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assign different rubies for different projects in a specified appointment.&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
To realize such purpose, we have the following tasks need to be done:&lt;br /&gt;
&lt;br /&gt;
1. For current design, the rubric used for a specified assignment is set at the following page. To make sure users can choose to set different rubrics for different projects, we need first add a radio button at this page. Therefore, users can use this button to indicate if they want to use the same rubric for all the projects or set some different rubrics for some projects.&lt;br /&gt;
[[File:2018F1873rubric.png]]&lt;br /&gt;
&lt;br /&gt;
2.To make sure users can choose rubrics for each project, we should add a new dropdown list beside each project in the following page. Therefore, each time users choose to identify different rubrics fro different projects, the list will appear and users can choose proper rubrics. The default rubric set at last page will be overwritten in this case.&lt;br /&gt;
[[File:2018F1873project.png]]&lt;br /&gt;
&lt;br /&gt;
3.Make changes to the controller so that these functions can work.&lt;br /&gt;
&lt;br /&gt;
4. Add questionnaire_id in sign_up_topics table to make sure the projects can always relate to correct rubrics&lt;br /&gt;
&lt;br /&gt;
5. Test what we changed to make sure it works as intended and not influence the original system.&lt;br /&gt;
&lt;br /&gt;
== Technical design ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1  Add checkbox===&lt;br /&gt;
&amp;lt;pre&amp;gt;1. add a checkbox at the top of the page which says &amp;quot;Vary rubric by topic&amp;quot;&lt;br /&gt;
2. set the default state for this checkbox as unchecked&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119454</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119454"/>
		<updated>2018-11-12T20:32:02Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Task 1 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
There is problem that for each assignment, it includes several different topics and students can choose from these topics as they like. Those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, these projects can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have one same rubric, which may lead unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assign different rubies for different projects in a specified appointment.&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
To realize such purpose, we have the following tasks need to be done:&lt;br /&gt;
&lt;br /&gt;
1. For current design, the rubric used for a specified assignment is set at the following page. To make sure users can choose to set different rubrics for different projects, we need first add a radio button at this page. Therefore, users can use this button to indicate if they want to use the same rubric for all the projects or set some different rubrics for some projects.&lt;br /&gt;
[[File:2018F1873rubric.png]]&lt;br /&gt;
&lt;br /&gt;
2.To make sure users can choose rubrics for each project, we should add a new dropdown list beside each project in the following page. Therefore, each time users choose to identify different rubrics fro different projects, the list will appear and users can choose proper rubrics. The default rubric set at last page will be overwritten in this case.&lt;br /&gt;
[[File:2018F1873project.png]]&lt;br /&gt;
&lt;br /&gt;
3.Make changes to the controller so that these functions can work.&lt;br /&gt;
&lt;br /&gt;
4. Add questionnaire_id in sign_up_topics table to make sure the projects can always relate to correct rubrics&lt;br /&gt;
&lt;br /&gt;
5. Test what we changed to make sure it works as intended and not influence the original system.&lt;br /&gt;
&lt;br /&gt;
== Technical design ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1 ===&lt;br /&gt;
&amp;lt;pre&amp;gt;a&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119453</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119453"/>
		<updated>2018-11-12T20:30:54Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
There is problem that for each assignment, it includes several different topics and students can choose from these topics as they like. Those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, these projects can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have one same rubric, which may lead unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assign different rubies for different projects in a specified appointment.&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
To realize such purpose, we have the following tasks need to be done:&lt;br /&gt;
&lt;br /&gt;
1. For current design, the rubric used for a specified assignment is set at the following page. To make sure users can choose to set different rubrics for different projects, we need first add a radio button at this page. Therefore, users can use this button to indicate if they want to use the same rubric for all the projects or set some different rubrics for some projects.&lt;br /&gt;
[[File:2018F1873rubric.png]]&lt;br /&gt;
&lt;br /&gt;
2.To make sure users can choose rubrics for each project, we should add a new dropdown list beside each project in the following page. Therefore, each time users choose to identify different rubrics fro different projects, the list will appear and users can choose proper rubrics. The default rubric set at last page will be overwritten in this case.&lt;br /&gt;
[[File:2018F1873project.png]]&lt;br /&gt;
&lt;br /&gt;
3.Make changes to the controller so that these functions can work.&lt;br /&gt;
&lt;br /&gt;
4. Add questionnaire_id in sign_up_topics table to make sure the projects can always relate to correct rubrics&lt;br /&gt;
&lt;br /&gt;
5. Test what we changed to make sure it works as intended and not influence the original system.&lt;br /&gt;
&lt;br /&gt;
== Technical design ==&lt;br /&gt;
&lt;br /&gt;
=== Task 1 ===&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119451</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119451"/>
		<updated>2018-11-12T20:26:08Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
There is problem that for each assignment, it includes several different topics and students can choose from these topics as they like. Those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, these projects can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have one same rubric, which may lead unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assign different rubies for different projects in a specified appointment.&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
To realize such purpose, we have the following tasks need to be done:&lt;br /&gt;
&lt;br /&gt;
1. For current design, the rubric used for a specified assignment is set at the following page. To make sure users can choose to set different rubrics for different projects, we need first add a radio button at this page. Therefore, users can use this button to indicate if they want to use the same rubric for all the projects or set some different rubrics for some projects.&lt;br /&gt;
[[File:2018F1873rubric.png]]&lt;br /&gt;
&lt;br /&gt;
2.To make sure users can choose rubrics for each project, we should add a new dropdown list beside each project in the following page. Therefore, each time users choose to identify different rubrics fro different projects, the list will appear and users can choose proper rubrics. The default rubric set at last page will be overwritten in this case.&lt;br /&gt;
[[File:2018F1873project.png]]&lt;br /&gt;
&lt;br /&gt;
3.Make changes to the controller so that these functions can work.&lt;br /&gt;
&lt;br /&gt;
4. Add questionnaire_id in sign_up_topics table to make sure the projects can always relate to correct rubrics&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119448</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119448"/>
		<updated>2018-11-12T20:13:05Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
There is problem that for each assignment, it includes several different topics and students can choose from these topics as they like. Those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, these projects can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have one same rubric, which may lead unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assign different rubies for different projects in a specified appointment.&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
To realize such purpose, we have the following tasks need to be done:&lt;br /&gt;
&lt;br /&gt;
1. For current design, the rubric used for a specified assignment is set at the following page. To make sure users can choose to set different rubrics for different projects, we need first add a radio button at this page. Therefore, users can use this button to indicate if they want to use the same rubric for all the projects or set some different rubrics for some projects.&lt;br /&gt;
[[File:2018F1873rubric.png]]&lt;br /&gt;
&lt;br /&gt;
2.To make sure users can choose rubrics for each project, we should add a new dropdown list beside each project in the following page. Therefore, each time users choose to identify different rubrics fro different projects, the list will appear and users can choose proper rubrics. The default rubric set at last page will be overwritten in this case.&lt;br /&gt;
[[File:2018F1873project.png]]&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:2018F1873project.png&amp;diff=119447</id>
		<title>File:2018F1873project.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:2018F1873project.png&amp;diff=119447"/>
		<updated>2018-11-12T20:12:44Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: uploaded a new version of &amp;amp;quot;File:2018F1873project.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:2018F1873project.png&amp;diff=119446</id>
		<title>File:2018F1873project.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:2018F1873project.png&amp;diff=119446"/>
		<updated>2018-11-12T20:11:02Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119445</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119445"/>
		<updated>2018-11-12T20:10:17Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
There is problem that for each assignment, it includes several different topics and students can choose from these topics as they like. Those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, these projects can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have one same rubric, which may lead unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assign different rubies for different projects in a specified appointment.&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
To realize such purpose, we have the following tasks need to be done:&lt;br /&gt;
&lt;br /&gt;
1. For current design, the rubric used for a specified assignment is set at the following page. To make sure users can choose to set different rubrics for different projects, we need first add a radio button at this page. Therefore, users can use this button to indicate if they want to use the same rubric for all the projects or set some different rubrics for some projects.&lt;br /&gt;
[[File:2018F1873rubric.png]]&lt;br /&gt;
2.To make sure users can choose rubrics for each project, we should add a new dropdown list beside each project in the following page. Therefore, each time users choose to identify different rubrics fro different projects, the list will appear and users can choose proper rubrics. The default rubric set at last page will be overwritten in this case.&lt;br /&gt;
[[File:2018F1873project.png]]&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119444</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119444"/>
		<updated>2018-11-12T20:05:14Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
There is problem that for each assignment, it includes several different topics and students can choose from these topics as they like. Those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, these projects can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have one same rubric, which may lead unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assign different rubies for different projects in a specified appointment.&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
To realize such purpose, we have the following tasks need to be done:&lt;br /&gt;
&lt;br /&gt;
1. For current design, the rubric used for a specified assignment is set at the following page. To make sure users can choose to set different rubrics for different projects, we need first add a radio button at this page. Therefore, users can use this button to indicate if they want to use the same rubric for all the projects or set some different rubrics for some projects.&lt;br /&gt;
[[File:2018F1873rubric.png]]&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119443</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119443"/>
		<updated>2018-11-12T20:04:39Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
There is problem that for each assignment, it includes several different topics and students can choose from these topics as they like. Those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, these projects can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have one same rubric, which may lead unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assign different rubies for different projects in a specified appointment.&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
To realize such purpose, we have the following tasks need to be done:&lt;br /&gt;
1. For current design, the rubric used for a specified assignment is set at the following page. To make sure users can choose to set different rubrics for different projects, we need first add a radio button at this page. Therefore, users can use this button to indicate if they want to use the same rubric for all the projects or set some different rubrics for some projects.&lt;br /&gt;
[[File:2018F1873rubric.png]]&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:2018F1873rubric.png&amp;diff=119442</id>
		<title>File:2018F1873rubric.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:2018F1873rubric.png&amp;diff=119442"/>
		<updated>2018-11-12T20:03:34Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:RubricPage.png&amp;diff=119441</id>
		<title>File:RubricPage.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:RubricPage.png&amp;diff=119441"/>
		<updated>2018-11-12T19:57:48Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119440</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119440"/>
		<updated>2018-11-12T19:56:56Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Tasks */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
There is problem that for each assignment, it includes several different topics and students can choose from these topics as they like. Those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, these projects can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have one same rubric, which may lead unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assign different rubies for different projects in a specified appointment.&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
To realize such purpose, we have the following tasks need to be done:&lt;br /&gt;
1. For current design, the rubric used for a specified assignment is set at the following page. To make sure users can choose to set different rubrics for different projects, we need first add a radio button at this page. Therefore, users can use this button to indicate if they want to use the same rubric for all the projects or set some different rubrics for some projects.&lt;br /&gt;
[[File:/Users/wuwei/Desktop/屏幕快照 2018-11-12 下午2.49.45.png]]&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119439</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119439"/>
		<updated>2018-11-12T19:55:51Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
There is problem that for each assignment, it includes several different topics and students can choose from these topics as they like. Those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, these projects can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have one same rubric, which may lead unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assign different rubies for different projects in a specified appointment.&lt;br /&gt;
&lt;br /&gt;
= Design =&lt;br /&gt;
&lt;br /&gt;
== Tasks ==&lt;br /&gt;
&lt;br /&gt;
To realize such purpose, we have the following tasks need to be done:&lt;br /&gt;
1. For current design, the rubric used for a specified assignment is set at the following page. To make sure users can choose to set different rubrics for different projects, we need first add a radio button at this page. Therefore, users can use this button to indicate if they want to use the same rubric for all the projects or set some different rubrics for some projects.&lt;br /&gt;
[[File:/Users/wuwei/Desktop/屏幕快照 2018-11-12 下午2.49.45.png]&lt;br /&gt;
/Users/wuwei/Desktop/屏幕快照 2018-11-12 下午2.49.45.png&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119437</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119437"/>
		<updated>2018-11-12T17:07:14Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Introduction =&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
There is problem that for each assignment, it includes several different topics and students can choose from these topics as they like. Those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, these projects can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have one same rubric, which may lead unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assign different rubies for different projects in a specified appointment.&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119436</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119436"/>
		<updated>2018-11-12T17:06:50Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Motivation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Background ===&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
=== Motivation ===&lt;br /&gt;
There is problem that for each assignment, it includes several different topics and students can choose from these topics as they like. Those topics fall into different categories. That is, an assignment always include different kind of projects. In Expertiza, these projects can be refactoring projects, testing projects, Mozilla projects,  etc. Apparently, for different kinds of projects, we have different criteria to evaluate their performance. However, due to the current design of the system, all projects belong to the same assignment can only have one same rubric, which may lead unnecessary criteria for some projects and inadequate criteria for other projects. &lt;br /&gt;
To make sure all kinds of projects can be evaluated properly. We plan to refactor the system to allow assign different rubies for different projects in a specified appointment.&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119435</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119435"/>
		<updated>2018-11-12T16:56:33Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Background ===&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119434</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119434"/>
		<updated>2018-11-12T16:53:34Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Introduction */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
[http://www.example.com link title]== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Background ===&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119433</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119433"/>
		<updated>2018-11-12T16:52:42Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Background */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
=== Background ===&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119432</id>
		<title>CSC/ECE 517 Fall 2018/E1873 Specialized rubics for different topic types</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1873_Specialized_rubics_for_different_topic_types&amp;diff=119432"/>
		<updated>2018-11-12T16:52:22Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: Created page with &amp;quot; == Introduction ==  == Background == One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is don...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
One of fantastic features that Expertiza provides is for each assignment, it allows students providing reviews for others' jobs. This is done by offering a pre-defined questionnaire for the whole assignment, which is called the rubric for this assignment. Each rubric has several questions, each question provides a criterion to evaluate the performance from a specific angle. Then students can evaluate the entire job by rating and answer these questions. The team did that job can also get a detailed feedback for different aspects of the project.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1848_Write_unit_tests_for_assignment_team&amp;diff=119250</id>
		<title>E1848 Write unit tests for assignment team</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1848_Write_unit_tests_for_assignment_team&amp;diff=119250"/>
		<updated>2018-11-10T03:10:51Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For this progect, the goal is to wirte up unit tests for assignment_team.rb&lt;br /&gt;
&lt;br /&gt;
==Project Introduction==&lt;br /&gt;
====Background====&lt;br /&gt;
assignment_team.rb is the child class of team.rb. It is used to handle multiple problems relates to team in the assignment. Its responsibilities can mainly fall in three categories: participant of the team, reviews of the team, and the operation for the whole team. For the participant, it can be used to decide if a participant is in a given team and view the members of the team or remove a member. For reviews, it deals with the problem that getting the reviews for the team, assign reviewer for the team and get if the team has been reviewed by a specific reviewers. For the whole team, we can delete the team or view the scores, etc. by using this class.&lt;br /&gt;
====Motivation====&lt;br /&gt;
Make sure assignment_team.rb provides all functions as expected is important for the whole system. It requires enough tests for all the functions and the edge cases may occur. However, there are not enough unit tests for this model in expertiza. The following tests are added to assignment_team.rb in this project.&lt;br /&gt;
To make sure we can cover as many conditions as we can(the objective for this project is getting at least 90% coverage rate), we first design test cases. The following factors are taking into considerations: the expected functions for each method, the possible edge cases and the pre-conditions for each cases. Then we get the unit test plan and complete the test following test steps.&lt;br /&gt;
&lt;br /&gt;
==Memebers of Project==&lt;br /&gt;
Jianshu Zhang&lt;br /&gt;
&lt;br /&gt;
Wanjing Kuang&lt;br /&gt;
&lt;br /&gt;
Wei Wu&lt;br /&gt;
&lt;br /&gt;
==Mentor==&lt;br /&gt;
Zhewei Hu&lt;br /&gt;
&lt;br /&gt;
==File Involvement==&lt;br /&gt;
1.app/models/assignment_team.rb&lt;br /&gt;
&lt;br /&gt;
2.spec/models/assignment_team_spec.rb&lt;br /&gt;
&lt;br /&gt;
3.spec/factories/factories.rb&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
1. two test cases for method &amp;quot;include?&amp;quot;: When the team includes a given participant and When the team doesn't include a given participant&lt;br /&gt;
&lt;br /&gt;
2. one test case for method &amp;quot;parent_model&amp;quot;: It returns &amp;quot;Assignment&amp;quot; when the method is called.&lt;br /&gt;
&lt;br /&gt;
3. two test cases for method &amp;quot;self.parent_model(id)&amp;quot;: When it's given a correct id and When it's given an incorrect id.&lt;br /&gt;
&lt;br /&gt;
4. one test case for method &amp;quot;fullname&amp;quot;: When the participant has an full name.&lt;br /&gt;
&lt;br /&gt;
5. one test case for method &amp;quot;review_map_type&amp;quot;: It returns ReviewResponseMap when the method is called.&lt;br /&gt;
&lt;br /&gt;
6. one test case for method &amp;quot;self.prototype&amp;quot;: It returns an new instance of AssignmentTeam when the method is called.&lt;br /&gt;
&lt;br /&gt;
7. two test cases for method &amp;quot;assign_reviewer(reviewer)&amp;quot;: When the team has an assignment and When the assignment record can not be found.&lt;br /&gt;
&lt;br /&gt;
8. one test case for method &amp;quot;reviewd_by?&amp;quot;: When it gets correct reviewer and returns true as an result.&lt;br /&gt;
&lt;br /&gt;
9. one test case for method &amp;quot; topic&amp;quot;: When it returns the correct id.&lt;br /&gt;
&lt;br /&gt;
10. three test cases for method &amp;quot;has_submissions?&amp;quot;: When the team doesn't submit any file or link, when team submits a link instead of files and &lt;br /&gt;
when the team submits some files.&lt;br /&gt;
&lt;br /&gt;
11. two test cases for method &amp;quot;participants&amp;quot;: When no participants in this team and When adding some participants and get all the participants.&lt;br /&gt;
&lt;br /&gt;
12. one test case for method &amp;quot;add_participant&amp;quot;: When adding an participant, it will return an instance of AssignmentParticipant.&lt;br /&gt;
&lt;br /&gt;
13. two test cases for method &amp;quot; delete and destroy&amp;quot;: Testing delete and destory.&lt;br /&gt;
&lt;br /&gt;
14. two test cases for method &amp;quot;hyoerlinks&amp;quot;: the current teams submitted hyperlinks and not submitted the hyperlinks&lt;br /&gt;
&lt;br /&gt;
15.three test cases for method &amp;quot;submit_hyperlink&amp;quot;:  the hyperlink is empty, the hyperlink is not empty and it calls the method on NET::HTTP,the hyperlink is not empty and it raises error&lt;br /&gt;
&lt;br /&gt;
16.three test cases for method &amp;quot;team&amp;quot;: the participant is nil, the participant exists and the team user exists&lt;br /&gt;
&lt;br /&gt;
17.two test cases for method &amp;quot;export_files&amp;quot;: the team_name equals false and true&lt;br /&gt;
&lt;br /&gt;
==Unit Tests==&lt;br /&gt;
&lt;br /&gt;
===Unit Test Tool===&lt;br /&gt;
Rspec&lt;br /&gt;
&lt;br /&gt;
===Unit Test File===&lt;br /&gt;
expertiza/spec/models/assignment_team_spec.rb&lt;br /&gt;
&lt;br /&gt;
===Unit Test Steps===&lt;br /&gt;
&lt;br /&gt;
*Create unit test cases in the assignment_team_spec.rb&lt;br /&gt;
&lt;br /&gt;
*run rspec spec/models/assignment_team_spec.rb under expertiza directory&lt;br /&gt;
&lt;br /&gt;
*the rspec outputs the number of test cases that are passed and those that are failed.&lt;br /&gt;
&lt;br /&gt;
===Unit Test Cases===&lt;br /&gt;
&lt;br /&gt;
====Testing include?====&lt;br /&gt;
2 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1. The team includes a given participant.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment_team) { build(:assignment_team, id: 1, parent_id: 1, name: &amp;quot;full name&amp;quot;) }&lt;br /&gt;
      let(:participant1) { build(:participant, id: 2, user: user) }&lt;br /&gt;
      it &amp;quot;returns true&amp;quot; do&lt;br /&gt;
        allow(assignment_team).to receive(:add_participants).with(participant1)&lt;br /&gt;
        expect(assignment_team.includes?(participant1))&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. The team doesn't include a given participant.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment_team) { build(:assignment_team, id: 1, parent_id: 1, name: &amp;quot;full name&amp;quot;) }&lt;br /&gt;
      let(:participant1) { build(:participant, id: 2, user: user) }&lt;br /&gt;
      let(:participant2) { build(:participant, id: 3) }&lt;br /&gt;
      it &amp;quot;returns false&amp;quot; do&lt;br /&gt;
        allow(assignment_team).to receive(:add_participants).with(participant1)&lt;br /&gt;
        expect(assignment_team.includes?(participant2))&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing parent_model====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns Assignment as result&amp;quot; do&lt;br /&gt;
        expect(assignment_team.parent_model).to eq(&amp;quot;Assignment&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing self.parent_model(id)====&lt;br /&gt;
2 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1.When it's given a correct id.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment) { build(:assignment, id: 1) }&lt;br /&gt;
      it &amp;quot;returns an assignemt&amp;quot; do&lt;br /&gt;
        allow(Assignment).to receive(:find).with(1).and_return(assignment)&lt;br /&gt;
        expect(AssignmentTeam.parent_model(1)).to eq(assignment)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.When it's given an incorrect id.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;raises an exception&amp;quot; do&lt;br /&gt;
        expect { AssignmentTeam.parent_model 2 }.to raise_exception(ActiveRecord::RecordNotFound)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing fullname====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns the full name of assignment team&amp;quot; do&lt;br /&gt;
        expect(assignment_team.fullname).to eq(&amp;quot;full name&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing review_map_type====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns ReviewResponseMap as result&amp;quot; do&lt;br /&gt;
        expect(assignment_team.review_map_type).to eq(&amp;quot;ReviewResponseMap&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing self.prototype====&lt;br /&gt;
1 test cases is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns an new instance of AssignmentTeam&amp;quot; do&lt;br /&gt;
        expect(AssignmentTeam.prototype).to be_instance_of(AssignmentTeam)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing assign_reviewer(reviewer)====&lt;br /&gt;
2 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1. When the team has an assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:reviewer) { build(:participant, id: 1) }&lt;br /&gt;
      it &amp;quot;returns an instance of ReviewResponseMap&amp;quot; do&lt;br /&gt;
        expect(assignment_team.assign_reviewer(reviewer)).to be_instance_of(ReviewResponseMap)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. When the assignment record can not be found&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment_team2) { build(:assignment_team, id: 2, parent_id: 2) }&lt;br /&gt;
      it &amp;quot;returns an exception&amp;quot; do&lt;br /&gt;
        expect { assignment_team2.assign_reviewer(reviewer) }.to raise_exception(ActiveRecord::RecordNotFound)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing reviewd_by?====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns true&amp;quot; do&lt;br /&gt;
        allow(ReviewResponseMap).to receive(:where).\&lt;br /&gt;
          with('reviewee_id = ? &amp;amp;&amp;amp; reviewer_id = ? &amp;amp;&amp;amp; reviewed_object_id = ?', 1, 1, 1).and_return([review_response_map])&lt;br /&gt;
        expect(assignment_team.reviewed_by?(reviewer)).to be true&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing topic====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:signed_up_team) { build(:signed_up_team, id: 1, team_id: 1, is_waitlisted: 0, topic_id: 1) }&lt;br /&gt;
      it &amp;quot;returns a topic id&amp;quot; do&lt;br /&gt;
        allow(SignedUpTeam).to receive(:find_by).with(team_id: 1, is_waitlisted: 0).and_return(signed_up_team)&lt;br /&gt;
        expect(assignment_team.topic).to eq(1)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Testing has_submissions? ====&lt;br /&gt;
3 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1.The team doesn't submit any file or link. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:team2) { build(:assignment_team, id: 2, parent_id: 1, name: &amp;quot;team2&amp;quot;, submitted_hyperlinks: &amp;quot;&amp;quot;) }&lt;br /&gt;
      it &amp;quot;no file or no link&amp;quot; do&lt;br /&gt;
        expect(team2.has_submissions?).to eq(false)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.The team submits a link instead of files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:team1) { build(:assignment_team, id: 1, parent_id: 1, name: &amp;quot;team1&amp;quot;, submitted_hyperlinks: &amp;quot;http://example.com&amp;quot;) }&lt;br /&gt;
      it &amp;quot;submitted hyperlinks&amp;quot; do&lt;br /&gt;
        expect(team1.has_submissions?).to eq(true)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. The team submits some files.  Stub is used to emulate the scenario that the team has submitted a file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
      it &amp;quot;returns true&amp;quot; do&lt;br /&gt;
        allow(team2).to receive(:submitted_files).and_return([double(:File)])&lt;br /&gt;
        expect(team2.has_submissions?).to be true&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing participants ====&lt;br /&gt;
&lt;br /&gt;
1. No participants in this team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#no participant' do&lt;br /&gt;
        expect(team1.participants).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. add some participants and get all the participants&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:student1) { build(:student, id: 1, name: 'johns', fullname: 'johns franklin') }&lt;br /&gt;
      let(:student2) { build(:student, id: 2, name: 'kate', fullname: 'kate moss') }&lt;br /&gt;
      let(:par1) { build(:participant, id: 1, parent_id: 1, user_id: 1) }&lt;br /&gt;
      let(:par2) { build(:participant, id: 2, parent_id: 1, user_id: 2) }&lt;br /&gt;
      it '#1 participant' do&lt;br /&gt;
        allow(AssignmentTeam).to receive(:users).with(id: team1.id).and_return([student1,student2])&lt;br /&gt;
        expect(team1.participants).to eq([par1, par2])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing add_participant ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#add participants' do&lt;br /&gt;
        expect(team1.add_participant(ass1.id, par1)).to be_instance_of(AssignmentParticipant)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing the delete and destroy====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#delete' do&lt;br /&gt;
        expect(team1.delete).to be_instance_of(AssignmentTeam)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#destroy' do&lt;br /&gt;
        expect(team1.destroy).to be_instance_of(AssignmentTeam)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing members====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#get_first_member' do&lt;br /&gt;
        allow(AssignmentTeam).to receive(:find_by).with(id: team1.id).and_return(team1)&lt;br /&gt;
        allow(team1).to receive(:participants).and_return([par1, par2])&lt;br /&gt;
        expect(AssignmentTeam.get_first_member(team1.id)).to eq(par1)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing import and export====&lt;br /&gt;
&lt;br /&gt;
1. import a team to a non-existing assignment and expect an exception&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     it '#import an nonexisting assignment id' do&lt;br /&gt;
        row = {teamname: &amp;quot;hello_world&amp;quot;, teammembers: %w[johns kate]}&lt;br /&gt;
        options = {has_teamname: &amp;quot;true_first&amp;quot;}&lt;br /&gt;
        expect { AssignmentTeam.import(row, 99_999, options) }.to raise_error(ImportError)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. export teams into a csv file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#export' do&lt;br /&gt;
        options = {}&lt;br /&gt;
        csv = CSV.open(&amp;quot;assignment_team_export.csv&amp;quot;, &amp;quot;w&amp;quot;)&lt;br /&gt;
        assignment_id = ass1.id&lt;br /&gt;
        allow(AssignmentTeam).to receive(:where).with(parent_id: assignment_id).and_return([team1, team2, team3])&lt;br /&gt;
        allow(TeamsUser).to receive(:where).and_return([par1, par2])&lt;br /&gt;
        expect(AssignmentTeam.export(csv, assignment_id, options)).to be_instance_of(CSV)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing copy====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#copy' do&lt;br /&gt;
        allow(TeamsUser).to receive(:where).with(team_id: team1.id).and_return([par1])&lt;br /&gt;
        expect(team1.copy(course1.id)).to eq([par1])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing hyperlinks====&lt;br /&gt;
2 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1. when the current teams submitted hyperlinks&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment_team) { build(:assignment_team) }&lt;br /&gt;
      context &amp;quot;when current teams submitted hyperlinks&amp;quot; do&lt;br /&gt;
        it &amp;quot;returns the hyperlinks submitted by the team&amp;quot; do&lt;br /&gt;
          expect(assignment_team.hyperlinks).to eq([&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;])&lt;br /&gt;
        end&lt;br /&gt;
       end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when current teams did not submit hyperlinks&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     let(:team_without_submitted_hyperlinks) { build(:assignment_team, submitted_hyperlinks: &amp;quot;&amp;quot;) }&lt;br /&gt;
     context &amp;quot;when current teams did not submit hyperlinks&amp;quot; do&lt;br /&gt;
       it &amp;quot;returns an empty array&amp;quot; do&lt;br /&gt;
         expect(team_without_submitted_hyperlinks.hyperlinks).to eq([])&lt;br /&gt;
       end&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing files====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     before :each do&lt;br /&gt;
       @directory = &amp;quot;a&amp;quot;&lt;br /&gt;
       @files = [&amp;quot;b.txt&amp;quot;, &amp;quot;c.java&amp;quot;, &amp;quot;d.txt&amp;quot;]&lt;br /&gt;
       @files1 = [&amp;quot;b/c&amp;quot;, &amp;quot;d/e&amp;quot;]&lt;br /&gt;
      end&lt;br /&gt;
      it &amp;quot;call the method in Dir&amp;quot; do&lt;br /&gt;
        expect(Dir).to receive(:[]).with(@directory + &amp;quot;/*&amp;quot;).and_return(@files)&lt;br /&gt;
        assignment_team.files(@directory)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing submit_hyperlink====&lt;br /&gt;
3 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1. when the hyperlink is empty&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     context &amp;quot;when the hyperlink is empty&amp;quot; do&lt;br /&gt;
      it &amp;quot;raise excpetion&amp;quot; do&lt;br /&gt;
        expect{(assignment_team.submit_hyperlink(&amp;quot;&amp;quot;))}.to raise_error('The hyperlink cannot be empty!')&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when the hyperlink is not empty and it calls the method on NET::HTTP&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      before :each do&lt;br /&gt;
        @link = &amp;quot;htp.aa/..&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
      it &amp;quot;call the method on NET::HTTP&amp;quot; do&lt;br /&gt;
         expect(Net::HTTP).to receive(:get_response).with(URI(@link+'http://'))&lt;br /&gt;
         assignment_team.submit_hyperlink(@link)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. when the hyperlink is not empty and it raises error&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;raise error&amp;quot; do&lt;br /&gt;
          allow(Net::HTTP).to receive(:get_response).with(URI(@link+'http://')).and_return(&amp;quot;402&amp;quot;)&lt;br /&gt;
          expect{(assignment_team.submit_hyperlink(@link))}.to raise_error('HTTP status code: 402')&lt;br /&gt;
       end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing remove_hyperlink====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      before :each do&lt;br /&gt;
        @hyperlink = &amp;quot;http://a.com&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
     it 'call the hyperlinks method' do&lt;br /&gt;
        expect(assignment_team).to receive(:hyperlinks).and_return([&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;])&lt;br /&gt;
        assignment_team.remove_hyperlink(@hyperlink)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing team====&lt;br /&gt;
3 test cases are designed to test this method&lt;br /&gt;
&lt;br /&gt;
1. when the participant is nil then this method will return nil&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      context 'when the participant is nil then this method will return nil' do&lt;br /&gt;
        it 'the participant is nil' do&lt;br /&gt;
          expect(AssignmentTeam.team(nil)).to eq(nil)&lt;br /&gt;
        end&lt;br /&gt;
       end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when it can find the participant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:participant) { build(:participant) }&lt;br /&gt;
      context 'can find the participant' do&lt;br /&gt;
        it 'send the correct user_id to the TeamsUser.where method' do&lt;br /&gt;
          expect(TeamsUser).to receive(:where).with(user_id: participant.user_id).and_return([team_user])&lt;br /&gt;
          AssignmentTeam.team(participant)&lt;br /&gt;
        end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. when the team user exists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:team_user) { build(:team_user) }&lt;br /&gt;
      context 'the team user exists' do&lt;br /&gt;
        before :each do&lt;br /&gt;
          allow(TeamsUser).to receive(:where).with(user_id: 1).and_return([team_user])&lt;br /&gt;
          AssignmentTeam.team(participant)&lt;br /&gt;
       end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing export_fields==== &lt;br /&gt;
2 test cases are designed to test this method&lt;br /&gt;
&lt;br /&gt;
1. when the team_name equals false&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'the team_name equals false' do&lt;br /&gt;
        options = {:team_name =&amp;gt;&amp;quot;false&amp;quot;}&lt;br /&gt;
        expect(AssignmentTeam.export_fields(options)).to eq([&amp;quot;Team Name&amp;quot;, &amp;quot;Team members&amp;quot;,&amp;quot;Assignment Name&amp;quot;])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when the team_name equals true&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'the team_name equals true' do&lt;br /&gt;
        options = {:team_name =&amp;gt;&amp;quot;true&amp;quot;}&lt;br /&gt;
        expect(AssignmentTeam.export_fields(options)).to eq([&amp;quot;Team Name&amp;quot;, &amp;quot;Assignment Name&amp;quot;])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing remove_team_by_id====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'send find to Assignment' do&lt;br /&gt;
        expect(AssignmentTeam).to receive(:find).with(1)&lt;br /&gt;
        AssignmentTeam.remove_team_by_id(1)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing path====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'can get the path' do&lt;br /&gt;
        expect(assignment_team.path).to eq(Rails.root.to_s+'/pg_data/instructor6/csc517/test/final_test/0')&lt;br /&gt;
        assignment_team.path&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing set_student_directory_num====&lt;br /&gt;
3 test cases are designed to test this method&lt;br /&gt;
&lt;br /&gt;
1. when directory_num &amp;gt;= 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     context 'directory_num &amp;gt;= 0' do&lt;br /&gt;
       it 'return when num&amp;gt;=0' do&lt;br /&gt;
         expect(assignment_team.set_student_directory_num).to eq(nil)&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when the directory_num does not exist and it gets max num&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     let(:assignment_team1) {build(:assignment_team, directory_num: nil)}&lt;br /&gt;
     it 'get max num' do&lt;br /&gt;
        expect(AssignmentTeam).to receive_message_chain(:where,:order,:first,:directory_num).with(parent_id:       assignment_team1.parent_id).with('directory_num desc').with(no_args).with(no_args).and_return(1)&lt;br /&gt;
        assignment_team1.set_student_directory_num&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. when the directory_num does not exist and it updates attribute&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'update attribute' do&lt;br /&gt;
        allow(AssignmentTeam).to receive_message_chain(:where,:order,:first,:directory_num).with(parent_id: assignment_team1.parent_id).with('directory_num desc').with(no_args).with(no_args).and_return(1)&lt;br /&gt;
        expect(assignment_team1).to receive(:update_attributes).with(directory_num: 2)&lt;br /&gt;
        assignment_team1.set_student_directory_num&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing received_any_peer_review?====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'send the request to where of the ResponseMap' do&lt;br /&gt;
        expect(ResponseMap).to receive(:where).with(reviewee_id: assignment_team.id, reviewed_object_id: assignment_team.parent_id).and_return([])&lt;br /&gt;
        assignment_team.received_any_peer_review?&lt;br /&gt;
    end&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Coverage==&lt;br /&gt;
There is screenshot of the coverage page.&lt;br /&gt;
[https://drive.google.com/open?id=12jHYbHoL_MpjnM1tdy52DVjqasGmnHie]&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1848_Write_unit_tests_for_assignment_team&amp;diff=119249</id>
		<title>E1848 Write unit tests for assignment team</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1848_Write_unit_tests_for_assignment_team&amp;diff=119249"/>
		<updated>2018-11-10T03:10:10Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For this progect, the goal is to wirte up unit tests for assignment_team.rb&lt;br /&gt;
&lt;br /&gt;
==Project Introduction==&lt;br /&gt;
====Background====&lt;br /&gt;
assignment_team.rb is the child class of team.rb. It is used to handle multiple problems relates to team in the assignment. Its responsibilities can mainly fall in three categories: participant of the team, reviews of the team, and the operation for the whole team. For the participant, it can be used to decide if a participant is in a given team and view the members of the team or remove a member. For reviews, it deals with the problem that getting the reviews for the team, assign reviewer for the team and get if the team has been reviewed by a specific reviewers. For the whole team, we can delete the team or view the scores, etc. by using this class.&lt;br /&gt;
====Motivation====&lt;br /&gt;
Make sure assignment_team.rb provides all functions as expected is important for the whole system. It requires enough tests for all the functions and the edge cases may occur. However, there are not enough unit tests for this model in expertiza. The following tests are added to assignment_team.rb in this project.&lt;br /&gt;
To make sure we can cover as many conditions as we can(the objective for this project is getting at least 90% coverage rate), we first design test cases. The following factors are taking into considerations: the expected functions for each method, the possible edge cases and the pre-conditions for each cases. Then we get the unit test plan and complete the test following test steps.&lt;br /&gt;
&lt;br /&gt;
==Memebers of Project==&lt;br /&gt;
Jianshu Zhang&lt;br /&gt;
&lt;br /&gt;
Wanjing Kuang&lt;br /&gt;
&lt;br /&gt;
Wei Wu&lt;br /&gt;
&lt;br /&gt;
==Mentor==&lt;br /&gt;
Zhewei Hu&lt;br /&gt;
&lt;br /&gt;
==File Involvement==&lt;br /&gt;
1.app/models/assignment_team.rb&lt;br /&gt;
&lt;br /&gt;
2.spec/models/assignment_team_spec.rb&lt;br /&gt;
&lt;br /&gt;
3.spec/factories/factories.rb&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
1. two test cases for method &amp;quot;include?&amp;quot;: When the team includes a given participant and When the team doesn't include a given participant&lt;br /&gt;
&lt;br /&gt;
2. one test case for method &amp;quot;parent_model&amp;quot;: It returns &amp;quot;Assignment&amp;quot; when the method is called.&lt;br /&gt;
&lt;br /&gt;
3. two test cases for method &amp;quot;self.parent_model(id)&amp;quot;: When it's given a correct id and When it's given an incorrect id.&lt;br /&gt;
&lt;br /&gt;
4. one test case for method &amp;quot;fullname&amp;quot;: When the participant has an full name.&lt;br /&gt;
&lt;br /&gt;
5. one test case for method &amp;quot;review_map_type&amp;quot;: It returns ReviewResponseMap when the method is called.&lt;br /&gt;
&lt;br /&gt;
6. one test case for method &amp;quot;self.prototype&amp;quot;: It returns an new instance of AssignmentTeam when the method is called.&lt;br /&gt;
&lt;br /&gt;
7. two test cases for method &amp;quot;assign_reviewer(reviewer)&amp;quot;: When the team has an assignment and When the assignment record can not be found.&lt;br /&gt;
&lt;br /&gt;
8. one test case for method &amp;quot;reviewd_by?&amp;quot;: When it gets correct reviewer and returns true as an result.&lt;br /&gt;
&lt;br /&gt;
9. one test case for method &amp;quot; topic&amp;quot;: When it returns the correct id.&lt;br /&gt;
&lt;br /&gt;
10. three test cases for method &amp;quot;has_submissions?&amp;quot;: When the team doesn't submit any file or link, when team submits a link instead of files and &lt;br /&gt;
when the team submits some files.&lt;br /&gt;
&lt;br /&gt;
11. two test cases for method &amp;quot;participants&amp;quot;: When no participants in this team and When adding some participants and get all the participants.&lt;br /&gt;
&lt;br /&gt;
12. one test case for method &amp;quot;add_participant&amp;quot;: When adding an participant, it will return an instance of AssignmentParticipant.&lt;br /&gt;
&lt;br /&gt;
13. two test cases for method &amp;quot; delete and destroy&amp;quot;: Testing delete and destory.&lt;br /&gt;
&lt;br /&gt;
14. two test cases for method &amp;quot;hyoerlinks&amp;quot;: the current teams submitted hyperlinks and not submitted the hyperlinks&lt;br /&gt;
&lt;br /&gt;
15.three test cases for method &amp;quot;submit_hyperlink&amp;quot;:  the hyperlink is empty, the hyperlink is not empty and it calls the method on NET::HTTP,the hyperlink is not empty and it raises error&lt;br /&gt;
&lt;br /&gt;
16.three test cases for method &amp;quot;team&amp;quot;: the participant is nil, the participant exists and the team user exists&lt;br /&gt;
&lt;br /&gt;
17.two test cases for method &amp;quot;export_files&amp;quot;: the team_name equals false and true&lt;br /&gt;
&lt;br /&gt;
18.&lt;br /&gt;
&lt;br /&gt;
==Unit Tests==&lt;br /&gt;
&lt;br /&gt;
===Unit Test Tool===&lt;br /&gt;
Rspec&lt;br /&gt;
&lt;br /&gt;
===Unit Test File===&lt;br /&gt;
expertiza/spec/models/assignment_team_spec.rb&lt;br /&gt;
&lt;br /&gt;
===Unit Test Steps===&lt;br /&gt;
&lt;br /&gt;
*Create unit test cases in the assignment_team_spec.rb&lt;br /&gt;
&lt;br /&gt;
*run rspec spec/models/assignment_team_spec.rb under expertiza directory&lt;br /&gt;
&lt;br /&gt;
*the rspec outputs the number of test cases that are passed and those that are failed.&lt;br /&gt;
&lt;br /&gt;
===Unit Test Cases===&lt;br /&gt;
&lt;br /&gt;
====Testing include?====&lt;br /&gt;
2 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1. The team includes a given participant.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment_team) { build(:assignment_team, id: 1, parent_id: 1, name: &amp;quot;full name&amp;quot;) }&lt;br /&gt;
      let(:participant1) { build(:participant, id: 2, user: user) }&lt;br /&gt;
      it &amp;quot;returns true&amp;quot; do&lt;br /&gt;
        allow(assignment_team).to receive(:add_participants).with(participant1)&lt;br /&gt;
        expect(assignment_team.includes?(participant1))&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. The team doesn't include a given participant.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment_team) { build(:assignment_team, id: 1, parent_id: 1, name: &amp;quot;full name&amp;quot;) }&lt;br /&gt;
      let(:participant1) { build(:participant, id: 2, user: user) }&lt;br /&gt;
      let(:participant2) { build(:participant, id: 3) }&lt;br /&gt;
      it &amp;quot;returns false&amp;quot; do&lt;br /&gt;
        allow(assignment_team).to receive(:add_participants).with(participant1)&lt;br /&gt;
        expect(assignment_team.includes?(participant2))&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing parent_model====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns Assignment as result&amp;quot; do&lt;br /&gt;
        expect(assignment_team.parent_model).to eq(&amp;quot;Assignment&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing self.parent_model(id)====&lt;br /&gt;
2 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1.When it's given a correct id.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment) { build(:assignment, id: 1) }&lt;br /&gt;
      it &amp;quot;returns an assignemt&amp;quot; do&lt;br /&gt;
        allow(Assignment).to receive(:find).with(1).and_return(assignment)&lt;br /&gt;
        expect(AssignmentTeam.parent_model(1)).to eq(assignment)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.When it's given an incorrect id.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;raises an exception&amp;quot; do&lt;br /&gt;
        expect { AssignmentTeam.parent_model 2 }.to raise_exception(ActiveRecord::RecordNotFound)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing fullname====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns the full name of assignment team&amp;quot; do&lt;br /&gt;
        expect(assignment_team.fullname).to eq(&amp;quot;full name&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing review_map_type====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns ReviewResponseMap as result&amp;quot; do&lt;br /&gt;
        expect(assignment_team.review_map_type).to eq(&amp;quot;ReviewResponseMap&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing self.prototype====&lt;br /&gt;
1 test cases is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns an new instance of AssignmentTeam&amp;quot; do&lt;br /&gt;
        expect(AssignmentTeam.prototype).to be_instance_of(AssignmentTeam)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing assign_reviewer(reviewer)====&lt;br /&gt;
2 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1. When the team has an assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:reviewer) { build(:participant, id: 1) }&lt;br /&gt;
      it &amp;quot;returns an instance of ReviewResponseMap&amp;quot; do&lt;br /&gt;
        expect(assignment_team.assign_reviewer(reviewer)).to be_instance_of(ReviewResponseMap)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. When the assignment record can not be found&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment_team2) { build(:assignment_team, id: 2, parent_id: 2) }&lt;br /&gt;
      it &amp;quot;returns an exception&amp;quot; do&lt;br /&gt;
        expect { assignment_team2.assign_reviewer(reviewer) }.to raise_exception(ActiveRecord::RecordNotFound)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing reviewd_by?====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns true&amp;quot; do&lt;br /&gt;
        allow(ReviewResponseMap).to receive(:where).\&lt;br /&gt;
          with('reviewee_id = ? &amp;amp;&amp;amp; reviewer_id = ? &amp;amp;&amp;amp; reviewed_object_id = ?', 1, 1, 1).and_return([review_response_map])&lt;br /&gt;
        expect(assignment_team.reviewed_by?(reviewer)).to be true&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing topic====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:signed_up_team) { build(:signed_up_team, id: 1, team_id: 1, is_waitlisted: 0, topic_id: 1) }&lt;br /&gt;
      it &amp;quot;returns a topic id&amp;quot; do&lt;br /&gt;
        allow(SignedUpTeam).to receive(:find_by).with(team_id: 1, is_waitlisted: 0).and_return(signed_up_team)&lt;br /&gt;
        expect(assignment_team.topic).to eq(1)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Testing has_submissions? ====&lt;br /&gt;
3 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1.The team doesn't submit any file or link. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:team2) { build(:assignment_team, id: 2, parent_id: 1, name: &amp;quot;team2&amp;quot;, submitted_hyperlinks: &amp;quot;&amp;quot;) }&lt;br /&gt;
      it &amp;quot;no file or no link&amp;quot; do&lt;br /&gt;
        expect(team2.has_submissions?).to eq(false)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.The team submits a link instead of files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:team1) { build(:assignment_team, id: 1, parent_id: 1, name: &amp;quot;team1&amp;quot;, submitted_hyperlinks: &amp;quot;http://example.com&amp;quot;) }&lt;br /&gt;
      it &amp;quot;submitted hyperlinks&amp;quot; do&lt;br /&gt;
        expect(team1.has_submissions?).to eq(true)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. The team submits some files.  Stub is used to emulate the scenario that the team has submitted a file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
      it &amp;quot;returns true&amp;quot; do&lt;br /&gt;
        allow(team2).to receive(:submitted_files).and_return([double(:File)])&lt;br /&gt;
        expect(team2.has_submissions?).to be true&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing participants ====&lt;br /&gt;
&lt;br /&gt;
1. No participants in this team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#no participant' do&lt;br /&gt;
        expect(team1.participants).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. add some participants and get all the participants&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:student1) { build(:student, id: 1, name: 'johns', fullname: 'johns franklin') }&lt;br /&gt;
      let(:student2) { build(:student, id: 2, name: 'kate', fullname: 'kate moss') }&lt;br /&gt;
      let(:par1) { build(:participant, id: 1, parent_id: 1, user_id: 1) }&lt;br /&gt;
      let(:par2) { build(:participant, id: 2, parent_id: 1, user_id: 2) }&lt;br /&gt;
      it '#1 participant' do&lt;br /&gt;
        allow(AssignmentTeam).to receive(:users).with(id: team1.id).and_return([student1,student2])&lt;br /&gt;
        expect(team1.participants).to eq([par1, par2])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing add_participant ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#add participants' do&lt;br /&gt;
        expect(team1.add_participant(ass1.id, par1)).to be_instance_of(AssignmentParticipant)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing the delete and destroy====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#delete' do&lt;br /&gt;
        expect(team1.delete).to be_instance_of(AssignmentTeam)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#destroy' do&lt;br /&gt;
        expect(team1.destroy).to be_instance_of(AssignmentTeam)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing members====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#get_first_member' do&lt;br /&gt;
        allow(AssignmentTeam).to receive(:find_by).with(id: team1.id).and_return(team1)&lt;br /&gt;
        allow(team1).to receive(:participants).and_return([par1, par2])&lt;br /&gt;
        expect(AssignmentTeam.get_first_member(team1.id)).to eq(par1)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing import and export====&lt;br /&gt;
&lt;br /&gt;
1. import a team to a non-existing assignment and expect an exception&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     it '#import an nonexisting assignment id' do&lt;br /&gt;
        row = {teamname: &amp;quot;hello_world&amp;quot;, teammembers: %w[johns kate]}&lt;br /&gt;
        options = {has_teamname: &amp;quot;true_first&amp;quot;}&lt;br /&gt;
        expect { AssignmentTeam.import(row, 99_999, options) }.to raise_error(ImportError)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. export teams into a csv file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#export' do&lt;br /&gt;
        options = {}&lt;br /&gt;
        csv = CSV.open(&amp;quot;assignment_team_export.csv&amp;quot;, &amp;quot;w&amp;quot;)&lt;br /&gt;
        assignment_id = ass1.id&lt;br /&gt;
        allow(AssignmentTeam).to receive(:where).with(parent_id: assignment_id).and_return([team1, team2, team3])&lt;br /&gt;
        allow(TeamsUser).to receive(:where).and_return([par1, par2])&lt;br /&gt;
        expect(AssignmentTeam.export(csv, assignment_id, options)).to be_instance_of(CSV)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing copy====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#copy' do&lt;br /&gt;
        allow(TeamsUser).to receive(:where).with(team_id: team1.id).and_return([par1])&lt;br /&gt;
        expect(team1.copy(course1.id)).to eq([par1])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing hyperlinks====&lt;br /&gt;
2 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1. when the current teams submitted hyperlinks&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment_team) { build(:assignment_team) }&lt;br /&gt;
      context &amp;quot;when current teams submitted hyperlinks&amp;quot; do&lt;br /&gt;
        it &amp;quot;returns the hyperlinks submitted by the team&amp;quot; do&lt;br /&gt;
          expect(assignment_team.hyperlinks).to eq([&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;])&lt;br /&gt;
        end&lt;br /&gt;
       end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when current teams did not submit hyperlinks&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     let(:team_without_submitted_hyperlinks) { build(:assignment_team, submitted_hyperlinks: &amp;quot;&amp;quot;) }&lt;br /&gt;
     context &amp;quot;when current teams did not submit hyperlinks&amp;quot; do&lt;br /&gt;
       it &amp;quot;returns an empty array&amp;quot; do&lt;br /&gt;
         expect(team_without_submitted_hyperlinks.hyperlinks).to eq([])&lt;br /&gt;
       end&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing files====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     before :each do&lt;br /&gt;
       @directory = &amp;quot;a&amp;quot;&lt;br /&gt;
       @files = [&amp;quot;b.txt&amp;quot;, &amp;quot;c.java&amp;quot;, &amp;quot;d.txt&amp;quot;]&lt;br /&gt;
       @files1 = [&amp;quot;b/c&amp;quot;, &amp;quot;d/e&amp;quot;]&lt;br /&gt;
      end&lt;br /&gt;
      it &amp;quot;call the method in Dir&amp;quot; do&lt;br /&gt;
        expect(Dir).to receive(:[]).with(@directory + &amp;quot;/*&amp;quot;).and_return(@files)&lt;br /&gt;
        assignment_team.files(@directory)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing submit_hyperlink====&lt;br /&gt;
3 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1. when the hyperlink is empty&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     context &amp;quot;when the hyperlink is empty&amp;quot; do&lt;br /&gt;
      it &amp;quot;raise excpetion&amp;quot; do&lt;br /&gt;
        expect{(assignment_team.submit_hyperlink(&amp;quot;&amp;quot;))}.to raise_error('The hyperlink cannot be empty!')&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when the hyperlink is not empty and it calls the method on NET::HTTP&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      before :each do&lt;br /&gt;
        @link = &amp;quot;htp.aa/..&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
      it &amp;quot;call the method on NET::HTTP&amp;quot; do&lt;br /&gt;
         expect(Net::HTTP).to receive(:get_response).with(URI(@link+'http://'))&lt;br /&gt;
         assignment_team.submit_hyperlink(@link)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. when the hyperlink is not empty and it raises error&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;raise error&amp;quot; do&lt;br /&gt;
          allow(Net::HTTP).to receive(:get_response).with(URI(@link+'http://')).and_return(&amp;quot;402&amp;quot;)&lt;br /&gt;
          expect{(assignment_team.submit_hyperlink(@link))}.to raise_error('HTTP status code: 402')&lt;br /&gt;
       end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing remove_hyperlink====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      before :each do&lt;br /&gt;
        @hyperlink = &amp;quot;http://a.com&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
     it 'call the hyperlinks method' do&lt;br /&gt;
        expect(assignment_team).to receive(:hyperlinks).and_return([&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;])&lt;br /&gt;
        assignment_team.remove_hyperlink(@hyperlink)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing team====&lt;br /&gt;
3 test cases are designed to test this method&lt;br /&gt;
&lt;br /&gt;
1. when the participant is nil then this method will return nil&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      context 'when the participant is nil then this method will return nil' do&lt;br /&gt;
        it 'the participant is nil' do&lt;br /&gt;
          expect(AssignmentTeam.team(nil)).to eq(nil)&lt;br /&gt;
        end&lt;br /&gt;
       end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when it can find the participant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:participant) { build(:participant) }&lt;br /&gt;
      context 'can find the participant' do&lt;br /&gt;
        it 'send the correct user_id to the TeamsUser.where method' do&lt;br /&gt;
          expect(TeamsUser).to receive(:where).with(user_id: participant.user_id).and_return([team_user])&lt;br /&gt;
          AssignmentTeam.team(participant)&lt;br /&gt;
        end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. when the team user exists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:team_user) { build(:team_user) }&lt;br /&gt;
      context 'the team user exists' do&lt;br /&gt;
        before :each do&lt;br /&gt;
          allow(TeamsUser).to receive(:where).with(user_id: 1).and_return([team_user])&lt;br /&gt;
          AssignmentTeam.team(participant)&lt;br /&gt;
       end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing export_fields==== &lt;br /&gt;
2 test cases are designed to test this method&lt;br /&gt;
&lt;br /&gt;
1. when the team_name equals false&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'the team_name equals false' do&lt;br /&gt;
        options = {:team_name =&amp;gt;&amp;quot;false&amp;quot;}&lt;br /&gt;
        expect(AssignmentTeam.export_fields(options)).to eq([&amp;quot;Team Name&amp;quot;, &amp;quot;Team members&amp;quot;,&amp;quot;Assignment Name&amp;quot;])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when the team_name equals true&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'the team_name equals true' do&lt;br /&gt;
        options = {:team_name =&amp;gt;&amp;quot;true&amp;quot;}&lt;br /&gt;
        expect(AssignmentTeam.export_fields(options)).to eq([&amp;quot;Team Name&amp;quot;, &amp;quot;Assignment Name&amp;quot;])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing remove_team_by_id====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'send find to Assignment' do&lt;br /&gt;
        expect(AssignmentTeam).to receive(:find).with(1)&lt;br /&gt;
        AssignmentTeam.remove_team_by_id(1)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing path====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'can get the path' do&lt;br /&gt;
        expect(assignment_team.path).to eq(Rails.root.to_s+'/pg_data/instructor6/csc517/test/final_test/0')&lt;br /&gt;
        assignment_team.path&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing set_student_directory_num====&lt;br /&gt;
3 test cases are designed to test this method&lt;br /&gt;
&lt;br /&gt;
1. when directory_num &amp;gt;= 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     context 'directory_num &amp;gt;= 0' do&lt;br /&gt;
       it 'return when num&amp;gt;=0' do&lt;br /&gt;
         expect(assignment_team.set_student_directory_num).to eq(nil)&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when the directory_num does not exist and it gets max num&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     let(:assignment_team1) {build(:assignment_team, directory_num: nil)}&lt;br /&gt;
     it 'get max num' do&lt;br /&gt;
        expect(AssignmentTeam).to receive_message_chain(:where,:order,:first,:directory_num).with(parent_id:       assignment_team1.parent_id).with('directory_num desc').with(no_args).with(no_args).and_return(1)&lt;br /&gt;
        assignment_team1.set_student_directory_num&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. when the directory_num does not exist and it updates attribute&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'update attribute' do&lt;br /&gt;
        allow(AssignmentTeam).to receive_message_chain(:where,:order,:first,:directory_num).with(parent_id: assignment_team1.parent_id).with('directory_num desc').with(no_args).with(no_args).and_return(1)&lt;br /&gt;
        expect(assignment_team1).to receive(:update_attributes).with(directory_num: 2)&lt;br /&gt;
        assignment_team1.set_student_directory_num&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing received_any_peer_review?====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'send the request to where of the ResponseMap' do&lt;br /&gt;
        expect(ResponseMap).to receive(:where).with(reviewee_id: assignment_team.id, reviewed_object_id: assignment_team.parent_id).and_return([])&lt;br /&gt;
        assignment_team.received_any_peer_review?&lt;br /&gt;
    end&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Coverage==&lt;br /&gt;
There is screenshot of the coverage page.&lt;br /&gt;
[https://drive.google.com/open?id=12jHYbHoL_MpjnM1tdy52DVjqasGmnHie]&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1848_Write_unit_tests_for_assignment_team&amp;diff=119248</id>
		<title>E1848 Write unit tests for assignment team</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1848_Write_unit_tests_for_assignment_team&amp;diff=119248"/>
		<updated>2018-11-10T03:09:04Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For this progect, the goal is to wirte up unit tests for assignment_team.rb&lt;br /&gt;
&lt;br /&gt;
==Project Introduction==&lt;br /&gt;
====Background====&lt;br /&gt;
assignment_team.rb is the child class of team.rb. It is used to handle multiple problems relates to team in the assignment. Its responsibilities can mainly fall in three categories: participant of the team, reviews of the team, and the operation for the whole team. For the participant, it can be used to decide if a participant is in a given team and view the members of the team or remove a member. For reviews, it deals with the problem that getting the reviews for the team, assign reviewer for the team and get if the team has been reviewed by a specific reviewers. For the whole team, we can delete the team or view the scores, etc. by using this class.&lt;br /&gt;
====Motivation====&lt;br /&gt;
Make sure assignment_team.rb provides all functions as expected is important for the whole system. It requires enough tests for all the functions and the edge cases may occur. However, there are not enough unit tests for this model in expertiza. The following tests are added to assignment_team.rb in this project.&lt;br /&gt;
To make sure we can cover as many conditions as we can(the objective for this project is getting at least 90% coverage rate), we first design test cases. The following factors are taking into considerations: the expected functions for each method, the possible edge cases and the pre-conditions for each cases. Then we get the unit test plan and complete the test following test steps.&lt;br /&gt;
&lt;br /&gt;
==Memebers of Project==&lt;br /&gt;
Jianshu Zhang&lt;br /&gt;
&lt;br /&gt;
Wanjing Kuang&lt;br /&gt;
&lt;br /&gt;
Wei Wu&lt;br /&gt;
&lt;br /&gt;
==Mentor==&lt;br /&gt;
Zhewei Hu&lt;br /&gt;
&lt;br /&gt;
==File Involvement==&lt;br /&gt;
1.app/models/assignment_team.rb&lt;br /&gt;
&lt;br /&gt;
2.spec/models/assignment_team_spec.rb&lt;br /&gt;
&lt;br /&gt;
3.spec/factories/factories.rb&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
1. two test cases for method &amp;quot;include?&amp;quot;: When the team includes a given participant and When the team doesn't include a given participant&lt;br /&gt;
&lt;br /&gt;
2. one test case for method &amp;quot;parent_model&amp;quot;: It returns &amp;quot;Assignment&amp;quot; when the method is called.&lt;br /&gt;
&lt;br /&gt;
3. two test cases for method &amp;quot;self.parent_model(id)&amp;quot;: When it's given a correct id and When it's given an incorrect id.&lt;br /&gt;
&lt;br /&gt;
4. one test case for method &amp;quot;fullname&amp;quot;: When the participant has an full name.&lt;br /&gt;
&lt;br /&gt;
5. one test case for method &amp;quot;review_map_type&amp;quot;: It returns ReviewResponseMap when the method is called.&lt;br /&gt;
&lt;br /&gt;
6. one test case for method &amp;quot;self.prototype&amp;quot;: It returns an new instance of AssignmentTeam when the method is called.&lt;br /&gt;
&lt;br /&gt;
7. two test cases for method &amp;quot;assign_reviewer(reviewer)&amp;quot;: When the team has an assignment and When the assignment record can not be found.&lt;br /&gt;
&lt;br /&gt;
8. one test case for method &amp;quot;reviewd_by?&amp;quot;: When it gets correct reviewer and returns true as an result.&lt;br /&gt;
&lt;br /&gt;
9. one test case for method &amp;quot; topic&amp;quot;: When it returns the correct id.&lt;br /&gt;
&lt;br /&gt;
10. three test cases for method &amp;quot;has_submissions?&amp;quot;: When the team doesn't submit any file or link, when team submits a link instead of files and &lt;br /&gt;
when the team submits some files.&lt;br /&gt;
&lt;br /&gt;
11. two test cases for method &amp;quot;participants&amp;quot;: When no participants in this team and When adding some participants and get all the participants.&lt;br /&gt;
&lt;br /&gt;
12. one test case for method &amp;quot;add_participant&amp;quot;: When adding an participant, it will return an instance of AssignmentParticipant.&lt;br /&gt;
&lt;br /&gt;
13. two test cases for method &amp;quot; delete and destroy&amp;quot;: Testing delete and destory.&lt;br /&gt;
&lt;br /&gt;
14. two test cases for method &amp;quot;hyoerlinks&amp;quot;: the current teams submitted hyperlinks and not submitted the hyperlinks&lt;br /&gt;
&lt;br /&gt;
15.three test cases for method &amp;quot;submit_hyperlink&amp;quot;:  the hyperlink is empty, the hyperlink is not empty and it calls the method on NET::HTTP,the hyperlink is not empty and it raises error&lt;br /&gt;
&lt;br /&gt;
16.three test cases for method &amp;quot;team&amp;quot;: the participant is nil, the participant exists and the team user exists&lt;br /&gt;
&lt;br /&gt;
17.&lt;br /&gt;
&lt;br /&gt;
==Unit Tests==&lt;br /&gt;
&lt;br /&gt;
===Unit Test Tool===&lt;br /&gt;
Rspec&lt;br /&gt;
&lt;br /&gt;
===Unit Test File===&lt;br /&gt;
expertiza/spec/models/assignment_team_spec.rb&lt;br /&gt;
&lt;br /&gt;
===Unit Test Steps===&lt;br /&gt;
&lt;br /&gt;
*Create unit test cases in the assignment_team_spec.rb&lt;br /&gt;
&lt;br /&gt;
*run rspec spec/models/assignment_team_spec.rb under expertiza directory&lt;br /&gt;
&lt;br /&gt;
*the rspec outputs the number of test cases that are passed and those that are failed.&lt;br /&gt;
&lt;br /&gt;
===Unit Test Cases===&lt;br /&gt;
&lt;br /&gt;
====Testing include?====&lt;br /&gt;
2 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1. The team includes a given participant.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment_team) { build(:assignment_team, id: 1, parent_id: 1, name: &amp;quot;full name&amp;quot;) }&lt;br /&gt;
      let(:participant1) { build(:participant, id: 2, user: user) }&lt;br /&gt;
      it &amp;quot;returns true&amp;quot; do&lt;br /&gt;
        allow(assignment_team).to receive(:add_participants).with(participant1)&lt;br /&gt;
        expect(assignment_team.includes?(participant1))&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. The team doesn't include a given participant.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment_team) { build(:assignment_team, id: 1, parent_id: 1, name: &amp;quot;full name&amp;quot;) }&lt;br /&gt;
      let(:participant1) { build(:participant, id: 2, user: user) }&lt;br /&gt;
      let(:participant2) { build(:participant, id: 3) }&lt;br /&gt;
      it &amp;quot;returns false&amp;quot; do&lt;br /&gt;
        allow(assignment_team).to receive(:add_participants).with(participant1)&lt;br /&gt;
        expect(assignment_team.includes?(participant2))&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing parent_model====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns Assignment as result&amp;quot; do&lt;br /&gt;
        expect(assignment_team.parent_model).to eq(&amp;quot;Assignment&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing self.parent_model(id)====&lt;br /&gt;
2 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1.When it's given a correct id.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment) { build(:assignment, id: 1) }&lt;br /&gt;
      it &amp;quot;returns an assignemt&amp;quot; do&lt;br /&gt;
        allow(Assignment).to receive(:find).with(1).and_return(assignment)&lt;br /&gt;
        expect(AssignmentTeam.parent_model(1)).to eq(assignment)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.When it's given an incorrect id.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;raises an exception&amp;quot; do&lt;br /&gt;
        expect { AssignmentTeam.parent_model 2 }.to raise_exception(ActiveRecord::RecordNotFound)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing fullname====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns the full name of assignment team&amp;quot; do&lt;br /&gt;
        expect(assignment_team.fullname).to eq(&amp;quot;full name&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing review_map_type====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns ReviewResponseMap as result&amp;quot; do&lt;br /&gt;
        expect(assignment_team.review_map_type).to eq(&amp;quot;ReviewResponseMap&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing self.prototype====&lt;br /&gt;
1 test cases is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns an new instance of AssignmentTeam&amp;quot; do&lt;br /&gt;
        expect(AssignmentTeam.prototype).to be_instance_of(AssignmentTeam)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing assign_reviewer(reviewer)====&lt;br /&gt;
2 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1. When the team has an assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:reviewer) { build(:participant, id: 1) }&lt;br /&gt;
      it &amp;quot;returns an instance of ReviewResponseMap&amp;quot; do&lt;br /&gt;
        expect(assignment_team.assign_reviewer(reviewer)).to be_instance_of(ReviewResponseMap)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. When the assignment record can not be found&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment_team2) { build(:assignment_team, id: 2, parent_id: 2) }&lt;br /&gt;
      it &amp;quot;returns an exception&amp;quot; do&lt;br /&gt;
        expect { assignment_team2.assign_reviewer(reviewer) }.to raise_exception(ActiveRecord::RecordNotFound)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing reviewd_by?====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns true&amp;quot; do&lt;br /&gt;
        allow(ReviewResponseMap).to receive(:where).\&lt;br /&gt;
          with('reviewee_id = ? &amp;amp;&amp;amp; reviewer_id = ? &amp;amp;&amp;amp; reviewed_object_id = ?', 1, 1, 1).and_return([review_response_map])&lt;br /&gt;
        expect(assignment_team.reviewed_by?(reviewer)).to be true&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing topic====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:signed_up_team) { build(:signed_up_team, id: 1, team_id: 1, is_waitlisted: 0, topic_id: 1) }&lt;br /&gt;
      it &amp;quot;returns a topic id&amp;quot; do&lt;br /&gt;
        allow(SignedUpTeam).to receive(:find_by).with(team_id: 1, is_waitlisted: 0).and_return(signed_up_team)&lt;br /&gt;
        expect(assignment_team.topic).to eq(1)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Testing has_submissions? ====&lt;br /&gt;
3 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1.The team doesn't submit any file or link. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:team2) { build(:assignment_team, id: 2, parent_id: 1, name: &amp;quot;team2&amp;quot;, submitted_hyperlinks: &amp;quot;&amp;quot;) }&lt;br /&gt;
      it &amp;quot;no file or no link&amp;quot; do&lt;br /&gt;
        expect(team2.has_submissions?).to eq(false)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.The team submits a link instead of files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:team1) { build(:assignment_team, id: 1, parent_id: 1, name: &amp;quot;team1&amp;quot;, submitted_hyperlinks: &amp;quot;http://example.com&amp;quot;) }&lt;br /&gt;
      it &amp;quot;submitted hyperlinks&amp;quot; do&lt;br /&gt;
        expect(team1.has_submissions?).to eq(true)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. The team submits some files.  Stub is used to emulate the scenario that the team has submitted a file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
      it &amp;quot;returns true&amp;quot; do&lt;br /&gt;
        allow(team2).to receive(:submitted_files).and_return([double(:File)])&lt;br /&gt;
        expect(team2.has_submissions?).to be true&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing participants ====&lt;br /&gt;
&lt;br /&gt;
1. No participants in this team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#no participant' do&lt;br /&gt;
        expect(team1.participants).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. add some participants and get all the participants&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:student1) { build(:student, id: 1, name: 'johns', fullname: 'johns franklin') }&lt;br /&gt;
      let(:student2) { build(:student, id: 2, name: 'kate', fullname: 'kate moss') }&lt;br /&gt;
      let(:par1) { build(:participant, id: 1, parent_id: 1, user_id: 1) }&lt;br /&gt;
      let(:par2) { build(:participant, id: 2, parent_id: 1, user_id: 2) }&lt;br /&gt;
      it '#1 participant' do&lt;br /&gt;
        allow(AssignmentTeam).to receive(:users).with(id: team1.id).and_return([student1,student2])&lt;br /&gt;
        expect(team1.participants).to eq([par1, par2])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing add_participant ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#add participants' do&lt;br /&gt;
        expect(team1.add_participant(ass1.id, par1)).to be_instance_of(AssignmentParticipant)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing the delete and destroy====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#delete' do&lt;br /&gt;
        expect(team1.delete).to be_instance_of(AssignmentTeam)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#destroy' do&lt;br /&gt;
        expect(team1.destroy).to be_instance_of(AssignmentTeam)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing members====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#get_first_member' do&lt;br /&gt;
        allow(AssignmentTeam).to receive(:find_by).with(id: team1.id).and_return(team1)&lt;br /&gt;
        allow(team1).to receive(:participants).and_return([par1, par2])&lt;br /&gt;
        expect(AssignmentTeam.get_first_member(team1.id)).to eq(par1)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing import and export====&lt;br /&gt;
&lt;br /&gt;
1. import a team to a non-existing assignment and expect an exception&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     it '#import an nonexisting assignment id' do&lt;br /&gt;
        row = {teamname: &amp;quot;hello_world&amp;quot;, teammembers: %w[johns kate]}&lt;br /&gt;
        options = {has_teamname: &amp;quot;true_first&amp;quot;}&lt;br /&gt;
        expect { AssignmentTeam.import(row, 99_999, options) }.to raise_error(ImportError)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. export teams into a csv file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#export' do&lt;br /&gt;
        options = {}&lt;br /&gt;
        csv = CSV.open(&amp;quot;assignment_team_export.csv&amp;quot;, &amp;quot;w&amp;quot;)&lt;br /&gt;
        assignment_id = ass1.id&lt;br /&gt;
        allow(AssignmentTeam).to receive(:where).with(parent_id: assignment_id).and_return([team1, team2, team3])&lt;br /&gt;
        allow(TeamsUser).to receive(:where).and_return([par1, par2])&lt;br /&gt;
        expect(AssignmentTeam.export(csv, assignment_id, options)).to be_instance_of(CSV)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing copy====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#copy' do&lt;br /&gt;
        allow(TeamsUser).to receive(:where).with(team_id: team1.id).and_return([par1])&lt;br /&gt;
        expect(team1.copy(course1.id)).to eq([par1])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing hyperlinks====&lt;br /&gt;
2 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1. when the current teams submitted hyperlinks&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment_team) { build(:assignment_team) }&lt;br /&gt;
      context &amp;quot;when current teams submitted hyperlinks&amp;quot; do&lt;br /&gt;
        it &amp;quot;returns the hyperlinks submitted by the team&amp;quot; do&lt;br /&gt;
          expect(assignment_team.hyperlinks).to eq([&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;])&lt;br /&gt;
        end&lt;br /&gt;
       end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when current teams did not submit hyperlinks&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     let(:team_without_submitted_hyperlinks) { build(:assignment_team, submitted_hyperlinks: &amp;quot;&amp;quot;) }&lt;br /&gt;
     context &amp;quot;when current teams did not submit hyperlinks&amp;quot; do&lt;br /&gt;
       it &amp;quot;returns an empty array&amp;quot; do&lt;br /&gt;
         expect(team_without_submitted_hyperlinks.hyperlinks).to eq([])&lt;br /&gt;
       end&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing files====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     before :each do&lt;br /&gt;
       @directory = &amp;quot;a&amp;quot;&lt;br /&gt;
       @files = [&amp;quot;b.txt&amp;quot;, &amp;quot;c.java&amp;quot;, &amp;quot;d.txt&amp;quot;]&lt;br /&gt;
       @files1 = [&amp;quot;b/c&amp;quot;, &amp;quot;d/e&amp;quot;]&lt;br /&gt;
      end&lt;br /&gt;
      it &amp;quot;call the method in Dir&amp;quot; do&lt;br /&gt;
        expect(Dir).to receive(:[]).with(@directory + &amp;quot;/*&amp;quot;).and_return(@files)&lt;br /&gt;
        assignment_team.files(@directory)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing submit_hyperlink====&lt;br /&gt;
3 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1. when the hyperlink is empty&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     context &amp;quot;when the hyperlink is empty&amp;quot; do&lt;br /&gt;
      it &amp;quot;raise excpetion&amp;quot; do&lt;br /&gt;
        expect{(assignment_team.submit_hyperlink(&amp;quot;&amp;quot;))}.to raise_error('The hyperlink cannot be empty!')&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when the hyperlink is not empty and it calls the method on NET::HTTP&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      before :each do&lt;br /&gt;
        @link = &amp;quot;htp.aa/..&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
      it &amp;quot;call the method on NET::HTTP&amp;quot; do&lt;br /&gt;
         expect(Net::HTTP).to receive(:get_response).with(URI(@link+'http://'))&lt;br /&gt;
         assignment_team.submit_hyperlink(@link)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. when the hyperlink is not empty and it raises error&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;raise error&amp;quot; do&lt;br /&gt;
          allow(Net::HTTP).to receive(:get_response).with(URI(@link+'http://')).and_return(&amp;quot;402&amp;quot;)&lt;br /&gt;
          expect{(assignment_team.submit_hyperlink(@link))}.to raise_error('HTTP status code: 402')&lt;br /&gt;
       end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing remove_hyperlink====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      before :each do&lt;br /&gt;
        @hyperlink = &amp;quot;http://a.com&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
     it 'call the hyperlinks method' do&lt;br /&gt;
        expect(assignment_team).to receive(:hyperlinks).and_return([&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;])&lt;br /&gt;
        assignment_team.remove_hyperlink(@hyperlink)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing team====&lt;br /&gt;
3 test cases are designed to test this method&lt;br /&gt;
&lt;br /&gt;
1. when the participant is nil then this method will return nil&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      context 'when the participant is nil then this method will return nil' do&lt;br /&gt;
        it 'the participant is nil' do&lt;br /&gt;
          expect(AssignmentTeam.team(nil)).to eq(nil)&lt;br /&gt;
        end&lt;br /&gt;
       end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when it can find the participant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:participant) { build(:participant) }&lt;br /&gt;
      context 'can find the participant' do&lt;br /&gt;
        it 'send the correct user_id to the TeamsUser.where method' do&lt;br /&gt;
          expect(TeamsUser).to receive(:where).with(user_id: participant.user_id).and_return([team_user])&lt;br /&gt;
          AssignmentTeam.team(participant)&lt;br /&gt;
        end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. when the team user exists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:team_user) { build(:team_user) }&lt;br /&gt;
      context 'the team user exists' do&lt;br /&gt;
        before :each do&lt;br /&gt;
          allow(TeamsUser).to receive(:where).with(user_id: 1).and_return([team_user])&lt;br /&gt;
          AssignmentTeam.team(participant)&lt;br /&gt;
       end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing export_fields==== &lt;br /&gt;
2 test cases are designed to test this method&lt;br /&gt;
&lt;br /&gt;
1. when the team_name equals false&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'the team_name equals false' do&lt;br /&gt;
        options = {:team_name =&amp;gt;&amp;quot;false&amp;quot;}&lt;br /&gt;
        expect(AssignmentTeam.export_fields(options)).to eq([&amp;quot;Team Name&amp;quot;, &amp;quot;Team members&amp;quot;,&amp;quot;Assignment Name&amp;quot;])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when the team_name equals true&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'the team_name equals true' do&lt;br /&gt;
        options = {:team_name =&amp;gt;&amp;quot;true&amp;quot;}&lt;br /&gt;
        expect(AssignmentTeam.export_fields(options)).to eq([&amp;quot;Team Name&amp;quot;, &amp;quot;Assignment Name&amp;quot;])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing remove_team_by_id====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'send find to Assignment' do&lt;br /&gt;
        expect(AssignmentTeam).to receive(:find).with(1)&lt;br /&gt;
        AssignmentTeam.remove_team_by_id(1)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing path====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'can get the path' do&lt;br /&gt;
        expect(assignment_team.path).to eq(Rails.root.to_s+'/pg_data/instructor6/csc517/test/final_test/0')&lt;br /&gt;
        assignment_team.path&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing set_student_directory_num====&lt;br /&gt;
3 test cases are designed to test this method&lt;br /&gt;
&lt;br /&gt;
1. when directory_num &amp;gt;= 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     context 'directory_num &amp;gt;= 0' do&lt;br /&gt;
       it 'return when num&amp;gt;=0' do&lt;br /&gt;
         expect(assignment_team.set_student_directory_num).to eq(nil)&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when the directory_num does not exist and it gets max num&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     let(:assignment_team1) {build(:assignment_team, directory_num: nil)}&lt;br /&gt;
     it 'get max num' do&lt;br /&gt;
        expect(AssignmentTeam).to receive_message_chain(:where,:order,:first,:directory_num).with(parent_id:       assignment_team1.parent_id).with('directory_num desc').with(no_args).with(no_args).and_return(1)&lt;br /&gt;
        assignment_team1.set_student_directory_num&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. when the directory_num does not exist and it updates attribute&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'update attribute' do&lt;br /&gt;
        allow(AssignmentTeam).to receive_message_chain(:where,:order,:first,:directory_num).with(parent_id: assignment_team1.parent_id).with('directory_num desc').with(no_args).with(no_args).and_return(1)&lt;br /&gt;
        expect(assignment_team1).to receive(:update_attributes).with(directory_num: 2)&lt;br /&gt;
        assignment_team1.set_student_directory_num&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing received_any_peer_review?====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'send the request to where of the ResponseMap' do&lt;br /&gt;
        expect(ResponseMap).to receive(:where).with(reviewee_id: assignment_team.id, reviewed_object_id: assignment_team.parent_id).and_return([])&lt;br /&gt;
        assignment_team.received_any_peer_review?&lt;br /&gt;
    end&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Coverage==&lt;br /&gt;
There is screenshot of the coverage page.&lt;br /&gt;
[https://drive.google.com/open?id=12jHYbHoL_MpjnM1tdy52DVjqasGmnHie]&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1848_Write_unit_tests_for_assignment_team&amp;diff=119246</id>
		<title>E1848 Write unit tests for assignment team</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1848_Write_unit_tests_for_assignment_team&amp;diff=119246"/>
		<updated>2018-11-10T03:07:15Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For this progect, the goal is to wirte up unit tests for assignment_team.rb&lt;br /&gt;
&lt;br /&gt;
==Project Introduction==&lt;br /&gt;
====Background====&lt;br /&gt;
assignment_team.rb is the child class of team.rb. It is used to handle multiple problems relates to team in the assignment. Its responsibilities can mainly fall in three categories: participant of the team, reviews of the team, and the operation for the whole team. For the participant, it can be used to decide if a participant is in a given team and view the members of the team or remove a member. For reviews, it deals with the problem that getting the reviews for the team, assign reviewer for the team and get if the team has been reviewed by a specific reviewers. For the whole team, we can delete the team or view the scores, etc. by using this class.&lt;br /&gt;
====Motivation====&lt;br /&gt;
Make sure assignment_team.rb provides all functions as expected is important for the whole system. It requires enough tests for all the functions and the edge cases may occur. However, there are not enough unit tests for this model in expertiza. The following tests are added to assignment_team.rb in this project.&lt;br /&gt;
To make sure we can cover as many conditions as we can(the objective for this project is getting at least 90% coverage rate), we first design test cases. The following factors are taking into considerations: the expected functions for each method, the possible edge cases and the pre-conditions for each cases. Then we get the unit test plan and complete the test following test steps.&lt;br /&gt;
&lt;br /&gt;
==Memebers of Project==&lt;br /&gt;
Jianshu Zhang&lt;br /&gt;
&lt;br /&gt;
Wanjing Kuang&lt;br /&gt;
&lt;br /&gt;
Wei Wu&lt;br /&gt;
&lt;br /&gt;
==Mentor==&lt;br /&gt;
Zhewei Hu&lt;br /&gt;
&lt;br /&gt;
==File Involvement==&lt;br /&gt;
1.app/models/assignment_team.rb&lt;br /&gt;
&lt;br /&gt;
2.spec/models/assignment_team_spec.rb&lt;br /&gt;
&lt;br /&gt;
3.spec/factories/factories.rb&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
1. two test cases for method &amp;quot;include?&amp;quot;: When the team includes a given participant and When the team doesn't include a given participant&lt;br /&gt;
&lt;br /&gt;
2. one test case for method &amp;quot;parent_model&amp;quot;: It returns &amp;quot;Assignment&amp;quot; when the method is called.&lt;br /&gt;
&lt;br /&gt;
3. two test cases for method &amp;quot;self.parent_model(id)&amp;quot;: When it's given a correct id and When it's given an incorrect id.&lt;br /&gt;
&lt;br /&gt;
4. one test case for method &amp;quot;fullname&amp;quot;: When the participant has an full name.&lt;br /&gt;
&lt;br /&gt;
5. one test case for method &amp;quot;review_map_type&amp;quot;: It returns ReviewResponseMap when the method is called.&lt;br /&gt;
&lt;br /&gt;
6. one test case for method &amp;quot;self.prototype&amp;quot;: It returns an new instance of AssignmentTeam when the method is called.&lt;br /&gt;
&lt;br /&gt;
7. two test cases for method &amp;quot;assign_reviewer(reviewer)&amp;quot;: When the team has an assignment and When the assignment record can not be found.&lt;br /&gt;
&lt;br /&gt;
8. one test case for method &amp;quot;reviewd_by?&amp;quot;: When it gets correct reviewer and returns true as an result.&lt;br /&gt;
&lt;br /&gt;
9. one test case for method &amp;quot; topic&amp;quot;: When it returns the correct id.&lt;br /&gt;
&lt;br /&gt;
10. three test cases for method &amp;quot;has_submissions?&amp;quot;: When the team doesn't submit any file or link, when team submits a link instead of files and &lt;br /&gt;
when the team submits some files.&lt;br /&gt;
&lt;br /&gt;
11. two test cases for method &amp;quot;participants&amp;quot;: When no participants in this team and When adding some participants and get all the participants.&lt;br /&gt;
&lt;br /&gt;
12. one test case for method &amp;quot;add_participant&amp;quot;: When adding an participant, it will return an instance of AssignmentParticipant.&lt;br /&gt;
&lt;br /&gt;
13. two test cases for method &amp;quot; delete and destroy&amp;quot;: Testing delete and destory.&lt;br /&gt;
&lt;br /&gt;
14. two test cases for method &amp;quot;hyoerlinks&amp;quot;: the current teams submitted hyperlinks and not submitted the hyperlinks&lt;br /&gt;
&lt;br /&gt;
15.three test cases for method &amp;quot;submit_hyperlink&amp;quot;:  the hyperlink is empty, the hyperlink is not empty and it calls the method on NET::HTTP,the hyperlink is not empty and it raises error&lt;br /&gt;
&lt;br /&gt;
16.&lt;br /&gt;
&lt;br /&gt;
==Unit Tests==&lt;br /&gt;
&lt;br /&gt;
===Unit Test Tool===&lt;br /&gt;
Rspec&lt;br /&gt;
&lt;br /&gt;
===Unit Test File===&lt;br /&gt;
expertiza/spec/models/assignment_team_spec.rb&lt;br /&gt;
&lt;br /&gt;
===Unit Test Steps===&lt;br /&gt;
&lt;br /&gt;
*Create unit test cases in the assignment_team_spec.rb&lt;br /&gt;
&lt;br /&gt;
*run rspec spec/models/assignment_team_spec.rb under expertiza directory&lt;br /&gt;
&lt;br /&gt;
*the rspec outputs the number of test cases that are passed and those that are failed.&lt;br /&gt;
&lt;br /&gt;
===Unit Test Cases===&lt;br /&gt;
&lt;br /&gt;
====Testing include?====&lt;br /&gt;
2 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1. The team includes a given participant.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment_team) { build(:assignment_team, id: 1, parent_id: 1, name: &amp;quot;full name&amp;quot;) }&lt;br /&gt;
      let(:participant1) { build(:participant, id: 2, user: user) }&lt;br /&gt;
      it &amp;quot;returns true&amp;quot; do&lt;br /&gt;
        allow(assignment_team).to receive(:add_participants).with(participant1)&lt;br /&gt;
        expect(assignment_team.includes?(participant1))&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. The team doesn't include a given participant.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment_team) { build(:assignment_team, id: 1, parent_id: 1, name: &amp;quot;full name&amp;quot;) }&lt;br /&gt;
      let(:participant1) { build(:participant, id: 2, user: user) }&lt;br /&gt;
      let(:participant2) { build(:participant, id: 3) }&lt;br /&gt;
      it &amp;quot;returns false&amp;quot; do&lt;br /&gt;
        allow(assignment_team).to receive(:add_participants).with(participant1)&lt;br /&gt;
        expect(assignment_team.includes?(participant2))&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing parent_model====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns Assignment as result&amp;quot; do&lt;br /&gt;
        expect(assignment_team.parent_model).to eq(&amp;quot;Assignment&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing self.parent_model(id)====&lt;br /&gt;
2 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1.When it's given a correct id.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment) { build(:assignment, id: 1) }&lt;br /&gt;
      it &amp;quot;returns an assignemt&amp;quot; do&lt;br /&gt;
        allow(Assignment).to receive(:find).with(1).and_return(assignment)&lt;br /&gt;
        expect(AssignmentTeam.parent_model(1)).to eq(assignment)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.When it's given an incorrect id.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;raises an exception&amp;quot; do&lt;br /&gt;
        expect { AssignmentTeam.parent_model 2 }.to raise_exception(ActiveRecord::RecordNotFound)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing fullname====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns the full name of assignment team&amp;quot; do&lt;br /&gt;
        expect(assignment_team.fullname).to eq(&amp;quot;full name&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing review_map_type====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns ReviewResponseMap as result&amp;quot; do&lt;br /&gt;
        expect(assignment_team.review_map_type).to eq(&amp;quot;ReviewResponseMap&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing self.prototype====&lt;br /&gt;
1 test cases is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns an new instance of AssignmentTeam&amp;quot; do&lt;br /&gt;
        expect(AssignmentTeam.prototype).to be_instance_of(AssignmentTeam)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing assign_reviewer(reviewer)====&lt;br /&gt;
2 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1. When the team has an assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:reviewer) { build(:participant, id: 1) }&lt;br /&gt;
      it &amp;quot;returns an instance of ReviewResponseMap&amp;quot; do&lt;br /&gt;
        expect(assignment_team.assign_reviewer(reviewer)).to be_instance_of(ReviewResponseMap)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. When the assignment record can not be found&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment_team2) { build(:assignment_team, id: 2, parent_id: 2) }&lt;br /&gt;
      it &amp;quot;returns an exception&amp;quot; do&lt;br /&gt;
        expect { assignment_team2.assign_reviewer(reviewer) }.to raise_exception(ActiveRecord::RecordNotFound)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing reviewd_by?====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns true&amp;quot; do&lt;br /&gt;
        allow(ReviewResponseMap).to receive(:where).\&lt;br /&gt;
          with('reviewee_id = ? &amp;amp;&amp;amp; reviewer_id = ? &amp;amp;&amp;amp; reviewed_object_id = ?', 1, 1, 1).and_return([review_response_map])&lt;br /&gt;
        expect(assignment_team.reviewed_by?(reviewer)).to be true&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing topic====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:signed_up_team) { build(:signed_up_team, id: 1, team_id: 1, is_waitlisted: 0, topic_id: 1) }&lt;br /&gt;
      it &amp;quot;returns a topic id&amp;quot; do&lt;br /&gt;
        allow(SignedUpTeam).to receive(:find_by).with(team_id: 1, is_waitlisted: 0).and_return(signed_up_team)&lt;br /&gt;
        expect(assignment_team.topic).to eq(1)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Testing has_submissions? ====&lt;br /&gt;
3 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1.The team doesn't submit any file or link. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:team2) { build(:assignment_team, id: 2, parent_id: 1, name: &amp;quot;team2&amp;quot;, submitted_hyperlinks: &amp;quot;&amp;quot;) }&lt;br /&gt;
      it &amp;quot;no file or no link&amp;quot; do&lt;br /&gt;
        expect(team2.has_submissions?).to eq(false)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.The team submits a link instead of files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:team1) { build(:assignment_team, id: 1, parent_id: 1, name: &amp;quot;team1&amp;quot;, submitted_hyperlinks: &amp;quot;http://example.com&amp;quot;) }&lt;br /&gt;
      it &amp;quot;submitted hyperlinks&amp;quot; do&lt;br /&gt;
        expect(team1.has_submissions?).to eq(true)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. The team submits some files.  Stub is used to emulate the scenario that the team has submitted a file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
      it &amp;quot;returns true&amp;quot; do&lt;br /&gt;
        allow(team2).to receive(:submitted_files).and_return([double(:File)])&lt;br /&gt;
        expect(team2.has_submissions?).to be true&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing participants ====&lt;br /&gt;
&lt;br /&gt;
1. No participants in this team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#no participant' do&lt;br /&gt;
        expect(team1.participants).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. add some participants and get all the participants&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:student1) { build(:student, id: 1, name: 'johns', fullname: 'johns franklin') }&lt;br /&gt;
      let(:student2) { build(:student, id: 2, name: 'kate', fullname: 'kate moss') }&lt;br /&gt;
      let(:par1) { build(:participant, id: 1, parent_id: 1, user_id: 1) }&lt;br /&gt;
      let(:par2) { build(:participant, id: 2, parent_id: 1, user_id: 2) }&lt;br /&gt;
      it '#1 participant' do&lt;br /&gt;
        allow(AssignmentTeam).to receive(:users).with(id: team1.id).and_return([student1,student2])&lt;br /&gt;
        expect(team1.participants).to eq([par1, par2])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing add_participant ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#add participants' do&lt;br /&gt;
        expect(team1.add_participant(ass1.id, par1)).to be_instance_of(AssignmentParticipant)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing the delete and destroy====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#delete' do&lt;br /&gt;
        expect(team1.delete).to be_instance_of(AssignmentTeam)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#destroy' do&lt;br /&gt;
        expect(team1.destroy).to be_instance_of(AssignmentTeam)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing members====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#get_first_member' do&lt;br /&gt;
        allow(AssignmentTeam).to receive(:find_by).with(id: team1.id).and_return(team1)&lt;br /&gt;
        allow(team1).to receive(:participants).and_return([par1, par2])&lt;br /&gt;
        expect(AssignmentTeam.get_first_member(team1.id)).to eq(par1)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing import and export====&lt;br /&gt;
&lt;br /&gt;
1. import a team to a non-existing assignment and expect an exception&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     it '#import an nonexisting assignment id' do&lt;br /&gt;
        row = {teamname: &amp;quot;hello_world&amp;quot;, teammembers: %w[johns kate]}&lt;br /&gt;
        options = {has_teamname: &amp;quot;true_first&amp;quot;}&lt;br /&gt;
        expect { AssignmentTeam.import(row, 99_999, options) }.to raise_error(ImportError)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. export teams into a csv file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#export' do&lt;br /&gt;
        options = {}&lt;br /&gt;
        csv = CSV.open(&amp;quot;assignment_team_export.csv&amp;quot;, &amp;quot;w&amp;quot;)&lt;br /&gt;
        assignment_id = ass1.id&lt;br /&gt;
        allow(AssignmentTeam).to receive(:where).with(parent_id: assignment_id).and_return([team1, team2, team3])&lt;br /&gt;
        allow(TeamsUser).to receive(:where).and_return([par1, par2])&lt;br /&gt;
        expect(AssignmentTeam.export(csv, assignment_id, options)).to be_instance_of(CSV)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing copy====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#copy' do&lt;br /&gt;
        allow(TeamsUser).to receive(:where).with(team_id: team1.id).and_return([par1])&lt;br /&gt;
        expect(team1.copy(course1.id)).to eq([par1])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing hyperlinks====&lt;br /&gt;
2 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1. when the current teams submitted hyperlinks&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment_team) { build(:assignment_team) }&lt;br /&gt;
      context &amp;quot;when current teams submitted hyperlinks&amp;quot; do&lt;br /&gt;
        it &amp;quot;returns the hyperlinks submitted by the team&amp;quot; do&lt;br /&gt;
          expect(assignment_team.hyperlinks).to eq([&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;])&lt;br /&gt;
        end&lt;br /&gt;
       end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when current teams did not submit hyperlinks&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     let(:team_without_submitted_hyperlinks) { build(:assignment_team, submitted_hyperlinks: &amp;quot;&amp;quot;) }&lt;br /&gt;
     context &amp;quot;when current teams did not submit hyperlinks&amp;quot; do&lt;br /&gt;
       it &amp;quot;returns an empty array&amp;quot; do&lt;br /&gt;
         expect(team_without_submitted_hyperlinks.hyperlinks).to eq([])&lt;br /&gt;
       end&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing files====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     before :each do&lt;br /&gt;
       @directory = &amp;quot;a&amp;quot;&lt;br /&gt;
       @files = [&amp;quot;b.txt&amp;quot;, &amp;quot;c.java&amp;quot;, &amp;quot;d.txt&amp;quot;]&lt;br /&gt;
       @files1 = [&amp;quot;b/c&amp;quot;, &amp;quot;d/e&amp;quot;]&lt;br /&gt;
      end&lt;br /&gt;
      it &amp;quot;call the method in Dir&amp;quot; do&lt;br /&gt;
        expect(Dir).to receive(:[]).with(@directory + &amp;quot;/*&amp;quot;).and_return(@files)&lt;br /&gt;
        assignment_team.files(@directory)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing submit_hyperlink====&lt;br /&gt;
3 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1. when the hyperlink is empty&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     context &amp;quot;when the hyperlink is empty&amp;quot; do&lt;br /&gt;
      it &amp;quot;raise excpetion&amp;quot; do&lt;br /&gt;
        expect{(assignment_team.submit_hyperlink(&amp;quot;&amp;quot;))}.to raise_error('The hyperlink cannot be empty!')&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when the hyperlink is not empty and it calls the method on NET::HTTP&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      before :each do&lt;br /&gt;
        @link = &amp;quot;htp.aa/..&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
      it &amp;quot;call the method on NET::HTTP&amp;quot; do&lt;br /&gt;
         expect(Net::HTTP).to receive(:get_response).with(URI(@link+'http://'))&lt;br /&gt;
         assignment_team.submit_hyperlink(@link)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. when the hyperlink is not empty and it raises error&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;raise error&amp;quot; do&lt;br /&gt;
          allow(Net::HTTP).to receive(:get_response).with(URI(@link+'http://')).and_return(&amp;quot;402&amp;quot;)&lt;br /&gt;
          expect{(assignment_team.submit_hyperlink(@link))}.to raise_error('HTTP status code: 402')&lt;br /&gt;
       end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing remove_hyperlink====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      before :each do&lt;br /&gt;
        @hyperlink = &amp;quot;http://a.com&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
     it 'call the hyperlinks method' do&lt;br /&gt;
        expect(assignment_team).to receive(:hyperlinks).and_return([&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;])&lt;br /&gt;
        assignment_team.remove_hyperlink(@hyperlink)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing team====&lt;br /&gt;
3 test cases are designed to test this method&lt;br /&gt;
&lt;br /&gt;
1. when the participant is nil then this method will return nil&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      context 'when the participant is nil then this method will return nil' do&lt;br /&gt;
        it 'the participant is nil' do&lt;br /&gt;
          expect(AssignmentTeam.team(nil)).to eq(nil)&lt;br /&gt;
        end&lt;br /&gt;
       end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when it can find the participant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:participant) { build(:participant) }&lt;br /&gt;
      context 'can find the participant' do&lt;br /&gt;
        it 'send the correct user_id to the TeamsUser.where method' do&lt;br /&gt;
          expect(TeamsUser).to receive(:where).with(user_id: participant.user_id).and_return([team_user])&lt;br /&gt;
          AssignmentTeam.team(participant)&lt;br /&gt;
        end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. when the team user exists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:team_user) { build(:team_user) }&lt;br /&gt;
      context 'the team user exists' do&lt;br /&gt;
        before :each do&lt;br /&gt;
          allow(TeamsUser).to receive(:where).with(user_id: 1).and_return([team_user])&lt;br /&gt;
          AssignmentTeam.team(participant)&lt;br /&gt;
       end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing export_fields==== &lt;br /&gt;
2 test cases are designed to test this method&lt;br /&gt;
&lt;br /&gt;
1. when the team_name equals false&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'the team_name equals false' do&lt;br /&gt;
        options = {:team_name =&amp;gt;&amp;quot;false&amp;quot;}&lt;br /&gt;
        expect(AssignmentTeam.export_fields(options)).to eq([&amp;quot;Team Name&amp;quot;, &amp;quot;Team members&amp;quot;,&amp;quot;Assignment Name&amp;quot;])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when the team_name equals true&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'the team_name equals true' do&lt;br /&gt;
        options = {:team_name =&amp;gt;&amp;quot;true&amp;quot;}&lt;br /&gt;
        expect(AssignmentTeam.export_fields(options)).to eq([&amp;quot;Team Name&amp;quot;, &amp;quot;Assignment Name&amp;quot;])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing remove_team_by_id====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'send find to Assignment' do&lt;br /&gt;
        expect(AssignmentTeam).to receive(:find).with(1)&lt;br /&gt;
        AssignmentTeam.remove_team_by_id(1)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing path====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'can get the path' do&lt;br /&gt;
        expect(assignment_team.path).to eq(Rails.root.to_s+'/pg_data/instructor6/csc517/test/final_test/0')&lt;br /&gt;
        assignment_team.path&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing set_student_directory_num====&lt;br /&gt;
3 test cases are designed to test this method&lt;br /&gt;
&lt;br /&gt;
1. when directory_num &amp;gt;= 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     context 'directory_num &amp;gt;= 0' do&lt;br /&gt;
       it 'return when num&amp;gt;=0' do&lt;br /&gt;
         expect(assignment_team.set_student_directory_num).to eq(nil)&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when the directory_num does not exist and it gets max num&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     let(:assignment_team1) {build(:assignment_team, directory_num: nil)}&lt;br /&gt;
     it 'get max num' do&lt;br /&gt;
        expect(AssignmentTeam).to receive_message_chain(:where,:order,:first,:directory_num).with(parent_id:       assignment_team1.parent_id).with('directory_num desc').with(no_args).with(no_args).and_return(1)&lt;br /&gt;
        assignment_team1.set_student_directory_num&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. when the directory_num does not exist and it updates attribute&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'update attribute' do&lt;br /&gt;
        allow(AssignmentTeam).to receive_message_chain(:where,:order,:first,:directory_num).with(parent_id: assignment_team1.parent_id).with('directory_num desc').with(no_args).with(no_args).and_return(1)&lt;br /&gt;
        expect(assignment_team1).to receive(:update_attributes).with(directory_num: 2)&lt;br /&gt;
        assignment_team1.set_student_directory_num&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing received_any_peer_review?====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'send the request to where of the ResponseMap' do&lt;br /&gt;
        expect(ResponseMap).to receive(:where).with(reviewee_id: assignment_team.id, reviewed_object_id: assignment_team.parent_id).and_return([])&lt;br /&gt;
        assignment_team.received_any_peer_review?&lt;br /&gt;
    end&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Coverage==&lt;br /&gt;
There is screenshot of the coverage page.&lt;br /&gt;
[https://drive.google.com/open?id=12jHYbHoL_MpjnM1tdy52DVjqasGmnHie]&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1848_Write_unit_tests_for_assignment_team&amp;diff=119243</id>
		<title>E1848 Write unit tests for assignment team</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1848_Write_unit_tests_for_assignment_team&amp;diff=119243"/>
		<updated>2018-11-10T03:05:25Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For this progect, the goal is to wirte up unit tests for assignment_team.rb&lt;br /&gt;
&lt;br /&gt;
==Project Introduction==&lt;br /&gt;
====Background====&lt;br /&gt;
assignment_team.rb is the child class of team.rb. It is used to handle multiple problems relates to team in the assignment. Its responsibilities can mainly fall in three categories: participant of the team, reviews of the team, and the operation for the whole team. For the participant, it can be used to decide if a participant is in a given team and view the members of the team or remove a member. For reviews, it deals with the problem that getting the reviews for the team, assign reviewer for the team and get if the team has been reviewed by a specific reviewers. For the whole team, we can delete the team or view the scores, etc. by using this class.&lt;br /&gt;
====Motivation====&lt;br /&gt;
Make sure assignment_team.rb provides all functions as expected is important for the whole system. It requires enough tests for all the functions and the edge cases may occur. However, there are not enough unit tests for this model in expertiza. The following tests are added to assignment_team.rb in this project.&lt;br /&gt;
To make sure we can cover as many conditions as we can(the objective for this project is getting at least 90% coverage rate), we first design test cases. The following factors are taking into considerations: the expected functions for each method, the possible edge cases and the pre-conditions for each cases. Then we get the unit test plan and complete the test following test steps.&lt;br /&gt;
&lt;br /&gt;
==Memebers of Project==&lt;br /&gt;
Jianshu Zhang&lt;br /&gt;
&lt;br /&gt;
Wanjing Kuang&lt;br /&gt;
&lt;br /&gt;
Wei Wu&lt;br /&gt;
&lt;br /&gt;
==Mentor==&lt;br /&gt;
Zhewei Hu&lt;br /&gt;
&lt;br /&gt;
==File Involvement==&lt;br /&gt;
1.app/models/assignment_team.rb&lt;br /&gt;
&lt;br /&gt;
2.spec/models/assignment_team_spec.rb&lt;br /&gt;
&lt;br /&gt;
3.spec/factories/factories.rb&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
1. two test cases for method &amp;quot;include?&amp;quot;: When the team includes a given participant and When the team doesn't include a given participant&lt;br /&gt;
&lt;br /&gt;
2. one test case for method &amp;quot;parent_model&amp;quot;: It returns &amp;quot;Assignment&amp;quot; when the method is called.&lt;br /&gt;
&lt;br /&gt;
3. two test cases for method &amp;quot;self.parent_model(id)&amp;quot;: When it's given a correct id and When it's given an incorrect id.&lt;br /&gt;
&lt;br /&gt;
4. one test case for method &amp;quot;fullname&amp;quot;: When the participant has an full name.&lt;br /&gt;
&lt;br /&gt;
5. one test case for method &amp;quot;review_map_type&amp;quot;: It returns ReviewResponseMap when the method is called.&lt;br /&gt;
&lt;br /&gt;
6. one test case for method &amp;quot;self.prototype&amp;quot;: It returns an new instance of AssignmentTeam when the method is called.&lt;br /&gt;
&lt;br /&gt;
7. two test cases for method &amp;quot;assign_reviewer(reviewer)&amp;quot;: When the team has an assignment and When the assignment record can not be found.&lt;br /&gt;
&lt;br /&gt;
8. one test case for method &amp;quot;reviewd_by?&amp;quot;: When it gets correct reviewer and returns true as an result.&lt;br /&gt;
&lt;br /&gt;
9. one test case for method &amp;quot; topic&amp;quot;: When it returns the correct id.&lt;br /&gt;
&lt;br /&gt;
10. three test cases for method &amp;quot;has_submissions?&amp;quot;: When the team doesn't submit any file or link, when team submits a link instead of files and &lt;br /&gt;
when the team submits some files.&lt;br /&gt;
&lt;br /&gt;
11. two test cases for method &amp;quot;participants&amp;quot;: When no participants in this team and When adding some participants and get all the participants.&lt;br /&gt;
&lt;br /&gt;
12. one test case for method &amp;quot;add_participant&amp;quot;: When adding an participant, it will return an instance of AssignmentParticipant.&lt;br /&gt;
&lt;br /&gt;
13. two test cases for method &amp;quot; delete and destroy&amp;quot;: Testing delete and destory.&lt;br /&gt;
&lt;br /&gt;
14. two test cases for method &amp;quot;hyoerlinks&amp;quot;: the current teams submitted hyperlinks and not submitted the hyperlinks&lt;br /&gt;
&lt;br /&gt;
15.&lt;br /&gt;
&lt;br /&gt;
==Unit Tests==&lt;br /&gt;
&lt;br /&gt;
===Unit Test Tool===&lt;br /&gt;
Rspec&lt;br /&gt;
&lt;br /&gt;
===Unit Test File===&lt;br /&gt;
expertiza/spec/models/assignment_team_spec.rb&lt;br /&gt;
&lt;br /&gt;
===Unit Test Steps===&lt;br /&gt;
&lt;br /&gt;
*Create unit test cases in the assignment_team_spec.rb&lt;br /&gt;
&lt;br /&gt;
*run rspec spec/models/assignment_team_spec.rb under expertiza directory&lt;br /&gt;
&lt;br /&gt;
*the rspec outputs the number of test cases that are passed and those that are failed.&lt;br /&gt;
&lt;br /&gt;
===Unit Test Cases===&lt;br /&gt;
&lt;br /&gt;
====Testing include?====&lt;br /&gt;
2 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1. The team includes a given participant.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment_team) { build(:assignment_team, id: 1, parent_id: 1, name: &amp;quot;full name&amp;quot;) }&lt;br /&gt;
      let(:participant1) { build(:participant, id: 2, user: user) }&lt;br /&gt;
      it &amp;quot;returns true&amp;quot; do&lt;br /&gt;
        allow(assignment_team).to receive(:add_participants).with(participant1)&lt;br /&gt;
        expect(assignment_team.includes?(participant1))&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. The team doesn't include a given participant.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment_team) { build(:assignment_team, id: 1, parent_id: 1, name: &amp;quot;full name&amp;quot;) }&lt;br /&gt;
      let(:participant1) { build(:participant, id: 2, user: user) }&lt;br /&gt;
      let(:participant2) { build(:participant, id: 3) }&lt;br /&gt;
      it &amp;quot;returns false&amp;quot; do&lt;br /&gt;
        allow(assignment_team).to receive(:add_participants).with(participant1)&lt;br /&gt;
        expect(assignment_team.includes?(participant2))&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing parent_model====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns Assignment as result&amp;quot; do&lt;br /&gt;
        expect(assignment_team.parent_model).to eq(&amp;quot;Assignment&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing self.parent_model(id)====&lt;br /&gt;
2 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1.When it's given a correct id.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment) { build(:assignment, id: 1) }&lt;br /&gt;
      it &amp;quot;returns an assignemt&amp;quot; do&lt;br /&gt;
        allow(Assignment).to receive(:find).with(1).and_return(assignment)&lt;br /&gt;
        expect(AssignmentTeam.parent_model(1)).to eq(assignment)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.When it's given an incorrect id.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;raises an exception&amp;quot; do&lt;br /&gt;
        expect { AssignmentTeam.parent_model 2 }.to raise_exception(ActiveRecord::RecordNotFound)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing fullname====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns the full name of assignment team&amp;quot; do&lt;br /&gt;
        expect(assignment_team.fullname).to eq(&amp;quot;full name&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing review_map_type====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns ReviewResponseMap as result&amp;quot; do&lt;br /&gt;
        expect(assignment_team.review_map_type).to eq(&amp;quot;ReviewResponseMap&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing self.prototype====&lt;br /&gt;
1 test cases is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns an new instance of AssignmentTeam&amp;quot; do&lt;br /&gt;
        expect(AssignmentTeam.prototype).to be_instance_of(AssignmentTeam)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing assign_reviewer(reviewer)====&lt;br /&gt;
2 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1. When the team has an assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:reviewer) { build(:participant, id: 1) }&lt;br /&gt;
      it &amp;quot;returns an instance of ReviewResponseMap&amp;quot; do&lt;br /&gt;
        expect(assignment_team.assign_reviewer(reviewer)).to be_instance_of(ReviewResponseMap)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. When the assignment record can not be found&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment_team2) { build(:assignment_team, id: 2, parent_id: 2) }&lt;br /&gt;
      it &amp;quot;returns an exception&amp;quot; do&lt;br /&gt;
        expect { assignment_team2.assign_reviewer(reviewer) }.to raise_exception(ActiveRecord::RecordNotFound)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing reviewd_by?====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns true&amp;quot; do&lt;br /&gt;
        allow(ReviewResponseMap).to receive(:where).\&lt;br /&gt;
          with('reviewee_id = ? &amp;amp;&amp;amp; reviewer_id = ? &amp;amp;&amp;amp; reviewed_object_id = ?', 1, 1, 1).and_return([review_response_map])&lt;br /&gt;
        expect(assignment_team.reviewed_by?(reviewer)).to be true&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing topic====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:signed_up_team) { build(:signed_up_team, id: 1, team_id: 1, is_waitlisted: 0, topic_id: 1) }&lt;br /&gt;
      it &amp;quot;returns a topic id&amp;quot; do&lt;br /&gt;
        allow(SignedUpTeam).to receive(:find_by).with(team_id: 1, is_waitlisted: 0).and_return(signed_up_team)&lt;br /&gt;
        expect(assignment_team.topic).to eq(1)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Testing has_submissions? ====&lt;br /&gt;
3 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1.The team doesn't submit any file or link. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:team2) { build(:assignment_team, id: 2, parent_id: 1, name: &amp;quot;team2&amp;quot;, submitted_hyperlinks: &amp;quot;&amp;quot;) }&lt;br /&gt;
      it &amp;quot;no file or no link&amp;quot; do&lt;br /&gt;
        expect(team2.has_submissions?).to eq(false)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.The team submits a link instead of files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:team1) { build(:assignment_team, id: 1, parent_id: 1, name: &amp;quot;team1&amp;quot;, submitted_hyperlinks: &amp;quot;http://example.com&amp;quot;) }&lt;br /&gt;
      it &amp;quot;submitted hyperlinks&amp;quot; do&lt;br /&gt;
        expect(team1.has_submissions?).to eq(true)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. The team submits some files.  Stub is used to emulate the scenario that the team has submitted a file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
      it &amp;quot;returns true&amp;quot; do&lt;br /&gt;
        allow(team2).to receive(:submitted_files).and_return([double(:File)])&lt;br /&gt;
        expect(team2.has_submissions?).to be true&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing participants ====&lt;br /&gt;
&lt;br /&gt;
1. No participants in this team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#no participant' do&lt;br /&gt;
        expect(team1.participants).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. add some participants and get all the participants&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:student1) { build(:student, id: 1, name: 'johns', fullname: 'johns franklin') }&lt;br /&gt;
      let(:student2) { build(:student, id: 2, name: 'kate', fullname: 'kate moss') }&lt;br /&gt;
      let(:par1) { build(:participant, id: 1, parent_id: 1, user_id: 1) }&lt;br /&gt;
      let(:par2) { build(:participant, id: 2, parent_id: 1, user_id: 2) }&lt;br /&gt;
      it '#1 participant' do&lt;br /&gt;
        allow(AssignmentTeam).to receive(:users).with(id: team1.id).and_return([student1,student2])&lt;br /&gt;
        expect(team1.participants).to eq([par1, par2])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing add_participant ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#add participants' do&lt;br /&gt;
        expect(team1.add_participant(ass1.id, par1)).to be_instance_of(AssignmentParticipant)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing the delete and destroy====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#delete' do&lt;br /&gt;
        expect(team1.delete).to be_instance_of(AssignmentTeam)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#destroy' do&lt;br /&gt;
        expect(team1.destroy).to be_instance_of(AssignmentTeam)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing members====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#get_first_member' do&lt;br /&gt;
        allow(AssignmentTeam).to receive(:find_by).with(id: team1.id).and_return(team1)&lt;br /&gt;
        allow(team1).to receive(:participants).and_return([par1, par2])&lt;br /&gt;
        expect(AssignmentTeam.get_first_member(team1.id)).to eq(par1)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing import and export====&lt;br /&gt;
&lt;br /&gt;
1. import a team to a non-existing assignment and expect an exception&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     it '#import an nonexisting assignment id' do&lt;br /&gt;
        row = {teamname: &amp;quot;hello_world&amp;quot;, teammembers: %w[johns kate]}&lt;br /&gt;
        options = {has_teamname: &amp;quot;true_first&amp;quot;}&lt;br /&gt;
        expect { AssignmentTeam.import(row, 99_999, options) }.to raise_error(ImportError)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. export teams into a csv file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#export' do&lt;br /&gt;
        options = {}&lt;br /&gt;
        csv = CSV.open(&amp;quot;assignment_team_export.csv&amp;quot;, &amp;quot;w&amp;quot;)&lt;br /&gt;
        assignment_id = ass1.id&lt;br /&gt;
        allow(AssignmentTeam).to receive(:where).with(parent_id: assignment_id).and_return([team1, team2, team3])&lt;br /&gt;
        allow(TeamsUser).to receive(:where).and_return([par1, par2])&lt;br /&gt;
        expect(AssignmentTeam.export(csv, assignment_id, options)).to be_instance_of(CSV)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing copy====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#copy' do&lt;br /&gt;
        allow(TeamsUser).to receive(:where).with(team_id: team1.id).and_return([par1])&lt;br /&gt;
        expect(team1.copy(course1.id)).to eq([par1])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing hyperlinks====&lt;br /&gt;
2 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1. when the current teams submitted hyperlinks&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment_team) { build(:assignment_team) }&lt;br /&gt;
      context &amp;quot;when current teams submitted hyperlinks&amp;quot; do&lt;br /&gt;
        it &amp;quot;returns the hyperlinks submitted by the team&amp;quot; do&lt;br /&gt;
          expect(assignment_team.hyperlinks).to eq([&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;])&lt;br /&gt;
        end&lt;br /&gt;
       end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when current teams did not submit hyperlinks&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     let(:team_without_submitted_hyperlinks) { build(:assignment_team, submitted_hyperlinks: &amp;quot;&amp;quot;) }&lt;br /&gt;
     context &amp;quot;when current teams did not submit hyperlinks&amp;quot; do&lt;br /&gt;
       it &amp;quot;returns an empty array&amp;quot; do&lt;br /&gt;
         expect(team_without_submitted_hyperlinks.hyperlinks).to eq([])&lt;br /&gt;
       end&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing files====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     before :each do&lt;br /&gt;
       @directory = &amp;quot;a&amp;quot;&lt;br /&gt;
       @files = [&amp;quot;b.txt&amp;quot;, &amp;quot;c.java&amp;quot;, &amp;quot;d.txt&amp;quot;]&lt;br /&gt;
       @files1 = [&amp;quot;b/c&amp;quot;, &amp;quot;d/e&amp;quot;]&lt;br /&gt;
      end&lt;br /&gt;
      it &amp;quot;call the method in Dir&amp;quot; do&lt;br /&gt;
        expect(Dir).to receive(:[]).with(@directory + &amp;quot;/*&amp;quot;).and_return(@files)&lt;br /&gt;
        assignment_team.files(@directory)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing submit_hyperlink====&lt;br /&gt;
3 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1. when the hyperlink is empty&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     context &amp;quot;when the hyperlink is empty&amp;quot; do&lt;br /&gt;
      it &amp;quot;raise excpetion&amp;quot; do&lt;br /&gt;
        expect{(assignment_team.submit_hyperlink(&amp;quot;&amp;quot;))}.to raise_error('The hyperlink cannot be empty!')&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when the hyperlink is not empty and it calls the method on NET::HTTP&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      before :each do&lt;br /&gt;
        @link = &amp;quot;htp.aa/..&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
      it &amp;quot;call the method on NET::HTTP&amp;quot; do&lt;br /&gt;
         expect(Net::HTTP).to receive(:get_response).with(URI(@link+'http://'))&lt;br /&gt;
         assignment_team.submit_hyperlink(@link)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. when the hyperlink is not empty and it raises error&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;raise error&amp;quot; do&lt;br /&gt;
          allow(Net::HTTP).to receive(:get_response).with(URI(@link+'http://')).and_return(&amp;quot;402&amp;quot;)&lt;br /&gt;
          expect{(assignment_team.submit_hyperlink(@link))}.to raise_error('HTTP status code: 402')&lt;br /&gt;
       end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing remove_hyperlink====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      before :each do&lt;br /&gt;
        @hyperlink = &amp;quot;http://a.com&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
     it 'call the hyperlinks method' do&lt;br /&gt;
        expect(assignment_team).to receive(:hyperlinks).and_return([&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;])&lt;br /&gt;
        assignment_team.remove_hyperlink(@hyperlink)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing team====&lt;br /&gt;
3 test cases are designed to test this method&lt;br /&gt;
&lt;br /&gt;
1. when the participant is nil then this method will return nil&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      context 'when the participant is nil then this method will return nil' do&lt;br /&gt;
        it 'the participant is nil' do&lt;br /&gt;
          expect(AssignmentTeam.team(nil)).to eq(nil)&lt;br /&gt;
        end&lt;br /&gt;
       end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when it can find the participant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:participant) { build(:participant) }&lt;br /&gt;
      context 'can find the participant' do&lt;br /&gt;
        it 'send the correct user_id to the TeamsUser.where method' do&lt;br /&gt;
          expect(TeamsUser).to receive(:where).with(user_id: participant.user_id).and_return([team_user])&lt;br /&gt;
          AssignmentTeam.team(participant)&lt;br /&gt;
        end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. when the team user exists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:team_user) { build(:team_user) }&lt;br /&gt;
      context 'the team user exists' do&lt;br /&gt;
        before :each do&lt;br /&gt;
          allow(TeamsUser).to receive(:where).with(user_id: 1).and_return([team_user])&lt;br /&gt;
          AssignmentTeam.team(participant)&lt;br /&gt;
       end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing export_fields==== &lt;br /&gt;
2 test cases are designed to test this method&lt;br /&gt;
&lt;br /&gt;
1. when the team_name equals false&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'the team_name equals false' do&lt;br /&gt;
        options = {:team_name =&amp;gt;&amp;quot;false&amp;quot;}&lt;br /&gt;
        expect(AssignmentTeam.export_fields(options)).to eq([&amp;quot;Team Name&amp;quot;, &amp;quot;Team members&amp;quot;,&amp;quot;Assignment Name&amp;quot;])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when the team_name equals true&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'the team_name equals true' do&lt;br /&gt;
        options = {:team_name =&amp;gt;&amp;quot;true&amp;quot;}&lt;br /&gt;
        expect(AssignmentTeam.export_fields(options)).to eq([&amp;quot;Team Name&amp;quot;, &amp;quot;Assignment Name&amp;quot;])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing remove_team_by_id====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'send find to Assignment' do&lt;br /&gt;
        expect(AssignmentTeam).to receive(:find).with(1)&lt;br /&gt;
        AssignmentTeam.remove_team_by_id(1)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing path====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'can get the path' do&lt;br /&gt;
        expect(assignment_team.path).to eq(Rails.root.to_s+'/pg_data/instructor6/csc517/test/final_test/0')&lt;br /&gt;
        assignment_team.path&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing set_student_directory_num====&lt;br /&gt;
3 test cases are designed to test this method&lt;br /&gt;
&lt;br /&gt;
1. when directory_num &amp;gt;= 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     context 'directory_num &amp;gt;= 0' do&lt;br /&gt;
       it 'return when num&amp;gt;=0' do&lt;br /&gt;
         expect(assignment_team.set_student_directory_num).to eq(nil)&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when the directory_num does not exist and it gets max num&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     let(:assignment_team1) {build(:assignment_team, directory_num: nil)}&lt;br /&gt;
     it 'get max num' do&lt;br /&gt;
        expect(AssignmentTeam).to receive_message_chain(:where,:order,:first,:directory_num).with(parent_id:       assignment_team1.parent_id).with('directory_num desc').with(no_args).with(no_args).and_return(1)&lt;br /&gt;
        assignment_team1.set_student_directory_num&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. when the directory_num does not exist and it updates attribute&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'update attribute' do&lt;br /&gt;
        allow(AssignmentTeam).to receive_message_chain(:where,:order,:first,:directory_num).with(parent_id: assignment_team1.parent_id).with('directory_num desc').with(no_args).with(no_args).and_return(1)&lt;br /&gt;
        expect(assignment_team1).to receive(:update_attributes).with(directory_num: 2)&lt;br /&gt;
        assignment_team1.set_student_directory_num&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing received_any_peer_review?====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'send the request to where of the ResponseMap' do&lt;br /&gt;
        expect(ResponseMap).to receive(:where).with(reviewee_id: assignment_team.id, reviewed_object_id: assignment_team.parent_id).and_return([])&lt;br /&gt;
        assignment_team.received_any_peer_review?&lt;br /&gt;
    end&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Coverage==&lt;br /&gt;
There is screenshot of the coverage page.&lt;br /&gt;
[https://drive.google.com/open?id=12jHYbHoL_MpjnM1tdy52DVjqasGmnHie]&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1848_Write_unit_tests_for_assignment_team&amp;diff=119240</id>
		<title>E1848 Write unit tests for assignment team</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1848_Write_unit_tests_for_assignment_team&amp;diff=119240"/>
		<updated>2018-11-10T03:03:07Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* Motivation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For this progect, the goal is to wirte up unit tests for assignment_team.rb&lt;br /&gt;
&lt;br /&gt;
==Project Introduction==&lt;br /&gt;
====Background====&lt;br /&gt;
assignment_team.rb is the child class of team.rb. It is used to handle multiple problems relates to team in the assignment. Its responsibilities can mainly fall in three categories: participant of the team, reviews of the team, and the operation for the whole team. For the participant, it can be used to decide if a participant is in a given team and view the members of the team or remove a member. For reviews, it deals with the problem that getting the reviews for the team, assign reviewer for the team and get if the team has been reviewed by a specific reviewers. For the whole team, we can delete the team or view the scores, etc. by using this class.&lt;br /&gt;
====Motivation====&lt;br /&gt;
Make sure assignment_team.rb provides all functions as expected is important for the whole system. It requires enough tests for all the functions and the edge cases may occur. However, there are not enough unit tests for this model in expertiza. The following tests are added to assignment_team.rb in this project.&lt;br /&gt;
To make sure we can cover as many conditions as we can(the objective for this project is getting at least 90% coverage rate), we first design test cases. The following factors are taking into considerations: the expected functions for each method, the possible edge cases and the pre-conditions for each cases. Then we get the unit test plan and complete the test following test steps.&lt;br /&gt;
&lt;br /&gt;
==Memebers of Project==&lt;br /&gt;
Jianshu Zhang&lt;br /&gt;
&lt;br /&gt;
Wanjing Kuang&lt;br /&gt;
&lt;br /&gt;
Wei Wu&lt;br /&gt;
&lt;br /&gt;
==Mentor==&lt;br /&gt;
Zhewei Hu&lt;br /&gt;
&lt;br /&gt;
==File Involvement==&lt;br /&gt;
1.app/models/assignment_team.rb&lt;br /&gt;
&lt;br /&gt;
2.spec/models/assignment_team_spec.rb&lt;br /&gt;
&lt;br /&gt;
3.spec/factories/factories.rb&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
1. two test cases for method &amp;quot;include?&amp;quot;: When the team includes a given participant and When the team doesn't include a given participant&lt;br /&gt;
&lt;br /&gt;
2. one test case for method &amp;quot;parent_model&amp;quot;: It returns &amp;quot;Assignment&amp;quot; when the method is called.&lt;br /&gt;
&lt;br /&gt;
3. two test cases for method &amp;quot;self.parent_model(id)&amp;quot;: When it's given a correct id and When it's given an incorrect id.&lt;br /&gt;
&lt;br /&gt;
4. one test case for method &amp;quot;fullname&amp;quot;: When the participant has an full name.&lt;br /&gt;
&lt;br /&gt;
5. one test case for method &amp;quot;review_map_type&amp;quot;: It returns ReviewResponseMap when the method is called.&lt;br /&gt;
&lt;br /&gt;
6. one test case for method &amp;quot;self.prototype&amp;quot;: It returns an new instance of AssignmentTeam when the method is called.&lt;br /&gt;
&lt;br /&gt;
7. two test cases for method &amp;quot;assign_reviewer(reviewer)&amp;quot;: When the team has an assignment and When the assignment record can not be found.&lt;br /&gt;
&lt;br /&gt;
8. one test case for method &amp;quot;reviewd_by?&amp;quot;: When it gets correct reviewer and returns true as an result.&lt;br /&gt;
&lt;br /&gt;
9. one test case for method &amp;quot; topic&amp;quot;: When it returns the correct id.&lt;br /&gt;
&lt;br /&gt;
10. three test cases for method &amp;quot;has_submissions?&amp;quot;: When the team doesn't submit any file or link, when team submits a link instead of files and &lt;br /&gt;
when the team submits some files.&lt;br /&gt;
&lt;br /&gt;
11. two test cases for method &amp;quot;participants&amp;quot;: When no participants in this team and When adding some participants and get all the participants.&lt;br /&gt;
&lt;br /&gt;
12. one test case for method &amp;quot;add_participant&amp;quot;: When adding an participant, it will return an instance of AssignmentParticipant.&lt;br /&gt;
&lt;br /&gt;
13. two test cases for method &amp;quot; delete and destroy&amp;quot;: Testing delete and destory.&lt;br /&gt;
&lt;br /&gt;
==Unit Tests==&lt;br /&gt;
&lt;br /&gt;
===Unit Test Tool===&lt;br /&gt;
Rspec&lt;br /&gt;
&lt;br /&gt;
===Unit Test File===&lt;br /&gt;
expertiza/spec/models/assignment_team_spec.rb&lt;br /&gt;
&lt;br /&gt;
===Unit Test Steps===&lt;br /&gt;
&lt;br /&gt;
*Create unit test cases in the assignment_team_spec.rb&lt;br /&gt;
&lt;br /&gt;
*run rspec spec/models/assignment_team_spec.rb under expertiza directory&lt;br /&gt;
&lt;br /&gt;
*the rspec outputs the number of test cases that are passed and those that are failed.&lt;br /&gt;
&lt;br /&gt;
===Unit Test Cases===&lt;br /&gt;
&lt;br /&gt;
====Testing include?====&lt;br /&gt;
2 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1. The team includes a given participant.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment_team) { build(:assignment_team, id: 1, parent_id: 1, name: &amp;quot;full name&amp;quot;) }&lt;br /&gt;
      let(:participant1) { build(:participant, id: 2, user: user) }&lt;br /&gt;
      it &amp;quot;returns true&amp;quot; do&lt;br /&gt;
        allow(assignment_team).to receive(:add_participants).with(participant1)&lt;br /&gt;
        expect(assignment_team.includes?(participant1))&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. The team doesn't include a given participant.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment_team) { build(:assignment_team, id: 1, parent_id: 1, name: &amp;quot;full name&amp;quot;) }&lt;br /&gt;
      let(:participant1) { build(:participant, id: 2, user: user) }&lt;br /&gt;
      let(:participant2) { build(:participant, id: 3) }&lt;br /&gt;
      it &amp;quot;returns false&amp;quot; do&lt;br /&gt;
        allow(assignment_team).to receive(:add_participants).with(participant1)&lt;br /&gt;
        expect(assignment_team.includes?(participant2))&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing parent_model====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns Assignment as result&amp;quot; do&lt;br /&gt;
        expect(assignment_team.parent_model).to eq(&amp;quot;Assignment&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing self.parent_model(id)====&lt;br /&gt;
2 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1.When it's given a correct id.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment) { build(:assignment, id: 1) }&lt;br /&gt;
      it &amp;quot;returns an assignemt&amp;quot; do&lt;br /&gt;
        allow(Assignment).to receive(:find).with(1).and_return(assignment)&lt;br /&gt;
        expect(AssignmentTeam.parent_model(1)).to eq(assignment)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.When it's given an incorrect id.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;raises an exception&amp;quot; do&lt;br /&gt;
        expect { AssignmentTeam.parent_model 2 }.to raise_exception(ActiveRecord::RecordNotFound)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing fullname====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns the full name of assignment team&amp;quot; do&lt;br /&gt;
        expect(assignment_team.fullname).to eq(&amp;quot;full name&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing review_map_type====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns ReviewResponseMap as result&amp;quot; do&lt;br /&gt;
        expect(assignment_team.review_map_type).to eq(&amp;quot;ReviewResponseMap&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing self.prototype====&lt;br /&gt;
1 test cases is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns an new instance of AssignmentTeam&amp;quot; do&lt;br /&gt;
        expect(AssignmentTeam.prototype).to be_instance_of(AssignmentTeam)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing assign_reviewer(reviewer)====&lt;br /&gt;
2 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1. When the team has an assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:reviewer) { build(:participant, id: 1) }&lt;br /&gt;
      it &amp;quot;returns an instance of ReviewResponseMap&amp;quot; do&lt;br /&gt;
        expect(assignment_team.assign_reviewer(reviewer)).to be_instance_of(ReviewResponseMap)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. When the assignment record can not be found&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment_team2) { build(:assignment_team, id: 2, parent_id: 2) }&lt;br /&gt;
      it &amp;quot;returns an exception&amp;quot; do&lt;br /&gt;
        expect { assignment_team2.assign_reviewer(reviewer) }.to raise_exception(ActiveRecord::RecordNotFound)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing reviewd_by?====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns true&amp;quot; do&lt;br /&gt;
        allow(ReviewResponseMap).to receive(:where).\&lt;br /&gt;
          with('reviewee_id = ? &amp;amp;&amp;amp; reviewer_id = ? &amp;amp;&amp;amp; reviewed_object_id = ?', 1, 1, 1).and_return([review_response_map])&lt;br /&gt;
        expect(assignment_team.reviewed_by?(reviewer)).to be true&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing topic====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:signed_up_team) { build(:signed_up_team, id: 1, team_id: 1, is_waitlisted: 0, topic_id: 1) }&lt;br /&gt;
      it &amp;quot;returns a topic id&amp;quot; do&lt;br /&gt;
        allow(SignedUpTeam).to receive(:find_by).with(team_id: 1, is_waitlisted: 0).and_return(signed_up_team)&lt;br /&gt;
        expect(assignment_team.topic).to eq(1)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Testing has_submissions? ====&lt;br /&gt;
3 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1.The team doesn't submit any file or link. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:team2) { build(:assignment_team, id: 2, parent_id: 1, name: &amp;quot;team2&amp;quot;, submitted_hyperlinks: &amp;quot;&amp;quot;) }&lt;br /&gt;
      it &amp;quot;no file or no link&amp;quot; do&lt;br /&gt;
        expect(team2.has_submissions?).to eq(false)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.The team submits a link instead of files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:team1) { build(:assignment_team, id: 1, parent_id: 1, name: &amp;quot;team1&amp;quot;, submitted_hyperlinks: &amp;quot;http://example.com&amp;quot;) }&lt;br /&gt;
      it &amp;quot;submitted hyperlinks&amp;quot; do&lt;br /&gt;
        expect(team1.has_submissions?).to eq(true)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. The team submits some files.  Stub is used to emulate the scenario that the team has submitted a file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
      it &amp;quot;returns true&amp;quot; do&lt;br /&gt;
        allow(team2).to receive(:submitted_files).and_return([double(:File)])&lt;br /&gt;
        expect(team2.has_submissions?).to be true&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing participants ====&lt;br /&gt;
&lt;br /&gt;
1. No participants in this team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#no participant' do&lt;br /&gt;
        expect(team1.participants).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. add some participants and get all the participants&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:student1) { build(:student, id: 1, name: 'johns', fullname: 'johns franklin') }&lt;br /&gt;
      let(:student2) { build(:student, id: 2, name: 'kate', fullname: 'kate moss') }&lt;br /&gt;
      let(:par1) { build(:participant, id: 1, parent_id: 1, user_id: 1) }&lt;br /&gt;
      let(:par2) { build(:participant, id: 2, parent_id: 1, user_id: 2) }&lt;br /&gt;
      it '#1 participant' do&lt;br /&gt;
        allow(AssignmentTeam).to receive(:users).with(id: team1.id).and_return([student1,student2])&lt;br /&gt;
        expect(team1.participants).to eq([par1, par2])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing add_participant ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#add participants' do&lt;br /&gt;
        expect(team1.add_participant(ass1.id, par1)).to be_instance_of(AssignmentParticipant)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing the delete and destroy====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#delete' do&lt;br /&gt;
        expect(team1.delete).to be_instance_of(AssignmentTeam)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#destroy' do&lt;br /&gt;
        expect(team1.destroy).to be_instance_of(AssignmentTeam)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing members====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#get_first_member' do&lt;br /&gt;
        allow(AssignmentTeam).to receive(:find_by).with(id: team1.id).and_return(team1)&lt;br /&gt;
        allow(team1).to receive(:participants).and_return([par1, par2])&lt;br /&gt;
        expect(AssignmentTeam.get_first_member(team1.id)).to eq(par1)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing import and export====&lt;br /&gt;
&lt;br /&gt;
1. import a team to a non-existing assignment and expect an exception&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     it '#import an nonexisting assignment id' do&lt;br /&gt;
        row = {teamname: &amp;quot;hello_world&amp;quot;, teammembers: %w[johns kate]}&lt;br /&gt;
        options = {has_teamname: &amp;quot;true_first&amp;quot;}&lt;br /&gt;
        expect { AssignmentTeam.import(row, 99_999, options) }.to raise_error(ImportError)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. export teams into a csv file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#export' do&lt;br /&gt;
        options = {}&lt;br /&gt;
        csv = CSV.open(&amp;quot;assignment_team_export.csv&amp;quot;, &amp;quot;w&amp;quot;)&lt;br /&gt;
        assignment_id = ass1.id&lt;br /&gt;
        allow(AssignmentTeam).to receive(:where).with(parent_id: assignment_id).and_return([team1, team2, team3])&lt;br /&gt;
        allow(TeamsUser).to receive(:where).and_return([par1, par2])&lt;br /&gt;
        expect(AssignmentTeam.export(csv, assignment_id, options)).to be_instance_of(CSV)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing copy====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#copy' do&lt;br /&gt;
        allow(TeamsUser).to receive(:where).with(team_id: team1.id).and_return([par1])&lt;br /&gt;
        expect(team1.copy(course1.id)).to eq([par1])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing hyperlinks====&lt;br /&gt;
2 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1. when the current teams submitted hyperlinks&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment_team) { build(:assignment_team) }&lt;br /&gt;
      context &amp;quot;when current teams submitted hyperlinks&amp;quot; do&lt;br /&gt;
        it &amp;quot;returns the hyperlinks submitted by the team&amp;quot; do&lt;br /&gt;
          expect(assignment_team.hyperlinks).to eq([&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;])&lt;br /&gt;
        end&lt;br /&gt;
       end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when current teams did not submit hyperlinks&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     let(:team_without_submitted_hyperlinks) { build(:assignment_team, submitted_hyperlinks: &amp;quot;&amp;quot;) }&lt;br /&gt;
     context &amp;quot;when current teams did not submit hyperlinks&amp;quot; do&lt;br /&gt;
       it &amp;quot;returns an empty array&amp;quot; do&lt;br /&gt;
         expect(team_without_submitted_hyperlinks.hyperlinks).to eq([])&lt;br /&gt;
       end&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing files====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     before :each do&lt;br /&gt;
       @directory = &amp;quot;a&amp;quot;&lt;br /&gt;
       @files = [&amp;quot;b.txt&amp;quot;, &amp;quot;c.java&amp;quot;, &amp;quot;d.txt&amp;quot;]&lt;br /&gt;
       @files1 = [&amp;quot;b/c&amp;quot;, &amp;quot;d/e&amp;quot;]&lt;br /&gt;
      end&lt;br /&gt;
      it &amp;quot;call the method in Dir&amp;quot; do&lt;br /&gt;
        expect(Dir).to receive(:[]).with(@directory + &amp;quot;/*&amp;quot;).and_return(@files)&lt;br /&gt;
        assignment_team.files(@directory)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing submit_hyperlink====&lt;br /&gt;
3 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1. when the hyperlink is empty&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     context &amp;quot;when the hyperlink is empty&amp;quot; do&lt;br /&gt;
      it &amp;quot;raise excpetion&amp;quot; do&lt;br /&gt;
        expect{(assignment_team.submit_hyperlink(&amp;quot;&amp;quot;))}.to raise_error('The hyperlink cannot be empty!')&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when the hyperlink is not empty and it calls the method on NET::HTTP&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      before :each do&lt;br /&gt;
        @link = &amp;quot;htp.aa/..&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
      it &amp;quot;call the method on NET::HTTP&amp;quot; do&lt;br /&gt;
         expect(Net::HTTP).to receive(:get_response).with(URI(@link+'http://'))&lt;br /&gt;
         assignment_team.submit_hyperlink(@link)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. when the hyperlink is not empty and it raises error&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;raise error&amp;quot; do&lt;br /&gt;
          allow(Net::HTTP).to receive(:get_response).with(URI(@link+'http://')).and_return(&amp;quot;402&amp;quot;)&lt;br /&gt;
          expect{(assignment_team.submit_hyperlink(@link))}.to raise_error('HTTP status code: 402')&lt;br /&gt;
       end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing remove_hyperlink====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      before :each do&lt;br /&gt;
        @hyperlink = &amp;quot;http://a.com&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
     it 'call the hyperlinks method' do&lt;br /&gt;
        expect(assignment_team).to receive(:hyperlinks).and_return([&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;])&lt;br /&gt;
        assignment_team.remove_hyperlink(@hyperlink)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing team====&lt;br /&gt;
3 test cases are designed to test this method&lt;br /&gt;
&lt;br /&gt;
1. when the participant is nil then this method will return nil&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      context 'when the participant is nil then this method will return nil' do&lt;br /&gt;
        it 'the participant is nil' do&lt;br /&gt;
          expect(AssignmentTeam.team(nil)).to eq(nil)&lt;br /&gt;
        end&lt;br /&gt;
       end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when it can find the participant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:participant) { build(:participant) }&lt;br /&gt;
      context 'can find the participant' do&lt;br /&gt;
        it 'send the correct user_id to the TeamsUser.where method' do&lt;br /&gt;
          expect(TeamsUser).to receive(:where).with(user_id: participant.user_id).and_return([team_user])&lt;br /&gt;
          AssignmentTeam.team(participant)&lt;br /&gt;
        end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. when the team user exists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:team_user) { build(:team_user) }&lt;br /&gt;
      context 'the team user exists' do&lt;br /&gt;
        before :each do&lt;br /&gt;
          allow(TeamsUser).to receive(:where).with(user_id: 1).and_return([team_user])&lt;br /&gt;
          AssignmentTeam.team(participant)&lt;br /&gt;
       end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing export_fields==== &lt;br /&gt;
2 test cases are designed to test this method&lt;br /&gt;
&lt;br /&gt;
1. when the team_name equals false&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'the team_name equals false' do&lt;br /&gt;
        options = {:team_name =&amp;gt;&amp;quot;false&amp;quot;}&lt;br /&gt;
        expect(AssignmentTeam.export_fields(options)).to eq([&amp;quot;Team Name&amp;quot;, &amp;quot;Team members&amp;quot;,&amp;quot;Assignment Name&amp;quot;])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when the team_name equals true&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'the team_name equals true' do&lt;br /&gt;
        options = {:team_name =&amp;gt;&amp;quot;true&amp;quot;}&lt;br /&gt;
        expect(AssignmentTeam.export_fields(options)).to eq([&amp;quot;Team Name&amp;quot;, &amp;quot;Assignment Name&amp;quot;])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing remove_team_by_id====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'send find to Assignment' do&lt;br /&gt;
        expect(AssignmentTeam).to receive(:find).with(1)&lt;br /&gt;
        AssignmentTeam.remove_team_by_id(1)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing path====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'can get the path' do&lt;br /&gt;
        expect(assignment_team.path).to eq(Rails.root.to_s+'/pg_data/instructor6/csc517/test/final_test/0')&lt;br /&gt;
        assignment_team.path&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing set_student_directory_num====&lt;br /&gt;
3 test cases are designed to test this method&lt;br /&gt;
&lt;br /&gt;
1. when directory_num &amp;gt;= 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     context 'directory_num &amp;gt;= 0' do&lt;br /&gt;
       it 'return when num&amp;gt;=0' do&lt;br /&gt;
         expect(assignment_team.set_student_directory_num).to eq(nil)&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when the directory_num does not exist and it gets max num&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     let(:assignment_team1) {build(:assignment_team, directory_num: nil)}&lt;br /&gt;
     it 'get max num' do&lt;br /&gt;
        expect(AssignmentTeam).to receive_message_chain(:where,:order,:first,:directory_num).with(parent_id:       assignment_team1.parent_id).with('directory_num desc').with(no_args).with(no_args).and_return(1)&lt;br /&gt;
        assignment_team1.set_student_directory_num&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. when the directory_num does not exist and it updates attribute&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'update attribute' do&lt;br /&gt;
        allow(AssignmentTeam).to receive_message_chain(:where,:order,:first,:directory_num).with(parent_id: assignment_team1.parent_id).with('directory_num desc').with(no_args).with(no_args).and_return(1)&lt;br /&gt;
        expect(assignment_team1).to receive(:update_attributes).with(directory_num: 2)&lt;br /&gt;
        assignment_team1.set_student_directory_num&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing received_any_peer_review?====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'send the request to where of the ResponseMap' do&lt;br /&gt;
        expect(ResponseMap).to receive(:where).with(reviewee_id: assignment_team.id, reviewed_object_id: assignment_team.parent_id).and_return([])&lt;br /&gt;
        assignment_team.received_any_peer_review?&lt;br /&gt;
    end&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Coverage==&lt;br /&gt;
There is screenshot of the coverage page.&lt;br /&gt;
[https://drive.google.com/open?id=12jHYbHoL_MpjnM1tdy52DVjqasGmnHie]&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1848_Write_unit_tests_for_assignment_team&amp;diff=119236</id>
		<title>E1848 Write unit tests for assignment team</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1848_Write_unit_tests_for_assignment_team&amp;diff=119236"/>
		<updated>2018-11-10T02:54:49Z</updated>

		<summary type="html">&lt;p&gt;Wwu24: /* File Involvement */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;For this progect, the goal is to wirte up unit tests for assignment_team.rb&lt;br /&gt;
&lt;br /&gt;
==Project Introduction==&lt;br /&gt;
====Background====&lt;br /&gt;
assignment_team.rb is the child class of team.rb. It is used to handle multiple problems relates to team in the assignment. Its responsibilities can mainly fall in three categories: participant of the team, reviews of the team, and the operation for the whole team. For the participant, it can be used to decide if a participant is in a given team and view the members of the team or remove a member. For reviews, it deals with the problem that getting the reviews for the team, assign reviewer for the team and get if the team has been reviewed by a specific reviewers. For the whole team, we can delete the team or view the scores, etc. by using this class.&lt;br /&gt;
====Motivation====&lt;br /&gt;
Make sure assignment_team.rb provides all functions as expected is important for the whole system. It requires enough tests for all the functions and the edge cases may occur. However, there are not enough unit tests for this model in expertiza. The following tests are added to assignment_team.rb in this project.&lt;br /&gt;
&lt;br /&gt;
==Memebers of Project==&lt;br /&gt;
Jianshu Zhang&lt;br /&gt;
&lt;br /&gt;
Wanjing Kuang&lt;br /&gt;
&lt;br /&gt;
Wei Wu&lt;br /&gt;
&lt;br /&gt;
==Mentor==&lt;br /&gt;
Zhewei Hu&lt;br /&gt;
&lt;br /&gt;
==File Involvement==&lt;br /&gt;
1.app/models/assignment_team.rb&lt;br /&gt;
&lt;br /&gt;
2.spec/models/assignment_team_spec.rb&lt;br /&gt;
&lt;br /&gt;
3.spec/factories/factories.rb&lt;br /&gt;
&lt;br /&gt;
==Test Plan==&lt;br /&gt;
1. two test cases for method &amp;quot;include?&amp;quot;: When the team includes a given participant and When the team doesn't include a given participant&lt;br /&gt;
&lt;br /&gt;
2. one test case for method &amp;quot;parent_model&amp;quot;: It returns &amp;quot;Assignment&amp;quot; when the method is called.&lt;br /&gt;
&lt;br /&gt;
3. two test cases for method &amp;quot;self.parent_model(id)&amp;quot;: When it's given a correct id and When it's given an incorrect id.&lt;br /&gt;
&lt;br /&gt;
4. one test case for method &amp;quot;fullname&amp;quot;: When the participant has an full name.&lt;br /&gt;
&lt;br /&gt;
5. one test case for method &amp;quot;review_map_type&amp;quot;: It returns ReviewResponseMap when the method is called.&lt;br /&gt;
&lt;br /&gt;
6. one test case for method &amp;quot;self.prototype&amp;quot;: It returns an new instance of AssignmentTeam when the method is called.&lt;br /&gt;
&lt;br /&gt;
7. two test cases for method &amp;quot;assign_reviewer(reviewer)&amp;quot;: When the team has an assignment and When the assignment record can not be found.&lt;br /&gt;
&lt;br /&gt;
8. one test case for method &amp;quot;reviewd_by?&amp;quot;: When it gets correct reviewer and returns true as an result.&lt;br /&gt;
&lt;br /&gt;
9. one test case for method &amp;quot; topic&amp;quot;: When it returns the correct id.&lt;br /&gt;
&lt;br /&gt;
10. three test cases for method &amp;quot;has_submissions?&amp;quot;: When the team doesn't submit any file or link, when team submits a link instead of files and &lt;br /&gt;
when the team submits some files.&lt;br /&gt;
&lt;br /&gt;
11. two test cases for method &amp;quot;participants&amp;quot;: When no participants in this team and When adding some participants and get all the participants.&lt;br /&gt;
&lt;br /&gt;
12. one test case for method &amp;quot;add_participant&amp;quot;: When adding an participant, it will return an instance of AssignmentParticipant.&lt;br /&gt;
&lt;br /&gt;
13. two test cases for method &amp;quot; delete and destroy&amp;quot;: Testing delete and destory.&lt;br /&gt;
&lt;br /&gt;
==Unit Tests==&lt;br /&gt;
&lt;br /&gt;
===Unit Test Tool===&lt;br /&gt;
Rspec&lt;br /&gt;
&lt;br /&gt;
===Unit Test File===&lt;br /&gt;
expertiza/spec/models/assignment_team_spec.rb&lt;br /&gt;
&lt;br /&gt;
===Unit Test Steps===&lt;br /&gt;
&lt;br /&gt;
*Create unit test cases in the assignment_team_spec.rb&lt;br /&gt;
&lt;br /&gt;
*run rspec spec/models/assignment_team_spec.rb under expertiza directory&lt;br /&gt;
&lt;br /&gt;
*the rspec outputs the number of test cases that are passed and those that are failed.&lt;br /&gt;
&lt;br /&gt;
===Unit Test Cases===&lt;br /&gt;
&lt;br /&gt;
====Testing include?====&lt;br /&gt;
2 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1. The team includes a given participant.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment_team) { build(:assignment_team, id: 1, parent_id: 1, name: &amp;quot;full name&amp;quot;) }&lt;br /&gt;
      let(:participant1) { build(:participant, id: 2, user: user) }&lt;br /&gt;
      it &amp;quot;returns true&amp;quot; do&lt;br /&gt;
        allow(assignment_team).to receive(:add_participants).with(participant1)&lt;br /&gt;
        expect(assignment_team.includes?(participant1))&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. The team doesn't include a given participant.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment_team) { build(:assignment_team, id: 1, parent_id: 1, name: &amp;quot;full name&amp;quot;) }&lt;br /&gt;
      let(:participant1) { build(:participant, id: 2, user: user) }&lt;br /&gt;
      let(:participant2) { build(:participant, id: 3) }&lt;br /&gt;
      it &amp;quot;returns false&amp;quot; do&lt;br /&gt;
        allow(assignment_team).to receive(:add_participants).with(participant1)&lt;br /&gt;
        expect(assignment_team.includes?(participant2))&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing parent_model====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns Assignment as result&amp;quot; do&lt;br /&gt;
        expect(assignment_team.parent_model).to eq(&amp;quot;Assignment&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing self.parent_model(id)====&lt;br /&gt;
2 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1.When it's given a correct id.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment) { build(:assignment, id: 1) }&lt;br /&gt;
      it &amp;quot;returns an assignemt&amp;quot; do&lt;br /&gt;
        allow(Assignment).to receive(:find).with(1).and_return(assignment)&lt;br /&gt;
        expect(AssignmentTeam.parent_model(1)).to eq(assignment)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.When it's given an incorrect id.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;raises an exception&amp;quot; do&lt;br /&gt;
        expect { AssignmentTeam.parent_model 2 }.to raise_exception(ActiveRecord::RecordNotFound)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing fullname====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns the full name of assignment team&amp;quot; do&lt;br /&gt;
        expect(assignment_team.fullname).to eq(&amp;quot;full name&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing review_map_type====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns ReviewResponseMap as result&amp;quot; do&lt;br /&gt;
        expect(assignment_team.review_map_type).to eq(&amp;quot;ReviewResponseMap&amp;quot;)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing self.prototype====&lt;br /&gt;
1 test cases is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns an new instance of AssignmentTeam&amp;quot; do&lt;br /&gt;
        expect(AssignmentTeam.prototype).to be_instance_of(AssignmentTeam)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing assign_reviewer(reviewer)====&lt;br /&gt;
2 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1. When the team has an assignment.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:reviewer) { build(:participant, id: 1) }&lt;br /&gt;
      it &amp;quot;returns an instance of ReviewResponseMap&amp;quot; do&lt;br /&gt;
        expect(assignment_team.assign_reviewer(reviewer)).to be_instance_of(ReviewResponseMap)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. When the assignment record can not be found&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment_team2) { build(:assignment_team, id: 2, parent_id: 2) }&lt;br /&gt;
      it &amp;quot;returns an exception&amp;quot; do&lt;br /&gt;
        expect { assignment_team2.assign_reviewer(reviewer) }.to raise_exception(ActiveRecord::RecordNotFound)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing reviewd_by?====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;returns true&amp;quot; do&lt;br /&gt;
        allow(ReviewResponseMap).to receive(:where).\&lt;br /&gt;
          with('reviewee_id = ? &amp;amp;&amp;amp; reviewer_id = ? &amp;amp;&amp;amp; reviewed_object_id = ?', 1, 1, 1).and_return([review_response_map])&lt;br /&gt;
        expect(assignment_team.reviewed_by?(reviewer)).to be true&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing topic====&lt;br /&gt;
1 test case is designed to test this method:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:signed_up_team) { build(:signed_up_team, id: 1, team_id: 1, is_waitlisted: 0, topic_id: 1) }&lt;br /&gt;
      it &amp;quot;returns a topic id&amp;quot; do&lt;br /&gt;
        allow(SignedUpTeam).to receive(:find_by).with(team_id: 1, is_waitlisted: 0).and_return(signed_up_team)&lt;br /&gt;
        expect(assignment_team.topic).to eq(1)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====Testing has_submissions? ====&lt;br /&gt;
3 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1.The team doesn't submit any file or link. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:team2) { build(:assignment_team, id: 2, parent_id: 1, name: &amp;quot;team2&amp;quot;, submitted_hyperlinks: &amp;quot;&amp;quot;) }&lt;br /&gt;
      it &amp;quot;no file or no link&amp;quot; do&lt;br /&gt;
        expect(team2.has_submissions?).to eq(false)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2.The team submits a link instead of files.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:team1) { build(:assignment_team, id: 1, parent_id: 1, name: &amp;quot;team1&amp;quot;, submitted_hyperlinks: &amp;quot;http://example.com&amp;quot;) }&lt;br /&gt;
      it &amp;quot;submitted hyperlinks&amp;quot; do&lt;br /&gt;
        expect(team1.has_submissions?).to eq(true)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. The team submits some files.  Stub is used to emulate the scenario that the team has submitted a file.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
      it &amp;quot;returns true&amp;quot; do&lt;br /&gt;
        allow(team2).to receive(:submitted_files).and_return([double(:File)])&lt;br /&gt;
        expect(team2.has_submissions?).to be true&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing participants ====&lt;br /&gt;
&lt;br /&gt;
1. No participants in this team&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#no participant' do&lt;br /&gt;
        expect(team1.participants).to eq([])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. add some participants and get all the participants&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:student1) { build(:student, id: 1, name: 'johns', fullname: 'johns franklin') }&lt;br /&gt;
      let(:student2) { build(:student, id: 2, name: 'kate', fullname: 'kate moss') }&lt;br /&gt;
      let(:par1) { build(:participant, id: 1, parent_id: 1, user_id: 1) }&lt;br /&gt;
      let(:par2) { build(:participant, id: 2, parent_id: 1, user_id: 2) }&lt;br /&gt;
      it '#1 participant' do&lt;br /&gt;
        allow(AssignmentTeam).to receive(:users).with(id: team1.id).and_return([student1,student2])&lt;br /&gt;
        expect(team1.participants).to eq([par1, par2])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing add_participant ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#add participants' do&lt;br /&gt;
        expect(team1.add_participant(ass1.id, par1)).to be_instance_of(AssignmentParticipant)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing the delete and destroy====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#delete' do&lt;br /&gt;
        expect(team1.delete).to be_instance_of(AssignmentTeam)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#destroy' do&lt;br /&gt;
        expect(team1.destroy).to be_instance_of(AssignmentTeam)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing members====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#get_first_member' do&lt;br /&gt;
        allow(AssignmentTeam).to receive(:find_by).with(id: team1.id).and_return(team1)&lt;br /&gt;
        allow(team1).to receive(:participants).and_return([par1, par2])&lt;br /&gt;
        expect(AssignmentTeam.get_first_member(team1.id)).to eq(par1)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing import and export====&lt;br /&gt;
&lt;br /&gt;
1. import a team to a non-existing assignment and expect an exception&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     it '#import an nonexisting assignment id' do&lt;br /&gt;
        row = {teamname: &amp;quot;hello_world&amp;quot;, teammembers: %w[johns kate]}&lt;br /&gt;
        options = {has_teamname: &amp;quot;true_first&amp;quot;}&lt;br /&gt;
        expect { AssignmentTeam.import(row, 99_999, options) }.to raise_error(ImportError)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. export teams into a csv file&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#export' do&lt;br /&gt;
        options = {}&lt;br /&gt;
        csv = CSV.open(&amp;quot;assignment_team_export.csv&amp;quot;, &amp;quot;w&amp;quot;)&lt;br /&gt;
        assignment_id = ass1.id&lt;br /&gt;
        allow(AssignmentTeam).to receive(:where).with(parent_id: assignment_id).and_return([team1, team2, team3])&lt;br /&gt;
        allow(TeamsUser).to receive(:where).and_return([par1, par2])&lt;br /&gt;
        expect(AssignmentTeam.export(csv, assignment_id, options)).to be_instance_of(CSV)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing copy====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it '#copy' do&lt;br /&gt;
        allow(TeamsUser).to receive(:where).with(team_id: team1.id).and_return([par1])&lt;br /&gt;
        expect(team1.copy(course1.id)).to eq([par1])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing hyperlinks====&lt;br /&gt;
2 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1. when the current teams submitted hyperlinks&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:assignment_team) { build(:assignment_team) }&lt;br /&gt;
      context &amp;quot;when current teams submitted hyperlinks&amp;quot; do&lt;br /&gt;
        it &amp;quot;returns the hyperlinks submitted by the team&amp;quot; do&lt;br /&gt;
          expect(assignment_team.hyperlinks).to eq([&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;])&lt;br /&gt;
        end&lt;br /&gt;
       end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when current teams did not submit hyperlinks&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     let(:team_without_submitted_hyperlinks) { build(:assignment_team, submitted_hyperlinks: &amp;quot;&amp;quot;) }&lt;br /&gt;
     context &amp;quot;when current teams did not submit hyperlinks&amp;quot; do&lt;br /&gt;
       it &amp;quot;returns an empty array&amp;quot; do&lt;br /&gt;
         expect(team_without_submitted_hyperlinks.hyperlinks).to eq([])&lt;br /&gt;
       end&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing files====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     before :each do&lt;br /&gt;
       @directory = &amp;quot;a&amp;quot;&lt;br /&gt;
       @files = [&amp;quot;b.txt&amp;quot;, &amp;quot;c.java&amp;quot;, &amp;quot;d.txt&amp;quot;]&lt;br /&gt;
       @files1 = [&amp;quot;b/c&amp;quot;, &amp;quot;d/e&amp;quot;]&lt;br /&gt;
      end&lt;br /&gt;
      it &amp;quot;call the method in Dir&amp;quot; do&lt;br /&gt;
        expect(Dir).to receive(:[]).with(@directory + &amp;quot;/*&amp;quot;).and_return(@files)&lt;br /&gt;
        assignment_team.files(@directory)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing submit_hyperlink====&lt;br /&gt;
3 test cases are designed to test this method:&lt;br /&gt;
&lt;br /&gt;
1. when the hyperlink is empty&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     context &amp;quot;when the hyperlink is empty&amp;quot; do&lt;br /&gt;
      it &amp;quot;raise excpetion&amp;quot; do&lt;br /&gt;
        expect{(assignment_team.submit_hyperlink(&amp;quot;&amp;quot;))}.to raise_error('The hyperlink cannot be empty!')&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when the hyperlink is not empty and it calls the method on NET::HTTP&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      before :each do&lt;br /&gt;
        @link = &amp;quot;htp.aa/..&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
      it &amp;quot;call the method on NET::HTTP&amp;quot; do&lt;br /&gt;
         expect(Net::HTTP).to receive(:get_response).with(URI(@link+'http://'))&lt;br /&gt;
         assignment_team.submit_hyperlink(@link)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. when the hyperlink is not empty and it raises error&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it &amp;quot;raise error&amp;quot; do&lt;br /&gt;
          allow(Net::HTTP).to receive(:get_response).with(URI(@link+'http://')).and_return(&amp;quot;402&amp;quot;)&lt;br /&gt;
          expect{(assignment_team.submit_hyperlink(@link))}.to raise_error('HTTP status code: 402')&lt;br /&gt;
       end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing remove_hyperlink====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      before :each do&lt;br /&gt;
        @hyperlink = &amp;quot;http://a.com&amp;quot;&lt;br /&gt;
      end&lt;br /&gt;
     it 'call the hyperlinks method' do&lt;br /&gt;
        expect(assignment_team).to receive(:hyperlinks).and_return([&amp;quot;https://www.expertiza.ncsu.edu&amp;quot;])&lt;br /&gt;
        assignment_team.remove_hyperlink(@hyperlink)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing team====&lt;br /&gt;
3 test cases are designed to test this method&lt;br /&gt;
&lt;br /&gt;
1. when the participant is nil then this method will return nil&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      context 'when the participant is nil then this method will return nil' do&lt;br /&gt;
        it 'the participant is nil' do&lt;br /&gt;
          expect(AssignmentTeam.team(nil)).to eq(nil)&lt;br /&gt;
        end&lt;br /&gt;
       end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when it can find the participant&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:participant) { build(:participant) }&lt;br /&gt;
      context 'can find the participant' do&lt;br /&gt;
        it 'send the correct user_id to the TeamsUser.where method' do&lt;br /&gt;
          expect(TeamsUser).to receive(:where).with(user_id: participant.user_id).and_return([team_user])&lt;br /&gt;
          AssignmentTeam.team(participant)&lt;br /&gt;
        end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. when the team user exists&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      let(:team_user) { build(:team_user) }&lt;br /&gt;
      context 'the team user exists' do&lt;br /&gt;
        before :each do&lt;br /&gt;
          allow(TeamsUser).to receive(:where).with(user_id: 1).and_return([team_user])&lt;br /&gt;
          AssignmentTeam.team(participant)&lt;br /&gt;
       end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing export_fields==== &lt;br /&gt;
2 test cases are designed to test this method&lt;br /&gt;
&lt;br /&gt;
1. when the team_name equals false&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'the team_name equals false' do&lt;br /&gt;
        options = {:team_name =&amp;gt;&amp;quot;false&amp;quot;}&lt;br /&gt;
        expect(AssignmentTeam.export_fields(options)).to eq([&amp;quot;Team Name&amp;quot;, &amp;quot;Team members&amp;quot;,&amp;quot;Assignment Name&amp;quot;])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when the team_name equals true&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'the team_name equals true' do&lt;br /&gt;
        options = {:team_name =&amp;gt;&amp;quot;true&amp;quot;}&lt;br /&gt;
        expect(AssignmentTeam.export_fields(options)).to eq([&amp;quot;Team Name&amp;quot;, &amp;quot;Assignment Name&amp;quot;])&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing remove_team_by_id====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'send find to Assignment' do&lt;br /&gt;
        expect(AssignmentTeam).to receive(:find).with(1)&lt;br /&gt;
        AssignmentTeam.remove_team_by_id(1)&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing path====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'can get the path' do&lt;br /&gt;
        expect(assignment_team.path).to eq(Rails.root.to_s+'/pg_data/instructor6/csc517/test/final_test/0')&lt;br /&gt;
        assignment_team.path&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing set_student_directory_num====&lt;br /&gt;
3 test cases are designed to test this method&lt;br /&gt;
&lt;br /&gt;
1. when directory_num &amp;gt;= 0&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     context 'directory_num &amp;gt;= 0' do&lt;br /&gt;
       it 'return when num&amp;gt;=0' do&lt;br /&gt;
         expect(assignment_team.set_student_directory_num).to eq(nil)&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
2. when the directory_num does not exist and it gets max num&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
     let(:assignment_team1) {build(:assignment_team, directory_num: nil)}&lt;br /&gt;
     it 'get max num' do&lt;br /&gt;
        expect(AssignmentTeam).to receive_message_chain(:where,:order,:first,:directory_num).with(parent_id:       assignment_team1.parent_id).with('directory_num desc').with(no_args).with(no_args).and_return(1)&lt;br /&gt;
        assignment_team1.set_student_directory_num&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3. when the directory_num does not exist and it updates attribute&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'update attribute' do&lt;br /&gt;
        allow(AssignmentTeam).to receive_message_chain(:where,:order,:first,:directory_num).with(parent_id: assignment_team1.parent_id).with('directory_num desc').with(no_args).with(no_args).and_return(1)&lt;br /&gt;
        expect(assignment_team1).to receive(:update_attributes).with(directory_num: 2)&lt;br /&gt;
        assignment_team1.set_student_directory_num&lt;br /&gt;
      end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====Testing received_any_peer_review?====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
      it 'send the request to where of the ResponseMap' do&lt;br /&gt;
        expect(ResponseMap).to receive(:where).with(reviewee_id: assignment_team.id, reviewed_object_id: assignment_team.parent_id).and_return([])&lt;br /&gt;
        assignment_team.received_any_peer_review?&lt;br /&gt;
    end&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Test Coverage==&lt;br /&gt;
There is screenshot of the coverage page.&lt;br /&gt;
[https://drive.google.com/open?id=12jHYbHoL_MpjnM1tdy52DVjqasGmnHie]&lt;/div&gt;</summary>
		<author><name>Wwu24</name></author>
	</entry>
</feed>