<?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=Sjrappl</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=Sjrappl"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Sjrappl"/>
	<updated>2026-05-12T21:40:21Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review&amp;diff=119694</id>
		<title>CSC/ECE 517 Fall 2018/E1856 Allow reviewers to bid on what to review</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review&amp;diff=119694"/>
		<updated>2018-11-13T15:49:09Z</updated>

		<summary type="html">&lt;p&gt;Sjrappl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
Students can currently bid on project topics to be their assignment. The completion of this project will allow students to also bid on what projects they will be reviewing after the completion of the project.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
Almost all of the functionality for our project has already been implemented in the review portions of the Expertiza system. Because of this, we will approach this project by first using a decorator pattern to add lottery capability to the review mapping controller for choosing topics. Then we will duplicate the view for choosing project topics and modify it so that it interacts with the review mapping controller. We understand that this is not DRY code, so we will try to address this problem by seeing if there is any way we can modify the choose project topics page in order to reuse its code, yet still fulfill the functionality of review mapping.&lt;br /&gt;
&lt;br /&gt;
== Current System Status ==&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
== Challenges ==&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
== Design Patterns ==&lt;br /&gt;
Model View Controller - Expertiza uses the Ruby on Rails framework which is set up to use the Model View Controller software pattern.&lt;br /&gt;
&lt;br /&gt;
DRY Principle - We will be attempting to write our code in a dry way, that being that code within the system is not duplicated.&lt;/div&gt;</summary>
		<author><name>Sjrappl</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review&amp;diff=119693</id>
		<title>CSC/ECE 517 Fall 2018/E1856 Allow reviewers to bid on what to review</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review&amp;diff=119693"/>
		<updated>2018-11-13T15:42:28Z</updated>

		<summary type="html">&lt;p&gt;Sjrappl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
Students can currently bid on project topics to be their assignment. The completion of this project will allow students to also bid on what projects they will be reviewing after the completion of the project.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
Almost all of the functionality for our project has already been implemented in the review portions of the Expertiza system. Because of this, we will approach this project by first using a decorator pattern to add lottery capability to the review mapping controller for choosing topics. Then we will duplicate the view for choosing project topics and modify it so that it interacts with the review mapping controller. We understand that this is not DRY code, so we will try to address this problem by seeing if there is any way we can modify the choose project topics page in order to reuse its code, yet still fulfill the functionality of review mapping.&lt;br /&gt;
&lt;br /&gt;
== Current System Status ==&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
== Challenges ==&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;/div&gt;</summary>
		<author><name>Sjrappl</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review&amp;diff=119692</id>
		<title>CSC/ECE 517 Fall 2018/E1856 Allow reviewers to bid on what to review</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review&amp;diff=119692"/>
		<updated>2018-11-13T15:41:25Z</updated>

		<summary type="html">&lt;p&gt;Sjrappl: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
Students can currently bid on project topics to be their assignment. The completion of this project will allow students to also bid on what projects they will be reviewing after the completion of the project.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
Almost all of the functionality for our project has already been implemented in the review portions of the Expertiza system. Because of this, we will approach this project by first using a decorator pattern to add lottery capability to the review mapping controller for choosing topics. Then we will duplicate the view for choosing project topics and modify it so that it interacts with the review mapping controller. We understand that this is not DRY code, so we will try to address this problem by seeing if there is any way we can modify the choose project topics page in order to reuse its code, yet still fulfill the functionality of review mapping.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
== Challenges ==&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;/div&gt;</summary>
		<author><name>Sjrappl</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review&amp;diff=119691</id>
		<title>CSC/ECE 517 Fall 2018/E1856 Allow reviewers to bid on what to review</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review&amp;diff=119691"/>
		<updated>2018-11-13T15:37:32Z</updated>

		<summary type="html">&lt;p&gt;Sjrappl: /* Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
Students can currently bid on project topics to be their assignment. The completion of this project will allow students to also bid on what projects they will be reviewing after the completion of the project.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
Almost all of the functionality for our project has already been implemented in the review portions of the Expertiza system. Because of this, we will approach this project by first using a decorator pattern to add lottery capability to the review mapping controller.&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
== Challenges ==&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;/div&gt;</summary>
		<author><name>Sjrappl</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review&amp;diff=119690</id>
		<title>CSC/ECE 517 Fall 2018/E1856 Allow reviewers to bid on what to review</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review&amp;diff=119690"/>
		<updated>2018-11-13T15:34:26Z</updated>

		<summary type="html">&lt;p&gt;Sjrappl: /* Description */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
Students can currently bid on project topics to be their assignment. The completion of this project will allow students to also bid on what projects they will be reviewing after the completion of the project.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
== Challenges ==&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;/div&gt;</summary>
		<author><name>Sjrappl</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review&amp;diff=119689</id>
		<title>CSC/ECE 517 Fall 2018/E1856 Allow reviewers to bid on what to review</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review&amp;diff=119689"/>
		<updated>2018-11-13T15:29:22Z</updated>

		<summary type="html">&lt;p&gt;Sjrappl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Description ==&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
== Design ==&lt;br /&gt;
&lt;br /&gt;
== Implementation ==&lt;br /&gt;
&lt;br /&gt;
== Challenges ==&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;/div&gt;</summary>
		<author><name>Sjrappl</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018&amp;diff=119687</id>
		<title>CSC/ECE 517 Fall 2018</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018&amp;diff=119687"/>
		<updated>2018-11-13T15:26:29Z</updated>

		<summary type="html">&lt;p&gt;Sjrappl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2018/OSS E1848 Write unit tests for assignment team.rb]]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1839_Review_Requirements_and_Thresholds CSC/ECE 517 Fall 2018 E1839 Review Requirements and Thresholds]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1848_Write_unit_tests_for_assignment_team CSC/ECE 517 Fall 2018 E1848 Write unit tests for assignment_team]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1835_Refactor_delayed_mailer_and_scheduled_task CSC/ECE 517 Fall 2018 E1835_Refactor_delayed_mailer_and_scheduled_task]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1829_OSS_project_Duke_Blue_Fix_import_glitches CSC/ECE 517 Fall 2018 E1829 OSS project Duke Blue: Fix import glitches]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1853_Write_unit_tests_for_menu.rb CSC/ECE 517 Fall 2018 E1853 Write unit tests for menu.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1853_write_unit_tests_for_menu CSC/ECE517 Fall 2018 E1853 Write Unit Tests For menu.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018_-_Project_E1852_Write_unit_tests_for_participant.rb CSC/ECE 517 Fall 2018 E1852 Write unit tests for participant.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1844_Issues_related_to_names CSC/ECE 517 Fall 2018 E1844 Issues related to names]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/User_talk:Rshakya CSC/ECE 517 Fall 2018/E1852 Unit Test for Participant Model]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1850_Write_unit_tests_for_review_response_map CSC/ECE 517 Fall 2018 Write unit tests for review-response_map.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1849_Write_Unit_Tests_for_vm_question_response.rb CSC/ECE 517 Fall 2018/E1849 Write Unit Tests for vm_question_response.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1866_Expertiza_Internationalization CSC/ECE 517 Fall 2018/E1866 Expertiza Internationalization]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1879_Student_Generated_Questions_Added_To_Rubric CSC/ECE 517 Fall 2018/E1879 Student Generated Questions Added To Rubric]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review CSC/ECE 517 Fall 2018/E1856 Allow]&lt;/div&gt;</summary>
		<author><name>Sjrappl</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018&amp;diff=119686</id>
		<title>CSC/ECE 517 Fall 2018</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018&amp;diff=119686"/>
		<updated>2018-11-13T15:26:17Z</updated>

		<summary type="html">&lt;p&gt;Sjrappl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2018/OSS E1848 Write unit tests for assignment team.rb]]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1839_Review_Requirements_and_Thresholds CSC/ECE 517 Fall 2018 E1839 Review Requirements and Thresholds]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1848_Write_unit_tests_for_assignment_team CSC/ECE 517 Fall 2018 E1848 Write unit tests for assignment_team]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1835_Refactor_delayed_mailer_and_scheduled_task CSC/ECE 517 Fall 2018 E1835_Refactor_delayed_mailer_and_scheduled_task]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1829_OSS_project_Duke_Blue_Fix_import_glitches CSC/ECE 517 Fall 2018 E1829 OSS project Duke Blue: Fix import glitches]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1853_Write_unit_tests_for_menu.rb CSC/ECE 517 Fall 2018 E1853 Write unit tests for menu.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1853_write_unit_tests_for_menu CSC/ECE517 Fall 2018 E1853 Write Unit Tests For menu.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018_-_Project_E1852_Write_unit_tests_for_participant.rb CSC/ECE 517 Fall 2018 E1852 Write unit tests for participant.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1844_Issues_related_to_names CSC/ECE 517 Fall 2018 E1844 Issues related to names]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/User_talk:Rshakya CSC/ECE 517 Fall 2018/E1852 Unit Test for Participant Model]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1850_Write_unit_tests_for_review_response_map CSC/ECE 517 Fall 2018 Write unit tests for review-response_map.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1849_Write_Unit_Tests_for_vm_question_response.rb CSC/ECE 517 Fall 2018/E1849 Write Unit Tests for vm_question_response.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1866_Expertiza_Internationalization CSC/ECE 517 Fall 2018/E1866 Expertiza Internationalization]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1879_Student_Generated_Questions_Added_To_Rubric CSC/ECE 517 Fall 2018/E1879 Student Generated Questions Added To Rubric]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review CSC/ECE 517 Fall 2018/E1856 Allow&lt;br /&gt;
Reviewers to Bid on What to Review]&lt;/div&gt;</summary>
		<author><name>Sjrappl</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018&amp;diff=119685</id>
		<title>CSC/ECE 517 Fall 2018</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018&amp;diff=119685"/>
		<updated>2018-11-13T15:25:54Z</updated>

		<summary type="html">&lt;p&gt;Sjrappl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2018/OSS E1848 Write unit tests for assignment team.rb]]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1839_Review_Requirements_and_Thresholds CSC/ECE 517 Fall 2018 E1839 Review Requirements and Thresholds]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1848_Write_unit_tests_for_assignment_team CSC/ECE 517 Fall 2018 E1848 Write unit tests for assignment_team]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1835_Refactor_delayed_mailer_and_scheduled_task CSC/ECE 517 Fall 2018 E1835_Refactor_delayed_mailer_and_scheduled_task]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1829_OSS_project_Duke_Blue_Fix_import_glitches CSC/ECE 517 Fall 2018 E1829 OSS project Duke Blue: Fix import glitches]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1853_Write_unit_tests_for_menu.rb CSC/ECE 517 Fall 2018 E1853 Write unit tests for menu.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1853_write_unit_tests_for_menu CSC/ECE517 Fall 2018 E1853 Write Unit Tests For menu.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018_-_Project_E1852_Write_unit_tests_for_participant.rb CSC/ECE 517 Fall 2018 E1852 Write unit tests for participant.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1844_Issues_related_to_names CSC/ECE 517 Fall 2018 E1844 Issues related to names]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/User_talk:Rshakya CSC/ECE 517 Fall 2018/E1852 Unit Test for Participant Model]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1850_Write_unit_tests_for_review_response_map CSC/ECE 517 Fall 2018 Write unit tests for review-response_map.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1849_Write_Unit_Tests_for_vm_question_response.rb CSC/ECE 517 Fall 2018/E1849 Write Unit Tests for vm_question_response.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1866_Expertiza_Internationalization CSC/ECE 517 Fall 2018/E1866 Expertiza Internationalization]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1879_Student_Generated_Questions_Added_To_Rubric CSC/ECE 517 Fall 2018/E1879 Student Generated Questions Added To Rubric]&lt;br /&gt;
