<?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=Ssiddha</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=Ssiddha"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Ssiddha"/>
	<updated>2026-05-10T10:20:02Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:UseCase_rubric.png&amp;diff=123665</id>
		<title>File:UseCase rubric.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:UseCase_rubric.png&amp;diff=123665"/>
		<updated>2019-04-09T01:08:51Z</updated>

		<summary type="html">&lt;p&gt;Ssiddha: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ssiddha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1924._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=123664</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1924. Regulate changing of rubrics while projects are in progress</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1924._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=123664"/>
		<updated>2019-04-09T01:08:27Z</updated>

		<summary type="html">&lt;p&gt;Ssiddha: /* Use case Diagram */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Regulate changing of rubrics while projects are in progress '''&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc). It consists of multiple features, one such feature is the ability to setup an assignment by an instructor. While setting up an assignment, the instructor would be asked to choose different kinds of rubrics. Any of these rubrics can later be edited or changed to a different rubric. A problem arises when an assignment is underway (students have already started reviewing) and a rubric is edited or changed. Some students started reviewing with the old rubric and the rest of the students who had not started a review will be presented with the updated rubric. This usually happens when an assignment is copied from a previous year and the rubrics are not updated to match the current topic. It could be at a later point that the instructor/TA realizes this and changes it. The goal of this project is two-fold: One, If a rubric is replaced, or the items/questions are changed, then all the reviews that have been done need to be redone and two, the system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Setting up and Building the Project'''==&lt;br /&gt;
Follow the Guidelines mentioned in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/expertiza/expertiza/blob/master/README.md read me]&amp;lt;/span&amp;gt; page of the project's Wiki Page for building the Project in a Local Environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
===Current Scenario===&lt;br /&gt;
Currently, when an instructor updates a questionnaire rubric of an ongoing assignment, the reviews are not reset and moreover, no notifications are sent to reviewers to update them of the changes made. Moreover, the instructor, post making changes, would have to individually inform each reviewer of the changes made and ask them to change the reviews accordingly.&lt;br /&gt;
&lt;br /&gt;
===Expected Solution===&lt;br /&gt;
The project aims to resolve the two main issue arising from the problems mentioned above:&lt;br /&gt;
&lt;br /&gt;
* If a rubric is replaced, or the items/questions are changed, then all the reviews that have been done need to be redone&lt;br /&gt;
* The system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.&lt;br /&gt;
&lt;br /&gt;
Further descriptions about how the project will be implemented and what files will be changed are mentioned in subsequent sections.&lt;br /&gt;
&lt;br /&gt;
=='''Design Diagrams'''==&lt;br /&gt;
===Use case Diagram===&lt;br /&gt;
&lt;br /&gt;
[[File:UseCase_rubric.png|Use Case Diagram]]&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution'''==&lt;br /&gt;
The solution is divided into 2 phases viz. Identification of edit and Notification.&lt;br /&gt;
&lt;br /&gt;
===Identification of edit===&lt;br /&gt;
When a rubric is submitted after an edit, the update method is called. The current rubric is made such that the question type (Radio/Checkbox/True or False) is not editable, however, the wording of the question can be edited. The questions can be deleted and/or added. We term an edit as major edit if the change involves addition or deletion of a question and a minor edit corresponds to editing any existing questions. The params passed to the controller also includes a tag/identifier if a new question was added. We plan on using this identifier along with the number of questions to identify it the changes made were major or minor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===E-mail Notification===&lt;br /&gt;
Once this solution finds that the rubric has major edits and there exists some user who has started the response (corresponding records exist), email notification module is initiated. In this phase, these records are pulled from the ActiveRecord and sent to the user through email. Once the email is sent successfully, records are deleted from the DB.&lt;br /&gt;
&lt;br /&gt;
At this stage, the user has all the details already added by them and when they click on &amp;quot;Review&amp;quot;, the questions now correspond to the new rubric. This lets the user to edit on the new rubric without losing data for any question. One of the motives behind sending these responses as email is that the first few questions in the review may be similar across rubrics and the user may re-use the same responses when prompted with the new rubric.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Code Change'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
The current rspec file describes various contexts for testing such as adding new questions if attributes weren't correctly entered etc. As stated in the earlier sections, the update method of the questionnaire controller would be edited to identify major changes and trigger emails and deletions of records of responses. A context corresponding to this in the spec file for questionnaire controller under the describe block for update would be added.&lt;br /&gt;
&lt;br /&gt;
At this moment we are thinking of at least 2 new test cases, both these cases correspond to editing a rubric:&lt;br /&gt;
# If there is no new question added and the question id's match with the ones in the record - validate the existence of the record&lt;br /&gt;
# If there is a new question added - assert if the email was sent&lt;/div&gt;</summary>
		<author><name>Ssiddha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1924._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=123663</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1924. Regulate changing of rubrics while projects are in progress</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1924._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=123663"/>
		<updated>2019-04-09T01:08:03Z</updated>

		<summary type="html">&lt;p&gt;Ssiddha: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Regulate changing of rubrics while projects are in progress '''&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc). It consists of multiple features, one such feature is the ability to setup an assignment by an instructor. While setting up an assignment, the instructor would be asked to choose different kinds of rubrics. Any of these rubrics can later be edited or changed to a different rubric. A problem arises when an assignment is underway (students have already started reviewing) and a rubric is edited or changed. Some students started reviewing with the old rubric and the rest of the students who had not started a review will be presented with the updated rubric. This usually happens when an assignment is copied from a previous year and the rubrics are not updated to match the current topic. It could be at a later point that the instructor/TA realizes this and changes it. The goal of this project is two-fold: One, If a rubric is replaced, or the items/questions are changed, then all the reviews that have been done need to be redone and two, the system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Setting up and Building the Project'''==&lt;br /&gt;
Follow the Guidelines mentioned in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/expertiza/expertiza/blob/master/README.md read me]&amp;lt;/span&amp;gt; page of the project's Wiki Page for building the Project in a Local Environment.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
===Current Scenario===&lt;br /&gt;
Currently, when an instructor updates a questionnaire rubric of an ongoing assignment, the reviews are not reset and moreover, no notifications are sent to reviewers to update them of the changes made. Moreover, the instructor, post making changes, would have to individually inform each reviewer of the changes made and ask them to change the reviews accordingly.&lt;br /&gt;
&lt;br /&gt;
===Expected Solution===&lt;br /&gt;
The project aims to resolve the two main issue arising from the problems mentioned above:&lt;br /&gt;
&lt;br /&gt;
* If a rubric is replaced, or the items/questions are changed, then all the reviews that have been done need to be redone&lt;br /&gt;
* The system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.&lt;br /&gt;
&lt;br /&gt;
Further descriptions about how the project will be implemented and what files will be changed are mentioned in subsequent sections.&lt;br /&gt;
&lt;br /&gt;
=='''Design Diagrams'''==&lt;br /&gt;
===Use case Diagram===&lt;br /&gt;
&lt;br /&gt;
[[File:UseCase.png|Use Case Diagram]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution'''==&lt;br /&gt;
The solution is divided into 2 phases viz. Identification of edit and Notification.&lt;br /&gt;
&lt;br /&gt;
===Identification of edit===&lt;br /&gt;
When a rubric is submitted after an edit, the update method is called. The current rubric is made such that the question type (Radio/Checkbox/True or False) is not editable, however, the wording of the question can be edited. The questions can be deleted and/or added. We term an edit as major edit if the change involves addition or deletion of a question and a minor edit corresponds to editing any existing questions. The params passed to the controller also includes a tag/identifier if a new question was added. We plan on using this identifier along with the number of questions to identify it the changes made were major or minor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===E-mail Notification===&lt;br /&gt;
Once this solution finds that the rubric has major edits and there exists some user who has started the response (corresponding records exist), email notification module is initiated. In this phase, these records are pulled from the ActiveRecord and sent to the user through email. Once the email is sent successfully, records are deleted from the DB.&lt;br /&gt;
&lt;br /&gt;
At this stage, the user has all the details already added by them and when they click on &amp;quot;Review&amp;quot;, the questions now correspond to the new rubric. This lets the user to edit on the new rubric without losing data for any question. One of the motives behind sending these responses as email is that the first few questions in the review may be similar across rubrics and the user may re-use the same responses when prompted with the new rubric.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Code Change'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
The current rspec file describes various contexts for testing such as adding new questions if attributes weren't correctly entered etc. As stated in the earlier sections, the update method of the questionnaire controller would be edited to identify major changes and trigger emails and deletions of records of responses. A context corresponding to this in the spec file for questionnaire controller under the describe block for update would be added.&lt;br /&gt;
&lt;br /&gt;
At this moment we are thinking of at least 2 new test cases, both these cases correspond to editing a rubric:&lt;br /&gt;
# If there is no new question added and the question id's match with the ones in the record - validate the existence of the record&lt;br /&gt;
# If there is a new question added - assert if the email was sent&lt;/div&gt;</summary>
		<author><name>Ssiddha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1924._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=123660</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1924. Regulate changing of rubrics while projects are in progress</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1924._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=123660"/>
		<updated>2019-04-09T00:44:31Z</updated>

		<summary type="html">&lt;p&gt;Ssiddha: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Regulate changing of rubrics while projects are in progress '''&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc). It consists of multiple features, one such feature is the ability to setup an assignment by an instructor. While setting up an assignment, the instructor would be asked to choose different kinds of rubrics. Any of these rubrics can later be edited or changed to a different rubric. A problem arises when an assignment is underway (students have already started reviewing) and a rubric is edited or changed. Some students started reviewing with the old rubric and the rest of the students who had not started a review will be presented with the updated rubric. This usually happens when an assignment is copied from a previous year and the rubrics are not updated to match the current topic. It could be at a later point that the instructor/TA realizes this and changes it. The goal of this project is two-fold: One, If a rubric is replaced, or the items/questions are changed, then all the reviews that have been done need to be redone and two, the system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Setting up and Building the Project'''==&lt;br /&gt;
