<?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=Jwarren3</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=Jwarren3"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Jwarren3"/>
	<updated>2026-06-29T05:33:35Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=E1929_Visualizations_for_Instructors&amp;diff=123634</id>
		<title>E1929 Visualizations for Instructors</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=E1929_Visualizations_for_Instructors&amp;diff=123634"/>
		<updated>2019-04-08T21:05:06Z</updated>

		<summary type="html">&lt;p&gt;Jwarren3: /* Tools and Design Choices */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
It is the desire of all instructors to emphasize course material that students have trouble understanding and de-emphasize those aspects of the course material which students readily grasp. One method used by instructors is the creation of questionnaires, or rubrics. A rubric consists of a number of questions, or criterion, that give instructors a glimpse into student understanding of course materials. Use of rubrics and their association with a course assignment allow instructors to find-tune their lesson plans to their students' understanding.&lt;br /&gt;
&lt;br /&gt;
Creation of assignments, and their associated rubrics, can be a daunting task that can be made easier through the use of online platforms. Expertiza is one such online assignment grading platform. Within Expertiza, instructors create courses and assignments. For each assignment, instructors create one or more peer review rubrics for students to complete. After each round of rubrics, students can submit changes to their assignment based on these rubrics, with each submission and rubric considered a round. Hence, assignments have multiple rounds with each round associated with a rubric.&lt;br /&gt;
&lt;br /&gt;
Instructors use the association between the assignment and the submitted rubric(s) associated with the assignment to understand what subjects need more focus. For example, a low average score on a rubric's particular question, or criterion, can indicate that the class has issues with a particular part of the assignment. Currently, instructors using Expertiza display assignment scores on one pages, but need to visit a completely separate page to display rubric scores. This separation of information hinders the instructor's ability to fully comprehend the associations between the assignment scores and the rubric scores. This, in turn, minimizes the likelihood that instructors will integrate this information to fine-tune their course material.&lt;br /&gt;
&lt;br /&gt;
This project proposes to overcome this weakness in Expertiza by integrating the display of assignment scores and rubric scores onto a single page. This integration will allow instructors to more easily associate low rubric average scores with assignment scores. The ability to visualize assignment scores and rubric scores in a single location will reduce the workload on instructors when the scores. This, in turn, will increase the likelihood that instructors will change their lesson plans to reflect the students' understanding of the course material.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Proposed Changes ==&lt;br /&gt;
To help instructors understand the relationship between assignment scores and rubric scores, this project proposes two types of visualizations. The first type of visualization allows instructors to examine the rubric statistics for a single assignment. The second type of visualization allows instructors to compare the rubric statistics between two different assignments when the criteria for each assignment is the same.&lt;br /&gt;
&lt;br /&gt;
=== Existing Views ===&lt;br /&gt;
&lt;br /&gt;
In both cases, the project will add rubric statistics to the assignment grade view. The current assignment grade view consists of a header containing grade statistics followed by a table of the individual grades. In the assignment grade view header, the left side fo the header shows the average assignment grade as a circle, while the right side of the assignment grade view header shows the assignment grade distribution. Figure 1 shows the current header in the grade assignment view page.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[File:Existing_Assignment_Grades.JPG|frame|centre|Figure 1: Existing assignment grade page header. The existing assignment grade page header has both the average grade for the assignment and the grade distribution for the assignment. The left side shows the average as the percentage of a circle. The right side of the header shows the grade distribution for the assignment. The grade distribution shows the minimum and maximum grade for the assignment. Under the header is a list of the grades for each student.]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The changes proposed by this project integrate rubric statistics to the above assignment grade view. Rubric statistic integration into the assignment grade view allow two types of visualizations. The first visualization allows the instructor to display rubric statistics within a single assignment. The second visualization allows the instructor to display rubric statistics between different assignments in the same course.&lt;br /&gt;
&lt;br /&gt;
=== Proposed Assignment Grade Visualization ===&lt;br /&gt;
&lt;br /&gt;
This project proposes the integration of rubric statistic visualization for both single assignments and multiple assignments into the assignment grade view. The integration occurs with a single change to the header of the assignment grade view, and retains the list of student grades. The following HTML mock-up shows the proposed changes to the header. The list of student grades is not changed and therefore not shown.&lt;br /&gt;
&lt;br /&gt;
https://jwarren3.github.io/expertiza/tabs.html&lt;br /&gt;
&lt;br /&gt;
The upper part of the rubric statistic visualization displays a set of tabs that allow the instructor to analyze the rubric within a single assignment or to compare the rubric statistics between multiple assignments. The middle part of the rubric statistic visualization displays the statistics for each selected criteria as a bar graph. The heights of the bars are shown as a percentage of the maximum value for each criteria. The bottom part of the rubric statistic visualization displays a set of options that allow the instructor to filter the statistics shown in the bar graph. The left side (assignment average) and right side (assignment distribution) of the assignment grade view header are not changed.&lt;br /&gt;
&lt;br /&gt;
In the integration of the rubric statistic visualization mock-up within a single assignment, there are two rounds of rubrics for the students to fill out. The rubric in round 1 consisted of five criteria, while the rubric in round 2 consisted of 4 criteria. The round of interest is selected using the drop-down menu on the left side. The criteria shown in the bar graph are selected using radio buttons next to each criterion. Finally, the type of statistic shown is selected using a drop-down menu on the right side of the options. Currently, the statistic is limited to either mean or median. Hovering the mouse over each of the bars in the bar graph shows the numerical value of the chosen statistic.&lt;br /&gt;
&lt;br /&gt;
Visualizing the rubric statistics within a single assignment starts by selecting the left tab titled &amp;quot;Analyze Assignment&amp;quot;. The default displays the mean of all criteria from the first round. Changing the round, the type of statistic, and the particular criteria are controlled from the drop-down menus and radio buttons below the bar graph.&lt;br /&gt;
&lt;br /&gt;
Visualizing the rubric statistics between assignments starts by selecting the right tab titled &amp;quot;Compare Assignments&amp;quot;. The default displays the comparisons between round one and all criteria of an assignment in the same course. The default assignment is the chronologically earliest assignment. The current assignment is shown in red while the rubric being compared is shown in blue.&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
This project expects to change controller files, view files, JavaScript files, and RSpec files. This project does not expect to change any model files, though models will be changed if model data needs to be reformatted. This project does not expect to change the database.&lt;br /&gt;
&lt;br /&gt;
=== Design Flow ===&lt;br /&gt;
Instructor wants to view student scores on individual rubric criteria:&lt;br /&gt;
&lt;br /&gt;
[[File:DesignFlowSingle.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Instructor wants to compare student scores on individual rubric criteria between two compatible rounds of two different assignments:&lt;br /&gt;
&lt;br /&gt;
[[File:DesignFlowCompare.png]]&lt;br /&gt;
&lt;br /&gt;
=== Tools and Design Choices ===&lt;br /&gt;
This project proposes using a third party JavaScript library for rendering the rubric statistics. This project proposes two requirements for the visualization library. The first requirement is to use a visualization library that performs client-side rendering. Using a client-side rendering library will minimize the number of server interactions as the instructor changes which rubric statistics to display. This minimization of server interaction will maximize the response time of Expertiza.&lt;br /&gt;
&lt;br /&gt;
The second requirement for the visualization library is compatibility with current Expertiza graphics. The compatibility requirement implies that the visualization library is one that is already being used in Expertiza or a visualization library that could be used to render the current graphics.&lt;br /&gt;
&lt;br /&gt;
Examples of client-side visualization libraries are given below:&lt;br /&gt;
&lt;br /&gt;
    Highcharts (http://www.highcharts.com/)&lt;br /&gt;
    RaphaelJS (http://g.raphaeljs.com/)&lt;br /&gt;
    dygraphs (http://dygraphs.com/)&lt;br /&gt;
    Protovis (http://vis.stanford.edu/protovis/)&lt;br /&gt;
    Grafico (http://grafico.kilianvalkhof.com/)&lt;br /&gt;
    ChartKick (https://chartkick.com/)&lt;br /&gt;
    VanCharts (http://www.vancharts.com/)&lt;br /&gt;
    GoogleCharts (https://developers.google.com/chart/)&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
The team plans to perform both automated tests using frameworks RSpec and Capybara. In addition, we will perform manual tests of the user interface (UI), using the app.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Framework Tests ===&lt;br /&gt;
The RSpec Testing Framework, automated testing, will be used to verify the Models of the Expertiza Rails Web application feature set. Since this feature is dealing with Visualizations (charts) that is intimately tied with an Active Record Models, we will seed the Testing Database with known data via RSpec. These changes will be automatically rolled-back once the testing is complete.  &lt;br /&gt;
&lt;br /&gt;
=== Capybara Tests ===&lt;br /&gt;
Another automated testing framework that will be used is Capybara. Capybara is an browser type test to simulate a user clicking through your site. We will use this testing framework to verify that our charting object is present on the page and contains the seeded data that we had loaded.&lt;br /&gt;
&lt;br /&gt;
=== UI Tests ===&lt;br /&gt;
In addition to the automated tests above we will also perform manual testing of the newly added features to include:&lt;br /&gt;
&lt;br /&gt;
* Chart is displaying correctly&lt;br /&gt;
*# Bars are showing up where expected&lt;br /&gt;
*# Bar annotations are showing the expected value&lt;br /&gt;
*# Criteria labels are for the correct bar and displaying correct values&lt;br /&gt;
*# Hover text is displaying the correct values&lt;br /&gt;
*# Null values are not present on the chart&lt;br /&gt;
*# Correct colors are used for the multi-round view&lt;br /&gt;
* Show Labels checkbox works as expected&lt;br /&gt;
* Round Criteria is displaying correctly&lt;br /&gt;
*# Round dropdown menu shows all rounds for the assignment&lt;br /&gt;
*# Selecting a round changes the criteria checkboxes&lt;br /&gt;
*# All checkboxes are displayed with appropriate text&lt;br /&gt;
*# Checkboxes correctly remove or add criterion bars to the chart&lt;br /&gt;
&lt;br /&gt;
== Files Involved ==&lt;br /&gt;
&lt;br /&gt;
== Test Results ==&lt;br /&gt;
The team ran both automated tests, using the RSpec framework, and manual tests of the user interface (UI), using the app. The automated tests helped to ensure that the basic functionality of the app still worked, while the UI tests ensured that the visualizations were correct.&lt;br /&gt;
&lt;br /&gt;
=== RSpec Test Results ===&lt;br /&gt;
&lt;br /&gt;
=== UI Tests ===&lt;/div&gt;</summary>
		<author><name>Jwarren3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1905._Refactor_questionnaires_controller.rb&amp;diff=123046</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1905. Refactor 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_E1905._Refactor_questionnaires_controller.rb&amp;diff=123046"/>
		<updated>2019-04-02T02:12:42Z</updated>

		<summary type="html">&lt;p&gt;Jwarren3: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
===Description of the project===&lt;br /&gt;
The questionnaires controller had several issues; this project aimed to address some of them, including:&lt;br /&gt;
&lt;br /&gt;
* Remove or move logic that should reside elsewhere, e.g. in a model class.&lt;br /&gt;
* Remove logic and references to logic that is no longer being used.&lt;br /&gt;
&lt;br /&gt;
===Files modified in the project===&lt;br /&gt;
# app/controllers/questionnaires_controller.rb&lt;br /&gt;
# app/models/questionnaire.rb&lt;br /&gt;
# app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
# app/views/questionnaires/edit_questionnaire.html.erb (deleted)&lt;br /&gt;
# spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
# spec/models/questionnaire_spec.rb&lt;br /&gt;
&lt;br /&gt;
===Issues and Improvements===&lt;br /&gt;
&lt;br /&gt;
====The ''assign_instructor_id'' method====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
This method had two issues:&lt;br /&gt;
# Its name was misleading because it did not actually assign a value; it simply obtained a value from the user in the session.&lt;br /&gt;
# It was delving into implementation details of the ''User'' class.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
The equivalent logic was already implemented in the ''User'' class's ''instructor_id'' method, so calls to the ''assign_instructor_id'' method were simply replaced with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
session[:user].instructor_id&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A description in ''spec/controllers/questionnaires_controller_spec.rb'' was updated to reflect that ''assign_instructor_id'' was no longer in scope.&lt;br /&gt;
&lt;br /&gt;
====The ''export'' and ''import'' methods====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
These methods were actually no longer being used, because the functionality they provided was moved to the ''export_file'' and ''import_file'' routes.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* The logic was triggered by the presence of the parameters ''import'' or ''export'' in the ''save_all_questions'' action.  Code that caused these parameters to be present had been commented out of ''_questionnaire.html.erb'' and ''edit_questionnaire.html.erb'' in the questionnaire views.  The latter file was no longer reachable, as there was no reference to an ''edit_questionnaire'' action in ''config/routes.rb'' or any direct references to it in the questionnaires controller itself.  Thus the commented-out code was removed from ''_questionnaire.html.erb'' and the ''edit_questionnaire.html.erb'' file was deleted.&lt;br /&gt;
* The logic referencing the parameters and methods was removed from the ''save_all_questions'' method.&lt;br /&gt;
&lt;br /&gt;
====The 'copy' and 'copy_questionnaire_details' methods====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
&lt;br /&gt;
#There were two methods ''copy'' and ''copy_questionnaire_details'' present in app/controllers/questionnaire_controller.rb which implemented just one functionality of making a copy of a particular questionnaire.&lt;br /&gt;
#There was no need of two methods in the controller itself. Also, some parts of what was happening needed to be in the model.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* Nothing special was happening in the ''copy_questionnaire_details'' method. Also, it needed to be placed into the model because of the nature of things happening inside it.&lt;br /&gt;
* So, now we have one method ''copy'' in the controller, which calls the ''copy_questionnaire_details'' method, which is present in the Questionnaire model. The instructor_id as well as the params are passed as arguments to the ''copy_questionnaire_details'' method.&lt;br /&gt;
* The other methods that the older ''copy_questionnaire_details'' methods used to call, like ''assign_instructor_id'' were removed in the changes above and they are now included in the method in the model itself.&lt;br /&gt;
* The Exception (if it occurs while saving the Questionnaire object) is being handled in the ''copy'' method of the controller so that the user can be redirected easily.&lt;br /&gt;
&lt;br /&gt;
====Making code DRYer====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
&lt;br /&gt;
#There were parts of the code, specifically when QuizQuestionChoice was created, which was copied throughout the questionnaires_controller.rb. &lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* To make the code DRYer, the repeating code sequences were added into a function called ''create_quiz_question_choice''.&lt;br /&gt;
* Calls were made to this method wherever QuizQuestionChoice was made.&lt;br /&gt;
&lt;br /&gt;
=== Test Plan ===&lt;br /&gt;
There is no means of testing the removal of dead code, except to run the existing suite of test cases:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Removal of the ''assign_instructor_id'' method can be tested by running test cases for the questionnaires controller, since existing test cases rely on the instructor ID being retrieved correctly:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Testing the method ''create_quiz_question_choice'' can likewise be done with this command. &lt;br /&gt;
The logic associated with getting the instructor ID from a user is tested using&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec/models/user_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The additions to the questionnaires model can be tested using&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec/models/questionnaire_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note: If you are having difficulties running the ''rspec'' command, try using&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bundle exec rspec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
instead.  This will use the gems specified in ''Gemfile'' that were installed via ''bundle install''.&lt;/div&gt;</summary>
		<author><name>Jwarren3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1905._Refactor_questionnaires_controller.rb&amp;diff=123039</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1905. Refactor 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_E1905._Refactor_questionnaires_controller.rb&amp;diff=123039"/>
		<updated>2019-04-02T02:07:11Z</updated>

		<summary type="html">&lt;p&gt;Jwarren3: /* Files modified in the project */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
===Description of the project===&lt;br /&gt;
The questionnaires controller had several issues; this project aimed to address some of them, including:&lt;br /&gt;
&lt;br /&gt;
* Remove or move logic that should reside elsewhere, e.g. in a model class.&lt;br /&gt;
* Remove logic and references to logic that is no longer being used.&lt;br /&gt;
&lt;br /&gt;
===Files modified in the project===&lt;br /&gt;
# app/controllers/questionnaires_controller.rb&lt;br /&gt;
# app/models/questionnaire.rb&lt;br /&gt;
# app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
# app/views/questionnaires/edit_questionnaire.html.erb (deleted)&lt;br /&gt;
# spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
# spec/models/questionnaire_spec.rb&lt;br /&gt;
&lt;br /&gt;
===Issues and Improvements===&lt;br /&gt;
&lt;br /&gt;
====The ''assign_instructor_id'' method====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
This method had two issues:&lt;br /&gt;
# Its name was misleading because it did not actually assign a value; it simply obtained a value from the user in the session.&lt;br /&gt;
# It was delving into implementation details of the ''User'' class.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
The equivalent logic was already implemented in the ''User'' class's ''instructor_id'' method, so calls to the ''assign_instructor_id'' method were simply replaced with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
session[:user].instructor_id&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A description in ''spec/controllers/questionnaires_controller_spec.rb'' was updated to reflect that ''assign_instructor_id'' was no longer in scope.&lt;br /&gt;
&lt;br /&gt;
====The ''export'' and ''import'' methods====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
These methods were actually no longer being used, because the functionality they provided was moved to the ''export_file'' and ''import_file'' routes.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* The logic was triggered by the presence of the parameters ''import'' or ''export'' in the ''save_all_questions'' action.  Code that caused these parameters to be present had been commented out of ''_questionnaire.html.erb'' and ''edit_questionnaire.html.erb'' in the questionnaire views.  The latter file was no longer reachable, as there was no reference to an ''edit_questionnaire'' action in ''config/routes.rb'' or any direct references to it in the questionnaires controller itself.  Thus the commented-out code was removed from ''_questionnaire.html.erb'' and the ''edit_questionnaire.html.erb'' file was deleted.&lt;br /&gt;
* The logic referencing the parameters and methods was removed from the ''save_all_questions'' method.&lt;br /&gt;
&lt;br /&gt;
====The 'copy' and 'copy_questionnaire_details' methods====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
&lt;br /&gt;
#There were two methods ''copy'' and ''copy_questionnaire_details'' present in app/controllers/questionnaire_controller.rb which implemented just one functionality of making a copy of a particular questionnaire.&lt;br /&gt;
#There was no need of two methods in the controller itself. Also, some parts of what was happening needed to be in the model.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* Nothing special was happening in the ''copy_questionnaire_details'' method. Also, it needed to be placed into the model because of the nature of things happening inside it.&lt;br /&gt;
* So, now we have one method ''copy'' in the controller, which calls the ''copy_questionnaire_details'' method, which is present in the Questionnaire model. The instructor_id as well as the params are passed as arguments to the ''copy_questionnaire_details'' method.&lt;br /&gt;
* The other methods that the older ''copy_questionnaire_details'' methods used to call, like ''assign_instructor_id'' were removed in the changes above and they are now included in the method in the model itself.&lt;br /&gt;
* The Exception (if it occurs while saving the Questionnaire object) is being handled in the ''copy'' method of the controller so that the user can be redirected easily.&lt;br /&gt;
&lt;br /&gt;
====Making code DRYer====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
&lt;br /&gt;
#There were parts of the code, specifically when QuizQuestionChoice was created, which was copied throughout the questionnaires_controller.rb. &lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* To make the code DRYer, the repeating code sequences were added into a function called ''create_quiz_question_choice''.&lt;br /&gt;
* Calls were made to this method wherever QuizQuestionChoice was made.&lt;br /&gt;
&lt;br /&gt;
=== Test Plan ===&lt;br /&gt;
There is no means of testing the removal of dead code, except to run the existing suite of test cases:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Removal of the ''assign_instructor_id'' method can be tested by running test cases for the questionnaires controller, since existing test cases rely on the instructor ID being retrieved correctly:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The logic associated with getting the instructor ID from a user is tested using&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec/models/user_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The additions to the questionnaires model can be tested using&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec/models/questionnaire_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note: If you are having difficulties running the ''rspec'' command, try using&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bundle exec rspec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
instead.  This will use the gems specified in ''Gemfile'' that were installed via ''bundle install''.&lt;/div&gt;</summary>
		<author><name>Jwarren3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1905._Refactor_questionnaires_controller.rb&amp;diff=123037</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1905. Refactor 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_E1905._Refactor_questionnaires_controller.rb&amp;diff=123037"/>
		<updated>2019-04-02T02:05:15Z</updated>

		<summary type="html">&lt;p&gt;Jwarren3: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
===Description of the project===&lt;br /&gt;
The questionnaires controller had several issues; this project aimed to address some of them, including:&lt;br /&gt;
&lt;br /&gt;
* Remove or move logic that should reside elsewhere, e.g. in a model class.&lt;br /&gt;
* Remove logic and references to logic that is no longer being used.&lt;br /&gt;
&lt;br /&gt;
===Files modified in the project===&lt;br /&gt;
# app/controllers/questionnaires_controller.rb&lt;br /&gt;
# app/models/questionnaire.rb&lt;br /&gt;
# app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
# app/views/questionnaires/edit_questionnaire.html.erb (deleted)&lt;br /&gt;
# spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
===Issues and Improvements===&lt;br /&gt;
&lt;br /&gt;
====The ''assign_instructor_id'' method====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
This method had two issues:&lt;br /&gt;
# Its name was misleading because it did not actually assign a value; it simply obtained a value from the user in the session.&lt;br /&gt;
# It was delving into implementation details of the ''User'' class.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
The equivalent logic was already implemented in the ''User'' class's ''instructor_id'' method, so calls to the ''assign_instructor_id'' method were simply replaced with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
session[:user].instructor_id&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A description in ''spec/controllers/questionnaires_controller_spec.rb'' was updated to reflect that ''assign_instructor_id'' was no longer in scope.&lt;br /&gt;
&lt;br /&gt;
====The ''export'' and ''import'' methods====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
These methods were actually no longer being used, because the functionality they provided was moved to the ''export_file'' and ''import_file'' routes.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* The logic was triggered by the presence of the parameters ''import'' or ''export'' in the ''save_all_questions'' action.  Code that caused these parameters to be present had been commented out of ''_questionnaire.html.erb'' and ''edit_questionnaire.html.erb'' in the questionnaire views.  The latter file was no longer reachable, as there was no reference to an ''edit_questionnaire'' action in ''config/routes.rb'' or any direct references to it in the questionnaires controller itself.  Thus the commented-out code was removed from ''_questionnaire.html.erb'' and the ''edit_questionnaire.html.erb'' file was deleted.&lt;br /&gt;
* The logic referencing the parameters and methods was removed from the ''save_all_questions'' method.&lt;br /&gt;
&lt;br /&gt;
====The 'copy' and 'copy_questionnaire_details' methods====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
&lt;br /&gt;
#There were two methods ''copy'' and ''copy_questionnaire_details'' present in app/controllers/questionnaire_controller.rb which implemented just one functionality of making a copy of a particular questionnaire.&lt;br /&gt;
#There was no need of two methods in the controller itself. Also, some parts of what was happening needed to be in the model.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* Nothing special was happening in the ''copy_questionnaire_details'' method. Also, it needed to be placed into the model because of the nature of things happening inside it.&lt;br /&gt;
* So, now we have one method ''copy'' in the controller, which calls the ''copy_questionnaire_details'' method, which is present in the Questionnaire model. The instructor_id as well as the params are passed as arguments to the ''copy_questionnaire_details'' method.&lt;br /&gt;
* The other methods that the older ''copy_questionnaire_details'' methods used to call, like ''assign_instructor_id'' were removed in the changes above and they are now included in the method in the model itself.&lt;br /&gt;
* The Exception (if it occurs while saving the Questionnaire object) is being handled in the ''copy'' method of the controller so that the user can be redirected easily.&lt;br /&gt;
&lt;br /&gt;
====Making code DRYer====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
&lt;br /&gt;
#There were parts of the code, specifically when QuizQuestionChoice was created, which was copied throughout the questionnaires_controller.rb. &lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* To make the code DRYer, the repeating code sequences were added into a function called ''create_quiz_question_choice''.&lt;br /&gt;
* Calls were made to this method wherever QuizQuestionChoice was made.&lt;br /&gt;
&lt;br /&gt;
=== Test Plan ===&lt;br /&gt;
There is no means of testing the removal of dead code, except to run the existing suite of test cases:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Removal of the ''assign_instructor_id'' method can be tested by running test cases for the questionnaires controller, since existing test cases rely on the instructor ID being retrieved correctly:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The logic associated with getting the instructor ID from a user is tested using&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec/models/user_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The additions to the questionnaires model can be tested using&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec/models/questionnaire_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note: If you are having difficulties running the ''rspec'' command, try using&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bundle exec rspec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
instead.  This will use the gems specified in ''Gemfile'' that were installed via ''bundle install''.&lt;/div&gt;</summary>
		<author><name>Jwarren3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1905._Refactor_questionnaires_controller.rb&amp;diff=123035</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1905. Refactor 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_E1905._Refactor_questionnaires_controller.rb&amp;diff=123035"/>
		<updated>2019-04-02T02:04:53Z</updated>

		<summary type="html">&lt;p&gt;Jwarren3: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
===Description of the project===&lt;br /&gt;
The questionnaires controller had several issues; this project aimed to address some of them, including:&lt;br /&gt;
&lt;br /&gt;
* Remove or move logic that should reside elsewhere, e.g. in a model class.&lt;br /&gt;
* Remove logic and references to logic that is no longer being used.&lt;br /&gt;
&lt;br /&gt;
===Files modified in the project===&lt;br /&gt;
# app/controllers/questionnaires_controller.rb&lt;br /&gt;
# app/models/questionnaire.rb&lt;br /&gt;
# app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
# app/views/questionnaires/edit_questionnaire.html.erb (deleted)&lt;br /&gt;
# spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
===Issues and Improvements===&lt;br /&gt;
&lt;br /&gt;
====The ''assign_instructor_id'' method====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
This method had two issues:&lt;br /&gt;
# Its name was misleading because it did not actually assign a value; it simply obtained a value from the user in the session.&lt;br /&gt;
# It was delving into implementation details of the ''User'' class.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
The equivalent logic was already implemented in the ''User'' class's ''instructor_id'' method, so calls to the ''assign_instructor_id'' method were simply replaced with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
session[:user].instructor_id&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A description in ''spec/controllers/questionnaires_controller_spec.rb'' was updated to reflect that ''assign_instructor_id'' was no longer in scope.&lt;br /&gt;
&lt;br /&gt;
====The ''export'' and ''import'' methods====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
These methods were actually no longer being used, because the functionality they provided was moved to the ''export_file'' and ''import_file'' routes.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* The logic was triggered by the presence of the parameters ''import'' or ''export'' in the ''save_all_questions'' action.  Code that caused these parameters to be present had been commented out of ''_questionnaire.html.erb'' and ''edit_questionnaire.html.erb'' in the questionnaire views.  The latter file was no longer reachable, as there was no reference to an ''edit_questionnaire'' action in ''config/routes.rb'' or any direct references to it in the questionnaires controller itself.  Thus the commented-out code was removed from ''_questionnaire.html.erb'' and the ''edit_questionnaire.html.erb'' file was deleted.&lt;br /&gt;
* The logic referencing the parameters and methods was removed from the ''save_all_questions'' method.&lt;br /&gt;
&lt;br /&gt;
====The 'copy' and 'copy_questionnaire_details' methods====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
&lt;br /&gt;
#There were two methods ''copy'' and ''copy_questionnaire_details'' present in app/controllers/questionnaire_controller.rb which implemented just one functionality of making a copy of a particular questionnaire.&lt;br /&gt;
#There was no need of two methods in the controller itself. Also, some parts of what was happening needed to be in the model.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* Nothing special was happening in the ''copy_questionnaire_details'' method. Also, it needed to be placed into the model because of the nature of things happening inside it.&lt;br /&gt;
* So, now we have one method ''copy'' in the controller, which calls the ''copy_questionnaire_details'' method, which is present in the Questionnaire model. The instructor_id as well as the params are passed as arguments to the ''copy_questionnaire_details'' method.&lt;br /&gt;
* The other methods that the older ''copy_questionnaire_details'' methods used to call, like ''assign_instructor_id'' were removed in the changes above and they are now included in the method in the model itself.&lt;br /&gt;
* The Exception (if it occurs while saving the Questionnaire object) is being handled in the ''copy'' method of the controller so that the user can be redirected easily.&lt;br /&gt;
&lt;br /&gt;
====Making code DRYer====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
&lt;br /&gt;
#There were parts of the code, specifically when QuizQuestionChoice was created, which was copied throughout the questionnaires_controller.rb. &lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* To make the code DRYer, the repeating code sequences were added into a function called ''create_quiz_question_choice''.&lt;br /&gt;
* Calls were made to this method wherever QuizQuestionChoice was made.&lt;br /&gt;
&lt;br /&gt;
=== Test Plan ===&lt;br /&gt;
There is no means of testing the removal of dead code, except to run the existing suite of test cases:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Removal of the ''assign_instructor_id'' method can be tested by running test cases for the questionnaires controller, since existing test cases rely on the instructor ID being retrieved correctly:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The logic associated with getting the instructor ID from a user is tested using&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec/models/user_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The additions to the questionnaires model can be tested using&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec/models/questionnaire_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note: If you are having difficulties running the ''spec'' command, try using&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bundle exec rspec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
instead.  This will use the gems specified in ''Gemfile'' that were installed via ''bundle install''.&lt;/div&gt;</summary>
		<author><name>Jwarren3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1905._Refactor_questionnaires_controller.rb&amp;diff=123034</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1905. Refactor 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_E1905._Refactor_questionnaires_controller.rb&amp;diff=123034"/>
		<updated>2019-04-02T02:04:38Z</updated>

		<summary type="html">&lt;p&gt;Jwarren3: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
===Description of the project===&lt;br /&gt;
The questionnaires controller had several issues; this project aimed to address some of them, including:&lt;br /&gt;
&lt;br /&gt;
* Remove or move logic that should reside elsewhere, e.g. in a model class.&lt;br /&gt;
* Remove logic and references to logic that is no longer being used.&lt;br /&gt;
&lt;br /&gt;
===Files modified in the project===&lt;br /&gt;
# app/controllers/questionnaires_controller.rb&lt;br /&gt;
# app/models/questionnaire.rb&lt;br /&gt;
# app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
# app/views/questionnaires/edit_questionnaire.html.erb (deleted)&lt;br /&gt;
# spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
===Issues and Improvements===&lt;br /&gt;
&lt;br /&gt;
====The ''assign_instructor_id'' method====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
This method had two issues:&lt;br /&gt;
# Its name was misleading because it did not actually assign a value; it simply obtained a value from the user in the session.&lt;br /&gt;
# It was delving into implementation details of the ''User'' class.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
The equivalent logic was already implemented in the ''User'' class's ''instructor_id'' method, so calls to the ''assign_instructor_id'' method were simply replaced with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
session[:user].instructor_id&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A description in ''spec/controllers/questionnaires_controller_spec.rb'' was updated to reflect that ''assign_instructor_id'' was no longer in scope.&lt;br /&gt;
&lt;br /&gt;
====The ''export'' and ''import'' methods====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
These methods were actually no longer being used, because the functionality they provided was moved to the ''export_file'' and ''import_file'' routes.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* The logic was triggered by the presence of the parameters ''import'' or ''export'' in the ''save_all_questions'' action.  Code that caused these parameters to be present had been commented out of ''_questionnaire.html.erb'' and ''edit_questionnaire.html.erb'' in the questionnaire views.  The latter file was no longer reachable, as there was no reference to an ''edit_questionnaire'' action in ''config/routes.rb'' or any direct references to it in the questionnaires controller itself.  Thus the commented-out code was removed from ''_questionnaire.html.erb'' and the ''edit_questionnaire.html.erb'' file was deleted.&lt;br /&gt;
* The logic referencing the parameters and methods was removed from the ''save_all_questions'' method.&lt;br /&gt;
&lt;br /&gt;
====The 'copy' and 'copy_questionnaire_details' methods====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
&lt;br /&gt;
#There were two methods ''copy'' and ''copy_questionnaire_details'' present in app/controllers/questionnaire_controller.rb which implemented just one functionality of making a copy of a particular questionnaire.&lt;br /&gt;
#There was no need of two methods in the controller itself. Also, some parts of what was happening needed to be in the model.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* Nothing special was happening in the ''copy_questionnaire_details'' method. Also, it needed to be placed into the model because of the nature of things happening inside it.&lt;br /&gt;
* So, now we have one method ''copy'' in the controller, which calls the ''copy_questionnaire_details'' method, which is present in the Questionnaire model. The instructor_id as well as the params are passed as arguments to the ''copy_questionnaire_details'' method.&lt;br /&gt;
* The other methods that the older ''copy_questionnaire_details'' methods used to call, like ''assign_instructor_id'' were removed in the changes above and they are now included in the method in the model itself.&lt;br /&gt;
* The Exception (if it occurs while saving the Questionnaire object) is being handled in the ''copy'' method of the controller so that the user can be redirected easily.&lt;br /&gt;
&lt;br /&gt;
====Making code DRYer====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
&lt;br /&gt;
#There were parts of the code, specifically when QuizQuestionChoice was created, which was copied throughout the questionnaires_controller.rb. &lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* To make the code DRYer, the repeating code sequences were added into a function called ''create_quiz_question_choice''.&lt;br /&gt;
* Calls were made to this method wherever QuizQuestionChoice was made.&lt;br /&gt;
&lt;br /&gt;
=== Test Plan ===&lt;br /&gt;
There is no means of testing the removal of dead code, except to run the existing suite of test cases:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Removal of the ''assign_instructor_id'' method can be tested by running test cases for the questionnaires controller, since existing test cases rely on the instructor ID being retrieved correctly:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The logic associated with getting the instructor ID from a user is tested using&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec/models/user_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The additions to the questionnaires model can be tested using&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec/models/questionnaire_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Note: If you are having difficulties running the ''spec'' command, try using&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bundle exec spec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
instead.  This will use the gems specified in ''Gemfile'' that were installed via ''bundle install''.&lt;/div&gt;</summary>
		<author><name>Jwarren3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1905._Refactor_questionnaires_controller.rb&amp;diff=122930</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1905. Refactor 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_E1905._Refactor_questionnaires_controller.rb&amp;diff=122930"/>
		<updated>2019-04-01T23:17:10Z</updated>

		<summary type="html">&lt;p&gt;Jwarren3: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
===Description of the project===&lt;br /&gt;
The questionnaires controller had several issues; this project aimed to address some of them, including:&lt;br /&gt;
&lt;br /&gt;
* Remove or move logic that should reside elsewhere, e.g. in a model class.&lt;br /&gt;
* Remove logic and references to logic that is no longer being used.&lt;br /&gt;
&lt;br /&gt;
===Files modified in the project===&lt;br /&gt;
# app/controllers/questionnaires_controller.rb&lt;br /&gt;
# app/models/questionnaire.rb&lt;br /&gt;
# app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
# app/views/questionnaires/edit_questionnaire.html.erb (deleted)&lt;br /&gt;
# spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
===Issues and Improvements===&lt;br /&gt;
&lt;br /&gt;
====The ''assign_instructor_id'' method====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
This method had two issues:&lt;br /&gt;
# Its name was misleading because it did not actually assign a value; it simply obtained a value from the user in the session.&lt;br /&gt;
# It was delving into implementation details of the ''User'' class.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
The equivalent logic was already implemented in the ''User'' class's ''instructor_id'' method, so calls to the ''assign_instructor_id'' method were simply replaced with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
session[:user].instructor_id&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A description in ''spec/controllers/questionnaires_controller_spec.rb'' was updated to reflect that ''assign_instructor_id'' was no longer in scope.&lt;br /&gt;
&lt;br /&gt;
====The ''export'' and ''import'' methods====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
These methods were actually no longer being used, because the functionality they provided was moved to the ''export_file'' and ''import_file'' routes.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* The logic was triggered by the presence of the parameters ''import'' or ''export'' in the ''save_all_questions'' action.  Code that caused these parameters to be present had been commented out of ''_questionnaire.html.erb'' and ''edit_questionnaire.html.erb'' in the questionnaire views.  The latter file was no longer reachable, as there was no reference to an ''edit_questionnaire'' action in ''config/routes.rb'' or any direct references to it in the questionnaires controller itself.  Thus the commented-out code was removed from ''_questionnaire.html.erb'' and the ''edit_questionnaire.html.erb'' file was deleted.&lt;br /&gt;
* The logic referencing the parameters and methods was removed from the ''save_all_questions'' method.&lt;br /&gt;
&lt;br /&gt;
====The 'copy' and 'copy_questionnaire_details' methods====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
&lt;br /&gt;
#There were two methods ''copy'' and ''copy_questionnaire_details'' present in app/controllers/questionnaire_controller.rb which implemented just one functionality of making a copy of a particular questionnaire.&lt;br /&gt;
#There was no need of two methods in the controller itself. Also, some parts of what was happening needed to be in the model.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* Nothing special was happening in the ''copy_questionnaire_details'' method. Also, it needed to be placed into the model because of the nature of things happening inside it.&lt;br /&gt;
* So, now we have one method ''copy'' in the controller, which calls the ''copy_questionnaire_details'' method, which is present in the Questionnaire model. The instructor_id as well as the params are passed as arguments to the ''copy_questionnaire_details'' method.&lt;br /&gt;
* The other methods that the older ''copy_questionnaire_details'' methods used to call, like ''assign_instructor_id'' were removed in the changes above and they are now included in the method in the model itself.&lt;br /&gt;
* The Exception (if it occurs while saving the Questionnaire object) is being handled in the ''copy'' method of the controller so that the user can be redirected easily.&lt;br /&gt;
&lt;br /&gt;
====Making code DRYer====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
&lt;br /&gt;
#There were parts of the code, specifically when QuizQuestionChoice was created, which was copied throughout the questionnaires_controller.rb. &lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* To make the code DRYer, the repeating code sequences were added into a function called ''create_quiz_question_choice''.&lt;br /&gt;
* Calls were made to this method wherever QuizQuestionChoice was made.&lt;br /&gt;
&lt;br /&gt;
=== Test Plan ===&lt;br /&gt;
There is no means of testing the removal of dead code, except to run the existing suite of test cases:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Removal of the ''assign_instructor_id'' method can be tested by running test cases for the questionnaires controller, since existing test cases rely on the instructor ID being retrieved correctly:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The logic associated with getting the instructor ID from a user is tested using&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec/models/user_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The additions to the questionnaires model can be tested using&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec/models/questionnaire_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwarren3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1905._Refactor_questionnaires_controller.rb&amp;diff=122709</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1905. Refactor 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_E1905._Refactor_questionnaires_controller.rb&amp;diff=122709"/>
		<updated>2019-03-31T13:52:34Z</updated>

		<summary type="html">&lt;p&gt;Jwarren3: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
===Description of the project===&lt;br /&gt;
The questionnaires controller had several issues; this project aimed to address some of them, including:&lt;br /&gt;
&lt;br /&gt;
* Remove or move logic that should reside elsewhere, e.g. in a model class.&lt;br /&gt;
* Remove logic and references to logic that is no longer being used.&lt;br /&gt;
&lt;br /&gt;
===Files modified in the project===&lt;br /&gt;
# app/controllers/questionnaires_controller.rb&lt;br /&gt;
# app/models/questionnaire.rb&lt;br /&gt;
# app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
# app/views/questionnaires/edit_questionnaire.html.erb (deleted)&lt;br /&gt;
# spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
===Issues and Improvements===&lt;br /&gt;
&lt;br /&gt;
====The ''assign_instructor_id'' method====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
This method had two issues:&lt;br /&gt;
# Its name was misleading because it did not actually assign a value; it simply obtained a value from the user in the session.&lt;br /&gt;
# It was delving into implementation details of the ''User'' class.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
The equivalent logic was already implemented in the ''User'' class's ''instructor_id'' method, so calls to the ''assign_instructor_id'' method were simply replaced with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
session[:user].instructor_id&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A description in ''spec/controllers/questionnaires_controller_spec.rb'' was updated to reflect that ''assign_instructor_id'' was no longer in scope.&lt;br /&gt;
&lt;br /&gt;
====The ''export'' and ''import'' methods====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
These methods were actually no longer being used, because the functionality they provided was moved to the ''export_file'' and ''import_file'' routes.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* The logic was triggered by the presence of the parameters ''import'' or ''export'' in the ''save_all_questions'' action.  Code that caused these parameters to be present had been commented out of ''_questionnaire.html.erb'' and ''edit_questionnaire.html.erb'' in the questionnaire views.  The latter file was no longer reachable, as there was no reference to an ''edit_questionnaire'' action in ''config/routes.rb'' or any direct references to it in the questionnaires controller itself.  Thus the commented-out code was removed from ''_questionnaire.html.erb'' and the ''edit_questionnaire.html.erb'' file was deleted.&lt;br /&gt;
* The logic referencing the parameters and methods was removed from the ''save_all_questions'' method.&lt;br /&gt;
&lt;br /&gt;
====The 'copy' and 'copy_questionnaire_details' methods====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
&lt;br /&gt;
#There were two methods ''copy'' and ''copy_questionnaire_details'' present in app/controllers/questionnaire_controller.rb which implemented just one functionality of making a copy of a particular questionnaire.&lt;br /&gt;
#There was no need of two methods in the controller itself. Also, some parts of what was happening needed to be in the model.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* Nothing special was happening in the ''copy_questionnaire_details'' method. Also, it needed to be placed into the model because of the nature of things happening inside it.&lt;br /&gt;
* So, now we have one method ''copy'' in the controller, which calls the ''copy_questionnaire_details'' method, which is present in the Questionnaire model. The instructor_id as well as the params are passed as arguments to the ''copy_questionnaire_details'' method.&lt;br /&gt;
* The other methods that the older ''copy_questionnaire_details'' methods used to call, like ''assign_instructor_id'' were removed in the changes above and they are now included in the method in the model itself.&lt;br /&gt;
* The Exception (if it occurs while saving the Questionnaire object) is being handled in the ''copy'' method of the controller so that the user can be redirected easily.&lt;br /&gt;
&lt;br /&gt;
====Making code DRYer====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
&lt;br /&gt;
#There were parts of the code, specifically when QuizQuestionChoice was created, which was copied throughout the questionnaires_controller.rb. &lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* To make the code DRYer, the repeating code sequences were added into a function called ''create_quiz_question_choice''.&lt;br /&gt;
* Calls were made to this method wherever QuizQuestionChoice was made.&lt;br /&gt;
&lt;br /&gt;
=== Test Plan ===&lt;br /&gt;
There is no means of testing the removal of dead code, except to run the existing suite of test cases:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Removal of the ''assign_instructor_id'' method can be tested by running test cases for the questionnaires controller, since existing test cases rely on the instructor ID being retrieved correctly:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The logic associated with getting the instructor ID from a user is tested using&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec/models/user_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwarren3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1905._Refactor_questionnaires_controller.rb&amp;diff=122708</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1905. Refactor 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_E1905._Refactor_questionnaires_controller.rb&amp;diff=122708"/>
		<updated>2019-03-31T13:47:20Z</updated>

		<summary type="html">&lt;p&gt;Jwarren3: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
===Description of the project===&lt;br /&gt;
The questionnaires controller had several issues; this project aimed to address some of them, including:&lt;br /&gt;
&lt;br /&gt;
* Remove or move logic that should reside elsewhere, e.g. in a model class.&lt;br /&gt;
* Remove logic and references to logic that is no longer being used.&lt;br /&gt;
&lt;br /&gt;
===Files modified in the project===&lt;br /&gt;
# app/controllers/questionnaires_controller.rb&lt;br /&gt;
# app/models/questionnaire.rb&lt;br /&gt;
# app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
# app/views/questionnaires/edit_questionnaire.html.erb (deleted)&lt;br /&gt;
# spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
===Issues and Improvements===&lt;br /&gt;
&lt;br /&gt;
====The ''assign_instructor_id'' method====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
This method had two issues:&lt;br /&gt;
# Its name was misleading because it did not actually assign a value; it simply obtained a value from the user in the session.&lt;br /&gt;
# It was delving into implementation details of the ''User'' class.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
The equivalent logic was already implemented in the ''User'' class's ''instructor_id'' method, so calls to the ''assign_instructor_id'' method were simply replaced with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
session[:user].instructor_id&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A description in ''spec/controllers/questionnaires_controller_spec.rb'' was updated to reflect that ''assign_instructor_id'' was no longer in scope.&lt;br /&gt;
&lt;br /&gt;
====The ''export'' and ''import'' methods====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
These methods were actually no longer being used, because the functionality they provided was moved to the ''export_file'' and ''import_file'' routes.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* The logic was triggered by the presence of the parameters ''import'' or ''export'' in the ''save_all_questions'' action.  Code that caused these parameters to be present had been commented out of ''_questionnaire.html.erb'' and ''edit_questionnaire.html.erb'' in the questionnaire views.  The latter file was no longer reachable, as there was no reference to an ''edit_questionnaire'' action in ''config/routes.rb'' or any direct references to it in the questionnaires controller itself.  Thus the commented-out code was removed from ''_questionnaire.html.erb'' and the ''edit_questionnaire.html.erb'' file was deleted.&lt;br /&gt;
* The logic referencing the parameters and methods was removed from the ''save_all_questions'' method.&lt;br /&gt;
&lt;br /&gt;
====The 'copy' and 'copy_questionnaire_details' methods====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
&lt;br /&gt;
#There were two methods ''copy'' and ''copy_questionnaire_details'' present in app/controllers/questionnaire_controller.rb which implemented just one functionality of making a copy of a particular questionnaire.&lt;br /&gt;
#There was no need of two methods in the controller itself. Also, some parts of what was happening needed to be in the model.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* Nothing special was happening in the ''copy_questionnaire_details'' method. Also, it needed to be placed into the model because of the nature of things happening inside it.&lt;br /&gt;
* So, now we have one method ''copy'' in the controller, which calls the ''copy_questionnaire_details'' method, which is present in the Questionnaire model. The instructor_id as well as the params are passed as arguments to the ''copy_questionnaire_details'' method.&lt;br /&gt;
* The other methods that the older ''copy_questionnaire_details'' methods used to call, like ''assign_instructor_id'' were removed in the changes above and they are now included in the method in the model itself.&lt;br /&gt;
* The Exception (if it occurs while saving the Questionnaire object) is being handled in the ''copy'' method of the controller so that the user can be redirected easily.&lt;br /&gt;
&lt;br /&gt;
====Making code DRYer====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
&lt;br /&gt;
#There were parts of the code, specifically when QuizQuestionChoice was created, which was copied throughout the questionnaires_controller.rb. &lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* To make the code DRYer, the repeating code sequences were added into a function called ''create_quiz_question_choice''.&lt;br /&gt;
* Calls were made to this method wherever QuizQuestionChoice was made.&lt;br /&gt;
&lt;br /&gt;
=== Test Plan ===&lt;br /&gt;
There is no means of testing the removal of dead code, except to run the existing suite of test cases:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Removal of the ''assign_instructor_id'' method can be testing by running test cases for the questionnaires controller:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
The logic associated with getting the instructor ID from a user is tested using&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec/models/user_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwarren3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1905._Refactor_questionnaires_controller.rb&amp;diff=122707</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1905. Refactor 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_E1905._Refactor_questionnaires_controller.rb&amp;diff=122707"/>
		<updated>2019-03-31T13:33:55Z</updated>

		<summary type="html">&lt;p&gt;Jwarren3: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
===Description of the project===&lt;br /&gt;
The questionnaires controller had several issues; this project aimed to address some of them, including:&lt;br /&gt;
&lt;br /&gt;
* Remove or move logic that should reside elsewhere, e.g. in a model class.&lt;br /&gt;
* Remove logic and references to logic that is no longer being used.&lt;br /&gt;
&lt;br /&gt;
===Files modified in the project===&lt;br /&gt;
# app/controllers/questionnaires_controller.rb&lt;br /&gt;
# app/models/questionnaire.rb&lt;br /&gt;
# app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
# app/views/questionnaires/edit_questionnaire.html.erb (deleted)&lt;br /&gt;
# spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
===Issues and Improvements===&lt;br /&gt;
&lt;br /&gt;
====The ''assign_instructor_id'' method====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
This method had two issues:&lt;br /&gt;
# Its name was misleading because it did not actually assign a value; it simply obtained a value from the user in the session.&lt;br /&gt;
# It was delving into implementation details of the ''User'' class.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
The equivalent logic was already implemented in the ''User'' class's ''instructor_id'' method, so calls to the ''assign_instructor_id'' method were simply replaced with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
session[:user].instructor_id&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A description in ''spec/controllers/questionnaires_controller_spec.rb'' was updated to reflect that ''assign_instructor_id'' was no longer in scope.&lt;br /&gt;
&lt;br /&gt;
====The ''export'' and ''import'' methods====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
These methods were actually no longer being used, because the functionality they provided was moved to the ''export_file'' and ''import_file'' routes.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* The logic was triggered by the presence of the parameters ''import'' or ''export'' in the ''save_all_questions'' action.  Code that caused these parameters to be present had been commented out of ''_questionnaire.html.erb'' and ''edit_questionnaire.html.erb'' in the questionnaire views.  The latter file was no longer reachable, as there was no reference to an ''edit_questionnaire'' action in ''config/routes.rb'' or any direct references to it in the questionnaires controller itself.  Thus the commented-out code was removed from ''_questionnaire.html.erb'' and the ''edit_questionnaire.html.erb'' file was deleted.&lt;br /&gt;
* The logic referencing the parameters and methods was removed from the ''save_all_questions'' method.&lt;br /&gt;
&lt;br /&gt;
====The 'copy' and 'copy_questionnaire_details' methods====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
&lt;br /&gt;
#There were two methods ''copy'' and ''copy_questionnaire_details'' present in app/controllers/questionnaire_controller.rb which implemented just one functionality of making a copy of a particular questionnaire.&lt;br /&gt;
#There was no need of two methods in the controller itself. Also, some parts of what was happening needed to be in the model.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* Nothing special was happening in the ''copy_questionnaire_details'' method. Also, it needed to be placed into the model because of the nature of things happening inside it.&lt;br /&gt;
* So, now we have one method ''copy'' in the controller, which calls the ''copy_questionnaire_details'' method, which is present in the Questionnaire model. The instructor_id as well as the params are passed as arguments to the ''copy_questionnaire_details'' method.&lt;br /&gt;
* The other methods that the older ''copy_questionnaire_details'' methods used to call, like ''assign_instructor_id'' were removed in the changes above and they are now included in the method in the model itself.&lt;br /&gt;
* The Exception (if it occurs while saving the Questionnaire object) is being handled in the ''copy'' method of the controller so that the user can be redirected easily.&lt;br /&gt;
&lt;br /&gt;
====Making code DRYer====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
&lt;br /&gt;
#There were parts of the code, specifically when QuizQuestionChoice was created, which was copied throughout the questionnaires_controller.rb. &lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* To make the code DRYer, the repeating code sequences were added into a function called ''create_quiz_question_choice''.&lt;br /&gt;
* Calls were made to this method wherever QuizQuestionChoice was made.&lt;br /&gt;
&lt;br /&gt;
=== Test Plan ===&lt;br /&gt;
There is no means of testing the removal of dead code, except to run the existing suite of test cases:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Removal of the ''assign_instructor_id'' method can be testing by running test cases for the questionnaires controller:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
rspec spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jwarren3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1905._Refactor_questionnaires_controller.rb&amp;diff=121830</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1905. Refactor 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_E1905._Refactor_questionnaires_controller.rb&amp;diff=121830"/>
		<updated>2019-03-24T19:00:00Z</updated>

		<summary type="html">&lt;p&gt;Jwarren3: /* Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
===Description of the project===&lt;br /&gt;
The questionnaires controller had several issues; this project aimed to address some of them, including:&lt;br /&gt;
&lt;br /&gt;
* Remove or move logic that should reside elsewhere, e.g. in a model class.&lt;br /&gt;
* Remove logic and references to logic that is no longer being used.&lt;br /&gt;
&lt;br /&gt;
===Files modified in the project===&lt;br /&gt;
# app/controllers/questionnaires_controller.rb&lt;br /&gt;
# app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
# app/views/questionnaires/edit_questionnaire.html.erb (deleted)&lt;br /&gt;
# spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
===Issues and Improvements===&lt;br /&gt;
&lt;br /&gt;
====The ''assign_instructor_id'' method====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
This method had two issues:&lt;br /&gt;
# Its name was misleading because it did not actually assign a value; it simply obtained a value from the user in the session.&lt;br /&gt;
# It was delving into implementation details of the ''User'' class.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
The equivalent logic was already implemented in the ''User'' class's ''instructor_id'' method, so calls to the ''assign_instructor_id'' method were simply replaced with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
session[:user].instructor_id&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A description in ''spec/controllers/questionnaires_controller_spec.rb'' was updated to reflect that ''assign_instructor_id'' was no longer in scope.&lt;br /&gt;
&lt;br /&gt;
====The ''export'' and ''import'' methods====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
These methods were actually no longer being used, because the functionality they provided was moved to the ''export_file'' and ''import_file'' routes.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* The logic was triggered by the presence of the parameters ''import'' or ''export'' in the ''save_all_questions'' action.  Code that caused these parameters to be present had been commented out of ''_questionnaire.html.erb'' and ''edit_questionnaire.html.erb'' in the questionnaire views.  The latter file was no longer reachable, as there was no reference to an ''edit_questionnaire'' action in ''config/routes.rb'' or any direct references to it in the questionnaires controller itself.  Thus the commented-out code was removed from ''_questionnaire.html.erb'' and the ''edit_questionnaire.html.erb'' file was deleted.&lt;br /&gt;
* The logic referencing the parameters and methods was removed from the ''save_all_questions'' method.&lt;/div&gt;</summary>
		<author><name>Jwarren3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019_-_Project_E1905._Refactor_questionnaires_controller.rb&amp;diff=121829</id>
		<title>CSC/ECE 517 Spring 2019 - Project E1905. Refactor 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_E1905._Refactor_questionnaires_controller.rb&amp;diff=121829"/>
		<updated>2019-03-24T18:57:12Z</updated>

		<summary type="html">&lt;p&gt;Jwarren3: Created page with &amp;quot;__TOC__  ===Description of the project=== The questionnaires controller had several issues; this project aimed to address some of them, including:  * Remove or move logic that sh...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
===Description of the project===&lt;br /&gt;
The questionnaires controller had several issues; this project aimed to address some of them, including:&lt;br /&gt;
&lt;br /&gt;
* Remove or move logic that should reside elsewhere, e.g. in a model class.&lt;br /&gt;
* Remove logic and references to logic that is no longer being used.&lt;br /&gt;
&lt;br /&gt;
===Files modified in the project===&lt;br /&gt;
# app/controllers/questionnaires_controller.rb&lt;br /&gt;
# app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
# app/views/questionnaires/edit_questionnaire.html.erb (deleted)&lt;br /&gt;
# spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
&lt;br /&gt;
===Issues and Improvements===&lt;br /&gt;
&lt;br /&gt;
====The ''assign_instructor_id'' method====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
This method had two issues:&lt;br /&gt;
# Its name was misleading because it did not actually assign a value; it simply obtained a value from the user in the session.&lt;br /&gt;
# It was delving into implementation details of the ''User'' class.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
The equivalent logic was already implemented in the ''User'' class's ''instructor_id'' method, so calls to the ''assign_instructor_id'' method were simply replaced with:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
session[:user].instructor_id&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====The ''export'' and ''import'' methods====&lt;br /&gt;
&lt;br /&gt;
=====Problems=====&lt;br /&gt;
These methods were actually no longer being used, because the functionality they provided was moved to the ''export_file'' and ''import_file'' routes.&lt;br /&gt;
&lt;br /&gt;
=====Solution=====&lt;br /&gt;
* The logic was triggered by the presence of the parameters ''import'' or ''export'' in the ''save_all_questions'' action.  Code that caused these parameters to be present had been commented out of ''_questionnaire.html.erb'' and ''edit_questionnaire.html.erb'' in the questionnaire views.  The latter file was no longer reachable, as there was no reference to an ''edit_questionnaire'' action in ''config/routes.rb'' or any direct references to it in the questionnaires controller itself.  Thus the commented-out code was removed from ''_questionnaire.html.erb'' and the ''edit_questionnaire.html.erb'' file was deleted.&lt;br /&gt;
* The logic referencing the parameters and methods was removed from the ''save_all_questions'' method.&lt;/div&gt;</summary>
		<author><name>Jwarren3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019&amp;diff=121822</id>
		<title>CSC/ECE 517 Spring 2019</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2019&amp;diff=121822"/>
		<updated>2019-03-24T18:24:28Z</updated>

		<summary type="html">&lt;p&gt;Jwarren3: Create initial page for CSC/ECE 517 Spring 2019&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;* [[CSC/ECE 517 Spring 2019 - Project E1905. Refactor questionnaires_controller.rb]]&lt;/div&gt;</summary>
		<author><name>Jwarren3</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=MainPage&amp;diff=121821</id>
		<title>MainPage</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=MainPage&amp;diff=121821"/>
		<updated>2019-03-24T18:22:13Z</updated>

		<summary type="html">&lt;p&gt;Jwarren3: Add page for csc517 spring 2019&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Expertiza==&lt;br /&gt;
* [[Expertiza documentation]]&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Summer 2008]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2010]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2011]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2012]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2013]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2014]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2015]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2016]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2014]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2015]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2016]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2017]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2017]]&lt;br /&gt;
* [[CSC/Independent Study Spring 2018]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2018]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2018]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2019]]&lt;br /&gt;
* [[CSC 456 Spring 2011|CSC 456 Spring 2012]]&lt;br /&gt;
* [[ECE 633]]&lt;br /&gt;
* [[KCU]]&lt;br /&gt;
* [[Progress reports]]&lt;br /&gt;
* [[ReactJs Frontend]]&lt;br /&gt;
==Application Behavior==&lt;br /&gt;
* [[Grading]]&lt;br /&gt;
&lt;br /&gt;
==Metaprogramming==&lt;br /&gt;
* [[CSC/ECE_517_Spring_2013/ch1b_1k_hf|Lecture on Metaprogramming]]&lt;br /&gt;
&lt;br /&gt;
==Development==&lt;br /&gt;
&lt;br /&gt;
''Expertiza now has a Java dependency, so the machine you are using to develop Expertiza on should have the JVM installed.''&lt;br /&gt;
&lt;br /&gt;
* [[Setting Up a Development Machine]]&lt;br /&gt;
* [[Creating a Linux Development Environment for Expertiza - Installation Guide]]&lt;br /&gt;
* [[Using git and github for projects]]&lt;br /&gt;
* [[Using heroku to deploy your projects]]&lt;br /&gt;
* [[How to Begin a Project from the Current Expertiza Repository]]&lt;br /&gt;
* [[Git]]&lt;br /&gt;
* [[How to Change a User's Password on a Development Machine]]&lt;br /&gt;
* [[Debugging Rails]]&lt;br /&gt;
* [http://rajanalwan.com/ui_guidelines/ Design Template]&lt;br /&gt;
&lt;br /&gt;
==Production==&lt;br /&gt;
* [[Deploying to Production]]&lt;br /&gt;
* [[Downloading Production Data]]&lt;br /&gt;
* [[Accessing the Production Server]]&lt;br /&gt;
&lt;br /&gt;
==Testing==&lt;br /&gt;
* [[Using Cucumber with Expertiza]]&lt;br /&gt;
* [[Rails Testing Overview]]&lt;br /&gt;
* [[Expertiza Continuous Integration]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
* [[Object-Oriented Design and Programming]]&lt;/div&gt;</summary>
		<author><name>Jwarren3</name></author>
	</entry>
</feed>