* http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review CSC/ECE 517 Fall 2018/E1856 Allow&lt;br /&gt;
Reviewers to Bid on What to Review]&lt;/div&gt;</summary>
		<author><name>Sjrappl</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018&amp;diff=119684</id>
		<title>CSC/ECE 517 Fall 2018</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018&amp;diff=119684"/>
		<updated>2018-11-13T15:25:38Z</updated>

		<summary type="html">&lt;p&gt;Sjrappl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2018/OSS E1848 Write unit tests for assignment team.rb]]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1839_Review_Requirements_and_Thresholds CSC/ECE 517 Fall 2018 E1839 Review Requirements and Thresholds]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1848_Write_unit_tests_for_assignment_team CSC/ECE 517 Fall 2018 E1848 Write unit tests for assignment_team]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1835_Refactor_delayed_mailer_and_scheduled_task CSC/ECE 517 Fall 2018 E1835_Refactor_delayed_mailer_and_scheduled_task]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1829_OSS_project_Duke_Blue_Fix_import_glitches CSC/ECE 517 Fall 2018 E1829 OSS project Duke Blue: Fix import glitches]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1853_Write_unit_tests_for_menu.rb CSC/ECE 517 Fall 2018 E1853 Write unit tests for menu.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1853_write_unit_tests_for_menu CSC/ECE517 Fall 2018 E1853 Write Unit Tests For menu.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018_-_Project_E1852_Write_unit_tests_for_participant.rb CSC/ECE 517 Fall 2018 E1852 Write unit tests for participant.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1844_Issues_related_to_names CSC/ECE 517 Fall 2018 E1844 Issues related to names]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/User_talk:Rshakya CSC/ECE 517 Fall 2018/E1852 Unit Test for Participant Model]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1850_Write_unit_tests_for_review_response_map CSC/ECE 517 Fall 2018 Write unit tests for review-response_map.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1849_Write_Unit_Tests_for_vm_question_response.rb CSC/ECE 517 Fall 2018/E1849 Write Unit Tests for vm_question_response.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1866_Expertiza_Internationalization CSC/ECE 517 Fall 2018/E1866 Expertiza Internationalization]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1879_Student_Generated_Questions_Added_To_Rubric CSC/ECE 517 Fall 2018/E1879 Student Generated Questions Added To Rubric]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review CSC/ECE 517 Fall 2018/E1856 Allow&lt;br /&gt;
Reviewers to Bid on What to Review]&lt;/div&gt;</summary>
		<author><name>Sjrappl</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018&amp;diff=119683</id>
		<title>CSC/ECE 517 Fall 2018</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018&amp;diff=119683"/>
		<updated>2018-11-13T15:25:12Z</updated>

		<summary type="html">&lt;p&gt;Sjrappl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2018/OSS E1848 Write unit tests for assignment team.rb]]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1839_Review_Requirements_and_Thresholds CSC/ECE 517 Fall 2018 E1839 Review Requirements and Thresholds]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1848_Write_unit_tests_for_assignment_team CSC/ECE 517 Fall 2018 E1848 Write unit tests for assignment_team]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1835_Refactor_delayed_mailer_and_scheduled_task CSC/ECE 517 Fall 2018 E1835_Refactor_delayed_mailer_and_scheduled_task]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1829_OSS_project_Duke_Blue_Fix_import_glitches CSC/ECE 517 Fall 2018 E1829 OSS project Duke Blue: Fix import glitches]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1853_Write_unit_tests_for_menu.rb CSC/ECE 517 Fall 2018 E1853 Write unit tests for menu.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1853_write_unit_tests_for_menu CSC/ECE517 Fall 2018 E1853 Write Unit Tests For menu.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018_-_Project_E1852_Write_unit_tests_for_participant.rb CSC/ECE 517 Fall 2018 E1852 Write unit tests for participant.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1844_Issues_related_to_names CSC/ECE 517 Fall 2018 E1844 Issues related to names]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/User_talk:Rshakya CSC/ECE 517 Fall 2018/E1852 Unit Test for Participant Model]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1850_Write_unit_tests_for_review_response_map CSC/ECE 517 Fall 2018 Write unit tests for review-response_map.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1849_Write_Unit_Tests_for_vm_question_response.rb CSC/ECE 517 Fall 2018/E1849 Write Unit Tests for vm_question_response.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1866_Expertiza_Internationalization CSC/ECE 517 Fall 2018/E1866 Expertiza Internationalization]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1879_Student_Generated_Questions_Added_To_Rubric CSC/ECE 517 Fall 2018/E1879 Student Generated Questions Added To Rubric]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review/ CSC/ECE 517 Fall 2018/E1856 Allow&lt;br /&gt;
Reviewers to Bid on What to Review]&lt;/div&gt;</summary>
		<author><name>Sjrappl</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018&amp;diff=119682</id>
		<title>CSC/ECE 517 Fall 2018</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018&amp;diff=119682"/>
		<updated>2018-11-13T15:24:50Z</updated>

		<summary type="html">&lt;p&gt;Sjrappl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2018/OSS E1848 Write unit tests for assignment team.rb]]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1839_Review_Requirements_and_Thresholds CSC/ECE 517 Fall 2018 E1839 Review Requirements and Thresholds]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1848_Write_unit_tests_for_assignment_team CSC/ECE 517 Fall 2018 E1848 Write unit tests for assignment_team]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1835_Refactor_delayed_mailer_and_scheduled_task CSC/ECE 517 Fall 2018 E1835_Refactor_delayed_mailer_and_scheduled_task]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1829_OSS_project_Duke_Blue_Fix_import_glitches CSC/ECE 517 Fall 2018 E1829 OSS project Duke Blue: Fix import glitches]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1853_Write_unit_tests_for_menu.rb CSC/ECE 517 Fall 2018 E1853 Write unit tests for menu.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1853_write_unit_tests_for_menu CSC/ECE517 Fall 2018 E1853 Write Unit Tests For menu.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018_-_Project_E1852_Write_unit_tests_for_participant.rb CSC/ECE 517 Fall 2018 E1852 Write unit tests for participant.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1844_Issues_related_to_names CSC/ECE 517 Fall 2018 E1844 Issues related to names]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/User_talk:Rshakya CSC/ECE 517 Fall 2018/E1852 Unit Test for Participant Model]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1850_Write_unit_tests_for_review_response_map CSC/ECE 517 Fall 2018 Write unit tests for review-response_map.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1849_Write_Unit_Tests_for_vm_question_response.rb CSC/ECE 517 Fall 2018/E1849 Write Unit Tests for vm_question_response.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1866_Expertiza_Internationalization CSC/ECE 517 Fall 2018/E1866 Expertiza Internationalization]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1879_Student_Generated_Questions_Added_To_Rubric CSC/ECE 517 Fall 2018/E1879 Student Generated Questions Added To Rubric]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review/ CSC/ECE 517 Fall 2018/E1856 Allow]&lt;/div&gt;</summary>
		<author><name>Sjrappl</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review&amp;diff=119681</id>
		<title>CSC/ECE 517 Fall 2018/E1856 Allow reviewers to bid on what to review</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review&amp;diff=119681"/>
		<updated>2018-11-13T15:20:37Z</updated>

		<summary type="html">&lt;p&gt;Sjrappl: Created page with &amp;quot;This page exists now.&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page exists now.&lt;/div&gt;</summary>
		<author><name>Sjrappl</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018&amp;diff=119680</id>
		<title>CSC/ECE 517 Fall 2018</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018&amp;diff=119680"/>
		<updated>2018-11-13T15:20:00Z</updated>

		<summary type="html">&lt;p&gt;Sjrappl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2018/OSS E1848 Write unit tests for assignment team.rb]]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1839_Review_Requirements_and_Thresholds CSC/ECE 517 Fall 2018 E1839 Review Requirements and Thresholds]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1848_Write_unit_tests_for_assignment_team CSC/ECE 517 Fall 2018 E1848 Write unit tests for assignment_team]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1835_Refactor_delayed_mailer_and_scheduled_task CSC/ECE 517 Fall 2018 E1835_Refactor_delayed_mailer_and_scheduled_task]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1829_OSS_project_Duke_Blue_Fix_import_glitches CSC/ECE 517 Fall 2018 E1829 OSS project Duke Blue: Fix import glitches]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1853_Write_unit_tests_for_menu.rb CSC/ECE 517 Fall 2018 E1853 Write unit tests for menu.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1853_write_unit_tests_for_menu CSC/ECE517 Fall 2018 E1853 Write Unit Tests For menu.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018_-_Project_E1852_Write_unit_tests_for_participant.rb CSC/ECE 517 Fall 2018 E1852 Write unit tests for participant.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1844_Issues_related_to_names CSC/ECE 517 Fall 2018 E1844 Issues related to names]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/User_talk:Rshakya CSC/ECE 517 Fall 2018/E1852 Unit Test for Participant Model]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1850_Write_unit_tests_for_review_response_map CSC/ECE 517 Fall 2018 Write unit tests for review-response_map.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1849_Write_Unit_Tests_for_vm_question_response.rb CSC/ECE 517 Fall 2018/E1849 Write Unit Tests for vm_question_response.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1866_Expertiza_Internationalization CSC/ECE 517 Fall 2018/E1866 Expertiza Internationalization]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1879_Student_Generated_Questions_Added_To_Rubric CSC/ECE 517 Fall 2018/E1879 Student Generated Questions Added To Rubric]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1856_Allow_reviewers_to_bid_on_what_to_review]&lt;/div&gt;</summary>
		<author><name>Sjrappl</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018&amp;diff=119679</id>
		<title>CSC/ECE 517 Fall 2018</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018&amp;diff=119679"/>
		<updated>2018-11-13T15:15:44Z</updated>

		<summary type="html">&lt;p&gt;Sjrappl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2018/OSS E1848 Write unit tests for assignment team.rb]]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1839_Review_Requirements_and_Thresholds CSC/ECE 517 Fall 2018 E1839 Review Requirements and Thresholds]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1848_Write_unit_tests_for_assignment_team CSC/ECE 517 Fall 2018 E1848 Write unit tests for assignment_team]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1835_Refactor_delayed_mailer_and_scheduled_task CSC/ECE 517 Fall 2018 E1835_Refactor_delayed_mailer_and_scheduled_task]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1829_OSS_project_Duke_Blue_Fix_import_glitches CSC/ECE 517 Fall 2018 E1829 OSS project Duke Blue: Fix import glitches]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1853_Write_unit_tests_for_menu.rb CSC/ECE 517 Fall 2018 E1853 Write unit tests for menu.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1853_write_unit_tests_for_menu CSC/ECE517 Fall 2018 E1853 Write Unit Tests For menu.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018_-_Project_E1852_Write_unit_tests_for_participant.rb CSC/ECE 517 Fall 2018 E1852 Write unit tests for participant.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1844_Issues_related_to_names CSC/ECE 517 Fall 2018 E1844 Issues related to names]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/User_talk:Rshakya CSC/ECE 517 Fall 2018/E1852 Unit Test for Participant Model]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1850_Write_unit_tests_for_review_response_map CSC/ECE 517 Fall 2018 Write unit tests for review-response_map.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1849_Write_Unit_Tests_for_vm_question_response.rb CSC/ECE 517 Fall 2018/E1849 Write Unit Tests for vm_question_response.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1866_Expertiza_Internationalization CSC/ECE 517 Fall 2018/E1866 Expertiza Internationalization]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1879_Student_Generated_Questions_Added_To_Rubric CSC/ECE 517 Fall 2018/E1879 Student Generated Questions Added To Rubric]&lt;/div&gt;</summary>
		<author><name>Sjrappl</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018&amp;diff=119678</id>
		<title>CSC/ECE 517 Fall 2018</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018&amp;diff=119678"/>
		<updated>2018-11-13T15:14:05Z</updated>

		<summary type="html">&lt;p&gt;Sjrappl: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[CSC/ECE 517 Fall 2018- Project E1846. OSS Project Navy: Character Issues]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2018/OSS E1848 Write unit tests for assignment team.rb]]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1839_Review_Requirements_and_Thresholds CSC/ECE 517 Fall 2018 E1839 Review Requirements and Thresholds]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1848_Write_unit_tests_for_assignment_team CSC/ECE 517 Fall 2018 E1848 Write unit tests for assignment_team]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1835_Refactor_delayed_mailer_and_scheduled_task CSC/ECE 517 Fall 2018 E1835_Refactor_delayed_mailer_and_scheduled_task]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1829_OSS_project_Duke_Blue_Fix_import_glitches CSC/ECE 517 Fall 2018 E1829 OSS project Duke Blue: Fix import glitches]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1853_Write_unit_tests_for_menu.rb CSC/ECE 517 Fall 2018 E1853 Write unit tests for menu.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1853_write_unit_tests_for_menu CSC/ECE517 Fall 2018 E1853 Write Unit Tests For menu.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1856_Allow_reviewers_to_bid_on_what_to_review.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018_-_Project_E1852_Write_unit_tests_for_participant.rb CSC/ECE 517 Fall 2018 E1852 Write unit tests for participant.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1844_Issues_related_to_names CSC/ECE 517 Fall 2018 E1844 Issues related to names]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/User_talk:Rshakya CSC/ECE 517 Fall 2018/E1852 Unit Test for Participant Model]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/E1850_Write_unit_tests_for_review_response_map CSC/ECE 517 Fall 2018 Write unit tests for review-response_map.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1849_Write_Unit_Tests_for_vm_question_response.rb CSC/ECE 517 Fall 2018/E1849 Write Unit Tests for vm_question_response.rb]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1866_Expertiza_Internationalization CSC/ECE 517 Fall 2018/E1866 Expertiza Internationalization]&lt;br /&gt;