Follow the Guidelines mentioned in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/expertiza/expertiza/blob/master/README.md read me]&amp;lt;/span&amp;gt; page of the project's Wiki Page for building the Project in a Local Environment.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
===Current Scenario===&lt;br /&gt;
Currently, when an instructor updates a questionnaire rubric of an ongoing assignment, the reviews are not reset and moreover, no notifications are sent to reviewers to update them of the changes made. Moreover, the instructor, post making changes, would have to individually inform each reviewer of the changes made and ask them to change the reviews accordingly.&lt;br /&gt;
&lt;br /&gt;
===Expected Solution===&lt;br /&gt;
The project aims to resolve the two main issue arising from the problems mentioned above:&lt;br /&gt;
&lt;br /&gt;
* If a rubric is replaced, or the items/questions are changed, then all the reviews that have been done need to be redone&lt;br /&gt;
* The system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.&lt;br /&gt;
&lt;br /&gt;
Further descriptions about how the project will be implemented and what files will be changed are mentioned in subsequent sections.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution'''==&lt;br /&gt;
The solution is divided into 2 phases viz. Identification of edit and Notification.&lt;br /&gt;
&lt;br /&gt;
===Identification of edit===&lt;br /&gt;
When a rubric is submitted after an edit, the update method is called. The current rubric is made such that the question type (Radio/Checkbox/True or False) is not editable, however, the wording of the question can be edited. The questions can be deleted and/or added. We term an edit as major edit if the change involves addition or deletion of a question and a minor edit corresponds to editing any existing questions. The params passed to the controller also includes a tag/identifier if a new question was added. We plan on using this identifier along with the number of questions to identify it the changes made were major or minor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===E-mail Notification===&lt;br /&gt;
Once this solution finds that the rubric has major edits and there exists some user who has started the response (corresponding records exist), email notification module is initiated. In this phase, these records are pulled from the ActiveRecord and sent to the user through email. Once the email is sent successfully, records are deleted from the DB.&lt;br /&gt;
&lt;br /&gt;
At this stage, the user has all the details already added by them and when they click on &amp;quot;Review&amp;quot;, the questions now correspond to the new rubric. This lets the user to edit on the new rubric without losing data for any question. One of the motives behind sending these responses as email is that the first few questions in the review may be similar across rubrics and the user may re-use the same responses when prompted with the new rubric.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Code Change'''==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
The current rspec file describes various contexts for testing such as adding new questions if attributes weren't correctly entered etc. As stated in the earlier sections, the update method of the questionnaire controller would be edited to identify major changes and trigger emails and deletions of records of responses. A context corresponding to this in the spec file for questionnaire controller under the describe block for update would be added.&lt;br /&gt;
&lt;br /&gt;
At this moment we are thinking of at least 2 new test cases, both these cases correspond to editing a rubric:&lt;br /&gt;
# If there is no new question added and the question id's match with the ones in the record - validate the existence of the record&lt;br /&gt;
# If there is a new question added - assert if the email was sent&lt;/div&gt;</summary>
		<author><name>Ssiddha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1924._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=123659</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1924. Regulate changing of rubrics while projects are in progress</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1924._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=123659"/>
		<updated>2019-04-09T00:43:57Z</updated>

		<summary type="html">&lt;p&gt;Ssiddha: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Regulate changing of rubrics while projects are in progress '''&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc). It consists of multiple features, one such feature is the ability to setup an assignment by an instructor. While setting up an assignment, the instructor would be asked to choose different kinds of rubrics. Any of these rubrics can later be edited or changed to a different rubric. A problem arises when an assignment is underway (students have already started reviewing) and a rubric is edited or changed. Some students started reviewing with the old rubric and the rest of the students who had not started a review will be presented with the updated rubric. This usually happens when an assignment is copied from a previous year and the rubrics are not updated to match the current topic. It could be at a later point that the instructor/TA realizes this and changes it. The goal of this project is two-fold: One, If a rubric is replaced, or the items/questions are changed, then all the reviews that have been done need to be redone and two, the system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Setting up and Building the Project'''==&lt;br /&gt;
