<?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=Nkuncha</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=Nkuncha"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Nkuncha"/>
	<updated>2026-05-11T21:42:41Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:UML_diagram.png&amp;diff=124813</id>
		<title>File:UML diagram.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:UML_diagram.png&amp;diff=124813"/>
		<updated>2019-05-01T05:11:11Z</updated>

		<summary type="html">&lt;p&gt;Nkuncha: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nkuncha</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=124812</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=124812"/>
		<updated>2019-05-01T05:10:40Z</updated>

		<summary type="html">&lt;p&gt;Nkuncha: &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 who had started reviewing with the old rubric are not notified of the change. Only the rest of the students who had not started a review will be presented with the updated rubric.&lt;br /&gt;
&lt;br /&gt;
The goal of this project is two-fold:&lt;br /&gt;
 &lt;br /&gt;
1. If a rubric is replaced, or the items/questions are changed, then all the responses to that rubric need to be redone.&lt;br /&gt;
&lt;br /&gt;
2. 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;
However, if the change does not involve an addition/deletion of questions, it is termed as a minor change. If the change is deemed as a minor change, the refactoring should not make any changes to the current implementation&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. As of status quo, 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;
&lt;br /&gt;
===Data Flow Diagram===&lt;br /&gt;
&lt;br /&gt;
[[File:dfd_4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main function of the code is to change the rubric questionnaire. There are three main functions to change the rubric of a questionnaire: add, remove or edit questions. Editing a question is considered a minor change as it does not change the general format(i.e. number of questions or their types) of the rubric. The two major changes are highlighted, they are adding or removing a question.&lt;br /&gt;
&lt;br /&gt;
In case of a minor change the question in the database is simply updated, no other action/notification is required.&lt;br /&gt;
&lt;br /&gt;
In case of a major change, the reviews given for that question need to be deleted in case the question has been removed and the consequent changes need to be relayed to the appropriate databases. Moreover, the reviewers, whose reviews have been removed, need to be informed about the changes made and be asked to update the reviews via email. The email-ids for these users have to be queried from the Users database.&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;
The primary metric for identification of a major change is when the ids of questions associated to a questionnaire change. &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. As per the definition of a major change, it is obvious that there is no change in the question ids(records/objects) associated with the questionnaire. Hence this would be a minor change. &lt;br /&gt;
&lt;br /&gt;
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 because it entails a change in the objects associated with the questionnaire. The params passed to the controller also includes a tag/identifier if a new question was added. We are using this tag to identify there was a new question added and hence major change.&lt;br /&gt;
[[File:edit_questionnaire_page.png|Edit questionnaire page]]&lt;br /&gt;
In the diagram shown above, the &amp;quot;Save teammate review questionnaire&amp;quot; would result in a minor change. Clicking on the highlighted add and remove would result in a change of the questions and is therefore a major change.&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 respond to 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;
=='''Code Changes'''==&lt;br /&gt;
Firstly, we need to check if there has been a change in the questionnaire, i.e if any question has been added or deleted. For this we use the tags in the params. The view has been coded such that it adds a tag called &amp;quot;:add_new_questions&amp;quot; whenever there is a post method to add a new question. We have used this tag to identify a major change and redirected to necessary helper methods.  This is indicated in the image below:&lt;br /&gt;
&lt;br /&gt;
[[File:new_question_added.jpg|identification of major change]]&lt;br /&gt;
&lt;br /&gt;
Similarly, we have identified when a question is deleted and redirected again to helper methods.&lt;br /&gt;
&lt;br /&gt;
The next step, is to look iterate through answers database and group the answers for the edited questionnaire per user/reviewer. The below UML diagram would assist in understanding the flow of information and the relation between the models.&lt;br /&gt;
&lt;br /&gt;
[[File:UML_diagram.png|UML diagram showing the relationship between necessary models]]&lt;br /&gt;
&lt;br /&gt;
Please note that FK stands for foreign key in the above diagram.&lt;br /&gt;
&lt;br /&gt;
Using the question ids returned from view, we obtained the response id from the answer database. We tracked this response id through the response, response_map and user models to arrive at the user id. This has been achieved using the code shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:reviewer_answer_mapping.jpg|grouping of answers per reviewer]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once we have identified the answers, user mail id and other associated information, this has to be mailed to the user and then the records deleted. This has been achieved using the code shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:mailer_function.jpg|Mailer function and deleting of associated records]]&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;br /&gt;
&lt;br /&gt;
=='''Team members'''==&lt;br /&gt;
1. Aishwarya Tirumala &amp;lt;br&amp;gt;&lt;br /&gt;
2. Nilay Kapadia &amp;lt;br&amp;gt;&lt;br /&gt;
3. Nitin Nataraj Kuncham &amp;lt;br&amp;gt;&lt;br /&gt;
4. Suraj Siddharudh &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>Nkuncha</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=124811</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=124811"/>
		<updated>2019-05-01T05:10:02Z</updated>

		<summary type="html">&lt;p&gt;Nkuncha: added UML 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 who had started reviewing with the old rubric are not notified of the change. Only the rest of the students who had not started a review will be presented with the updated rubric.&lt;br /&gt;