* [http://wiki.expertiza.ncsu.edu/index.php/CSC/ECE_517_Fall_2018/E1879_Student_Generated_Questions_Added_To_Rubric CSC/ECE 517 Fall 2018/E1879 Student Generated Questions Added To Rubric]&lt;/div&gt;</summary>
		<author><name>Sjrappl</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018_E1836_Refactor_quiz_questionnaires_controller.rb&amp;diff=119190</id>
		<title>CSC/ECE 517 Fall 2018 E1836 Refactor quiz questionnaires controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018_E1836_Refactor_quiz_questionnaires_controller.rb&amp;diff=119190"/>
		<updated>2018-11-10T01:28:17Z</updated>

		<summary type="html">&lt;p&gt;Sjrappl: /* Test Plans */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1836. Refactoring quiz_questionnaires_controller.rb==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
The following tasks were accomplished in this project:&lt;br /&gt;
* Created quiz_questionnaire_controller.rb&lt;br /&gt;
* Moved view_quiz, new_quiz, create_quiz_questionnaire, edit_quiz and update_quiz from questionnaires_controller.rb, to quiz_questionnaires_controller.rb, and renamed it as view, new, create, edit and update respectively.&lt;br /&gt;
* Refactored the the long methods in questionnaires_controller.rb, such as create and create_questionnaire, update quiz, valid quiz, etc.&lt;br /&gt;
* Replaced switch statements in questionnaires_controller.rb with subclass methods.&lt;br /&gt;
* Created models for the subclasses.&lt;br /&gt;
* Removed hardcoded parameters, such as save_choice method.&lt;br /&gt;
* Appropriate tests were written to test the code.&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
'''Problem 1''': Create quiz_questionnaire_controller.rb and move some of the methods in the questionnaires_controller.rb to the new file created.&lt;br /&gt;
* '''Solution''': The methods view_quiz, new_quiz, create_quiz, edit_quiz and update_quiz in the questionnaires_controller.rb were the methods identified and moved into the quiz_questionnaire_controller.rb. They were respectively renamed as view, new, create, edit and update. The implementation of the newly created quiz_questionnaire_controller.rb can be seen below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class QuizQuestionnairesController &amp;lt; QuestionnairesController&lt;br /&gt;
&lt;br /&gt;
   #=========================================================================================================&lt;br /&gt;
   # Separate methods for quiz questionnaire&lt;br /&gt;
   #=========================================================================================================&lt;br /&gt;
&lt;br /&gt;
   # View a quiz questionnaire&lt;br /&gt;
   def view&lt;br /&gt;
     @questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
     @participant = Participant.find(params[:pid]) # creating an instance variable since it needs to be sent to submitted_content/edit&lt;br /&gt;
     render :view&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
   # define a new quiz questionnaire&lt;br /&gt;
   # method invoked by the view&lt;br /&gt;
   def new&lt;br /&gt;
     valid_request = true&lt;br /&gt;
     @assignment_id = params[:aid] # creating an instance variable to hold the assignment id&lt;br /&gt;
     @participant_id = params[:pid] # creating an instance variable to hold the participant id&lt;br /&gt;
     assignment = Assignment.find(@assignment_id)&lt;br /&gt;
     if !assignment.require_quiz? # flash error if this assignment does not require quiz&lt;br /&gt;
       flash[:error] = &amp;quot;This assignment does not support the quizzing feature.&amp;quot;&lt;br /&gt;
       valid_request = false&lt;br /&gt;
     else&lt;br /&gt;
       team = AssignmentParticipant.find(@participant_id).team&lt;br /&gt;
&lt;br /&gt;
       if team.nil? # flash error if this current participant does not have a team&lt;br /&gt;
         flash[:error] = &amp;quot;You should create or join a team first.&amp;quot;&lt;br /&gt;
         valid_request = false&lt;br /&gt;
       else&lt;br /&gt;
         if assignment.topics? &amp;amp;&amp;amp; team.topic.nil? # flash error if this assignment has topic but current team does not have a topic&lt;br /&gt;
           flash[:error] = &amp;quot;Your team should have a topic.&amp;quot;&lt;br /&gt;
           valid_request = false&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
     if valid_request &amp;amp;&amp;amp; Questionnaire::QUESTIONNAIRE_TYPES.include?(params[:model])&lt;br /&gt;
       @questionnaire = Object.const_get(params[:model]).new&lt;br /&gt;
       @questionnaire.private = params[:private]&lt;br /&gt;
       @questionnaire.min_question_score = 0&lt;br /&gt;
       @questionnaire.max_question_score = 1&lt;br /&gt;
&lt;br /&gt;
       render :new&lt;br /&gt;
     else&lt;br /&gt;
       redirect_to controller: 'submitted_content', action: 'view', id: params[:pid]&lt;br /&gt;
     end&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
   # seperate method for creating a quiz questionnaire because of differences in permission&lt;br /&gt;
   def create&lt;br /&gt;
     valid = QuizQuestionnaire.valid&lt;br /&gt;
     if valid.eql?(&amp;quot;valid&amp;quot;)&lt;br /&gt;
       @questionnaire = Object.const_get(params[:questionnaire][:type]).new(questionnaire_params)&lt;br /&gt;
&lt;br /&gt;
       # TODO: check for Quiz Questionnaire?&lt;br /&gt;
       if @questionnaire.type == &amp;quot;QuizQuestionnaire&amp;quot; # checking if it is a quiz questionnaire&lt;br /&gt;
         participant_id = params[:pid] # creating a local variable to send as parameter to submitted content if it is a quiz questionnaire&lt;br /&gt;
         @questionnaire.min_question_score = 0&lt;br /&gt;
         @questionnaire.max_question_score = 1&lt;br /&gt;
         author_team = AssignmentTeam.team(Participant.find(participant_id))&lt;br /&gt;
&lt;br /&gt;
         @questionnaire.instructor_id = author_team.id # for a team assignment, set the instructor id to the team_id&lt;br /&gt;
&lt;br /&gt;
         @successful_create = true&lt;br /&gt;
         save&lt;br /&gt;
&lt;br /&gt;
         save_choices @questionnaire.id&lt;br /&gt;
&lt;br /&gt;
         flash[:note] = &amp;quot;The quiz was successfully created.&amp;quot; if @successful_create == true&lt;br /&gt;
         redirect_to controller: 'submitted_content', action: 'edit', id: participant_id&lt;br /&gt;
       else # if it is not a quiz questionnaire&lt;br /&gt;
         @questionnaire.instructor_id = Ta.get_my_instructor(session[:user].id) if session[:user].role.name == &amp;quot;Teaching Assistant&amp;quot;&lt;br /&gt;
         save&lt;br /&gt;
&lt;br /&gt;
         redirect_to controller: 'tree_display', action: 'list'&lt;br /&gt;
       end&lt;br /&gt;
     else&lt;br /&gt;
       flash[:error] = valid.to_s&lt;br /&gt;
       redirect_to :back&lt;br /&gt;
     end&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
   # edit a quiz questionnaire&lt;br /&gt;
   def edit&lt;br /&gt;
     @questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
     if !@questionnaire.taken_by_anyone?&lt;br /&gt;
       render :edit&lt;br /&gt;
     else&lt;br /&gt;
       flash[:error] = &amp;quot;Your quiz has been taken by some other students, you cannot edit it anymore.&amp;quot;&lt;br /&gt;
       redirect_to controller: 'submitted_content', action: 'view', id: params[:pid]&lt;br /&gt;
     end&lt;br /&gt;
   end&lt;br /&gt;
   # save an updated quiz questionnaire to the database&lt;br /&gt;
   def update&lt;br /&gt;
     @questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
     if @questionnaire.nil?&lt;br /&gt;
       redirect_to controller: 'submitted_content', action: 'view', id: params[:pid]&lt;br /&gt;
       return&lt;br /&gt;
     end&lt;br /&gt;
     if params['save'] &amp;amp;&amp;amp; params[:question].try(:keys)&lt;br /&gt;
       @questionnaire.update_attributes(questionnaire_params)&lt;br /&gt;
&lt;br /&gt;
       for qid in params[:question].keys&lt;br /&gt;
         @question = Question.find(qid)&lt;br /&gt;
         @question.txt = params[:question][qid.to_sym][:txt]&lt;br /&gt;
         @question.save&lt;br /&gt;
&lt;br /&gt;
         @quiz_question_choices = QuizQuestionChoice.where(question_id: qid)&lt;br /&gt;
         i = 1&lt;br /&gt;
         for quiz_question_choice in @quiz_question_choices&lt;br /&gt;
           type = @question.type&lt;br /&gt;
           id = @question.id&lt;br /&gt;
           QuizQuestionnaire.change_question_types(quiz_question_choice, type, id, i)&lt;br /&gt;
           i += 1&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
     redirect_to controller: 'submitted_content', action: 'view', id: params[:pid]&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Problem 2''': Refactor the long methods in questionnaires_controller.rb, such as create and create_questionnaire, update quiz, valid quiz, etc.&lt;br /&gt;
* '''Solution''': &lt;br /&gt;
a. Deleted the create_questionnaire method and replaced the call to it in create_quiz_questionnaire with the code of create_questionnaire and is later moved to quiz_questionnaires_controller.rb and the code snippet below is used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def create&lt;br /&gt;
     valid = QuizQuestionnaire.valid&lt;br /&gt;
     if valid.eql?(&amp;quot;valid&amp;quot;)&lt;br /&gt;
       @questionnaire = Object.const_get(params[:questionnaire][:type]).new(questionnaire_params)&lt;br /&gt;
&lt;br /&gt;
       # TODO: check for Quiz Questionnaire?&lt;br /&gt;
       if @questionnaire.type == &amp;quot;QuizQuestionnaire&amp;quot; # checking if it is a quiz questionnaire&lt;br /&gt;
         participant_id = params[:pid] # creating a local variable to send as parameter to submitted content if it is a quiz questionnaire&lt;br /&gt;
         @questionnaire.min_question_score = 0&lt;br /&gt;
         @questionnaire.max_question_score = 1&lt;br /&gt;
         author_team = AssignmentTeam.team(Participant.find(participant_id))&lt;br /&gt;
&lt;br /&gt;
         @questionnaire.instructor_id = author_team.id # for a team assignment, set the instructor id to the team_id&lt;br /&gt;
&lt;br /&gt;
         @successful_create = true&lt;br /&gt;
         save&lt;br /&gt;
&lt;br /&gt;
         save_choices @questionnaire.id&lt;br /&gt;
&lt;br /&gt;
         flash[:note] = &amp;quot;The quiz was successfully created.&amp;quot; if @successful_create == true&lt;br /&gt;
         redirect_to controller: 'submitted_content', action: 'edit', id: participant_id&lt;br /&gt;
       else # if it is not a quiz questionnaire&lt;br /&gt;
         @questionnaire.instructor_id = Ta.get_my_instructor(session[:user].id) if session[:user].role.name == &amp;quot;Teaching Assistant&amp;quot;&lt;br /&gt;
         save&lt;br /&gt;
&lt;br /&gt;
         redirect_to controller: 'tree_display', action: 'list'&lt;br /&gt;
       end&lt;br /&gt;
     else&lt;br /&gt;
       flash[:error] = valid.to_s&lt;br /&gt;
       redirect_to :back&lt;br /&gt;
     end&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
b. Moved the large block of for and if statements into method called change_question_types in the quiz_questionnaire model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def change_question_types(quiz_question_choice, type, id, i)&lt;br /&gt;
&lt;br /&gt;
	if type == &amp;quot;MultipleChoiceCheckbox&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            if params[:quiz_question_choices][id.to_s][type][i.to_s]&lt;br /&gt;
              quiz_question_choice.update_attributes(iscorrect: params[:quiz_question_choices][id.to_s][type][i.to_s][:iscorrect], txt: params[:quiz_question_choices][id.to_s][type][i.to_s][:txt])&lt;br /&gt;
&lt;br /&gt;
            else&lt;br /&gt;
              quiz_question_choice.update_attributes(iscorrect: '0', txt: params[:quiz_question_choices][quiz_question_choice.id.to_s][:txt])&lt;br /&gt;
            end&lt;br /&gt;
          end&lt;br /&gt;
&lt;br /&gt;
          if type == &amp;quot;MultipleChoiceRadio&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            if params[:quiz_question_choices][id.to_s][type][:correctindex] == i.to_s&lt;br /&gt;
              quiz_question_choice.update_attributes(iscorrect: '1', txt: params[:quiz_question_choices][id.to_s][type][i.to_s][:txt])&lt;br /&gt;
&lt;br /&gt;
            else&lt;br /&gt;
              quiz_question_choice.update_attributes(iscorrect: '0', txt: params[:quiz_question_choices][id.to_s][type][i.to_s][:txt])&lt;br /&gt;
            end&lt;br /&gt;
          end&lt;br /&gt;
&lt;br /&gt;
          if type == &amp;quot;TrueFalse&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            if params[:quiz_question_choices][id.to_s][type][1.to_s][:iscorrect] == &amp;quot;True&amp;quot; # the statement is correct&lt;br /&gt;
&lt;br /&gt;
              if quiz_question_choice.txt == &amp;quot;True&amp;quot;&lt;br /&gt;
                quiz_question_choice.update_attributes(iscorrect: '1') # the statement is correct so &amp;quot;True&amp;quot; is the right answer&lt;br /&gt;
&lt;br /&gt;
              else&lt;br /&gt;
                quiz_question_choice.update_attributes(iscorrect: '0')&lt;br /&gt;
              end&lt;br /&gt;
&lt;br /&gt;
            else # the statement is not correct&lt;br /&gt;
&lt;br /&gt;
              if quiz_question_choice.txt == &amp;quot;True&amp;quot;&lt;br /&gt;
                quiz_question_choice.update_attributes(iscorrect: '0')&lt;br /&gt;
&lt;br /&gt;
              else&lt;br /&gt;
                quiz_question_choice.update_attributes(iscorrect: '1') # the statement is not correct so &amp;quot;False&amp;quot; is the right answer&lt;br /&gt;
              end&lt;br /&gt;
            end&lt;br /&gt;
          end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
c. Replaced large block of for and if statements in update with a call to the new change_question_types method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     for quiz_question_choice in @quiz_question_choices&lt;br /&gt;
           type = @question.type&lt;br /&gt;
           id = @question.id&lt;br /&gt;
           QuizQuestionnaire.change_question_types(quiz_question_choice, type, id, i)&lt;br /&gt;
           i += 1&lt;br /&gt;
         end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
d. Moved export, import, copy_questionnaire_details, and assign_instructor_id to questionaire model. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def copy_questionnaire_details(questions, orig_questionnaire, id)&lt;br /&gt;
    self.instructor_id = self.assign_instructor_id()&lt;br /&gt;
    self.name = 'Copy of ' + orig_questionnaire.name&lt;br /&gt;
&lt;br /&gt;
    begin&lt;br /&gt;
      self.created_at = Time.now&lt;br /&gt;
      self.save!&lt;br /&gt;
      questions.each do |question|&lt;br /&gt;
        new_question = question.dup&lt;br /&gt;
        new_question.questionnaire_id = id&lt;br /&gt;
        new_question.size = '50,3' if (new_question.is_a? Criterion or new_question.is_a? TextResponse) and new_question.size.nil?&lt;br /&gt;
        new_question.save!&lt;br /&gt;
        advices = QuestionAdvice.where(question_id: question.id)&lt;br /&gt;
        next if advices.empty?&lt;br /&gt;
        advices.each do |advice|&lt;br /&gt;
          new_advice = advice.dup&lt;br /&gt;
          new_advice.question_id = new_question.id&lt;br /&gt;
          new_advice.save!&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      pFolder = TreeFolder.find_by(name: question.set_display_type(display_type))&lt;br /&gt;
      parent = FolderNode.find_by(node_object_id: pFolder.id)&lt;br /&gt;
      QuestionnaireNode.find_or_create_by(parent_id: parent.id, node_object_id: id)&lt;br /&gt;
      undo_link(&amp;quot;Copy of questionnaire #{orig_questionnaire.name} has been created successfully.&amp;quot;)&lt;br /&gt;
      redirect_to controller: 'questionnaires', action: 'view', id: @questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = 'The questionnaire was not able to be copied. Please check the original course for missing information.' + $ERROR_INFO&lt;br /&gt;
      redirect_to action: 'list', controller: 'tree_display'&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def export&lt;br /&gt;
    @questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    csv_data = QuestionnaireHelper.create_questionnaire_csv @questionnaire, session[:user].name&lt;br /&gt;
    send_data csv_data,&lt;br /&gt;
              type: 'text/csv; charset=iso-8859-1; header=present',&lt;br /&gt;
              disposition: &amp;quot;attachment; filename=questionnaires.csv&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def import&lt;br /&gt;
    @questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    file = params['csv']&lt;br /&gt;
    @questionnaire.questions &amp;lt;&amp;lt; QuestionnaireHelper.get_questions_from_csv(@questionnaire, file)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def assign_instructor_id&lt;br /&gt;
    # if the user to copy the questionnaire is a TA, the instructor should be the owner instead of the TA&lt;br /&gt;
    if session[:user].role.name != &amp;quot;Teaching Assistant&amp;quot;&lt;br /&gt;
      session[:user].id&lt;br /&gt;
    else # for TA we need to get his instructor id and by default add it to his course for which he is the TA&lt;br /&gt;
      Ta.get_my_instructor(session[:user].id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3''': Replace switch statements with subclasses methods and create models for the subclasses.&lt;br /&gt;
* '''Solution''': Moved the switch-case statement from create in questionaire_controller.rb into a method called set_display_type in questionaire model. The following is the code snippet that shows the same.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  def set_dispay_type(display_type)&lt;br /&gt;
&lt;br /&gt;
      case display_type&lt;br /&gt;
&lt;br /&gt;
      when 'Review'&lt;br /&gt;
	display_type = 'Review'&lt;br /&gt;
&lt;br /&gt;
      when 'Metareview'&lt;br /&gt;
	display_type = 'Metareview'&lt;br /&gt;
&lt;br /&gt;
      when 'AuthorFeedback'&lt;br /&gt;
        display_type = 'Author%Feedback'&lt;br /&gt;
&lt;br /&gt;
      when 'CourseSurvey'&lt;br /&gt;
        display_type = 'Course%Survey'&lt;br /&gt;
&lt;br /&gt;
      when 'TeammateReview'&lt;br /&gt;
        display_type = 'Teammate%Review'&lt;br /&gt;
&lt;br /&gt;
      when 'GlobalSurvey'&lt;br /&gt;
        display_type = 'Global%Survey'&lt;br /&gt;
&lt;br /&gt;
      when 'AssignmentSurvey'&lt;br /&gt;
        display_type = 'Assignment%Survey'&lt;br /&gt;
&lt;br /&gt;
      when 'Bookmarkrating'&lt;br /&gt;
	display_type = 'Bookmarkrating'&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Problem 4''': Remove hardcoded parameters, such as save_choice method&lt;br /&gt;
* '''Solution''': Hardcoded parameters are removed and necessary constants are defined.&lt;br /&gt;
&lt;br /&gt;
===Test Plans===&lt;br /&gt;
Because the purpose of our project was to better arrange our code, it follows that we also needed to rearrange the tests for that code. We first divided the tests for questionnaires_controller into two test files, questionnaires_controller_spec and quiz_questionnaires_controller_spec and separated the tests for CRUD operations of quiz_questionnaires_controller into the quiz_questionnaires_controller_spec, renaming them from view_quiz, create_quiz and the like to view and create. After this separation of CRUD operation testing, we tested the functionality that we moved out of the controllers into the model including the validation method for the quiz questionnaire. We did not include tests to cover the existing model functions, nor did we test the new set_display_type or change_question_types functions as they are setter methods, which, according to our testing instruction are not worth testing. &lt;br /&gt;
&lt;br /&gt;
The setup for testing was particularly troublesome for the deployment of this project. The tests did not run properly in RubyMine, so it was difficult to ensure they were set up properly, and none of the members of our group have any expertise in rspec testing.&lt;br /&gt;
&lt;br /&gt;
===References===&lt;br /&gt;
&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://github.com/Riounis/expertiza GitHub Project Repository Fork]&lt;br /&gt;
#[http://expertiza.ncsu.edu/ The live Expertiza website]&lt;br /&gt;
#[https://github.com/expertiza/expertiza/pull/1271 GitHub Pull Request]&lt;br /&gt;
#Clean Code: A handbook of agile software craftsmanship. Author: Robert C Martin&lt;/div&gt;</summary>
		<author><name>Sjrappl</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018_E1836_Refactor_quiz_questionnaires_controller.rb&amp;diff=119125</id>
		<title>CSC/ECE 517 Fall 2018 E1836 Refactor quiz questionnaires controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018_E1836_Refactor_quiz_questionnaires_controller.rb&amp;diff=119125"/>
		<updated>2018-11-09T22:44:08Z</updated>

		<summary type="html">&lt;p&gt;Sjrappl: /* Test Plans */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1836. Refactoring quiz_questionnaires_controller.rb==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
The following tasks were accomplished in this project:&lt;br /&gt;
* Created quiz_questionnaire_controller.rb&lt;br /&gt;
* Moved view_quiz, new_quiz, create_quiz_questionnaire, edit_quiz and update_quiz from questionnaires_controller.rb, to quiz_questionnaires_controller.rb, and renamed it as view, new, create, edit and update respectively.&lt;br /&gt;
* Refactored the the long methods in questionnaires_controller.rb, such as create and create_questionnaire, update quiz, valid quiz, etc.&lt;br /&gt;
* Replaced switch statements in questionnaires_controller.rb with subclass methods.&lt;br /&gt;
* Created models for the subclasses.&lt;br /&gt;
* Removed hardcoded parameters, such as save_choice method.&lt;br /&gt;
* Appropriate tests were written to test the code.&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
'''Problem 1''': Create quiz_questionnaire_controller.rb and move some of the methods in the questionnaires_controller.rb to the new file created.&lt;br /&gt;
* '''Solution''': The methods view_quiz, new_quiz, create_quiz, edit_quiz and update_quiz in the questionnaires_controller.rb were the methods identified and moved into the quiz_questionnaire_controller.rb. They were respectively renamed as view, new, create, edit and update. The implementation of the newly created quiz_questionnaire_controller.rb can be seen below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class QuizQuestionnairesController &amp;lt; QuestionnairesController&lt;br /&gt;
&lt;br /&gt;
   #=========================================================================================================&lt;br /&gt;
   # Separate methods for quiz questionnaire&lt;br /&gt;
   #=========================================================================================================&lt;br /&gt;
&lt;br /&gt;
   # View a quiz questionnaire&lt;br /&gt;
   def view&lt;br /&gt;
     @questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
     @participant = Participant.find(params[:pid]) # creating an instance variable since it needs to be sent to submitted_content/edit&lt;br /&gt;
     render :view&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
   # define a new quiz questionnaire&lt;br /&gt;
   # method invoked by the view&lt;br /&gt;
   def new&lt;br /&gt;
     valid_request = true&lt;br /&gt;
     @assignment_id = params[:aid] # creating an instance variable to hold the assignment id&lt;br /&gt;
     @participant_id = params[:pid] # creating an instance variable to hold the participant id&lt;br /&gt;
     assignment = Assignment.find(@assignment_id)&lt;br /&gt;
     if !assignment.require_quiz? # flash error if this assignment does not require quiz&lt;br /&gt;
       flash[:error] = &amp;quot;This assignment does not support the quizzing feature.&amp;quot;&lt;br /&gt;
       valid_request = false&lt;br /&gt;
     else&lt;br /&gt;
       team = AssignmentParticipant.find(@participant_id).team&lt;br /&gt;
&lt;br /&gt;
       if team.nil? # flash error if this current participant does not have a team&lt;br /&gt;
         flash[:error] = &amp;quot;You should create or join a team first.&amp;quot;&lt;br /&gt;
         valid_request = false&lt;br /&gt;
       else&lt;br /&gt;
         if assignment.topics? &amp;amp;&amp;amp; team.topic.nil? # flash error if this assignment has topic but current team does not have a topic&lt;br /&gt;
           flash[:error] = &amp;quot;Your team should have a topic.&amp;quot;&lt;br /&gt;
           valid_request = false&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
     if valid_request &amp;amp;&amp;amp; Questionnaire::QUESTIONNAIRE_TYPES.include?(params[:model])&lt;br /&gt;
       @questionnaire = Object.const_get(params[:model]).new&lt;br /&gt;
       @questionnaire.private = params[:private]&lt;br /&gt;
       @questionnaire.min_question_score = 0&lt;br /&gt;
       @questionnaire.max_question_score = 1&lt;br /&gt;
&lt;br /&gt;
       render :new&lt;br /&gt;
     else&lt;br /&gt;
       redirect_to controller: 'submitted_content', action: 'view', id: params[:pid]&lt;br /&gt;
     end&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
   # seperate method for creating a quiz questionnaire because of differences in permission&lt;br /&gt;
   def create&lt;br /&gt;
     valid = QuizQuestionnaire.valid&lt;br /&gt;
     if valid.eql?(&amp;quot;valid&amp;quot;)&lt;br /&gt;
       @questionnaire = Object.const_get(params[:questionnaire][:type]).new(questionnaire_params)&lt;br /&gt;
&lt;br /&gt;
       # TODO: check for Quiz Questionnaire?&lt;br /&gt;
       if @questionnaire.type == &amp;quot;QuizQuestionnaire&amp;quot; # checking if it is a quiz questionnaire&lt;br /&gt;
         participant_id = params[:pid] # creating a local variable to send as parameter to submitted content if it is a quiz questionnaire&lt;br /&gt;
         @questionnaire.min_question_score = 0&lt;br /&gt;
         @questionnaire.max_question_score = 1&lt;br /&gt;
         author_team = AssignmentTeam.team(Participant.find(participant_id))&lt;br /&gt;
&lt;br /&gt;
         @questionnaire.instructor_id = author_team.id # for a team assignment, set the instructor id to the team_id&lt;br /&gt;
&lt;br /&gt;
         @successful_create = true&lt;br /&gt;
         save&lt;br /&gt;
&lt;br /&gt;
         save_choices @questionnaire.id&lt;br /&gt;
&lt;br /&gt;
         flash[:note] = &amp;quot;The quiz was successfully created.&amp;quot; if @successful_create == true&lt;br /&gt;
         redirect_to controller: 'submitted_content', action: 'edit', id: participant_id&lt;br /&gt;
       else # if it is not a quiz questionnaire&lt;br /&gt;
         @questionnaire.instructor_id = Ta.get_my_instructor(session[:user].id) if session[:user].role.name == &amp;quot;Teaching Assistant&amp;quot;&lt;br /&gt;
         save&lt;br /&gt;
&lt;br /&gt;
         redirect_to controller: 'tree_display', action: 'list'&lt;br /&gt;
       end&lt;br /&gt;
     else&lt;br /&gt;
       flash[:error] = valid.to_s&lt;br /&gt;
       redirect_to :back&lt;br /&gt;
     end&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
   # edit a quiz questionnaire&lt;br /&gt;
   def edit&lt;br /&gt;
     @questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
     if !@questionnaire.taken_by_anyone?&lt;br /&gt;
       render :edit&lt;br /&gt;
     else&lt;br /&gt;
       flash[:error] = &amp;quot;Your quiz has been taken by some other students, you cannot edit it anymore.&amp;quot;&lt;br /&gt;
       redirect_to controller: 'submitted_content', action: 'view', id: params[:pid]&lt;br /&gt;
     end&lt;br /&gt;
   end&lt;br /&gt;
   # save an updated quiz questionnaire to the database&lt;br /&gt;
   def update&lt;br /&gt;
     @questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
     if @questionnaire.nil?&lt;br /&gt;
       redirect_to controller: 'submitted_content', action: 'view', id: params[:pid]&lt;br /&gt;
       return&lt;br /&gt;
     end&lt;br /&gt;
     if params['save'] &amp;amp;&amp;amp; params[:question].try(:keys)&lt;br /&gt;
       @questionnaire.update_attributes(questionnaire_params)&lt;br /&gt;
&lt;br /&gt;
       for qid in params[:question].keys&lt;br /&gt;
         @question = Question.find(qid)&lt;br /&gt;
         @question.txt = params[:question][qid.to_sym][:txt]&lt;br /&gt;
         @question.save&lt;br /&gt;
&lt;br /&gt;
         @quiz_question_choices = QuizQuestionChoice.where(question_id: qid)&lt;br /&gt;
         i = 1&lt;br /&gt;
         for quiz_question_choice in @quiz_question_choices&lt;br /&gt;
           type = @question.type&lt;br /&gt;
           id = @question.id&lt;br /&gt;
           QuizQuestionnaire.change_question_types(quiz_question_choice, type, id, i)&lt;br /&gt;
           i += 1&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
     redirect_to controller: 'submitted_content', action: 'view', id: params[:pid]&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Problem 2''': Refactor the long methods in questionnaires_controller.rb, such as create and create_questionnaire, update quiz, valid quiz, etc.&lt;br /&gt;
* '''Solution''': &lt;br /&gt;
a. Deleted the create_questionnaire method and replaced the call to it in create_quiz_questionnaire with the code of create_questionnaire and is later moved to quiz_questionnaires_controller.rb and the code snippet below is used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def create&lt;br /&gt;
     valid = QuizQuestionnaire.valid&lt;br /&gt;
     if valid.eql?(&amp;quot;valid&amp;quot;)&lt;br /&gt;
       @questionnaire = Object.const_get(params[:questionnaire][:type]).new(questionnaire_params)&lt;br /&gt;
&lt;br /&gt;
       # TODO: check for Quiz Questionnaire?&lt;br /&gt;
       if @questionnaire.type == &amp;quot;QuizQuestionnaire&amp;quot; # checking if it is a quiz questionnaire&lt;br /&gt;
         participant_id = params[:pid] # creating a local variable to send as parameter to submitted content if it is a quiz questionnaire&lt;br /&gt;
         @questionnaire.min_question_score = 0&lt;br /&gt;
         @questionnaire.max_question_score = 1&lt;br /&gt;
         author_team = AssignmentTeam.team(Participant.find(participant_id))&lt;br /&gt;
&lt;br /&gt;
         @questionnaire.instructor_id = author_team.id # for a team assignment, set the instructor id to the team_id&lt;br /&gt;
&lt;br /&gt;
         @successful_create = true&lt;br /&gt;
         save&lt;br /&gt;
&lt;br /&gt;
         save_choices @questionnaire.id&lt;br /&gt;
&lt;br /&gt;
         flash[:note] = &amp;quot;The quiz was successfully created.&amp;quot; if @successful_create == true&lt;br /&gt;
         redirect_to controller: 'submitted_content', action: 'edit', id: participant_id&lt;br /&gt;
       else # if it is not a quiz questionnaire&lt;br /&gt;
         @questionnaire.instructor_id = Ta.get_my_instructor(session[:user].id) if session[:user].role.name == &amp;quot;Teaching Assistant&amp;quot;&lt;br /&gt;
         save&lt;br /&gt;
&lt;br /&gt;
         redirect_to controller: 'tree_display', action: 'list'&lt;br /&gt;
       end&lt;br /&gt;
     else&lt;br /&gt;
       flash[:error] = valid.to_s&lt;br /&gt;
       redirect_to :back&lt;br /&gt;
     end&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
b. Moved the large block of for and if statements into method called change_question_types in the quiz_questionnaire model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def change_question_types(quiz_question_choice, type, id, i)&lt;br /&gt;
&lt;br /&gt;
	if type == &amp;quot;MultipleChoiceCheckbox&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            if params[:quiz_question_choices][id.to_s][type][i.to_s]&lt;br /&gt;
              quiz_question_choice.update_attributes(iscorrect: params[:quiz_question_choices][id.to_s][type][i.to_s][:iscorrect], txt: params[:quiz_question_choices][id.to_s][type][i.to_s][:txt])&lt;br /&gt;
&lt;br /&gt;
            else&lt;br /&gt;
              quiz_question_choice.update_attributes(iscorrect: '0', txt: params[:quiz_question_choices][quiz_question_choice.id.to_s][:txt])&lt;br /&gt;
            end&lt;br /&gt;
          end&lt;br /&gt;
&lt;br /&gt;
          if type == &amp;quot;MultipleChoiceRadio&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            if params[:quiz_question_choices][id.to_s][type][:correctindex] == i.to_s&lt;br /&gt;
              quiz_question_choice.update_attributes(iscorrect: '1', txt: params[:quiz_question_choices][id.to_s][type][i.to_s][:txt])&lt;br /&gt;
&lt;br /&gt;
            else&lt;br /&gt;
              quiz_question_choice.update_attributes(iscorrect: '0', txt: params[:quiz_question_choices][id.to_s][type][i.to_s][:txt])&lt;br /&gt;
            end&lt;br /&gt;
          end&lt;br /&gt;
&lt;br /&gt;
          if type == &amp;quot;TrueFalse&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            if params[:quiz_question_choices][id.to_s][type][1.to_s][:iscorrect] == &amp;quot;True&amp;quot; # the statement is correct&lt;br /&gt;
&lt;br /&gt;
              if quiz_question_choice.txt == &amp;quot;True&amp;quot;&lt;br /&gt;
                quiz_question_choice.update_attributes(iscorrect: '1') # the statement is correct so &amp;quot;True&amp;quot; is the right answer&lt;br /&gt;
&lt;br /&gt;
              else&lt;br /&gt;
                quiz_question_choice.update_attributes(iscorrect: '0')&lt;br /&gt;
              end&lt;br /&gt;
&lt;br /&gt;
            else # the statement is not correct&lt;br /&gt;
&lt;br /&gt;
              if quiz_question_choice.txt == &amp;quot;True&amp;quot;&lt;br /&gt;
                quiz_question_choice.update_attributes(iscorrect: '0')&lt;br /&gt;
&lt;br /&gt;
              else&lt;br /&gt;
                quiz_question_choice.update_attributes(iscorrect: '1') # the statement is not correct so &amp;quot;False&amp;quot; is the right answer&lt;br /&gt;
              end&lt;br /&gt;
            end&lt;br /&gt;
          end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
c. Replaced large block of for and if statements in update with a call to the new change_question_types method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     for quiz_question_choice in @quiz_question_choices&lt;br /&gt;
           type = @question.type&lt;br /&gt;
           id = @question.id&lt;br /&gt;
           QuizQuestionnaire.change_question_types(quiz_question_choice, type, id, i)&lt;br /&gt;
           i += 1&lt;br /&gt;
         end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
d. Moved export, import, copy_questionnaire_details, and assign_instructor_id to questionaire model. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def copy_questionnaire_details(questions, orig_questionnaire, id)&lt;br /&gt;
    self.instructor_id = self.assign_instructor_id()&lt;br /&gt;
    self.name = 'Copy of ' + orig_questionnaire.name&lt;br /&gt;
&lt;br /&gt;
    begin&lt;br /&gt;
      self.created_at = Time.now&lt;br /&gt;
      self.save!&lt;br /&gt;
      questions.each do |question|&lt;br /&gt;
        new_question = question.dup&lt;br /&gt;
        new_question.questionnaire_id = id&lt;br /&gt;
        new_question.size = '50,3' if (new_question.is_a? Criterion or new_question.is_a? TextResponse) and new_question.size.nil?&lt;br /&gt;
        new_question.save!&lt;br /&gt;
        advices = QuestionAdvice.where(question_id: question.id)&lt;br /&gt;
        next if advices.empty?&lt;br /&gt;
        advices.each do |advice|&lt;br /&gt;
          new_advice = advice.dup&lt;br /&gt;
          new_advice.question_id = new_question.id&lt;br /&gt;
          new_advice.save!&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      pFolder = TreeFolder.find_by(name: question.set_display_type(display_type))&lt;br /&gt;
      parent = FolderNode.find_by(node_object_id: pFolder.id)&lt;br /&gt;
      QuestionnaireNode.find_or_create_by(parent_id: parent.id, node_object_id: id)&lt;br /&gt;
      undo_link(&amp;quot;Copy of questionnaire #{orig_questionnaire.name} has been created successfully.&amp;quot;)&lt;br /&gt;
      redirect_to controller: 'questionnaires', action: 'view', id: @questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = 'The questionnaire was not able to be copied. Please check the original course for missing information.' + $ERROR_INFO&lt;br /&gt;
      redirect_to action: 'list', controller: 'tree_display'&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def export&lt;br /&gt;
    @questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    csv_data = QuestionnaireHelper.create_questionnaire_csv @questionnaire, session[:user].name&lt;br /&gt;
    send_data csv_data,&lt;br /&gt;
              type: 'text/csv; charset=iso-8859-1; header=present',&lt;br /&gt;
              disposition: &amp;quot;attachment; filename=questionnaires.csv&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def import&lt;br /&gt;
    @questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    file = params['csv']&lt;br /&gt;
    @questionnaire.questions &amp;lt;&amp;lt; QuestionnaireHelper.get_questions_from_csv(@questionnaire, file)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def assign_instructor_id&lt;br /&gt;
    # if the user to copy the questionnaire is a TA, the instructor should be the owner instead of the TA&lt;br /&gt;
    if session[:user].role.name != &amp;quot;Teaching Assistant&amp;quot;&lt;br /&gt;
      session[:user].id&lt;br /&gt;
    else # for TA we need to get his instructor id and by default add it to his course for which he is the TA&lt;br /&gt;
      Ta.get_my_instructor(session[:user].id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3''': Replace switch statements with subclasses methods and create models for the subclasses.&lt;br /&gt;
* '''Solution''': Moved the switch-case statement from create in questionaire_controller.rb into a method called set_display_type in questionaire model. The following is the code snippet that shows the same.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  def set_dispay_type(display_type)&lt;br /&gt;
&lt;br /&gt;
      case display_type&lt;br /&gt;
&lt;br /&gt;
      when 'Review'&lt;br /&gt;
	display_type = 'Review'&lt;br /&gt;
&lt;br /&gt;
      when 'Metareview'&lt;br /&gt;
	display_type = 'Metareview'&lt;br /&gt;
&lt;br /&gt;
      when 'AuthorFeedback'&lt;br /&gt;
        display_type = 'Author%Feedback'&lt;br /&gt;
&lt;br /&gt;
      when 'CourseSurvey'&lt;br /&gt;
        display_type = 'Course%Survey'&lt;br /&gt;
&lt;br /&gt;
      when 'TeammateReview'&lt;br /&gt;
        display_type = 'Teammate%Review'&lt;br /&gt;
&lt;br /&gt;
      when 'GlobalSurvey'&lt;br /&gt;
        display_type = 'Global%Survey'&lt;br /&gt;
&lt;br /&gt;
      when 'AssignmentSurvey'&lt;br /&gt;
        display_type = 'Assignment%Survey'&lt;br /&gt;
&lt;br /&gt;
      when 'Bookmarkrating'&lt;br /&gt;
	display_type = 'Bookmarkrating'&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Problem 4''': Remove hardcoded parameters, such as save_choice method&lt;br /&gt;
* '''Solution''': Hardcoded parameters are removed and necessary constants are defined.&lt;br /&gt;
&lt;br /&gt;
===Test Plans===&lt;br /&gt;
Because the purpose of our project was to better arrange our code, it follows that we also needed to rearrange the tests for that code. We first divided the tests for questionnaires_controller into two test files, questionnaires_controller_spec and quiz_questionnaires_controller_spec and separated the tests for CRUD operations of quiz_questionnaires_controller into the quiz_questionnaires_controller_spec. After this separation of CRUD operation testing, we tested the functionality that we moved out of the controllers into the model. This includes set_display_type, get_weighted_score, compute_weighted_score, true_false_questions?, max_possible_score, validate_questionnaire, copy_questionnaire_details, and assign_instructor id in questionnaires_controller, and symbol, get_assignments_for, get_weighted_score, compute_weighted_score, valid, change_question_types, taken_by_anyone?, and taken_by? in quiz_questionnaire_controller.&lt;br /&gt;
&lt;br /&gt;
The setup for testing was particularly troublesome for the deployment of this project. The tests did not run properly in RubyMine, so it was difficult to ensure they were set up properly.&lt;/div&gt;</summary>
		<author><name>Sjrappl</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018_E1836_Refactor_quiz_questionnaires_controller.rb&amp;diff=119124</id>
		<title>CSC/ECE 517 Fall 2018 E1836 Refactor quiz questionnaires controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2018_E1836_Refactor_quiz_questionnaires_controller.rb&amp;diff=119124"/>
		<updated>2018-11-09T22:41:54Z</updated>

		<summary type="html">&lt;p&gt;Sjrappl: /* Test Plans */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==E1836. Refactoring quiz_questionnaires_controller.rb==&lt;br /&gt;
&lt;br /&gt;
This page provides a description of the Expertiza based OSS project. &lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===About Expertiza===&lt;br /&gt;
&lt;br /&gt;
[http://expertiza.ncsu.edu/ Expertiza] is an open source project based on [http://rubyonrails.org/ Ruby on Rails] framework. Expertiza allows the instructor to create new assignments and customize new or existing assignments. It also allows the instructor to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions. Expertiza supports submission across various document types, including the URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
===Problem Statement===&lt;br /&gt;
The following tasks were accomplished in this project:&lt;br /&gt;
* Created quiz_questionnaire_controller.rb&lt;br /&gt;
* Moved view_quiz, new_quiz, create_quiz_questionnaire, edit_quiz and update_quiz from questionnaires_controller.rb, to quiz_questionnaires_controller.rb, and renamed it as view, new, create, edit and update respectively.&lt;br /&gt;
* Refactored the the long methods in questionnaires_controller.rb, such as create and create_questionnaire, update quiz, valid quiz, etc.&lt;br /&gt;
* Replaced switch statements in questionnaires_controller.rb with subclass methods.&lt;br /&gt;
* Created models for the subclasses.&lt;br /&gt;
* Removed hardcoded parameters, such as save_choice method.&lt;br /&gt;
* Appropriate tests were written to test the code.&lt;br /&gt;
&lt;br /&gt;
===Implementation===&lt;br /&gt;
&lt;br /&gt;
'''Problem 1''': Create quiz_questionnaire_controller.rb and move some of the methods in the questionnaires_controller.rb to the new file created.&lt;br /&gt;
* '''Solution''': The methods view_quiz, new_quiz, create_quiz, edit_quiz and update_quiz in the questionnaires_controller.rb were the methods identified and moved into the quiz_questionnaire_controller.rb. They were respectively renamed as view, new, create, edit and update. The implementation of the newly created quiz_questionnaire_controller.rb can be seen below.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class QuizQuestionnairesController &amp;lt; QuestionnairesController&lt;br /&gt;
&lt;br /&gt;
   #=========================================================================================================&lt;br /&gt;
   # Separate methods for quiz questionnaire&lt;br /&gt;
   #=========================================================================================================&lt;br /&gt;
&lt;br /&gt;
   # View a quiz questionnaire&lt;br /&gt;
   def view&lt;br /&gt;
     @questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
     @participant = Participant.find(params[:pid]) # creating an instance variable since it needs to be sent to submitted_content/edit&lt;br /&gt;
     render :view&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
   # define a new quiz questionnaire&lt;br /&gt;
   # method invoked by the view&lt;br /&gt;
   def new&lt;br /&gt;
     valid_request = true&lt;br /&gt;
     @assignment_id = params[:aid] # creating an instance variable to hold the assignment id&lt;br /&gt;
     @participant_id = params[:pid] # creating an instance variable to hold the participant id&lt;br /&gt;
     assignment = Assignment.find(@assignment_id)&lt;br /&gt;
     if !assignment.require_quiz? # flash error if this assignment does not require quiz&lt;br /&gt;
       flash[:error] = &amp;quot;This assignment does not support the quizzing feature.&amp;quot;&lt;br /&gt;
       valid_request = false&lt;br /&gt;
     else&lt;br /&gt;
       team = AssignmentParticipant.find(@participant_id).team&lt;br /&gt;
&lt;br /&gt;
       if team.nil? # flash error if this current participant does not have a team&lt;br /&gt;
         flash[:error] = &amp;quot;You should create or join a team first.&amp;quot;&lt;br /&gt;
         valid_request = false&lt;br /&gt;
       else&lt;br /&gt;
         if assignment.topics? &amp;amp;&amp;amp; team.topic.nil? # flash error if this assignment has topic but current team does not have a topic&lt;br /&gt;
           flash[:error] = &amp;quot;Your team should have a topic.&amp;quot;&lt;br /&gt;
           valid_request = false&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
&lt;br /&gt;
     if valid_request &amp;amp;&amp;amp; Questionnaire::QUESTIONNAIRE_TYPES.include?(params[:model])&lt;br /&gt;
       @questionnaire = Object.const_get(params[:model]).new&lt;br /&gt;
       @questionnaire.private = params[:private]&lt;br /&gt;
       @questionnaire.min_question_score = 0&lt;br /&gt;
       @questionnaire.max_question_score = 1&lt;br /&gt;
&lt;br /&gt;
       render :new&lt;br /&gt;
     else&lt;br /&gt;
       redirect_to controller: 'submitted_content', action: 'view', id: params[:pid]&lt;br /&gt;
     end&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
   # seperate method for creating a quiz questionnaire because of differences in permission&lt;br /&gt;
   def create&lt;br /&gt;
     valid = QuizQuestionnaire.valid&lt;br /&gt;
     if valid.eql?(&amp;quot;valid&amp;quot;)&lt;br /&gt;
       @questionnaire = Object.const_get(params[:questionnaire][:type]).new(questionnaire_params)&lt;br /&gt;
&lt;br /&gt;
       # TODO: check for Quiz Questionnaire?&lt;br /&gt;
       if @questionnaire.type == &amp;quot;QuizQuestionnaire&amp;quot; # checking if it is a quiz questionnaire&lt;br /&gt;
         participant_id = params[:pid] # creating a local variable to send as parameter to submitted content if it is a quiz questionnaire&lt;br /&gt;
         @questionnaire.min_question_score = 0&lt;br /&gt;
         @questionnaire.max_question_score = 1&lt;br /&gt;
         author_team = AssignmentTeam.team(Participant.find(participant_id))&lt;br /&gt;
&lt;br /&gt;
         @questionnaire.instructor_id = author_team.id # for a team assignment, set the instructor id to the team_id&lt;br /&gt;
&lt;br /&gt;
         @successful_create = true&lt;br /&gt;
         save&lt;br /&gt;
&lt;br /&gt;
         save_choices @questionnaire.id&lt;br /&gt;
&lt;br /&gt;
         flash[:note] = &amp;quot;The quiz was successfully created.&amp;quot; if @successful_create == true&lt;br /&gt;
         redirect_to controller: 'submitted_content', action: 'edit', id: participant_id&lt;br /&gt;
       else # if it is not a quiz questionnaire&lt;br /&gt;
         @questionnaire.instructor_id = Ta.get_my_instructor(session[:user].id) if session[:user].role.name == &amp;quot;Teaching Assistant&amp;quot;&lt;br /&gt;
         save&lt;br /&gt;
&lt;br /&gt;
         redirect_to controller: 'tree_display', action: 'list'&lt;br /&gt;
       end&lt;br /&gt;
     else&lt;br /&gt;
       flash[:error] = valid.to_s&lt;br /&gt;
       redirect_to :back&lt;br /&gt;
     end&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
   # edit a quiz questionnaire&lt;br /&gt;
   def edit&lt;br /&gt;
     @questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
     if !@questionnaire.taken_by_anyone?&lt;br /&gt;
       render :edit&lt;br /&gt;
     else&lt;br /&gt;
       flash[:error] = &amp;quot;Your quiz has been taken by some other students, you cannot edit it anymore.&amp;quot;&lt;br /&gt;
       redirect_to controller: 'submitted_content', action: 'view', id: params[:pid]&lt;br /&gt;
     end&lt;br /&gt;
   end&lt;br /&gt;
   # save an updated quiz questionnaire to the database&lt;br /&gt;
   def update&lt;br /&gt;
     @questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
     if @questionnaire.nil?&lt;br /&gt;
       redirect_to controller: 'submitted_content', action: 'view', id: params[:pid]&lt;br /&gt;
       return&lt;br /&gt;
     end&lt;br /&gt;
     if params['save'] &amp;amp;&amp;amp; params[:question].try(:keys)&lt;br /&gt;
       @questionnaire.update_attributes(questionnaire_params)&lt;br /&gt;
&lt;br /&gt;
       for qid in params[:question].keys&lt;br /&gt;
         @question = Question.find(qid)&lt;br /&gt;
         @question.txt = params[:question][qid.to_sym][:txt]&lt;br /&gt;
         @question.save&lt;br /&gt;
&lt;br /&gt;
         @quiz_question_choices = QuizQuestionChoice.where(question_id: qid)&lt;br /&gt;
         i = 1&lt;br /&gt;
         for quiz_question_choice in @quiz_question_choices&lt;br /&gt;
           type = @question.type&lt;br /&gt;
           id = @question.id&lt;br /&gt;
           QuizQuestionnaire.change_question_types(quiz_question_choice, type, id, i)&lt;br /&gt;
           i += 1&lt;br /&gt;
         end&lt;br /&gt;
       end&lt;br /&gt;
     end&lt;br /&gt;
     redirect_to controller: 'submitted_content', action: 'view', id: params[:pid]&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Problem 2''': Refactor the long methods in questionnaires_controller.rb, such as create and create_questionnaire, update quiz, valid quiz, etc.&lt;br /&gt;
* '''Solution''': &lt;br /&gt;
a. Deleted the create_questionnaire method and replaced the call to it in create_quiz_questionnaire with the code of create_questionnaire and is later moved to quiz_questionnaires_controller.rb and the code snippet below is used.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def create&lt;br /&gt;
     valid = QuizQuestionnaire.valid&lt;br /&gt;
     if valid.eql?(&amp;quot;valid&amp;quot;)&lt;br /&gt;
       @questionnaire = Object.const_get(params[:questionnaire][:type]).new(questionnaire_params)&lt;br /&gt;
&lt;br /&gt;
       # TODO: check for Quiz Questionnaire?&lt;br /&gt;
       if @questionnaire.type == &amp;quot;QuizQuestionnaire&amp;quot; # checking if it is a quiz questionnaire&lt;br /&gt;
         participant_id = params[:pid] # creating a local variable to send as parameter to submitted content if it is a quiz questionnaire&lt;br /&gt;
         @questionnaire.min_question_score = 0&lt;br /&gt;
         @questionnaire.max_question_score = 1&lt;br /&gt;
         author_team = AssignmentTeam.team(Participant.find(participant_id))&lt;br /&gt;
&lt;br /&gt;
         @questionnaire.instructor_id = author_team.id # for a team assignment, set the instructor id to the team_id&lt;br /&gt;
&lt;br /&gt;
         @successful_create = true&lt;br /&gt;
         save&lt;br /&gt;
&lt;br /&gt;
         save_choices @questionnaire.id&lt;br /&gt;
&lt;br /&gt;
         flash[:note] = &amp;quot;The quiz was successfully created.&amp;quot; if @successful_create == true&lt;br /&gt;
         redirect_to controller: 'submitted_content', action: 'edit', id: participant_id&lt;br /&gt;
       else # if it is not a quiz questionnaire&lt;br /&gt;
         @questionnaire.instructor_id = Ta.get_my_instructor(session[:user].id) if session[:user].role.name == &amp;quot;Teaching Assistant&amp;quot;&lt;br /&gt;
         save&lt;br /&gt;
&lt;br /&gt;
         redirect_to controller: 'tree_display', action: 'list'&lt;br /&gt;
       end&lt;br /&gt;
     else&lt;br /&gt;
       flash[:error] = valid.to_s&lt;br /&gt;
       redirect_to :back&lt;br /&gt;
     end&lt;br /&gt;
   end&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
b. Moved the large block of for and if statements into method called change_question_types in the quiz_questionnaire model.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
def change_question_types(quiz_question_choice, type, id, i)&lt;br /&gt;
&lt;br /&gt;
	if type == &amp;quot;MultipleChoiceCheckbox&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            if params[:quiz_question_choices][id.to_s][type][i.to_s]&lt;br /&gt;
              quiz_question_choice.update_attributes(iscorrect: params[:quiz_question_choices][id.to_s][type][i.to_s][:iscorrect], txt: params[:quiz_question_choices][id.to_s][type][i.to_s][:txt])&lt;br /&gt;
&lt;br /&gt;
            else&lt;br /&gt;
              quiz_question_choice.update_attributes(iscorrect: '0', txt: params[:quiz_question_choices][quiz_question_choice.id.to_s][:txt])&lt;br /&gt;
            end&lt;br /&gt;
          end&lt;br /&gt;
&lt;br /&gt;
          if type == &amp;quot;MultipleChoiceRadio&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            if params[:quiz_question_choices][id.to_s][type][:correctindex] == i.to_s&lt;br /&gt;
              quiz_question_choice.update_attributes(iscorrect: '1', txt: params[:quiz_question_choices][id.to_s][type][i.to_s][:txt])&lt;br /&gt;
&lt;br /&gt;
            else&lt;br /&gt;
              quiz_question_choice.update_attributes(iscorrect: '0', txt: params[:quiz_question_choices][id.to_s][type][i.to_s][:txt])&lt;br /&gt;
            end&lt;br /&gt;
          end&lt;br /&gt;
&lt;br /&gt;
          if type == &amp;quot;TrueFalse&amp;quot;&lt;br /&gt;
&lt;br /&gt;
            if params[:quiz_question_choices][id.to_s][type][1.to_s][:iscorrect] == &amp;quot;True&amp;quot; # the statement is correct&lt;br /&gt;
&lt;br /&gt;
              if quiz_question_choice.txt == &amp;quot;True&amp;quot;&lt;br /&gt;
                quiz_question_choice.update_attributes(iscorrect: '1') # the statement is correct so &amp;quot;True&amp;quot; is the right answer&lt;br /&gt;
&lt;br /&gt;
              else&lt;br /&gt;
                quiz_question_choice.update_attributes(iscorrect: '0')&lt;br /&gt;
              end&lt;br /&gt;
&lt;br /&gt;
            else # the statement is not correct&lt;br /&gt;
&lt;br /&gt;
              if quiz_question_choice.txt == &amp;quot;True&amp;quot;&lt;br /&gt;
                quiz_question_choice.update_attributes(iscorrect: '0')&lt;br /&gt;
&lt;br /&gt;
              else&lt;br /&gt;
                quiz_question_choice.update_attributes(iscorrect: '1') # the statement is not correct so &amp;quot;False&amp;quot; is the right answer&lt;br /&gt;
              end&lt;br /&gt;
            end&lt;br /&gt;
          end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
c. Replaced large block of for and if statements in update with a call to the new change_question_types method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
     for quiz_question_choice in @quiz_question_choices&lt;br /&gt;
           type = @question.type&lt;br /&gt;
           id = @question.id&lt;br /&gt;
           QuizQuestionnaire.change_question_types(quiz_question_choice, type, id, i)&lt;br /&gt;
           i += 1&lt;br /&gt;
         end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
d. Moved export, import, copy_questionnaire_details, and assign_instructor_id to questionaire model. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  def copy_questionnaire_details(questions, orig_questionnaire, id)&lt;br /&gt;
    self.instructor_id = self.assign_instructor_id()&lt;br /&gt;
    self.name = 'Copy of ' + orig_questionnaire.name&lt;br /&gt;
&lt;br /&gt;
    begin&lt;br /&gt;
      self.created_at = Time.now&lt;br /&gt;
      self.save!&lt;br /&gt;
      questions.each do |question|&lt;br /&gt;
        new_question = question.dup&lt;br /&gt;
        new_question.questionnaire_id = id&lt;br /&gt;
        new_question.size = '50,3' if (new_question.is_a? Criterion or new_question.is_a? TextResponse) and new_question.size.nil?&lt;br /&gt;
        new_question.save!&lt;br /&gt;
        advices = QuestionAdvice.where(question_id: question.id)&lt;br /&gt;
        next if advices.empty?&lt;br /&gt;
        advices.each do |advice|&lt;br /&gt;
          new_advice = advice.dup&lt;br /&gt;
          new_advice.question_id = new_question.id&lt;br /&gt;
          new_advice.save!&lt;br /&gt;
        end&lt;br /&gt;
      end&lt;br /&gt;
&lt;br /&gt;
      pFolder = TreeFolder.find_by(name: question.set_display_type(display_type))&lt;br /&gt;
      parent = FolderNode.find_by(node_object_id: pFolder.id)&lt;br /&gt;
      QuestionnaireNode.find_or_create_by(parent_id: parent.id, node_object_id: id)&lt;br /&gt;
      undo_link(&amp;quot;Copy of questionnaire #{orig_questionnaire.name} has been created successfully.&amp;quot;)&lt;br /&gt;
      redirect_to controller: 'questionnaires', action: 'view', id: @questionnaire.id&lt;br /&gt;
    rescue StandardError&lt;br /&gt;
      flash[:error] = 'The questionnaire was not able to be copied. Please check the original course for missing information.' + $ERROR_INFO&lt;br /&gt;
      redirect_to action: 'list', controller: 'tree_display'&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def export&lt;br /&gt;
    @questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    csv_data = QuestionnaireHelper.create_questionnaire_csv @questionnaire, session[:user].name&lt;br /&gt;
    send_data csv_data,&lt;br /&gt;
              type: 'text/csv; charset=iso-8859-1; header=present',&lt;br /&gt;
              disposition: &amp;quot;attachment; filename=questionnaires.csv&amp;quot;&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def import&lt;br /&gt;
    @questionnaire = Questionnaire.find(params[:id])&lt;br /&gt;
    file = params['csv']&lt;br /&gt;
    @questionnaire.questions &amp;lt;&amp;lt; QuestionnaireHelper.get_questions_from_csv(@questionnaire, file)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def assign_instructor_id&lt;br /&gt;
    # if the user to copy the questionnaire is a TA, the instructor should be the owner instead of the TA&lt;br /&gt;
    if session[:user].role.name != &amp;quot;Teaching Assistant&amp;quot;&lt;br /&gt;
      session[:user].id&lt;br /&gt;
    else # for TA we need to get his instructor id and by default add it to his course for which he is the TA&lt;br /&gt;
      Ta.get_my_instructor(session[:user].id)&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
3''': Replace switch statements with subclasses methods and create models for the subclasses.&lt;br /&gt;
* '''Solution''': Moved the switch-case statement from create in questionaire_controller.rb into a method called set_display_type in questionaire model. The following is the code snippet that shows the same.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
  def set_dispay_type(display_type)&lt;br /&gt;
&lt;br /&gt;
      case display_type&lt;br /&gt;
&lt;br /&gt;
      when 'Review'&lt;br /&gt;
	display_type = 'Review'&lt;br /&gt;
&lt;br /&gt;
      when 'Metareview'&lt;br /&gt;
	display_type = 'Metareview'&lt;br /&gt;
&lt;br /&gt;
      when 'AuthorFeedback'&lt;br /&gt;
        display_type = 'Author%Feedback'&lt;br /&gt;
&lt;br /&gt;
      when 'CourseSurvey'&lt;br /&gt;
        display_type = 'Course%Survey'&lt;br /&gt;
&lt;br /&gt;
      when 'TeammateReview'&lt;br /&gt;
        display_type = 'Teammate%Review'&lt;br /&gt;
&lt;br /&gt;
      when 'GlobalSurvey'&lt;br /&gt;
        display_type = 'Global%Survey'&lt;br /&gt;
&lt;br /&gt;
      when 'AssignmentSurvey'&lt;br /&gt;
        display_type = 'Assignment%Survey'&lt;br /&gt;
&lt;br /&gt;
      when 'Bookmarkrating'&lt;br /&gt;
	display_type = 'Bookmarkrating'&lt;br /&gt;
      end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''Problem 4''': Remove hardcoded parameters, such as save_choice method&lt;br /&gt;
* '''Solution''': Hardcoded parameters are removed and necessary constants are defined.&lt;br /&gt;
&lt;br /&gt;
===Test Plans===&lt;br /&gt;
Because the purpose of our project was to better arrange our code, it follows that we also needed to rearrange the tests for that code. We first divided the tests for questionnaires_controller into two test files, questionnaires_controller_spec and quiz_questionnaires_controller_spec and separated the tests for CRUD operations of quiz_questionnaires_controller into the quiz_questionnaires_controller_spec. After this separation of CRUD operation testing, we tested the functionality that we moved out of the controllers into the model. This includes set_display_type, get_weighted_score, compute_weighted_score, true_false_questions?, max_possible_score, validate_questionnaire, copy_questionnaire_details, and assign_instructor id in questionnaires_controller, and symbol, get_assignments_for, get_weighted_score, compute_weighted_score, valid, change_question_types, taken_by_anyone?, and taken_by? in quiz_questionnaire_controller.&lt;/div&gt;</summary>
		<author><name>Sjrappl</name></author>
	</entry>
</feed>