Follow the Guidelines mentioned in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/expertiza/expertiza/blob/master/README.md read me]&amp;lt;/span&amp;gt; page of the project's Wiki Page for building the Project in a Local Environment.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
===Current Scenario===&lt;br /&gt;
Currently, when an instructor updates a questionnaire rubric of an ongoing assignment, the reviews are not reset and moreover, no notifications are sent to reviewers to update them of the changes made. Moreover, the instructor, post making changes, would have to individually inform each reviewer of the changes made and ask them to change the reviews accordingly.&lt;br /&gt;
&lt;br /&gt;
===Expected Solution===&lt;br /&gt;
The project aims to resolve the two main issue arising from the problems mentioned above:&lt;br /&gt;
&lt;br /&gt;
* If a rubric is replaced, or the items/questions are changed, then all the reviews that have been done need to be redone&lt;br /&gt;
* The system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.&lt;br /&gt;
&lt;br /&gt;
Further descriptions about how the project will be implemented and what files will be changed are mentioned in subsequent sections.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution'''==&lt;br /&gt;
The solution is divided into 2 phases viz. Identification of edit and Notification.&lt;br /&gt;
&lt;br /&gt;
===Identification of edit===&lt;br /&gt;
When a rubric is submitted after an edit, the update method is called. The current rubric is made such that the question type (Radio/Checkbox/True or False) is not editable, however, the wording of the question can be edited. The questions can be deleted and/or added. We term an edit as major edit if the change involves addition or deletion of a question and a minor edit corresponds to editing any existing questions. The params passed to the controller also includes a tag/identifier if a new question was added. We plan on using this identifier along with the number of questions to identify it the changes made were major or minor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===E-mail Notification===&lt;br /&gt;
Once this solution finds that the rubric has major edits and there exists some user who has started the response (corresponding records exist), email notification module is initiated. In this phase, these records are pulled from the ActiveRecord and sent to the user through email. Once the email is sent successfully, records are deleted from the DB.&lt;br /&gt;
&lt;br /&gt;
At this stage, the user has all the details already added by them and when they click on &amp;quot;Review&amp;quot;, the questions now correspond to the new rubric. This lets the user to edit on the new rubric without losing data for any question. One of the motives behind sending these responses as email is that the first few questions in the review may be similar across rubrics and the user may re-use the same responses when prompted with the new rubric.&lt;br /&gt;
&lt;br /&gt;
===Proposed Code Change===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
The current rspec file describes various contexts for testing such as adding new questions if attributes weren't correctly entered etc. As stated in the earlier sections, the update method of the questionnaire controller would be edited to identify major changes and trigger emails and deletions of records of responses. A context corresponding to this in the spec file for questionnaire controller under the describe block for update would be added.&lt;br /&gt;
&lt;br /&gt;
At this moment we are thinking of at least 2 new test cases, both these cases correspond to editing a rubric:&lt;br /&gt;
# If there is no new question added and the question id's match with the ones in the record - validate the existence of the record&lt;br /&gt;
# If there is a new question added - assert if the email was sent&lt;/div&gt;</summary>
		<author><name>Ssiddha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1924._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=123658</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1924. Regulate changing of rubrics while projects are in progress</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1924._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=123658"/>
		<updated>2019-04-09T00:43:06Z</updated>

		<summary type="html">&lt;p&gt;Ssiddha: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Regulate changing of rubrics while projects are in progress '''&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc). It consists of multiple features, one such feature is the ability to setup an assignment by an instructor. While setting up an assignment, the instructor would be asked to choose different kinds of rubrics. Any of these rubrics can later be edited or changed to a different rubric. A problem arises when an assignment is underway (students have already started reviewing) and a rubric is edited or changed. Some students started reviewing with the old rubric and the rest of the students who had not started a review will be presented with the updated rubric. This usually happens when an assignment is copied from a previous year and the rubrics are not updated to match the current topic. It could be at a later point that the instructor/TA realizes this and changes it. The goal of this project is two-fold: One, If a rubric is replaced, or the items/questions are changed, then all the reviews that have been done need to be redone and two, the system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Setting up and Building the Project'''==&lt;br /&gt;
Follow the Guidelines mentioned in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/expertiza/expertiza/blob/master/README.md read me]&amp;lt;/span&amp;gt; page of the project's Wiki Page for building the Project in a Local Environment.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
===Current Scenario===&lt;br /&gt;
Currently, when an instructor updates a questionnaire rubric of an ongoing assignment, the reviews are not reset and moreover, no notifications are sent to reviewers to update them of the changes made. Moreover, the instructor, post making changes, would have to individually inform each reviewer of the changes made and ask them to change the reviews accordingly.&lt;br /&gt;
&lt;br /&gt;
===Expected Solution===&lt;br /&gt;
The project aims to resolve the two main issue arising from the problems mentioned above:&lt;br /&gt;
&lt;br /&gt;
* If a rubric is replaced, or the items/questions are changed, then all the reviews that have been done need to be redone&lt;br /&gt;
* The system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.&lt;br /&gt;
&lt;br /&gt;
Further descriptions about how the project will be implemented and what files will be changed are mentioned in subsequent sections.&lt;br /&gt;
&lt;br /&gt;
===Proposed Solution===&lt;br /&gt;
The solution is divided into 2 phases viz. Identification of edit and Notification.&lt;br /&gt;
&lt;br /&gt;
When a rubric is submitted after an edit, the update method is called. The current rubric is made such that the question type (Radio/Checkbox/True or False) is not editable, however, the wording of the question can be edited. The questions can be deleted and/or added. We term an edit as major edit if the change involves addition or deletion of a question and a minor edit corresponds to editing any existing questions. The params passed to the controller also includes a tag/identifier if a new question was added. We plan on using this identifier along with the number of questions to identify it the changes made were major or minor.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===E-mail Notification===&lt;br /&gt;
Once this solution finds that the rubric has major edits and there exists some user who has started the response (corresponding records exist), email notification module is initiated. In this phase, these records are pulled from the ActiveRecord and sent to the user through email. Once the email is sent successfully, records are deleted from the DB.&lt;br /&gt;
&lt;br /&gt;
At this stage, the user has all the details already added by them and when they click on &amp;quot;Review&amp;quot;, the questions now correspond to the new rubric. This lets the user to edit on the new rubric without losing data for any question. One of the motives behind sending these responses as email is that the first few questions in the review may be similar across rubrics and the user may re-use the same responses when prompted with the new rubric.&lt;br /&gt;
&lt;br /&gt;
===Proposed Code Change===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
The current rspec file describes various contexts for testing such as adding new questions if attributes weren't correctly entered etc. As stated in the earlier sections, the update method of the questionnaire controller would be edited to identify major changes and trigger emails and deletions of records of responses. A context corresponding to this in the spec file for questionnaire controller under the describe block for update would be added.&lt;br /&gt;
&lt;br /&gt;
At this moment we are thinking of at least 2 new test cases, both these cases correspond to editing a rubric:&lt;br /&gt;
# If there is no new question added and the question id's match with the ones in the record - validate the existence of the record&lt;br /&gt;
# If there is a new question added - assert if the email was sent&lt;/div&gt;</summary>
		<author><name>Ssiddha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1924._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=123651</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1924. Regulate changing of rubrics while projects are in progress</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1924._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=123651"/>
		<updated>2019-04-09T00:19:01Z</updated>

		<summary type="html">&lt;p&gt;Ssiddha: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;''' Regulate changing of rubrics while projects are in progress '''&lt;br /&gt;
&lt;br /&gt;
Expertiza is a web application through which students can submit and peer-review learning objects (articles, code, web sites, etc). It consists of multiple features, one such feature is the ability to setup an assignment by an instructor. While setting up an assignment, the instructor would be asked to choose different kinds of rubrics. Any of these rubrics can later be edited or changed to a different rubric. A problem arises when an assignment is underway (students have already started reviewing) and a rubric is edited or changed. Some students started reviewing with the old rubric and the rest of the students who had not started a review will be presented with the updated rubric. This usually happens when an assignment is copied from a previous year and the rubrics are not updated to match the current topic. It could be at a later point that the instructor/TA realizes this and changes it. The goal of this project is two-fold: One, If a rubric is replaced, or the items/questions are changed, then all the reviews that have been done need to be redone and two, the system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Setting up and Building the Project'''==&lt;br /&gt;
Follow the Guidelines mentioned in the &amp;lt;span class=&amp;quot;plainlinks&amp;quot;&amp;gt;[https://github.com/expertiza/expertiza/blob/master/README.md read me]&amp;lt;/span&amp;gt; page of the project's Wiki Page for building the Project in a Local Environment.&lt;br /&gt;
&lt;br /&gt;
=='''Project Description'''==&lt;br /&gt;
===Current Scenario===&lt;br /&gt;
Currently, when an instructor updates a questionnaire rubric of an ongoing assignment, the reviews are not reset and moreover, no notifications are sent to reviewers to update them of the changes made. Moreover, the instructor, post making changes, would have to individually inform each reviewer of the changes made and ask them to change the reviews accordingly.&lt;br /&gt;
&lt;br /&gt;
===Expected Solution===&lt;br /&gt;
The project aims to resolve the two main issue arising from the problems mentioned above:&lt;br /&gt;
&lt;br /&gt;
* If a rubric is replaced, or the items/questions are changed, then all the reviews that have been done need to be redone&lt;br /&gt;
* The system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.&lt;br /&gt;
&lt;br /&gt;
Further descriptions about how the project will be implemented and what files will be changed are mentioned in subsequent sections.&lt;br /&gt;
&lt;br /&gt;
=='''Proposed Solution'''==&lt;br /&gt;
When a rubric is submitted after an edit, the update method is called. The current rubric is made such that the question type is not editable, however, the wording of the question can be edited. The questions can be deleted or/and added. The params passed to the controller also includes a tag/identifier if a new question was added. We plan on using this identifier along with the number of questions to identify it the changes made were major or minor.&lt;br /&gt;
&lt;br /&gt;
If the number of questions returned from view and no new question tag/identifier then the change was minor, else the change was a major one.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===E-mail Notification===&lt;br /&gt;
Once this solution finds that the rubric has major edits and there exists some user who has started the response (corresponding records exist), email notification module is initiated. In this phase, these records are pulled from the ActiveRecord and sent to the user through email. Once the email is sent successfully, records are deleted from the DB.&lt;br /&gt;
&lt;br /&gt;
At this stage, the user has all the details already added by them and when they click on &amp;quot;Review&amp;quot;, the questions now correspond to the new rubric. This lets the user to edit on the new rubric without losing data for any question. One of the motives behind sending these responses as email is that the first few questions in the review may be similar across rubrics and the user may re-use the same responses when prompted with the new rubric.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=='''Test Plan'''==&lt;br /&gt;
The current rspec file describes various contexts for testing such as adding new questions if attributes weren't correctly entered etc. As stated in the earlier sections, the update method of the questionnaire controller would be edited to identify major changes and trigger emails and deletions of records of responses. A context corresponding to this in the spec file for questionnaire controller under the describe block for update would be added.&lt;/div&gt;</summary>
		<author><name>Ssiddha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1924._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=123385</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1924. Regulate changing of rubrics while projects are in progress</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1924._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=123385"/>
		<updated>2019-04-07T01:59:34Z</updated>

		<summary type="html">&lt;p&gt;Ssiddha: Created page with &amp;quot;Test&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Test&lt;/div&gt;</summary>
		<author><name>Ssiddha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019&amp;diff=122608</id>
		<title>CSC/ECE 517 Spring 2019</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019&amp;diff=122608"/>
		<updated>2019-03-28T17:27:30Z</updated>

		<summary type="html">&lt;p&gt;Ssiddha: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;*[[CSC/ECE 517 Spring 2019 - Project E1905. Refactor questionnaires_controller.rb]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2019 - Project E1916. Fix Code Climate issues in controllers with names beginning with A through N]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2019 - Project E1906. Refactor stage deadlines in Assignment.rb]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2019 - Project M1901 Implement missing WebAudio automation support]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2019 - Project E1917. Fix Code Climate issues in controllers with names beginning with P through Z]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2019 - Project E1921. Write tests for popup controller.rb]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2019 - M1902 Refactor bluetooth support for better maintainability]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2019 - E1922. Write tests for assessment360 controller.rb]]&lt;br /&gt;