&lt;br /&gt;
The goal of this project is two-fold:&lt;br /&gt;
 &lt;br /&gt;
1. If a rubric is replaced, or the items/questions are changed, then all the responses to that rubric need to be redone.&lt;br /&gt;
&lt;br /&gt;
2. 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;
However, if the change does not involve an addition/deletion of questions, it is termed as a minor change. If the change is deemed as a minor change, the refactoring should not make any changes to the current implementation&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. As of status quo, 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;
&lt;br /&gt;
===Data Flow Diagram===&lt;br /&gt;
&lt;br /&gt;
[[File:dfd_4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main function of the code is to change the rubric questionnaire. There are three main functions to change the rubric of a questionnaire: add, remove or edit questions. Editing a question is considered a minor change as it does not change the general format(i.e. number of questions or their types) of the rubric. The two major changes are highlighted, they are adding or removing a question.&lt;br /&gt;
&lt;br /&gt;
In case of a minor change the question in the database is simply updated, no other action/notification is required.&lt;br /&gt;
&lt;br /&gt;
In case of a major change, the reviews given for that question need to be deleted in case the question has been removed and the consequent changes need to be relayed to the appropriate databases. Moreover, the reviewers, whose reviews have been removed, need to be informed about the changes made and be asked to update the reviews via email. The email-ids for these users have to be queried from the Users database.&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;
The primary metric for identification of a major change is when the ids of questions associated to a questionnaire change. &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. As per the definition of a major change, it is obvious that there is no change in the question ids(records/objects) associated with the questionnaire. Hence this would be a minor change. &lt;br /&gt;
&lt;br /&gt;
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 because it entails a change in the objects associated with the questionnaire. The params passed to the controller also includes a tag/identifier if a new question was added. We are using this tag to identify there was a new question added and hence major change.&lt;br /&gt;
[[File:edit_questionnaire_page.png|Edit questionnaire page]]&lt;br /&gt;
In the diagram shown above, the &amp;quot;Save teammate review questionnaire&amp;quot; would result in a minor change. Clicking on the highlighted add and remove would result in a change of the questions and is therefore a major change.&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 respond to 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;
=='''Code Changes'''==&lt;br /&gt;
Firstly, we need to check if there has been a change in the questionnaire, i.e if any question has been added or deleted. For this we use the tags in the params. The view has been coded such that it adds a tag called &amp;quot;:add_new_questions&amp;quot; whenever there is a post method to add a new question. We have used this tag to identify a major change and redirected to necessary helper methods.  This is indicated in the image below:&lt;br /&gt;
&lt;br /&gt;
[[File:new_question_added.jpg|identification of major change]]&lt;br /&gt;
&lt;br /&gt;
Similarly, we have identified when a question is deleted and redirected again to helper methods.&lt;br /&gt;
&lt;br /&gt;
The next step, is to look iterate through answers database and group the answers for the edited questionnaire per user/reviewer. The below UML diagram would assist in understanding the flow of information and the relation between the models.&lt;br /&gt;
&lt;br /&gt;
[[File:UML.png|UML diagram showing the relationship between necessary models]]&lt;br /&gt;
&lt;br /&gt;
Please note that FK stands for foreign key in the above diagram.&lt;br /&gt;
&lt;br /&gt;
Using the question ids returned from view, we obtained the response id from the answer database. We tracked this response id through the response, response_map and user models to arrive at the user id. This has been achieved using the code shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:reviewer_answer_mapping.jpg|grouping of answers per reviewer]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once we have identified the answers, user mail id and other associated information, this has to be mailed to the user and then the records deleted. This has been achieved using the code shown below:&lt;br /&gt;
&lt;br /&gt;
[[File:mailer_function.jpg|Mailer function and deleting of associated records]]&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;br /&gt;
&lt;br /&gt;
=='''Team members'''==&lt;br /&gt;
1. Aishwarya Tirumala &amp;lt;br&amp;gt;&lt;br /&gt;
2. Nilay Kapadia &amp;lt;br&amp;gt;&lt;br /&gt;
3. Nitin Nataraj Kuncham &amp;lt;br&amp;gt;&lt;br /&gt;
4. Suraj Siddharudh &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>Nkuncha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Mailer_function.jpg&amp;diff=124810</id>
		<title>File:Mailer function.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Mailer_function.jpg&amp;diff=124810"/>
		<updated>2019-05-01T04:54:03Z</updated>

		<summary type="html">&lt;p&gt;Nkuncha: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nkuncha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Reviewer_answer_mapping.jpg&amp;diff=124809</id>
		<title>File:Reviewer answer mapping.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Reviewer_answer_mapping.jpg&amp;diff=124809"/>
		<updated>2019-05-01T04:52:59Z</updated>

		<summary type="html">&lt;p&gt;Nkuncha: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nkuncha</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=124808</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=124808"/>
		<updated>2019-05-01T04:52:44Z</updated>

		<summary type="html">&lt;p&gt;Nkuncha: &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 who had started reviewing with the old rubric are not notified of the change. Only the rest of the students who had not started a review will be presented with the updated rubric. &lt;br /&gt;
The goal of this project is two-fold: &lt;br /&gt;
1. If a rubric is replaced, or the items/questions are changed, then all the responses to that rubric need to be redone&lt;br /&gt;
2. 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;
However, if the change does not involve an addition/deletion of questions, it is termed as a minor change. If the change is deemed as a minor change, the refactoring should not make any changes to the current implementation&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. As of status quo, 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;
&lt;br /&gt;
===Data Flow Diagram===&lt;br /&gt;
&lt;br /&gt;
[[File:dfd_4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main function of the code is to change the rubric questionnaire. There are three main functions to change the rubric of a questionnaire: add, remove or edit questions. Editing a question is considered a minor change as it does not change the general format(i.e. number of questions or their types) of the rubric. The two major changes are highlighted, they are adding or removing a question.&lt;br /&gt;
&lt;br /&gt;
In case of a minor change the question in the database is simply updated, no other action/notification is required.&lt;br /&gt;
&lt;br /&gt;
In case of a major change, the reviews given for that question need to be deleted in case the question has been removed and the consequent changes need to be relayed to the appropriate databases. Moreover, the reviewers, whose reviews have been removed, need to be informed about the changes made and be asked to update the reviews via email. The email-ids for these users have to be queried from the Users database.&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;
The primary metric for identification of a major change is when the ids of questions associated to a questionnaire change. &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. As per the definition of a major change, it is obvious that there is no change in the question ids(records/objects) associated with the questionnaire. Hence this would be a minor change. &lt;br /&gt;
&lt;br /&gt;
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 because it entails a change in the objects associated with the questionnaire. The params passed to the controller also includes a tag/identifier if a new question was added. We are using this tag to identify there was a new question added and hence major change.&lt;br /&gt;
[[File:edit_questionnaire_page.png|Edit questionnaire page]]&lt;br /&gt;
In the diagram shown above, the &amp;quot;Save teammate review questionnaire&amp;quot; would result in a minor change. Clicking on the highlighted add and remove would result in a change of the questions and is therefore a major change.&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 respond to 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;
=='''Code Changes'''==&lt;br /&gt;
Firstly, we need to check if there has been a change in the questionnaire, i.e if any question has been added or deleted. For this we use the tags in the params. The view has been coded such that it adds a tag called &amp;quot;:add_new_questions&amp;quot; whenever there is a post method to add a new question. We have used this tag to identify a major change and redirected to necessary helper methods.  This is indicated in the image below:&lt;br /&gt;
[[File:new_question_added.jpg|identification of major change]]&lt;br /&gt;
&lt;br /&gt;
Similarly, we have identified when a question is deleted and redirected again to helper methods.&lt;br /&gt;
&lt;br /&gt;
The next step, is to look iterate through answers database and group the answers for the edited questionnaire per user/reviewer. This has been achieved using the code shown below:&lt;br /&gt;
[[File:reviewer_answer_mapping.jpg|grouping of answers per reviewer]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once we have identified the answers, user mail id and other associated information, this has to be mailed to the user and then the records deleted. This has been achieved using the code shown below:&lt;br /&gt;
[[File:mailer_function.jpg|Mailer function and deleting of associated records]]&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;br /&gt;
&lt;br /&gt;
=='''Team members'''==&lt;br /&gt;
1. Aishwarya Tirumala &amp;lt;br&amp;gt;&lt;br /&gt;
2. Nilay Kapadia &amp;lt;br&amp;gt;&lt;br /&gt;
3. Nitin Nataraj Kuncham &amp;lt;br&amp;gt;&lt;br /&gt;
4. Suraj Siddharudh &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>Nkuncha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_question_added.jpg&amp;diff=124807</id>
		<title>File:New question added.jpg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_question_added.jpg&amp;diff=124807"/>
		<updated>2019-05-01T04:51:51Z</updated>

		<summary type="html">&lt;p&gt;Nkuncha: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nkuncha</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=124806</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=124806"/>
		<updated>2019-05-01T04:51:30Z</updated>

		<summary type="html">&lt;p&gt;Nkuncha: code changes updated&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 who had started reviewing with the old rubric are not notified of the change. Only the rest of the students who had not started a review will be presented with the updated rubric. &lt;br /&gt;
The goal of this project is two-fold: &lt;br /&gt;
1. If a rubric is replaced, or the items/questions are changed, then all the responses to that rubric need to be redone&lt;br /&gt;
2. 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;
However, if the change does not involve an addition/deletion of questions, it is termed as a minor change. If the change is deemed as a minor change, the refactoring should not make any changes to the current implementation&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. As of status quo, 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;
&lt;br /&gt;
===Data Flow Diagram===&lt;br /&gt;
&lt;br /&gt;
[[File:dfd_4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main function of the code is to change the rubric questionnaire. There are three main functions to change the rubric of a questionnaire: add, remove or edit questions. Editing a question is considered a minor change as it does not change the general format(i.e. number of questions or their types) of the rubric. The two major changes are highlighted, they are adding or removing a question.&lt;br /&gt;
&lt;br /&gt;
In case of a minor change the question in the database is simply updated, no other action/notification is required.&lt;br /&gt;
&lt;br /&gt;
In case of a major change, the reviews given for that question need to be deleted in case the question has been removed and the consequent changes need to be relayed to the appropriate databases. Moreover, the reviewers, whose reviews have been removed, need to be informed about the changes made and be asked to update the reviews via email. The email-ids for these users have to be queried from the Users database.&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;
The primary metric for identification of a major change is when the ids of questions associated to a questionnaire change. &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. As per the definition of a major change, it is obvious that there is no change in the question ids(records/objects) associated with the questionnaire. Hence this would be a minor change. &lt;br /&gt;
&lt;br /&gt;
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 because it entails a change in the objects associated with the questionnaire. The params passed to the controller also includes a tag/identifier if a new question was added. We are using this tag to identify there was a new question added and hence major change.&lt;br /&gt;
[[File:edit_questionnaire_page.png|Edit questionnaire page]]&lt;br /&gt;
In the diagram shown above, the &amp;quot;Save teammate review questionnaire&amp;quot; would result in a minor change. Clicking on the highlighted add and remove would result in a change of the questions and is therefore a major change.&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 respond to 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;
=='''Code Changes'''==&lt;br /&gt;
Firstly, we need to check if there has been a change in the questionnaire, i.e if any question has been added or deleted. For this we use the tags in the params. The view has been coded such that it adds a tag called &amp;quot;:add_new_questions&amp;quot; whenever there is a post method to add a new question. We have used this tag to identify a major change and redirected to necessary helper methods.  This is indicated in the image below:&lt;br /&gt;
[[File:new_question_added.jpg|identification of major change]]&lt;br /&gt;
Similarly, we have identified when a question is deleted and redirected again to helper methods.&lt;br /&gt;
&lt;br /&gt;
The next step, is to look iterate through answers database and group the answers for the edited questionnaire per user/reviewer. This has been achieved using the code shown below:&lt;br /&gt;
[[File:reviewer_answer_mapping.jpg|grouping of answers per reviewer]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once we have identified the answers, user mail id and other associated information, this has to be mailed to the user and then the records deleted. This has been achieved using the code shown below:&lt;br /&gt;
[[File:mailer_function.jpg|Mailer function and deleting of associated records]]&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;br /&gt;
&lt;br /&gt;
=='''Team members'''==&lt;br /&gt;
1. Aishwarya Tirumala &amp;lt;br&amp;gt;&lt;br /&gt;
2. Nilay Kapadia &amp;lt;br&amp;gt;&lt;br /&gt;
3. Nitin Nataraj Kuncham &amp;lt;br&amp;gt;&lt;br /&gt;
4. Suraj Siddharudh &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>Nkuncha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Edit_questionnaire_page.png&amp;diff=124805</id>
		<title>File:Edit questionnaire page.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Edit_questionnaire_page.png&amp;diff=124805"/>
		<updated>2019-05-01T02:26:46Z</updated>

		<summary type="html">&lt;p&gt;Nkuncha: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nkuncha</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=124804</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=124804"/>
		<updated>2019-05-01T02:26:14Z</updated>

		<summary type="html">&lt;p&gt;Nkuncha: added image of edit questionnaire UI&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. If the change does not involve an addition/deletion of questions, it is termed as a minor change. If the change is deemed as a minor change, the refactoring should not make any changes to the current implementation&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;
&lt;br /&gt;
===Data Flow Diagram===&lt;br /&gt;
&lt;br /&gt;
[[File:dfd_4.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main function of the code is to change the rubric questionnaire. There are three main functions to change the rubric of a questionnaire: add, remove or edit questions. Editing a question is considered a minor change as it does not change the general format(i.e. number of questions or their types) of the rubric. The two major changes are highlighted, they are adding or removing a question.&lt;br /&gt;
&lt;br /&gt;
In case of a minor change the question in the database is simply updated, no other action/notification is required.&lt;br /&gt;
&lt;br /&gt;
In case of a major change, the reviews given for that question need to be deleted in case the question has been removed and the consequent changes need to be relayed to the appropriate databases. Moreover, the reviewers, whose reviews have been removed, need to be informed about the changes made and be asked to update the reviews via email. The email-ids for these users have to be queried from the Users database.&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;
&lt;br /&gt;
[[File:edit_questionnaire_page.png|Edit questionnaire page]]&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 are using this tag to identify there was a new question added and hence major change.&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 Changes'''==&lt;br /&gt;
Firstly, we need to check if there has been a change in the questionnaire, i.e if any question has been added or deleted. For this we pull out the records from the active database of the questions and compare it with the number of question entries in the view. We get the number of questions from the code snippet as shown below from questionnare_controller.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:code2.png|Code]]&lt;br /&gt;
&lt;br /&gt;
Now, we come across two cases. &lt;br /&gt;
In the first scenario, If there is a change in the number of questions we do the necessary changes. We delete all the response objects and answers and mail the changes to the user.&lt;br /&gt;
&lt;br /&gt;
In the second scenario, If there is no change in the number of questions then there can be two possible cases. Either there really has been no change in the questions and we leave it as it is. Else, there has been equal number of additions and deletions and to detect this we check if the parameter add_new_questions is present. If it is, then there has been an update and we again do the required changes as discussed above. We check this through the code snippet below of the update method in questionnare_controller.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:code1.png|Code]]&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;br /&gt;
&lt;br /&gt;
=='''Team members'''==&lt;br /&gt;
1. Aishwarya Tirumala &amp;lt;br&amp;gt;&lt;br /&gt;
2. Nilay Kapadia &amp;lt;br&amp;gt;&lt;br /&gt;
3. Nitin Nataraj Kuncham &amp;lt;br&amp;gt;&lt;br /&gt;
4. Suraj Siddharudh &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>Nkuncha</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=123873</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=123873"/>
		<updated>2019-04-12T21:12:03Z</updated>

		<summary type="html">&lt;p&gt;Nkuncha: added team members and references&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. If the change does not involve an addition/deletion of questions, it is termed as a minor change. If the change is deemed as a minor change, the refactoring should not make any changes to the current implementation&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;
&lt;br /&gt;
===Data Flow Diagram===&lt;br /&gt;
&lt;br /&gt;
[[File:dfd_4.png]]&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 Changes'''==&lt;br /&gt;
Firstly, we need to check if there has been a change in the questionnaire, i.e if any question has been added or deleted. For this we pull out the records from the active database of the questions and compare it with the number of question entries in the view. We get the number of questions from the code snippet as shown below from questionnare_controller.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:code2.png|Code]]&lt;br /&gt;
&lt;br /&gt;
Now, we come across two cases. &lt;br /&gt;
In the first scenario, If there is a change in the number of questions we do the necessary changes. We delete all the response objects and answers and mail the changes to the user.&lt;br /&gt;
&lt;br /&gt;
In the second scenario, If there is no change in the number of questions then there can be two possible cases. Either there really has been no change in the questions and we leave it as it is. Else, there has been equal number of additions and deletions and to detect this we check if the parameter add_new_questions is present. If it is, then there has been an update and we again do the required changes as discussed above. We check this through the code snippet below of the update method in questionnare_controller.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:code1.png|Code]]&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;br /&gt;
&lt;br /&gt;
=='''Team members'''==&lt;br /&gt;
1. Aishwarya Tirumala &amp;lt;br&amp;gt;&lt;br /&gt;
2. Nilay Kapadia &amp;lt;br&amp;gt;&lt;br /&gt;
3. Nitin Nataraj Kuncham &amp;lt;br&amp;gt;&lt;br /&gt;
4. Suraj Siddharudh &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>Nkuncha</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=123601</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=123601"/>
		<updated>2019-04-08T15:13:52Z</updated>

		<summary type="html">&lt;p&gt;Nkuncha: added test plan and proposed solution (2a&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 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 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;
=='''Test Plan'''==&lt;br /&gt;
The current rspec file describes various contexts for testing such as adding new questions, if attibutes 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>Nkuncha</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=123177</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=123177"/>
		<updated>2019-04-03T00:03:14Z</updated>

		<summary type="html">&lt;p&gt;Nkuncha: video&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;
A new controller called quiz_questionnaire_controller.rb was created using scaffold. The methods in the questionnaire control pertaining to quizzes were moved to the new controller. Certain methods such as create_questionnaire which are to be needed in both classes were refactored as explained in later sections. &amp;lt;br&amp;gt;&lt;br /&gt;
The routes.rb file was edited to reflect the new routes to the new controller's actions as shown in image below.&lt;br /&gt;
[[File:New_routes_file.png]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The views for the controller were not created or moved from questionnaires controller. Instead, every action in the quiz_questionnaire controller renders a view from the old controller itself. However, the links and redirect was edited multiple controllers and views (as stated in affected files), so that the action in the right controller was called.&lt;br /&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;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
The refactoring of code was done in a manner as to not affect the functionality or the code flow. Therefore, the test plan has not been modified from the original spec file apart from moving quiz_questionnaire relevant tests from questionnaire spec file to quiz_questionnaire spec file. The code is not hosted as there are no new functionalities created. As with other refactor projects, a video of using the UI is attached in the submission.&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>Nkuncha</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=122720</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=122720"/>
		<updated>2019-03-31T15:49:07Z</updated>

		<summary type="html">&lt;p&gt;Nkuncha: Added test plan&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;
A new controller called quiz_questionnaire_controller.rb was created using scaffold. The methods in the questionnaire control pertaining to quizzes were moved to the new controller. Certain methods such as create_questionnaire which are to be needed in both classes were refactored as explained in later sections. &amp;lt;br&amp;gt;&lt;br /&gt;
The routes.rb file was edited to reflect the new routes to the new controller's actions as shown in image below.&lt;br /&gt;
[[File:New_routes_file.png]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The views for the controller were not created or moved from questionnaires controller. Instead, every action in the quiz_questionnaire controller renders a view from the old controller itself. However, the links and redirect was edited multiple controllers and views (as stated in affected files), so that the action in the right controller was called.&lt;br /&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;
==Test Plan==&lt;br /&gt;
&lt;br /&gt;
The refactoring of code was done in a manner as to not affect the functionality or the code flow. Therefore, the test plan has not been modified from the original spec file apart from moving quiz_questionnaire relevant tests from questionnaire spec file to quiz_questionnaire spec file.&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>Nkuncha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_routes_file.png&amp;diff=122609</id>
		<title>File:New routes file.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_routes_file.png&amp;diff=122609"/>
		<updated>2019-03-28T17:29:27Z</updated>

		<summary type="html">&lt;p&gt;Nkuncha: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nkuncha</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=122432</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=122432"/>
		<updated>2019-03-26T01:43:23Z</updated>

		<summary type="html">&lt;p&gt;Nkuncha: Added creation of new controller&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;
A new controller called quiz_questionnaire_controller.rb was created using scaffold. The methods in the questionnaire control pertaining to quizzes were moved to the new controller. Certain methods such as create_questionnaire which are to be needed in both classes were refactored as explained in later sections. &amp;lt;br&amp;gt;&lt;br /&gt;
The routes.rb file was edited to reflect the new routes to the new controller's actions as shown in image below.&lt;br /&gt;
[[File:New_routes_file.png]]&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
The views for the controller were not created or moved from questionnaires controller. Instead, every action in the quiz_questionnaire controller renders a view from the old controller itself. However, the links and redirect was edited multiple controllers and views (as stated in affected files), so that the action in the right controller was called.&lt;br /&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>Nkuncha</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:New_routes_file.PNG&amp;diff=122428</id>
		<title>File:New routes file.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:New_routes_file.PNG&amp;diff=122428"/>
		<updated>2019-03-26T01:37:52Z</updated>

		<summary type="html">&lt;p&gt;Nkuncha: new routes.rb for to include routes for new controller&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;new routes.rb for to include routes for new controller&lt;/div&gt;</summary>
		<author><name>Nkuncha</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=122133</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=122133"/>
		<updated>2019-03-25T18:42:52Z</updated>

		<summary type="html">&lt;p&gt;Nkuncha: filled problem statement, files affected, team members and references&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 rpec 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;
to be filled &lt;br /&gt;
&lt;br /&gt;
4. Creation of new routes and updation of affected links in views &amp;lt;br&amp;gt;&lt;br /&gt;
to be filled&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>Nkuncha</name></author>
	</entry>
</feed>