*[[CSC/ECE 517 Spring 2019 - Project E1907 Refactor response controller]]&lt;br /&gt;
*[[CSC/ECE_517_Spring_2019_-_Project_E1903._Create_quiz_questionnaires_controller.rb]]&lt;/div&gt;</summary>
		<author><name>Ssiddha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1903._Create_quiz_questionnaires_controller.rb&amp;diff=122368</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1903. Create quiz questionnaires controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1903._Create_quiz_questionnaires_controller.rb&amp;diff=122368"/>
		<updated>2019-03-26T00:55:46Z</updated>

		<summary type="html">&lt;p&gt;Ssiddha: /* Changes made to current Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
1. The questionnaires_controller.rb has multiple methods to handle quizzes. Some of these methods cater only to quizzes. The controller has to be refactored into 2 controllers by moving the functions related to quizzes and the dependencies into a new controller called quiz_questionnaire_controller.rb.&lt;br /&gt;
&lt;br /&gt;
2. Some methods in the questionnaires_controller.rb are long or have hardcoded parameters. These methods have to be refactored into shorter functions rid of hardcoded parameters.&lt;br /&gt;
 &lt;br /&gt;
==Changes made to current Implementation==&lt;br /&gt;
&lt;br /&gt;
1. Creation of new controller &amp;lt;br&amp;gt;&lt;br /&gt;
to be filled&lt;br /&gt;
&lt;br /&gt;
2. Creation of Rspec file for new controller &amp;lt;br&amp;gt;&lt;br /&gt;
to be filled&lt;br /&gt;
&lt;br /&gt;
3. Refactoring current controller &amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem''':  Due to multiple refactoring over the years, there are few redundant methods in questionnaire_controller.rb. Additionally, a few of the methods like update_quiz, create contain the redundant piece of code and multiple switch statements.&lt;br /&gt;
&lt;br /&gt;
''Refactoring of create_questionnaire method'':&amp;lt;br&amp;gt;&lt;br /&gt;
The create_questionnaire method from questionnaire_controller.rb is used to create a questionnaire based on the type of questionnaire. The implementation corresponding to the quiz is irrelevant in the context of questionnaire_controller.rb. Newly created quiz_questionnaire_controller.rb undertakes the task of creating a questionnaire of type Quiz and the original method handles the creation of all other types of questionnaires. The control was delegated based on the type of questionnaire and the corresponding method is called.&amp;lt;br&amp;gt;&lt;br /&gt;
Refactored create_questionnaire method &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:create_questionnaire.png]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
Refactored create_quiz_questionnaire method &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:create_quiz_questionnaire.png]]&lt;br /&gt;
&lt;br /&gt;
''Refactoring of create method'': &amp;lt;br&amp;gt;&lt;br /&gt;
The create method is used to create a questionnaire in the questionnaire_controller.rb. Based on the type of questionnaire, the name in the view is changed. Assignment of display type is done using a switch case that takes up 11 lines of code and each case adds &amp;quot;%&amp;quot; to the camel cased value.&lt;br /&gt;
Solution: The implementation was changed to check if the display type matches with the available type and when matched, uses Regex, split and join methods to evaluate the same in a single line.&lt;br /&gt;
&lt;br /&gt;
[[File:Refactor Create Method.png]]&lt;br /&gt;
&lt;br /&gt;
''Refactoring of update_quiz method'':&amp;lt;br&amp;gt;&lt;br /&gt;
The update_quiz method is used to update the quiz when the user edits the existing quiz. Iterating over the set of questions, the attributes are updated based on the type of question (viz. Multiple Choice, Radio, True/False). The implementation for two of these types can be changed and can be used as private methods.&lt;br /&gt;
[[File:Private_methods.png]]&lt;br /&gt;
&lt;br /&gt;
''Refactoring of save_choices method'':&amp;lt;br&amp;gt;&lt;br /&gt;
The save_choices method contains a lot of redundant hard coded data that is not accessed/used in the application. These hardcoded variables were removed and the relevant code is refactored to work seamlessly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Creation of new route for quiz_questionnaire_controller and updated the affected links in views &amp;lt;br&amp;gt;&lt;br /&gt;
Created a new route quiz_questionnaire for quiz_questionnaire_controller in &amp;quot;routes.rb&amp;quot; and moved the custom created &amp;quot;get/post&amp;quot; routes for quizzes from questionnaires route to it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 resources :quiz_questionnaire, only: %i[new create edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      get :new_quiz&lt;br /&gt;
      post :create_quiz_questionnaire&lt;br /&gt;
      get :edit_quiz&lt;br /&gt;
      post :update_quiz&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then changed the controller name and route in all the following views which are accessing quiz_questionnaire_controller while keeping the application flow intact - &lt;br /&gt;
&lt;br /&gt;
/app/views/questionnaire/view.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @questionnaire.type == &amp;quot;QuizQuestionnaire&amp;quot; %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to 'Edit', :controller =&amp;gt; :quiz_questionnaire, :action =&amp;gt; :edit_quiz, :id =&amp;gt; &lt;br /&gt;
@questionnaire.id, :pid =&amp;gt; @participant.id %&amp;gt;|&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/app/views/questionnaire/new_quiz.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;%= form_tag :controller =&amp;gt; 'quiz_questionnaire', :action =&amp;gt; 'create_quiz_questionnaire', &lt;br /&gt;
:pid =&amp;gt; @participant_id, :aid =&amp;gt; @assignment_id do %&amp;gt;&lt;br /&gt;
        &amp;lt;% $disp_flag = 1 %&amp;gt;&lt;br /&gt;
        &amp;lt;%= render :partial =&amp;gt; 'quiz_questionnaire' %&amp;gt;&lt;br /&gt;
        &amp;lt;% $disp_flag = 0 %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%= render :partial =&amp;gt; 'new_question_template' %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        &amp;lt;%= submit_tag &amp;quot;Create Quiz&amp;quot;, :name=&amp;gt;&amp;quot;save&amp;quot; %&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/app/views/questionnaire/edit.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_tag({:controller=&amp;gt;'quiz_questionnaire', :action=&amp;gt;'update_quiz', :id=&amp;gt;@questionnaire.id, :pid =&amp;gt; params[:pid]}, :multipart =&amp;gt; true) do %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
/app/views/submitted_content/_main.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if !t_id.nil? &amp;amp;&amp;amp; questionnaire = QuizQuestionnaire.where([&amp;quot;instructor_id = ?&amp;quot;, t_id]).first %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to 'View quiz', :controller =&amp;gt; :quiz_questionnaire, :action =&amp;gt; :view_quiz, :id =&amp;gt; questionnaire.id, :pid =&amp;gt; participant.id %&amp;gt;&lt;br /&gt;
      &amp;lt;br/&amp;gt;&lt;br /&gt;
      &amp;lt;% if !questionnaire.taken_by_anyone?%&amp;gt;&lt;br /&gt;
        &amp;lt;%= link_to 'Edit quiz', :controller =&amp;gt; :quiz_questionnaire, :action =&amp;gt; :edit_quiz, :id =&amp;gt; questionnaire.id, :pid =&amp;gt; participant.id %&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% else %&amp;gt;&lt;br /&gt;
      &amp;lt;br/&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to 'Create a quiz', :controller =&amp;gt; :quiz_questionnaire, :action =&amp;gt; :new_quiz, :model =&amp;gt; &amp;quot;QuizQuestionnaire&amp;quot;, :private =&amp;gt; 0, :aid =&amp;gt; @assignment.id, :pid =&amp;gt; participant.id %&amp;gt;&lt;br /&gt;
      &amp;lt;br/&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files affected==&lt;br /&gt;
&lt;br /&gt;
The following files were created or refactored&lt;br /&gt;
1. /app/controllers/questionnaires_controller.rb &amp;lt;br&amp;gt;&lt;br /&gt;
2. /app/controllers/quiz_questionnaire_controller.rb &amp;lt;br&amp;gt;&lt;br /&gt;
3. /app/views/questionnaire/view.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
4. /app/views/questionnaire/new_quiz.erb &amp;lt;br&amp;gt;&lt;br /&gt;
5. /app/views/questionnaire/edit.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
6. /app/views/submitted_content/_main.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
7. /config/routes.rb &amp;lt;br&amp;gt;&lt;br /&gt;
8. /spec/controllers/questionnaires_controller_spec.rb &amp;lt;br&amp;gt;&lt;br /&gt;
9. /spec/controllers/quiz_questionnaire_controller_spec.rb &lt;br /&gt;
&lt;br /&gt;
==Team members==&lt;br /&gt;
1. Abhishek Arya (aarya@ncsu.edu) &amp;lt;br&amp;gt;&lt;br /&gt;
2. Nitin Nataraj Kuncham (nkuncha@ncsu.edu) &amp;lt;br&amp;gt;&lt;br /&gt;
3. Suraj Siddharudh (ssiddha@ncsu.edu) &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://www.rubyguides.com/2018/07/rspec-tutorial/ rpec tutorial]&lt;br /&gt;
#[https://www.stackoverflow.com/ Stackoverflow]&lt;/div&gt;</summary>
		<author><name>Ssiddha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Create_quiz_questionnaire.png&amp;diff=122366</id>
		<title>File:Create quiz questionnaire.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Create_quiz_questionnaire.png&amp;diff=122366"/>
		<updated>2019-03-26T00:55:21Z</updated>

		<summary type="html">&lt;p&gt;Ssiddha: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ssiddha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Create_questionnaire.png&amp;diff=122365</id>
		<title>File:Create questionnaire.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Create_questionnaire.png&amp;diff=122365"/>
		<updated>2019-03-26T00:55:00Z</updated>

		<summary type="html">&lt;p&gt;Ssiddha: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ssiddha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1903._Create_quiz_questionnaires_controller.rb&amp;diff=122364</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1903. Create quiz questionnaires controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1903._Create_quiz_questionnaires_controller.rb&amp;diff=122364"/>
		<updated>2019-03-26T00:54:49Z</updated>

		<summary type="html">&lt;p&gt;Ssiddha: /* Changes made to current Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
1. The questionnaires_controller.rb has multiple methods to handle quizzes. Some of these methods cater only to quizzes. The controller has to be refactored into 2 controllers by moving the functions related to quizzes and the dependencies into a new controller called quiz_questionnaire_controller.rb.&lt;br /&gt;
&lt;br /&gt;
2. Some methods in the questionnaires_controller.rb are long or have hardcoded parameters. These methods have to be refactored into shorter functions rid of hardcoded parameters.&lt;br /&gt;
 &lt;br /&gt;
==Changes made to current Implementation==&lt;br /&gt;
&lt;br /&gt;
1. Creation of new controller &amp;lt;br&amp;gt;&lt;br /&gt;
to be filled&lt;br /&gt;
&lt;br /&gt;
2. Creation of Rspec file for new controller &amp;lt;br&amp;gt;&lt;br /&gt;
to be filled&lt;br /&gt;
&lt;br /&gt;
3. Refactoring current controller &amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem''':  Due to multiple refactoring over the years, there are few redundant methods in questionnaire_controller.rb. Additionally, a few of the methods like update_quiz, create contain the redundant piece of code and multiple switch statements.&lt;br /&gt;
&lt;br /&gt;
''Refactoring of create_questionnaire method'':&amp;lt;br&amp;gt;&lt;br /&gt;
The create_questionnaire method from questionnaire_controller.rb is used to create a questionnaire based on the type of questionnaire. The implementation corresponding to the quiz is irrelevant in the context of questionnaire_controller.rb. Newly created quiz_questionnaire_controller.rb undertakes the task of creating a questionnaire of type Quiz and the original method handles the creation of all other types of questionnaires. The control was delegated based on the type of questionnaire and the corresponding method is called.&amp;lt;br&amp;gt;&lt;br /&gt;
Refactored create_questionnaire method &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:create_questionnaire.png]]&lt;br /&gt;
Refactored create_quiz_questionnaire method &amp;lt;br&amp;gt;&lt;br /&gt;
[[File:create_quiz_questionnaire.png]]&lt;br /&gt;
&lt;br /&gt;
''Refactoring of create method'': &amp;lt;br&amp;gt;&lt;br /&gt;
The create method is used to create a questionnaire in the questionnaire_controller.rb. Based on the type of questionnaire, the name in the view is changed. Assignment of display type is done using a switch case that takes up 11 lines of code and each case adds &amp;quot;%&amp;quot; to the camel cased value.&lt;br /&gt;
Solution: The implementation was changed to check if the display type matches with the available type and when matched, uses Regex, split and join methods to evaluate the same in a single line.&lt;br /&gt;
&lt;br /&gt;
[[File:Refactor Create Method.png]]&lt;br /&gt;
&lt;br /&gt;
''Refactoring of update_quiz method'':&amp;lt;br&amp;gt;&lt;br /&gt;
The update_quiz method is used to update the quiz when the user edits the existing quiz. Iterating over the set of questions, the attributes are updated based on the type of question (viz. Multiple Choice, Radio, True/False). The implementation for two of these types can be changed and can be used as private methods.&lt;br /&gt;
[[File:Private_methods.png]]&lt;br /&gt;
&lt;br /&gt;
''Refactoring of save_choices method'':&amp;lt;br&amp;gt;&lt;br /&gt;
The save_choices method contains a lot of redundant hard coded data that is not accessed/used in the application. These hardcoded variables were removed and the relevant code is refactored to work seamlessly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Creation of new route for quiz_questionnaire_controller and updated the affected links in views &amp;lt;br&amp;gt;&lt;br /&gt;
Created a new route quiz_questionnaire for quiz_questionnaire_controller in &amp;quot;routes.rb&amp;quot; and moved the custom created &amp;quot;get/post&amp;quot; routes for quizzes from questionnaires route to it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 resources :quiz_questionnaire, only: %i[new create edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      get :new_quiz&lt;br /&gt;
      post :create_quiz_questionnaire&lt;br /&gt;
      get :edit_quiz&lt;br /&gt;
      post :update_quiz&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then changed the controller name and route in all the following views which are accessing quiz_questionnaire_controller while keeping the application flow intact - &lt;br /&gt;
&lt;br /&gt;
/app/views/questionnaire/view.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @questionnaire.type == &amp;quot;QuizQuestionnaire&amp;quot; %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to 'Edit', :controller =&amp;gt; :quiz_questionnaire, :action =&amp;gt; :edit_quiz, :id =&amp;gt; &lt;br /&gt;
@questionnaire.id, :pid =&amp;gt; @participant.id %&amp;gt;|&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/app/views/questionnaire/new_quiz.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;%= form_tag :controller =&amp;gt; 'quiz_questionnaire', :action =&amp;gt; 'create_quiz_questionnaire', &lt;br /&gt;
:pid =&amp;gt; @participant_id, :aid =&amp;gt; @assignment_id do %&amp;gt;&lt;br /&gt;
        &amp;lt;% $disp_flag = 1 %&amp;gt;&lt;br /&gt;
        &amp;lt;%= render :partial =&amp;gt; 'quiz_questionnaire' %&amp;gt;&lt;br /&gt;
        &amp;lt;% $disp_flag = 0 %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%= render :partial =&amp;gt; 'new_question_template' %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        &amp;lt;%= submit_tag &amp;quot;Create Quiz&amp;quot;, :name=&amp;gt;&amp;quot;save&amp;quot; %&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/app/views/questionnaire/edit.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_tag({:controller=&amp;gt;'quiz_questionnaire', :action=&amp;gt;'update_quiz', :id=&amp;gt;@questionnaire.id, :pid =&amp;gt; params[:pid]}, :multipart =&amp;gt; true) do %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
/app/views/submitted_content/_main.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if !t_id.nil? &amp;amp;&amp;amp; questionnaire = QuizQuestionnaire.where([&amp;quot;instructor_id = ?&amp;quot;, t_id]).first %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to 'View quiz', :controller =&amp;gt; :quiz_questionnaire, :action =&amp;gt; :view_quiz, :id =&amp;gt; questionnaire.id, :pid =&amp;gt; participant.id %&amp;gt;&lt;br /&gt;
      &amp;lt;br/&amp;gt;&lt;br /&gt;
      &amp;lt;% if !questionnaire.taken_by_anyone?%&amp;gt;&lt;br /&gt;
        &amp;lt;%= link_to 'Edit quiz', :controller =&amp;gt; :quiz_questionnaire, :action =&amp;gt; :edit_quiz, :id =&amp;gt; questionnaire.id, :pid =&amp;gt; participant.id %&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% else %&amp;gt;&lt;br /&gt;
      &amp;lt;br/&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to 'Create a quiz', :controller =&amp;gt; :quiz_questionnaire, :action =&amp;gt; :new_quiz, :model =&amp;gt; &amp;quot;QuizQuestionnaire&amp;quot;, :private =&amp;gt; 0, :aid =&amp;gt; @assignment.id, :pid =&amp;gt; participant.id %&amp;gt;&lt;br /&gt;
      &amp;lt;br/&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files affected==&lt;br /&gt;
&lt;br /&gt;
The following files were created or refactored&lt;br /&gt;
1. /app/controllers/questionnaires_controller.rb &amp;lt;br&amp;gt;&lt;br /&gt;
2. /app/controllers/quiz_questionnaire_controller.rb &amp;lt;br&amp;gt;&lt;br /&gt;
3. /app/views/questionnaire/view.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
4. /app/views/questionnaire/new_quiz.erb &amp;lt;br&amp;gt;&lt;br /&gt;
5. /app/views/questionnaire/edit.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
6. /app/views/submitted_content/_main.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
7. /config/routes.rb &amp;lt;br&amp;gt;&lt;br /&gt;
8. /spec/controllers/questionnaires_controller_spec.rb &amp;lt;br&amp;gt;&lt;br /&gt;
9. /spec/controllers/quiz_questionnaire_controller_spec.rb &lt;br /&gt;
&lt;br /&gt;
==Team members==&lt;br /&gt;
1. Abhishek Arya (aarya@ncsu.edu) &amp;lt;br&amp;gt;&lt;br /&gt;
2. Nitin Nataraj Kuncham (nkuncha@ncsu.edu) &amp;lt;br&amp;gt;&lt;br /&gt;
3. Suraj Siddharudh (ssiddha@ncsu.edu) &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://www.rubyguides.com/2018/07/rspec-tutorial/ rpec tutorial]&lt;br /&gt;
#[https://www.stackoverflow.com/ Stackoverflow]&lt;/div&gt;</summary>
		<author><name>Ssiddha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Private_methods.png&amp;diff=122343</id>
		<title>File:Private methods.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Private_methods.png&amp;diff=122343"/>
		<updated>2019-03-26T00:40:25Z</updated>

		<summary type="html">&lt;p&gt;Ssiddha: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ssiddha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1903._Create_quiz_questionnaires_controller.rb&amp;diff=122342</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1903. Create quiz questionnaires controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1903._Create_quiz_questionnaires_controller.rb&amp;diff=122342"/>
		<updated>2019-03-26T00:39:59Z</updated>

		<summary type="html">&lt;p&gt;Ssiddha: /* Changes made to current Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
1. The questionnaires_controller.rb has multiple methods to handle quizzes. Some of these methods cater only to quizzes. The controller has to be refactored into 2 controllers by moving the functions related to quizzes and the dependencies into a new controller called quiz_questionnaire_controller.rb.&lt;br /&gt;
&lt;br /&gt;
2. Some methods in the questionnaires_controller.rb are long or have hardcoded parameters. These methods have to be refactored into shorter functions rid of hardcoded parameters.&lt;br /&gt;
 &lt;br /&gt;
==Changes made to current Implementation==&lt;br /&gt;
&lt;br /&gt;
1. Creation of new controller &amp;lt;br&amp;gt;&lt;br /&gt;
to be filled&lt;br /&gt;
&lt;br /&gt;
2. Creation of Rspec file for new controller &amp;lt;br&amp;gt;&lt;br /&gt;
to be filled&lt;br /&gt;
&lt;br /&gt;
3. Refactoring current controller &amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem''':  Due to multiple refactoring over the years, there are few redundant methods in questionnaire_controller.rb. Additionally, a few of the methods like update_quiz, create contain the redundant piece of code and multiple switch statements.&lt;br /&gt;
&lt;br /&gt;
''Refactoring of create method'': &lt;br /&gt;
The create method is used to create a questionnaire in the questionnaire_controller.rb. Based on the type of questionnaire, the name in the view is changed. Assignment of display type is done using a switch case that takes up 11 lines of code and each case adds &amp;quot;%&amp;quot; to the camel cased value.&lt;br /&gt;
Solution: The implementation was changed to check if the display type matches with the available type and when matched, uses Regex, split and join methods to evaluate the same in a single line.&lt;br /&gt;
&lt;br /&gt;
[[File:Refactor Create Method.png]]&lt;br /&gt;
&lt;br /&gt;
''Refactoring of update_quiz method'':&lt;br /&gt;
The update_quiz method is used to update the quiz when the user edits the existing quiz. Iterating over the set of questions, the attributes are updated based on the type of question (viz. Multiple Choice, Radio, True/False). The implementation for two of these types can be changed and can be used as private methods.&lt;br /&gt;
[[File:Private_methods.png]]&lt;br /&gt;
&lt;br /&gt;
''Refactoring of save_choices method'':&lt;br /&gt;
The save_choices method contains a lot of redundant hard coded data that is not accessed/used in the application. These hardcoded variables were removed and relevant code is refactored to work seemlessly&lt;br /&gt;
&lt;br /&gt;
4. Creation of new route for quiz_questionnaire_controller and updated the affected links in views &amp;lt;br&amp;gt;&lt;br /&gt;
Created a new route quiz_questionnaire for quiz_questionnaire_controller in &amp;quot;routes.rb&amp;quot; and moved the custom created &amp;quot;get/post&amp;quot; routes for quizzes from questionnaires route to it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 resources :quiz_questionnaire, only: %i[new create edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      get :new_quiz&lt;br /&gt;
      post :create_quiz_questionnaire&lt;br /&gt;
      get :edit_quiz&lt;br /&gt;
      post :update_quiz&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then changed the controller name and route in all the following views which are accessing quiz_questionnaire_controller while keeping the application flow intact - &lt;br /&gt;
&lt;br /&gt;
/app/views/questionnaire/view.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @questionnaire.type == &amp;quot;QuizQuestionnaire&amp;quot; %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to 'Edit', :controller =&amp;gt; :quiz_questionnaire, :action =&amp;gt; :edit_quiz, :id =&amp;gt; &lt;br /&gt;
@questionnaire.id, :pid =&amp;gt; @participant.id %&amp;gt;|&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/app/views/questionnaire/new_quiz.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;%= form_tag :controller =&amp;gt; 'quiz_questionnaire', :action =&amp;gt; 'create_quiz_questionnaire', &lt;br /&gt;
:pid =&amp;gt; @participant_id, :aid =&amp;gt; @assignment_id do %&amp;gt;&lt;br /&gt;
        &amp;lt;% $disp_flag = 1 %&amp;gt;&lt;br /&gt;
        &amp;lt;%= render :partial =&amp;gt; 'quiz_questionnaire' %&amp;gt;&lt;br /&gt;
        &amp;lt;% $disp_flag = 0 %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%= render :partial =&amp;gt; 'new_question_template' %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        &amp;lt;%= submit_tag &amp;quot;Create Quiz&amp;quot;, :name=&amp;gt;&amp;quot;save&amp;quot; %&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/app/views/questionnaire/edit.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_tag({:controller=&amp;gt;'quiz_questionnaire', :action=&amp;gt;'update_quiz', :id=&amp;gt;@questionnaire.id, :pid =&amp;gt; params[:pid]}, :multipart =&amp;gt; true) do %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
/app/views/submitted_content/_main.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if !t_id.nil? &amp;amp;&amp;amp; questionnaire = QuizQuestionnaire.where([&amp;quot;instructor_id = ?&amp;quot;, t_id]).first %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to 'View quiz', :controller =&amp;gt; :quiz_questionnaire, :action =&amp;gt; :view_quiz, :id =&amp;gt; questionnaire.id, :pid =&amp;gt; participant.id %&amp;gt;&lt;br /&gt;
      &amp;lt;br/&amp;gt;&lt;br /&gt;
      &amp;lt;% if !questionnaire.taken_by_anyone?%&amp;gt;&lt;br /&gt;
        &amp;lt;%= link_to 'Edit quiz', :controller =&amp;gt; :quiz_questionnaire, :action =&amp;gt; :edit_quiz, :id =&amp;gt; questionnaire.id, :pid =&amp;gt; participant.id %&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% else %&amp;gt;&lt;br /&gt;
      &amp;lt;br/&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to 'Create a quiz', :controller =&amp;gt; :quiz_questionnaire, :action =&amp;gt; :new_quiz, :model =&amp;gt; &amp;quot;QuizQuestionnaire&amp;quot;, :private =&amp;gt; 0, :aid =&amp;gt; @assignment.id, :pid =&amp;gt; participant.id %&amp;gt;&lt;br /&gt;
      &amp;lt;br/&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files affected==&lt;br /&gt;
&lt;br /&gt;
The following files were created or refactored&lt;br /&gt;
1. /app/controllers/questionnaires_controller.rb &amp;lt;br&amp;gt;&lt;br /&gt;
2. /app/controllers/quiz_questionnaire_controller.rb &amp;lt;br&amp;gt;&lt;br /&gt;
3. /app/views/questionnaire/view.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
4. /app/views/questionnaire/new_quiz.erb &amp;lt;br&amp;gt;&lt;br /&gt;
5. /app/views/questionnaire/edit.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
6. /app/views/submitted_content/_main.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
7. /config/routes.rb &amp;lt;br&amp;gt;&lt;br /&gt;
8. /spec/controllers/questionnaires_controller_spec.rb &amp;lt;br&amp;gt;&lt;br /&gt;
9. /spec/controllers/quiz_questionnaire_controller_spec.rb &lt;br /&gt;
&lt;br /&gt;
==Team members==&lt;br /&gt;
1. Abhishek Arya (aarya@ncsu.edu) &amp;lt;br&amp;gt;&lt;br /&gt;
2. Nitin Nataraj Kuncham (nkuncha@ncsu.edu) &amp;lt;br&amp;gt;&lt;br /&gt;
3. Suraj Siddharudh (ssiddha@ncsu.edu) &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://www.rubyguides.com/2018/07/rspec-tutorial/ rpec tutorial]&lt;br /&gt;
#[https://www.stackoverflow.com/ Stackoverflow]&lt;/div&gt;</summary>
		<author><name>Ssiddha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Refactor_Create_Method.png&amp;diff=122338</id>
		<title>File:Refactor Create Method.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Refactor_Create_Method.png&amp;diff=122338"/>
		<updated>2019-03-26T00:28:02Z</updated>

		<summary type="html">&lt;p&gt;Ssiddha: uploaded a new version of &amp;amp;quot;File:Refactor Create Method.png&amp;amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ssiddha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Refactor_Create_Method.png&amp;diff=122337</id>
		<title>File:Refactor Create Method.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Refactor_Create_Method.png&amp;diff=122337"/>
		<updated>2019-03-26T00:27:28Z</updated>

		<summary type="html">&lt;p&gt;Ssiddha: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Ssiddha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1903._Create_quiz_questionnaires_controller.rb&amp;diff=122334</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1903. Create quiz questionnaires controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1903._Create_quiz_questionnaires_controller.rb&amp;diff=122334"/>
		<updated>2019-03-26T00:26:56Z</updated>

		<summary type="html">&lt;p&gt;Ssiddha: /* Changes made to current Implementation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Problem Statement ==&lt;br /&gt;
&lt;br /&gt;
1. The questionnaires_controller.rb has multiple methods to handle quizzes. Some of these methods cater only to quizzes. The controller has to be refactored into 2 controllers by moving the functions related to quizzes and the dependencies into a new controller called quiz_questionnaire_controller.rb.&lt;br /&gt;
&lt;br /&gt;
2. Some methods in the questionnaires_controller.rb are long or have hardcoded parameters. These methods have to be refactored into shorter functions rid of hardcoded parameters.&lt;br /&gt;
 &lt;br /&gt;
==Changes made to current Implementation==&lt;br /&gt;
&lt;br /&gt;
1. Creation of new controller &amp;lt;br&amp;gt;&lt;br /&gt;
to be filled&lt;br /&gt;
&lt;br /&gt;
2. Creation of Rspec file for new controller &amp;lt;br&amp;gt;&lt;br /&gt;
to be filled&lt;br /&gt;
&lt;br /&gt;
3. Refactoring current controller &amp;lt;br&amp;gt;&lt;br /&gt;
'''Problem''':  Due to multiple refactoring over the years, there are few redundant methods in questionnaire_controller.rb. Additionally, a few of the methods like update_quiz, create contain the redundant piece of code and multiple switch statements.&lt;br /&gt;
&lt;br /&gt;
''Refactoring of create method'': &lt;br /&gt;
The create method is used to create a questionnaire in the questionnaire_controller.rb. Based on the type of questionnaire, the name in the view is changed. Assignment of display type is done using a switch case that takes up 11 lines of code and each case adds &amp;quot;%&amp;quot; to the camel cased value.&lt;br /&gt;
Solution: The implementation was changed to check if the display type matches with the available type and when matched, uses Regex, split and join methods to evaluate the same in a single line.&lt;br /&gt;
&lt;br /&gt;
[[File:Refactor Create Method.jpg]]&lt;br /&gt;
&lt;br /&gt;
4. Creation of new route for quiz_questionnaire_controller and updated the affected links in views &amp;lt;br&amp;gt;&lt;br /&gt;
Created a new route quiz_questionnaire for quiz_questionnaire_controller in &amp;quot;routes.rb&amp;quot; and moved the custom created &amp;quot;get/post&amp;quot; routes for quizzes from questionnaires route to it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 resources :quiz_questionnaire, only: %i[new create edit update] do&lt;br /&gt;
    collection do&lt;br /&gt;
      get :new_quiz&lt;br /&gt;
      post :create_quiz_questionnaire&lt;br /&gt;
      get :edit_quiz&lt;br /&gt;
      post :update_quiz&lt;br /&gt;
    end&lt;br /&gt;
  end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Then changed the controller name and route in all the following views which are accessing quiz_questionnaire_controller while keeping the application flow intact - &lt;br /&gt;
&lt;br /&gt;
/app/views/questionnaire/view.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if @questionnaire.type == &amp;quot;QuizQuestionnaire&amp;quot; %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to 'Edit', :controller =&amp;gt; :quiz_questionnaire, :action =&amp;gt; :edit_quiz, :id =&amp;gt; &lt;br /&gt;
@questionnaire.id, :pid =&amp;gt; @participant.id %&amp;gt;|&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/app/views/questionnaire/new_quiz.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 &amp;lt;%= form_tag :controller =&amp;gt; 'quiz_questionnaire', :action =&amp;gt; 'create_quiz_questionnaire', &lt;br /&gt;
:pid =&amp;gt; @participant_id, :aid =&amp;gt; @assignment_id do %&amp;gt;&lt;br /&gt;
        &amp;lt;% $disp_flag = 1 %&amp;gt;&lt;br /&gt;
        &amp;lt;%= render :partial =&amp;gt; 'quiz_questionnaire' %&amp;gt;&lt;br /&gt;
        &amp;lt;% $disp_flag = 0 %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;%= render :partial =&amp;gt; 'new_question_template' %&amp;gt;&lt;br /&gt;
&lt;br /&gt;
        &amp;lt;br&amp;gt;&lt;br /&gt;
        &amp;lt;%= submit_tag &amp;quot;Create Quiz&amp;quot;, :name=&amp;gt;&amp;quot;save&amp;quot; %&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
/app/views/questionnaire/edit.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;%= form_tag({:controller=&amp;gt;'quiz_questionnaire', :action=&amp;gt;'update_quiz', :id=&amp;gt;@questionnaire.id, :pid =&amp;gt; params[:pid]}, :multipart =&amp;gt; true) do %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
/app/views/submitted_content/_main.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&amp;lt;% if !t_id.nil? &amp;amp;&amp;amp; questionnaire = QuizQuestionnaire.where([&amp;quot;instructor_id = ?&amp;quot;, t_id]).first %&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to 'View quiz', :controller =&amp;gt; :quiz_questionnaire, :action =&amp;gt; :view_quiz, :id =&amp;gt; questionnaire.id, :pid =&amp;gt; participant.id %&amp;gt;&lt;br /&gt;
      &amp;lt;br/&amp;gt;&lt;br /&gt;
      &amp;lt;% if !questionnaire.taken_by_anyone?%&amp;gt;&lt;br /&gt;
        &amp;lt;%= link_to 'Edit quiz', :controller =&amp;gt; :quiz_questionnaire, :action =&amp;gt; :edit_quiz, :id =&amp;gt; questionnaire.id, :pid =&amp;gt; participant.id %&amp;gt;&lt;br /&gt;
      &amp;lt;% end %&amp;gt;&lt;br /&gt;
      &amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
    &amp;lt;% else %&amp;gt;&lt;br /&gt;
      &amp;lt;br/&amp;gt;&lt;br /&gt;
      &amp;lt;%= link_to 'Create a quiz', :controller =&amp;gt; :quiz_questionnaire, :action =&amp;gt; :new_quiz, :model =&amp;gt; &amp;quot;QuizQuestionnaire&amp;quot;, :private =&amp;gt; 0, :aid =&amp;gt; @assignment.id, :pid =&amp;gt; participant.id %&amp;gt;&lt;br /&gt;
      &amp;lt;br/&amp;gt;&lt;br /&gt;
    &amp;lt;% end %&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Files affected==&lt;br /&gt;
&lt;br /&gt;
The following files were created or refactored&lt;br /&gt;
1. /app/controllers/questionnaires_controller.rb &amp;lt;br&amp;gt;&lt;br /&gt;
2. /app/controllers/quiz_questionnaire_controller.rb &amp;lt;br&amp;gt;&lt;br /&gt;
3. /app/views/questionnaire/view.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
4. /app/views/questionnaire/new_quiz.erb &amp;lt;br&amp;gt;&lt;br /&gt;
5. /app/views/questionnaire/edit.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
6. /app/views/submitted_content/_main.html.erb &amp;lt;br&amp;gt;&lt;br /&gt;
7. /config/routes.rb &amp;lt;br&amp;gt;&lt;br /&gt;
8. /spec/controllers/questionnaires_controller_spec.rb &amp;lt;br&amp;gt;&lt;br /&gt;
9. /spec/controllers/quiz_questionnaire_controller_spec.rb &lt;br /&gt;
&lt;br /&gt;
==Team members==&lt;br /&gt;
1. Abhishek Arya (aarya@ncsu.edu) &amp;lt;br&amp;gt;&lt;br /&gt;
2. Nitin Nataraj Kuncham (nkuncha@ncsu.edu) &amp;lt;br&amp;gt;&lt;br /&gt;
3. Suraj Siddharudh (ssiddha@ncsu.edu) &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
#[https://github.com/expertiza/expertiza Expertiza on GitHub]&lt;br /&gt;
#[https://www.rubyguides.com/2018/07/rspec-tutorial/ rpec tutorial]&lt;br /&gt;
#[https://www.stackoverflow.com/ Stackoverflow]&lt;/div&gt;</summary>
		<author><name>Ssiddha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1903._Create_quiz_questionnaires_controller.rb&amp;diff=122110</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1903. Create quiz questionnaires controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1903._Create_quiz_questionnaires_controller.rb&amp;diff=122110"/>
		<updated>2019-03-25T17:47:07Z</updated>

		<summary type="html">&lt;p&gt;Ssiddha: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;E1903. Create Quiz Questionnaire Controller Spring 2018, CSC/ECE 517.&lt;br /&gt;
&lt;br /&gt;
== Problem Statement ==&lt;/div&gt;</summary>
		<author><name>Ssiddha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1903._Create_quiz_questionnaires_controller.rb&amp;diff=122107</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1903. Create quiz questionnaires controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1903._Create_quiz_questionnaires_controller.rb&amp;diff=122107"/>
		<updated>2019-03-25T17:39:22Z</updated>

		<summary type="html">&lt;p&gt;Ssiddha: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Test_E1903 Quiz Controller&lt;/div&gt;</summary>
		<author><name>Ssiddha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1903._Create_quiz_questionnaires_controller.rb&amp;diff=122106</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1903. Create quiz questionnaires controller.rb</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1903._Create_quiz_questionnaires_controller.rb&amp;diff=122106"/>
		<updated>2019-03-25T17:34:10Z</updated>

		<summary type="html">&lt;p&gt;Ssiddha: Created page with &amp;quot;Test_E1903 Quiz COntroller&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Test_E1903 Quiz COntroller&lt;/div&gt;</summary>
		<author><name>Ssiddha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1836_Refactor_Questionnaires_Controller&amp;diff=121957</id>
		<title>E1836 Refactor Questionnaires Controller</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1836_Refactor_Questionnaires_Controller&amp;diff=121957"/>
		<updated>2019-03-24T22:38:11Z</updated>

		<summary type="html">&lt;p&gt;Ssiddha: Created page with &amp;quot;Refactor Questionnaire Controller&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Refactor Questionnaire Controller&lt;/div&gt;</summary>
		<author><name>Ssiddha</name></author>
	</entry>
</feed>