<?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=Nnhimes</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=Nnhimes"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Nnhimes"/>
	<updated>2026-08-07T16:18:10Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022&amp;diff=142923</id>
		<title>CSC/ECE 517 Spring 2022</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2022&amp;diff=142923"/>
		<updated>2022-03-11T23:07:41Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: Created page with &amp;quot;== OSS Projects ==  * CSC/ECE 517 Spring 2022 - E2xxx. Example link. Replace me with project name  == Final Projects ==&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== OSS Projects ==&lt;br /&gt;
&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022 - E2xxx. Example link. Replace me with project name]]&lt;br /&gt;
&lt;br /&gt;
== Final Projects ==&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=MainPage&amp;diff=142922</id>
		<title>MainPage</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=MainPage&amp;diff=142922"/>
		<updated>2022-03-11T23:05:52Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* Expertiza */&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/ECE 517 Fall 2019]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2020]]&lt;br /&gt;
* [[CSC/ECE 517 Summer 2020]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2020]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2021]]&lt;br /&gt;
* [[CSC/ECE 517 Fall 2021]]&lt;br /&gt;
* [[CSC/ECE 517 Spring 2022]]&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;
* [[Front-End/Back-End]]&lt;br /&gt;
&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>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=141630</id>
		<title>Scoring &amp; Grading Methods (Fall '21)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=141630"/>
		<updated>2021-11-17T17:28:27Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scoring and Grading was given a refactor in the Fall of 2021. This doc page describes the key files for scoring and grading, their methods, and how to use them.&lt;br /&gt;
&lt;br /&gt;
At the lowest level, a score needs to be calculated anytime anyone fills out a rubric.  This score is calculated in &amp;lt;code&amp;gt;Response.rb&amp;lt;/code&amp;gt;. &lt;br /&gt;
It is computed as a weighted sum of the (scorable) items in the rubric.  If, for example, the assignment has two rounds of review, and reviewer ''x'' does a review in each round, there will be a score for the review done by reviewer ''x'' in Round 1 and a score for the review done by reviewer ''x'' in Round 2.&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;ResponseMap.rb&amp;lt;/code&amp;gt;, the scores given by an individual reviewer in different rounds are accumulated.  If, for example, the Round 1 review is weighted 70% and the Round 2 review 30%, the ... method in &amp;lt;code&amp;gt;ResponseMap.rb&amp;lt;/code&amp;gt; computes Round 1 score from &amp;lt;code&amp;gt;reviewer ''x'' * 70% + Round 2 score from reviewer ''x'' * 30%&amp;lt;/code&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
The scores from different reviewers are averaged in AssignmentTeam.rb.  This may be a simple average of reviewer ''x_i'''s score, for all i = 0, ..., m-1, or if the reviewers have been assigned different ''reputations'', it may be an average where each reviewer's score is weighted by that reviewer's reputation.&lt;br /&gt;
&lt;br /&gt;
Then, to get a final score, we need to add together the scores for the different kind of reviews, e.g., teammate reviews, author feedback, and reviews of submitted work.  [Where is this done?]&lt;br /&gt;
&lt;br /&gt;
== Key Files &amp;amp; Methods ==&lt;br /&gt;
&lt;br /&gt;
'''assignment_team.rb'''&lt;br /&gt;
&lt;br /&gt;
'''assignment_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
The following methods in &amp;lt;code&amp;gt;assignment_helper&amp;lt;/code&amp;gt; are part of the Scoring and Grading refactor:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;compute_total_score(scores)&amp;lt;/code&amp;gt;: When called with &amp;lt;code&amp;gt;assignment.compute_total_score(scores)&amp;lt;/code&amp;gt; (such as in &amp;lt;code&amp;gt;assignment_team.rb&amp;lt;/code&amp;gt;), it will sum the weighted scores of each questionnaire in an assignment using the scores passed to it and return the total. Ex) 60% Second Round Review Questionnaire, 40% Author Feedback Questionnaire on an assignment make up the total score.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;compute_reviews_hash&amp;lt;/code&amp;gt;: When called with &amp;lt;code&amp;gt;@assignment.compute_reviews_hash&amp;lt;/code&amp;gt; (such as in &amp;lt;code&amp;gt;report_formatter_helper.rb&amp;lt;/code&amp;gt;), it will itself call the private methods &amp;lt;code&amp;gt;scores_varying_rubrics&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;scores_non_varying_rubrics&amp;lt;/code&amp;gt; based on the &amp;lt;code&amp;gt;@assignment.vary_by_round&amp;lt;/code&amp;gt; value. When calling these private methods, it passes an empty ''review_scores'' hash and the ''response_maps'' of the assignment. The chosen private method then iterates through each of the ''response_maps'' for the assignment and returns the filled ''review_scores'' hash in the format &amp;lt;code&amp;gt;{response_map.reviewer_id: respective_scores}&amp;lt;/code&amp;gt;. This ''respective_scores'' value is calculated through &amp;lt;code&amp;gt;calc_review_score&amp;lt;/code&amp;gt; - another private method in &amp;lt;code&amp;gt;assignment_helper.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;compute_avg_and_ranges_hash&amp;lt;/code&amp;gt; When called with &amp;lt;code&amp;gt;@assignment.compute_avg_and_ranges_hash&amp;lt;/code&amp;gt; (such as in &amp;lt;code&amp;gt;report_formatter_helper.rb&amp;lt;/code&amp;gt;), it will find the contributors (&amp;lt;code&amp;gt;assignment_teams&amp;lt;/code&amp;gt;) for the assignment, and then find two variables for each team - ''questions'' and ''assessments''. The first, ''questions'', are the peer review questions for that team. The second, ''assessments'' are the team's owned assessments in &amp;lt;code&amp;gt;ReviewResponseMap&amp;lt;/code&amp;gt;. Then &amp;lt;code&amp;gt;Response.compute_scores(assessments, questions)&amp;lt;/code&amp;gt; is called to calculate scores. Finally, a hash of &amp;lt;code&amp;gt;{contributor.id: &amp;lt;computed scores&amp;gt;}&amp;lt;/code&amp;gt; is returned.&lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from &amp;lt;code&amp;gt;assignment_helper&amp;lt;/code&amp;gt;. The private methods are only called by these above methods.&lt;br /&gt;
Methods used in the now-defunct &amp;lt;code&amp;gt;on_the_fly_calc&amp;lt;/code&amp;gt; were merged into this file as part of the refactor, since any previous calls to the methods took place through an instance of assignment. There is currently an attempt to further abstract these methods in &amp;lt;code&amp;gt;assignment_helper.rb&amp;lt;/code&amp;gt; so that assignment is passed as a parameter (instead of using ''self''). &lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from &amp;lt;code&amp;gt;assignment.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;assignment_participant.rb&amp;lt;/code&amp;gt; into &amp;lt;code&amp;gt;response_map.rb&amp;lt;/code&amp;gt;. Below are some of the most commonly used methods in &amp;lt;code&amp;gt;response_map.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;self.scores(assignment, questions)&amp;lt;/code&amp;gt;: Computes and returns the scores of assignment for participants and teams&lt;br /&gt;
* &amp;lt;code&amp;gt;self.participant_scores(participant, questions)&amp;lt;/code&amp;gt;: Return scores that this participant has been given&lt;br /&gt;
* &amp;lt;code&amp;gt;self.compute_assignment_score(participant, questions, scores)&amp;lt;/code&amp;gt;: Called by &amp;lt;code&amp;gt;participant_scores()&amp;lt;/code&amp;gt; to retrieve the assignment score. This method itself calls &amp;lt;code&amp;gt;Response.compute_scores()&amp;lt;/code&amp;gt; to find the total score for a list of responses to a questionnaire. It then fills out a &amp;lt;code&amp;gt;scores&amp;lt;/code&amp;gt; hash filled with questionnaire symbols with this total score data. &lt;br /&gt;
* &amp;lt;code&amp;gt;self.merge_scores(participant, scores)&amp;lt;/code&amp;gt;: For each assignment review all scores and determine a max, min and average value&lt;br /&gt;
* &amp;lt;code&amp;gt;self.update_max_or_min(scores, round_sym, review_sym, symbol)&amp;lt;/code&amp;gt;: Called by &amp;lt;code&amp;gt;merge_scores()&amp;lt;/code&amp;gt; to update a rounds min/max scores. &lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from &amp;lt;code&amp;gt;response_map&amp;lt;/code&amp;gt;. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from &amp;lt;code&amp;gt;answer.rb&amp;lt;/code&amp;gt; into &amp;lt;code&amp;gt;response.rb&amp;lt;/code&amp;gt;. Below are some of the most commonly used methods in &amp;lt;code&amp;gt;response.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;self.compute_scores(assessments, questions)&amp;lt;/code&amp;gt;: Computes the total score for a list of assessments of some type (author feedback, teammate review). The &amp;lt;code&amp;gt;questions&amp;lt;/code&amp;gt; parameter is a list of what was filled out in the process of doing those assessments. Called by several files, including &amp;lt;code&amp;gt;bookmarks_controller, assignment_helper, assignment_team, and response_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;self.assessment_score(params)&amp;lt;/code&amp;gt;: Computes the total score for a specific assessment (not a list). Called by &amp;lt;code&amp;gt;compute_scores&amp;lt;/code&amp;gt; on each individual assessment. If there is no score, it returns ''-1.0''.&lt;br /&gt;
&lt;br /&gt;
== Display Files ==&lt;br /&gt;
&lt;br /&gt;
'''grades_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Largely generic methods, most of which assist in rendering views of grades. Includes redirection commands, a bar chart method, and a view model for grades.&lt;br /&gt;
&lt;br /&gt;
'''grades_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Helper methods for rendering views of grades. Includes notable methods regarding charts, vectors, and heatmaps of grades.&lt;br /&gt;
&lt;br /&gt;
== Significant Pull Requests ==&lt;br /&gt;
These are the pull requests responsible for the refactor:&lt;br /&gt;
&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2039 Refactor on_the_fly_calc]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2038 Refactor scores in assignment and participant]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2029 Grade refactoring]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2017 Answer refactoring]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=141629</id>
		<title>Scoring &amp; Grading Methods (Fall '21)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=141629"/>
		<updated>2021-11-17T17:25:53Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* Key Files &amp;amp; Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scoring and Grading was given a refactor in the Fall of 2021. This doc page describes the key files for scoring and grading, their methods, and how to use them.&lt;br /&gt;
&lt;br /&gt;
At the lowest level, a score needs to be calculated anytime anyone fills out a rubric.  This score is calculated in &amp;lt;code&amp;gt;Response.rb&amp;lt;/code&amp;gt;. &lt;br /&gt;
It is computed as a weighted sum of the (scorable) items in the rubric.  If, for example, the assignment has two rounds of review, and reviewer ''x'' does a review in each round, there will be a score for the review done by reviewer ''x'' in Round 1 and a score for the review done by reviewer ''x'' in Round 2.&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;ResponseMap.rb&amp;lt;/code&amp;gt;, the scores given by an individual reviewer in different rounds are accumulated.  If, for example, the Round 1 review is weighted 70% and the Round 2 review 30%, the ... method in &amp;lt;code&amp;gt;ResponseMap.rb&amp;lt;/code&amp;gt; computes Round 1 score from &amp;lt;code&amp;gt;reviewer ''x'' * 70% + Round 2 score from reviewer ''x'' * 30%&amp;lt;/code&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
The scores from different reviewers are averaged in AssignmentTeam.rb.  This may be a simple average of reviewer ''x_i'''s score, for all i = 0, ..., m-1, or if the reviewers have been assigned different ''reputations'', it may be an average where each reviewer's score is weighted by that reviewer's reputation.&lt;br /&gt;
&lt;br /&gt;
Then, to get a final score, we need to add together the scores for the different kind of reviews, e.g., teammate reviews, author feedback, and reviews of submitted work.  [Where is this done?]&lt;br /&gt;
&lt;br /&gt;
== Key Files &amp;amp; Methods ==&lt;br /&gt;
&lt;br /&gt;
'''assignment_team.rb'''&lt;br /&gt;
&lt;br /&gt;
'''assignment_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
The following methods in &amp;lt;code&amp;gt;assignment_helper&amp;lt;/code&amp;gt; are part of the Scoring and Grading refactor:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;compute_total_score(scores)&amp;lt;/code&amp;gt;: When called with &amp;lt;code&amp;gt;assignment.compute_total_score(scores)&amp;lt;/code&amp;gt; (such as in &amp;lt;code&amp;gt;assignment_team.rb&amp;lt;/code&amp;gt;), it will sum the weighted scores of each questionnaire in an assignment using the scores passed to it and return the total. Ex) 60% Second Round Review Questionnaire, 40% Author Feedback Questionnaire on an assignment make up the total score.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;compute_reviews_hash&amp;lt;/code&amp;gt;: When called with &amp;lt;code&amp;gt;@assignment.compute_reviews_hash&amp;lt;/code&amp;gt; (such as in &amp;lt;code&amp;gt;report_formatter_helper.rb&amp;lt;/code&amp;gt;), it will itself call the private methods &amp;lt;code&amp;gt;scores_varying_rubrics&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;scores_non_varying_rubrics&amp;lt;/code&amp;gt; based on the &amp;lt;code&amp;gt;@assignment.vary_by_round&amp;lt;/code&amp;gt; value. When calling these private methods, it passes an empty &amp;lt;code&amp;gt;review_scores&amp;lt;/code&amp;gt; hash and the &amp;lt;code&amp;gt;response_maps&amp;lt;/code&amp;gt; of the assignment. The chosen private method then iterates through each of the &amp;lt;code&amp;gt;response_maps&amp;lt;/code&amp;gt; for the assignment and returns the filled &amp;lt;code&amp;gt;review_scores&amp;lt;/code&amp;gt; hash in the format &amp;lt;code&amp;gt;{response_map.reviewer_id: respective_scores}&amp;lt;/code&amp;gt;. This &amp;lt;code&amp;gt;respective_scores&amp;lt;/code&amp;gt; value is calculated through &amp;lt;code&amp;gt;calc_review_score&amp;lt;/code&amp;gt; - another private method in &amp;lt;code&amp;gt;assignment_helper.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;compute_avg_and_ranges_hash&amp;lt;/code&amp;gt; When called with &amp;lt;code&amp;gt;@assignment.compute_avg_and_ranges_hash&amp;lt;/code&amp;gt; (such as in &amp;lt;code&amp;gt;report_formatter_helper.rb&amp;lt;/code&amp;gt;), it will find the contributors (&amp;lt;code&amp;gt;assignment_teams&amp;lt;/code&amp;gt;) for the assignment, and then find two variables for each team - &amp;lt;code&amp;gt;questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;assessments&amp;lt;/code&amp;gt;. The first, &amp;lt;code&amp;gt;questions&amp;lt;/code&amp;gt;, are the peer review questions for that team. The second, &amp;lt;code&amp;gt;assessments&amp;lt;/code&amp;gt; are the team's owned assessments in &amp;lt;code&amp;gt;ReviewResponseMap&amp;lt;/code&amp;gt;. Then &amp;lt;code&amp;gt;Response.compute_scores(assessments, questions)&amp;lt;/code&amp;gt; is called to calculate scores. Finally, a hash of &amp;lt;code&amp;gt;{contributor.id: &amp;lt;computed scores&amp;gt;}&amp;lt;/code&amp;gt; is returned.&lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from &amp;lt;code&amp;gt;assignment_helper&amp;lt;/code&amp;gt;. The private methods are only called by these above methods.&lt;br /&gt;
Methods used in the now-defunct &amp;lt;code&amp;gt;on_the_fly_calc&amp;lt;/code&amp;gt; were merged into this file as part of the refactor, since any previous calls to the methods took place through an instance of assignment. There is currently an attempt to further abstract these methods in &amp;lt;code&amp;gt;assignment_helper.rb&amp;lt;/code&amp;gt; so that assignment is passed as a parameter (instead of using ''self''). &lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from &amp;lt;code&amp;gt;assignment.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;assignment_participant.rb&amp;lt;/code&amp;gt; into &amp;lt;code&amp;gt;response_map.rb&amp;lt;/code&amp;gt;. Below are some of the most commonly used methods in &amp;lt;code&amp;gt;response_map.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;self.scores(assignment, questions)&amp;lt;/code&amp;gt;: Computes and returns the scores of assignment for participants and teams&lt;br /&gt;
* &amp;lt;code&amp;gt;self.participant_scores(participant, questions)&amp;lt;/code&amp;gt;: Return scores that this participant has been given&lt;br /&gt;
* &amp;lt;code&amp;gt;self.compute_assignment_score(participant, questions, scores)&amp;lt;/code&amp;gt;: Called by &amp;lt;code&amp;gt;participant_scores()&amp;lt;/code&amp;gt; to retrieve the assignment score. This method itself calls &amp;lt;code&amp;gt;Response.compute_scores()&amp;lt;/code&amp;gt; to find the total score for a list of responses to a questionnaire. It then fills out a &amp;lt;code&amp;gt;scores&amp;lt;/code&amp;gt; hash filled with questionnaire symbols with this total score data. &lt;br /&gt;
* &amp;lt;code&amp;gt;self.merge_scores(participant, scores)&amp;lt;/code&amp;gt;: For each assignment review all scores and determine a max, min and average value&lt;br /&gt;
* &amp;lt;code&amp;gt;self.update_max_or_min(scores, round_sym, review_sym, symbol)&amp;lt;/code&amp;gt;: Called by &amp;lt;code&amp;gt;merge_scores()&amp;lt;/code&amp;gt; to update a rounds min/max scores. &lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from &amp;lt;code&amp;gt;response_map&amp;lt;/code&amp;gt;. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from &amp;lt;code&amp;gt;answer.rb&amp;lt;/code&amp;gt; into &amp;lt;code&amp;gt;response.rb&amp;lt;/code&amp;gt;. Below are some of the most commonly used methods in &amp;lt;code&amp;gt;response.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;self.compute_scores(assessments, questions)&amp;lt;/code&amp;gt;: Computes the total score for a list of assessments of some type (author feedback, teammate review). The &amp;lt;code&amp;gt;questions&amp;lt;/code&amp;gt; parameter is a list of what was filled out in the process of doing those assessments. Called by several files, including &amp;lt;code&amp;gt;bookmarks_controller, assignment_helper, assignment_team, and response_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;self.assessment_score(params)&amp;lt;/code&amp;gt;: Computes the total score for a specific assessment (not a list). Called by &amp;lt;code&amp;gt;compute_scores&amp;lt;/code&amp;gt; on each individual assessment. If there is no score, it returns ''-1.0''.&lt;br /&gt;
&lt;br /&gt;
== Display Files ==&lt;br /&gt;
&lt;br /&gt;
'''grades_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Largely generic methods, most of which assist in rendering views of grades. Includes redirection commands, a bar chart method, and a view model for grades.&lt;br /&gt;
&lt;br /&gt;
'''grades_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Helper methods for rendering views of grades. Includes notable methods regarding charts, vectors, and heatmaps of grades.&lt;br /&gt;
&lt;br /&gt;
== Significant Pull Requests ==&lt;br /&gt;
These are the pull requests responsible for the refactor:&lt;br /&gt;
&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2039 Refactor on_the_fly_calc]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2038 Refactor scores in assignment and participant]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2029 Grade refactoring]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2017 Answer refactoring]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=141628</id>
		<title>Scoring &amp; Grading Methods (Fall '21)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=141628"/>
		<updated>2021-11-17T17:24:06Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scoring and Grading was given a refactor in the Fall of 2021. This doc page describes the key files for scoring and grading, their methods, and how to use them.&lt;br /&gt;
&lt;br /&gt;
At the lowest level, a score needs to be calculated anytime anyone fills out a rubric.  This score is calculated in &amp;lt;code&amp;gt;Response.rb&amp;lt;/code&amp;gt;. &lt;br /&gt;
It is computed as a weighted sum of the (scorable) items in the rubric.  If, for example, the assignment has two rounds of review, and reviewer ''x'' does a review in each round, there will be a score for the review done by reviewer ''x'' in Round 1 and a score for the review done by reviewer ''x'' in Round 2.&lt;br /&gt;
&lt;br /&gt;
In &amp;lt;code&amp;gt;ResponseMap.rb&amp;lt;/code&amp;gt;, the scores given by an individual reviewer in different rounds are accumulated.  If, for example, the Round 1 review is weighted 70% and the Round 2 review 30%, the ... method in &amp;lt;code&amp;gt;ResponseMap.rb&amp;lt;/code&amp;gt; computes Round 1 score from &amp;lt;code&amp;gt;reviewer ''x'' * 70% + Round 2 score from reviewer ''x'' * 30%&amp;lt;/code&amp;gt;&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
The scores from different reviewers are averaged in AssignmentTeam.rb.  This may be a simple average of reviewer ''x_i'''s score, for all i = 0, ..., m-1, or if the reviewers have been assigned different ''reputations'', it may be an average where each reviewer's score is weighted by that reviewer's reputation.&lt;br /&gt;
&lt;br /&gt;
Then, to get a final score, we need to add together the scores for the different kind of reviews, e.g., teammate reviews, author feedback, and reviews of submitted work.  [Where is this done?]&lt;br /&gt;
&lt;br /&gt;
== Key Files &amp;amp; Methods ==&lt;br /&gt;
&lt;br /&gt;
'''assignment_team.rb'''&lt;br /&gt;
&lt;br /&gt;
'''assignment_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Methods used in the now-defunct &amp;lt;code&amp;gt;on_the_fly_calc&amp;lt;/code&amp;gt; were merged into this file as part of the refactor, since any previous calls to the methods took place through an instance of assignment. There is currently an attempt to further abstract these methods in &amp;lt;code&amp;gt;assignment_helper.rb&amp;lt;/code&amp;gt; so that assignment is passed as a parameter (instead of using ''self''). &lt;br /&gt;
&lt;br /&gt;
The following methods in &amp;lt;code&amp;gt;assignment_helper&amp;lt;/code&amp;gt; are part of the Scoring and Grading refactor:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;compute_total_score(scores)&amp;lt;/code&amp;gt;: When called with &amp;lt;code&amp;gt;assignment.compute_total_score(scores)&amp;lt;/code&amp;gt; (such as in &amp;lt;code&amp;gt;assignment_team.rb&amp;lt;/code&amp;gt;), it will sum the weighted scores of each questionnaire in an assignment using the scores passed to it and return the total. Ex) 60% Second Round Review Questionnaire, 40% Author Feedback Questionnaire on an assignment make up the total score.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;compute_reviews_hash&amp;lt;/code&amp;gt;: When called with &amp;lt;code&amp;gt;@assignment.compute_reviews_hash&amp;lt;/code&amp;gt; (such as in &amp;lt;code&amp;gt;report_formatter_helper.rb&amp;lt;/code&amp;gt;), it will itself call the private methods &amp;lt;code&amp;gt;scores_varying_rubrics&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;scores_non_varying_rubrics&amp;lt;/code&amp;gt; based on the &amp;lt;code&amp;gt;@assignment.vary_by_round&amp;lt;/code&amp;gt; value. When calling these private methods, it passes an empty &amp;lt;code&amp;gt;review_scores&amp;lt;/code&amp;gt; hash and the &amp;lt;code&amp;gt;response_maps&amp;lt;/code&amp;gt; of the assignment. The chosen private method then iterates through each of the &amp;lt;code&amp;gt;response_maps&amp;lt;/code&amp;gt; for the assignment and returns the filled &amp;lt;code&amp;gt;review_scores&amp;lt;/code&amp;gt; hash in the format &amp;lt;code&amp;gt;{response_map.reviewer_id: respective_scores}&amp;lt;/code&amp;gt;. This &amp;lt;code&amp;gt;respective_scores&amp;lt;/code&amp;gt; value is calculated through &amp;lt;code&amp;gt;calc_review_score&amp;lt;/code&amp;gt; - another private method in &amp;lt;code&amp;gt;assignment_helper.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;compute_avg_and_ranges_hash&amp;lt;/code&amp;gt; When called with &amp;lt;code&amp;gt;@assignment.compute_avg_and_ranges_hash&amp;lt;/code&amp;gt; (such as in &amp;lt;code&amp;gt;report_formatter_helper.rb&amp;lt;/code&amp;gt;), it will find the contributors (&amp;lt;code&amp;gt;assignment_teams&amp;lt;/code&amp;gt;) for the assignment, and then find two variables for each team - &amp;lt;code&amp;gt;questions&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;assessments&amp;lt;/code&amp;gt;. The first, &amp;lt;code&amp;gt;questions&amp;lt;/code&amp;gt;, are the peer review questions for that team. The second, &amp;lt;code&amp;gt;assessments&amp;lt;/code&amp;gt; are the team's owned assessments in &amp;lt;code&amp;gt;ReviewResponseMap&amp;lt;/code&amp;gt;. Then &amp;lt;code&amp;gt;Response.compute_scores(assessments, questions)&amp;lt;/code&amp;gt; is called to calculate scores. Finally, a hash of &amp;lt;code&amp;gt;{contributor.id: &amp;lt;computed scores&amp;gt;}&amp;lt;/code&amp;gt; is returned.&lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from &amp;lt;code&amp;gt;assignment_helper&amp;lt;/code&amp;gt;. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from &amp;lt;code&amp;gt;assignment.rb&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;assignment_participant.rb&amp;lt;/code&amp;gt; into &amp;lt;code&amp;gt;response_map.rb&amp;lt;/code&amp;gt;. Below are some of the most commonly used methods in &amp;lt;code&amp;gt;response_map.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;self.scores(assignment, questions)&amp;lt;/code&amp;gt;: Computes and returns the scores of assignment for participants and teams&lt;br /&gt;
* &amp;lt;code&amp;gt;self.participant_scores(participant, questions)&amp;lt;/code&amp;gt;: Return scores that this participant has been given&lt;br /&gt;
* &amp;lt;code&amp;gt;self.compute_assignment_score(participant, questions, scores)&amp;lt;/code&amp;gt;: Called by &amp;lt;code&amp;gt;participant_scores()&amp;lt;/code&amp;gt; to retrieve the assignment score. This method itself calls &amp;lt;code&amp;gt;Response.compute_scores()&amp;lt;/code&amp;gt; to find the total score for a list of responses to a questionnaire. It then fills out a &amp;lt;code&amp;gt;scores&amp;lt;/code&amp;gt; hash filled with questionnaire symbols with this total score data. &lt;br /&gt;
* &amp;lt;code&amp;gt;self.merge_scores(participant, scores)&amp;lt;/code&amp;gt;: For each assignment review all scores and determine a max, min and average value&lt;br /&gt;
* &amp;lt;code&amp;gt;self.update_max_or_min(scores, round_sym, review_sym, symbol)&amp;lt;/code&amp;gt;: Called by &amp;lt;code&amp;gt;merge_scores()&amp;lt;/code&amp;gt; to update a rounds min/max scores. &lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from &amp;lt;code&amp;gt;response_map&amp;lt;/code&amp;gt;. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from &amp;lt;code&amp;gt;answer.rb&amp;lt;/code&amp;gt; into &amp;lt;code&amp;gt;response.rb&amp;lt;/code&amp;gt;. Below are some of the most commonly used methods in &amp;lt;code&amp;gt;response.rb&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;self.compute_scores(assessments, questions)&amp;lt;/code&amp;gt;: Computes the total score for a list of assessments of some type (author feedback, teammate review). The &amp;lt;code&amp;gt;questions&amp;lt;/code&amp;gt; parameter is a list of what was filled out in the process of doing those assessments. Called by several files, including &amp;lt;code&amp;gt;bookmarks_controller, assignment_helper, assignment_team, and response_map&amp;lt;/code&amp;gt;.&lt;br /&gt;
* &amp;lt;code&amp;gt;self.assessment_score(params)&amp;lt;/code&amp;gt;: Computes the total score for a specific assessment (not a list). Called by &amp;lt;code&amp;gt;compute_scores&amp;lt;/code&amp;gt; on each individual assessment. If there is no score, it returns ''-1.0''.&lt;br /&gt;
&lt;br /&gt;
== Display Files ==&lt;br /&gt;
&lt;br /&gt;
'''grades_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Largely generic methods, most of which assist in rendering views of grades. Includes redirection commands, a bar chart method, and a view model for grades.&lt;br /&gt;
&lt;br /&gt;
'''grades_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Helper methods for rendering views of grades. Includes notable methods regarding charts, vectors, and heatmaps of grades.&lt;br /&gt;
&lt;br /&gt;
== Significant Pull Requests ==&lt;br /&gt;
These are the pull requests responsible for the refactor:&lt;br /&gt;
&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2039 Refactor on_the_fly_calc]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2038 Refactor scores in assignment and participant]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2029 Grade refactoring]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2017 Answer refactoring]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=141627</id>
		<title>Scoring &amp; Grading Methods (Fall '21)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=141627"/>
		<updated>2021-11-17T16:54:19Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* Key Files &amp;amp; Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scoring and Grading was given a refactor in the Fall of 2021. This doc page describes the key files for scoring and grading, their methods, and how to use them.&lt;br /&gt;
&lt;br /&gt;
At the lowest level, a score needs to be calculated anytime anyone fills out a rubric.  This score is calculated in Response.rb. &lt;br /&gt;
It is computed as a weighted sum of the (scorable) items in the rubric.  If, for example, the assignment has two rounds of review, and reviewer ''x'' does a review in each round, there will be a score for the review done by reviewer ''x'' in Round 1 and a score for the review done by reviewer ''x'' in Round 2.&lt;br /&gt;
&lt;br /&gt;
In ResponseMap.rb, the scores given by an individual reviewer in different rounds are accumulated.  If, for example, the Round 1 review is weighted 70% and the Round 2 review 30%, the ... method in ResponseMap.rb computes Round 1 score from reviewer ''x'' * 70% + Round 2 score from reviewer ''x'' * 30%&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
The scores from different reviewers are averaged in AssignmentTeam.rb.  This may be a simple average of reviewer ''x_i'''s score, for all i = 0, ..., m-1, or if the reviewers have been assigned different ''reputations'', it may be an average where each reviewer's score is weighted by that reviewer's reputation.&lt;br /&gt;
&lt;br /&gt;
Then, to get a final score, we need to add together the scores for the different kind of reviews, e.g., teammate reviews, author feedback, and reviews of submitted work.  [Where is this done?]&lt;br /&gt;
&lt;br /&gt;
== Key Files &amp;amp; Methods ==&lt;br /&gt;
&lt;br /&gt;
'''assignment_team.rb'''&lt;br /&gt;
&lt;br /&gt;
'''assignment_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Methods used in on_the_fly_calc were merged into this file as part of the refactor, since any previous calls to the methods took place through an instance of assignment. There is currently an attempt to further abstract these methods in assignment_helper.rb so that assignment is passed as a parameter (instead of using ''self''). &lt;br /&gt;
&lt;br /&gt;
The following methods in assignment_helper are part of the Scoring and Grading refactor:&lt;br /&gt;
&lt;br /&gt;
* compute_total_score(scores): When called with ''assignment.compute_total_score(scores)'' (such as in assignment_team.rb), it will sum the weighted scores of each questionnaire in an assignment using the scores passed to it and return the total. Ex) 60% Second Round Review Questionnaire, 40% Author Feedback Questionnaire on an assignment make up the total score.&lt;br /&gt;
&lt;br /&gt;
* compute_reviews_hash: When called with ''@assignment.compute_reviews_hash'' (such as in report_formatter_helper.rb), it will itself call the private methods ''scores_varying_rubrics'' or ''scores_non_varying_rubrics'' based on the ''@assignment.vary_by_round'' value. When calling these private methods, it passes an empty ''review_scores'' hash and the ''response_maps'' of the assignment. The chosen private method then iterates through each of the ''response_maps'' for the assignment and returns the filled ''review_scores'' hash in the format ''{response_map.reviewer_id: respective_scores}''. This ''respective_scores'' value is calculated through ''calc_review_score'' - another private method in assignment_helper.rb.&lt;br /&gt;
&lt;br /&gt;
* compute_avg_and_ranges_hash: When called with ''@assignment.compute_avg_and_ranges_hash'' (such as in report_formatter_helper.rb), it will find the contributors (''assignment_teams'') for the assignment, and then find two variables for each team - ''questions'' and ''assessments''. The first, ''questions'', are the peer review questions for that team. The second, ''assessments'' are the team's owned assessments in ''ReviewResponseMap''. Then ''Response.compute_scores(assessments, questions)'' is called to calculate scores. Finally, a hash of ''{contributor.id: &amp;lt;computed scores&amp;gt;}'' is returned.&lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from assignment_helper. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from assignment.rb and assignment_participant.rb into response_map.rb. Below are some of the most commonly used methods in response_map.rb.&lt;br /&gt;
&lt;br /&gt;
* self.scores(assignment, questions): Computes and returns the scores of assignment for participants and teams&lt;br /&gt;
* self.participant_scores(participant, questions): Return scores that this participant has been given&lt;br /&gt;
* self.compute_assignment_score(participant, questions, scores): Called by ''participant_scores()'' to retrieve the assignment score. This method itself calls ''Response.compute_scores()'' to find the total score for a list of responses to a questionnaire. It then fills out a ''scores'' hash filled with questionnaire symbols with this total score data. &lt;br /&gt;
* self.merge_scores(participant, scores): For each assignment review all scores and determine a max, min and average value&lt;br /&gt;
* self.update_max_or_min(scores, round_sym, review_sym, symbol): Called by ''merge_scores()'' to update a rounds min/max scores. &lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from response_map. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from answer.rb into response.rb. Below are some of the most commonly used methods in response.rb.&lt;br /&gt;
&lt;br /&gt;
* self.compute_scores(assessments, questions): Computes the total score for a list of assessments of some type (author feedback, teammate review). The ''questions'' parameter is a list of what was filled out in the process of doing those assessments. Called by several files, including bookmarks_controller, assignment_helper, assignment_team, and response_map.&lt;br /&gt;
* self.assessment_score(params): Computes the total score for a specific assessment (not a list). Called by ''compute_scores'' on each individual assessment. If there is no score, it returns ''-1.0''.&lt;br /&gt;
&lt;br /&gt;
== Display Files ==&lt;br /&gt;
&lt;br /&gt;
'''grades_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Largely generic methods, most of which assist in rendering views of grades. Includes redirection commands, a bar chart method, and a view model for grades.&lt;br /&gt;
&lt;br /&gt;
'''grades_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Helper methods for rendering views of grades. Includes notable methods regarding charts, vectors, and heatmaps of grades.&lt;br /&gt;
&lt;br /&gt;
== Significant Pull Requests ==&lt;br /&gt;
These are the pull requests responsible for the refactor:&lt;br /&gt;
&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2039 Refactor on_the_fly_calc]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2038 Refactor scores in assignment and participant]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2029 Grade refactoring]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2017 Answer refactoring]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=141599</id>
		<title>Scoring &amp; Grading Methods (Fall '21)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=141599"/>
		<updated>2021-11-11T01:25:35Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* Key Files &amp;amp; Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scoring and Grading was given a refactor in the Fall of 2021. This doc page describes the key files for scoring and grading, their methods, and how to use them.&lt;br /&gt;
&lt;br /&gt;
At the lowest level, a score needs to be calculated anytime anyone fills out a rubric.  This score is calculated in Response.rb. &lt;br /&gt;
It is computed as a weighted sum of the (scorable) items in the rubric.  If, for example, the assignment has two rounds of review, and reviewer ''x'' does a review in each round, there will be a score for the review done by reviewer ''x'' in Round 1 and a score for the review done by reviewer ''x'' in Round 2.&lt;br /&gt;
&lt;br /&gt;
In ResponseMap.rb, the scores given by an individual reviewer in different rounds are accumulated.  If, for example, the Round 1 review is weighted 70% and the Round 2 review 30%, the ... method in ResponseMap.rb computes Round 1 score from reviewer ''x'' * 70% + Round 2 score from reviewer ''x'' * 30%&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
The scores from different reviewers are averaged in AssignmentTeam.rb.  This may be a simple average of reviewer ''x_i'''s score, for all i = 0, ..., m-1, or if the reviewers have been assigned different ''reputations'', it may be an average where each reviewer's score is weighted by that reviewer's reputation.&lt;br /&gt;
&lt;br /&gt;
Then, to get a final score, we need to add together the scores for the different kind of reviews, e.g., teammate reviews, author feedback, and reviews of submitted work.  [Where is this done?]&lt;br /&gt;
&lt;br /&gt;
== Key Files &amp;amp; Methods ==&lt;br /&gt;
'''assignment_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Methods used in on_the_fly_calc were merged into this file as part of the refactor, since any previous calls to the methods took place through an instance of assignment. There is currently an attempt to further abstract these methods in assignment_helper.rb so that assignment is passed as a parameter (instead of using ''self''). &lt;br /&gt;
&lt;br /&gt;
The following methods in assignment_helper are part of the Scoring and Grading refactor:&lt;br /&gt;
&lt;br /&gt;
* compute_total_score(scores): When called with ''assignment.compute_total_score(scores)'' (such as in assignment_team.rb), it will sum the weighted scores of each questionnaire in an assignment using the scores passed to it and return the total. Ex) 60% Second Round Review Questionnaire, 40% Author Feedback Questionnaire on an assignment make up the total score.&lt;br /&gt;
&lt;br /&gt;
* compute_reviews_hash: When called with ''@assignment.compute_reviews_hash'' (such as in report_formatter_helper.rb), it will itself call the private methods ''scores_varying_rubrics'' or ''scores_non_varying_rubrics'' based on the ''@assignment.vary_by_round'' value. When calling these private methods, it passes an empty ''review_scores'' hash and the ''response_maps'' of the assignment. The chosen private method then iterates through each of the ''response_maps'' for the assignment and returns the filled ''review_scores'' hash in the format ''{response_map.reviewer_id: respective_scores}''. This ''respective_scores'' value is calculated through ''calc_review_score'' - another private method in assignment_helper.rb.&lt;br /&gt;
&lt;br /&gt;
* compute_avg_and_ranges_hash: When called with ''@assignment.compute_avg_and_ranges_hash'' (such as in report_formatter_helper.rb), it will find the contributors (''assignment_teams'') for the assignment, and then find two variables for each team - ''questions'' and ''assessments''. The first, ''questions'', are the peer review questions for that team. The second, ''assessments'' are the team's owned assessments in ''ReviewResponseMap''. Then ''Response.compute_scores(assessments, questions)'' is called to calculate scores. Finally, a hash of ''{contributor.id: &amp;lt;computed scores&amp;gt;}'' is returned.&lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from assignment_helper. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from assignment.rb and assignment_participant.rb into response_map.rb. Below are some of the most commonly used methods in response_map.rb.&lt;br /&gt;
&lt;br /&gt;
* self.scores(assignment, questions): Computes and returns the scores of assignment for participants and teams&lt;br /&gt;
* self.participant_scores(participant, questions): Return scores that this participant has been given&lt;br /&gt;
* self.compute_assignment_score(participant, questions, scores): Called by ''participant_scores()'' to retrieve the assignment score. This method itself calls ''Response.compute_scores()'' to find the total score for a list of responses to a questionnaire. It then fills out a ''scores'' hash filled with questionnaire symbols with this total score data. &lt;br /&gt;
* self.merge_scores(participant, scores): For each assignment review all scores and determine a max, min and average value&lt;br /&gt;
* self.update_max_or_min(scores, round_sym, review_sym, symbol): Called by ''merge_scores()'' to update a rounds min/max scores. &lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from response_map. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from answer.rb into response.rb. Below are some of the most commonly used methods in response.rb.&lt;br /&gt;
&lt;br /&gt;
* self.compute_scores(assessments, questions): Computes the total score for a list of assessments of some type (author feedback, teammate review). The ''questions'' parameter is a list of what was filled out in the process of doing those assessments. Called by several files, including bookmarks_controller, assignment_helper, assignment_team, and response_map.&lt;br /&gt;
* self.assessment_score(params): Computes the total score for a specific assessment (not a list). Called by ''compute_scores'' on each individual assessment. If there is no score, it returns ''-1.0''.&lt;br /&gt;
&lt;br /&gt;
== Display Files ==&lt;br /&gt;
&lt;br /&gt;
'''grades_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Largely generic methods, most of which assist in rendering views of grades. Includes redirection commands, a bar chart method, and a view model for grades.&lt;br /&gt;
&lt;br /&gt;
'''grades_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Helper methods for rendering views of grades. Includes notable methods regarding charts, vectors, and heatmaps of grades.&lt;br /&gt;
&lt;br /&gt;
== Significant Pull Requests ==&lt;br /&gt;
These are the pull requests responsible for the refactor:&lt;br /&gt;
&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2039 Refactor on_the_fly_calc]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2038 Refactor scores in assignment and participant]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2029 Grade refactoring]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2017 Answer refactoring]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=141598</id>
		<title>Scoring &amp; Grading Methods (Fall '21)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=141598"/>
		<updated>2021-11-11T01:15:20Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* Display Files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scoring and Grading was given a refactor in the Fall of 2021. This doc page describes the key files for scoring and grading, their methods, and how to use them.&lt;br /&gt;
&lt;br /&gt;
At the lowest level, a score needs to be calculated anytime anyone fills out a rubric.  This score is calculated in Response.rb. &lt;br /&gt;
It is computed as a weighted sum of the (scorable) items in the rubric.  If, for example, the assignment has two rounds of review, and reviewer ''x'' does a review in each round, there will be a score for the review done by reviewer ''x'' in Round 1 and a score for the review done by reviewer ''x'' in Round 2.&lt;br /&gt;
&lt;br /&gt;
In ResponseMap.rb, the scores given by an individual reviewer in different rounds are accumulated.  If, for example, the Round 1 review is weighted 70% and the Round 2 review 30%, the ... method in ResponseMap.rb computes Round 1 score from reviewer ''x'' * 70% + Round 2 score from reviewer ''x'' * 30%&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
The scores from different reviewers are averaged in AssignmentTeam.rb.  This may be a simple average of reviewer ''x_i'''s score, for all i = 0, ..., m-1, or if the reviewers have been assigned different ''reputations'', it may be an average where each reviewer's score is weighted by that reviewer's reputation.&lt;br /&gt;
&lt;br /&gt;
Then, to get a final score, we need to add together the scores for the different kind of reviews, e.g., teammate reviews, author feedback, and reviews of submitted work.  [Where is this done?]&lt;br /&gt;
&lt;br /&gt;
== Key Files &amp;amp; Methods ==&lt;br /&gt;
'''assignment_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Methods used in on_the_fly_calc were merged into this file as part of the refactor, since any previous calls to the methods took place through an instance of assignment. There is currently an attempt to further abstract these methods in assignment_helper.rb so that assignment is passed as a parameter (instead of using ''self''). &lt;br /&gt;
&lt;br /&gt;
The following methods in assignment_helper are part of the Scoring and Grading refactor:&lt;br /&gt;
&lt;br /&gt;
* compute_total_score(scores): When called with ''assignment.compute_total_score(scores)'' (such as in assignment_team.rb), it will sum the weighted scores of each questionnaire in an assignment using the scores passed to it and return the total.&lt;br /&gt;
&lt;br /&gt;
* compute_reviews_hash: When called with ''@assignment.compute_reviews_hash'' (such as in report_formatter_helper.rb), it will itself call the private methods ''scores_varying_rubrics'' or ''scores_non_varying_rubrics'' based on the ''@assignment.vary_by_round'' value. When calling these private methods, it passes an empty ''review_scores'' hash and the ''response_maps'' of the assignment. The chosen private method then iterates through each of the ''response_maps'' for the assignment and returns the filled ''review_scores'' hash in the format ''{response_map.reviewer_id: respective_scores}''. This ''respective_scores'' value is calculated through ''calc_review_score'' - another private method in assignment_helper.rb.&lt;br /&gt;
&lt;br /&gt;
* compute_avg_and_ranges_hash: When called with ''@assignment.compute_avg_and_ranges_hash'' (such as in report_formatter_helper.rb), it will find the contributors (''assignment_teams'') for the assignment, and then find two variables for each team - ''questions'' and ''assessments''. The first, ''questions'', are the peer review questions for that team. The second, ''assessments'' are the team's owned assessments in ''ReviewResponseMap''. Then ''Response.compute_scores(assessments, questions)'' is called to calculate scores. Finally, a hash of ''{contributor.id: &amp;lt;computed scores&amp;gt;}'' is returned.&lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from assignment_helper. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from assignment.rb and assignment_participant.rb into response_map.rb. Below are some of the most commonly used methods in response_map.rb.&lt;br /&gt;
&lt;br /&gt;
* self.scores(assignment, questions): Computes and returns the scores of assignment for participants and teams&lt;br /&gt;
* self.participant_scores(participant, questions): Return scores that this participant has been given&lt;br /&gt;
* self.compute_assignment_score(participant, questions, scores): Called by ''participant_scores()'' to retrieve the assignment score. This method itself calls ''Response.compute_scores()'' to find the total score for a list of responses to a questionnaire. It then fills out a ''scores'' hash filled with questionnaire symbols with this total score data. &lt;br /&gt;
* self.merge_scores(participant, scores): For each assignment review all scores and determine a max, min and average value&lt;br /&gt;
* self.update_max_or_min(scores, round_sym, review_sym, symbol): Called by ''merge_scores()'' to update a rounds min/max scores. &lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from response_map. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from answer.rb into response.rb. Below are some of the most commonly used methods in response.rb.&lt;br /&gt;
&lt;br /&gt;
* self.compute_scores(assessments, questions): Computes the total score for a list of assessments of some type (author feedback, teammate review). The ''questions'' parameter is a list of what was filled out in the process of doing those assessments. Called by several files, including bookmarks_controller, assignment_helper, assignment_team, and response_map.&lt;br /&gt;
* self.assessment_score(params): Computes the total score for a specific assessment (not a list). Called by ''compute_scores'' on each individual assessment. If there is no score, it returns ''-1.0''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Display Files ==&lt;br /&gt;
&lt;br /&gt;
'''grades_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Largely generic methods, most of which assist in rendering views of grades. Includes redirection commands, a bar chart method, and a view model for grades.&lt;br /&gt;
&lt;br /&gt;
'''grades_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Helper methods for rendering views of grades. Includes notable methods regarding charts, vectors, and heatmaps of grades.&lt;br /&gt;
&lt;br /&gt;
== Significant Pull Requests ==&lt;br /&gt;
These are the pull requests responsible for the refactor:&lt;br /&gt;
&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2039 Refactor on_the_fly_calc]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2038 Refactor scores in assignment and participant]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2029 Grade refactoring]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2017 Answer refactoring]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=141597</id>
		<title>Scoring &amp; Grading Methods (Fall '21)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=141597"/>
		<updated>2021-11-11T01:14:48Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scoring and Grading was given a refactor in the Fall of 2021. This doc page describes the key files for scoring and grading, their methods, and how to use them.&lt;br /&gt;
&lt;br /&gt;
At the lowest level, a score needs to be calculated anytime anyone fills out a rubric.  This score is calculated in Response.rb. &lt;br /&gt;
It is computed as a weighted sum of the (scorable) items in the rubric.  If, for example, the assignment has two rounds of review, and reviewer ''x'' does a review in each round, there will be a score for the review done by reviewer ''x'' in Round 1 and a score for the review done by reviewer ''x'' in Round 2.&lt;br /&gt;
&lt;br /&gt;
In ResponseMap.rb, the scores given by an individual reviewer in different rounds are accumulated.  If, for example, the Round 1 review is weighted 70% and the Round 2 review 30%, the ... method in ResponseMap.rb computes Round 1 score from reviewer ''x'' * 70% + Round 2 score from reviewer ''x'' * 30%&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
The scores from different reviewers are averaged in AssignmentTeam.rb.  This may be a simple average of reviewer ''x_i'''s score, for all i = 0, ..., m-1, or if the reviewers have been assigned different ''reputations'', it may be an average where each reviewer's score is weighted by that reviewer's reputation.&lt;br /&gt;
&lt;br /&gt;
Then, to get a final score, we need to add together the scores for the different kind of reviews, e.g., teammate reviews, author feedback, and reviews of submitted work.  [Where is this done?]&lt;br /&gt;
&lt;br /&gt;
== Key Files &amp;amp; Methods ==&lt;br /&gt;
'''assignment_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Methods used in on_the_fly_calc were merged into this file as part of the refactor, since any previous calls to the methods took place through an instance of assignment. There is currently an attempt to further abstract these methods in assignment_helper.rb so that assignment is passed as a parameter (instead of using ''self''). &lt;br /&gt;
&lt;br /&gt;
The following methods in assignment_helper are part of the Scoring and Grading refactor:&lt;br /&gt;
&lt;br /&gt;
* compute_total_score(scores): When called with ''assignment.compute_total_score(scores)'' (such as in assignment_team.rb), it will sum the weighted scores of each questionnaire in an assignment using the scores passed to it and return the total.&lt;br /&gt;
&lt;br /&gt;
* compute_reviews_hash: When called with ''@assignment.compute_reviews_hash'' (such as in report_formatter_helper.rb), it will itself call the private methods ''scores_varying_rubrics'' or ''scores_non_varying_rubrics'' based on the ''@assignment.vary_by_round'' value. When calling these private methods, it passes an empty ''review_scores'' hash and the ''response_maps'' of the assignment. The chosen private method then iterates through each of the ''response_maps'' for the assignment and returns the filled ''review_scores'' hash in the format ''{response_map.reviewer_id: respective_scores}''. This ''respective_scores'' value is calculated through ''calc_review_score'' - another private method in assignment_helper.rb.&lt;br /&gt;
&lt;br /&gt;
* compute_avg_and_ranges_hash: When called with ''@assignment.compute_avg_and_ranges_hash'' (such as in report_formatter_helper.rb), it will find the contributors (''assignment_teams'') for the assignment, and then find two variables for each team - ''questions'' and ''assessments''. The first, ''questions'', are the peer review questions for that team. The second, ''assessments'' are the team's owned assessments in ''ReviewResponseMap''. Then ''Response.compute_scores(assessments, questions)'' is called to calculate scores. Finally, a hash of ''{contributor.id: &amp;lt;computed scores&amp;gt;}'' is returned.&lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from assignment_helper. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from assignment.rb and assignment_participant.rb into response_map.rb. Below are some of the most commonly used methods in response_map.rb.&lt;br /&gt;
&lt;br /&gt;
* self.scores(assignment, questions): Computes and returns the scores of assignment for participants and teams&lt;br /&gt;
* self.participant_scores(participant, questions): Return scores that this participant has been given&lt;br /&gt;
* self.compute_assignment_score(participant, questions, scores): Called by ''participant_scores()'' to retrieve the assignment score. This method itself calls ''Response.compute_scores()'' to find the total score for a list of responses to a questionnaire. It then fills out a ''scores'' hash filled with questionnaire symbols with this total score data. &lt;br /&gt;
* self.merge_scores(participant, scores): For each assignment review all scores and determine a max, min and average value&lt;br /&gt;
* self.update_max_or_min(scores, round_sym, review_sym, symbol): Called by ''merge_scores()'' to update a rounds min/max scores. &lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from response_map. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from answer.rb into response.rb. Below are some of the most commonly used methods in response.rb.&lt;br /&gt;
&lt;br /&gt;
* self.compute_scores(assessments, questions): Computes the total score for a list of assessments of some type (author feedback, teammate review). The ''questions'' parameter is a list of what was filled out in the process of doing those assessments. Called by several files, including bookmarks_controller, assignment_helper, assignment_team, and response_map.&lt;br /&gt;
* self.assessment_score(params): Computes the total score for a specific assessment (not a list). Called by ''compute_scores'' on each individual assessment. If there is no score, it returns ''-1.0''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Display Files ==&lt;br /&gt;
&lt;br /&gt;
'''grades_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Largely generic methods, most of which assist in rendering views of grades. Includes redirection commands, a bar chart method, and a view model for  &lt;br /&gt;
&lt;br /&gt;
'''grades_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Helper methods for rendering views of grades. Includes notable methods regarding charts, vectors, and heatmaps of grades.&lt;br /&gt;
&lt;br /&gt;
== Significant Pull Requests ==&lt;br /&gt;
These are the pull requests responsible for the refactor:&lt;br /&gt;
&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2039 Refactor on_the_fly_calc]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2038 Refactor scores in assignment and participant]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2029 Grade refactoring]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2017 Answer refactoring]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=141596</id>
		<title>Scoring &amp; Grading Methods (Fall '21)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=141596"/>
		<updated>2021-11-11T01:13:56Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* Key Files &amp;amp; Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scoring and Grading was given a refactor in the Fall of 2021. This doc page describes the key files for scoring and grading, their methods, and how to use them.&lt;br /&gt;
&lt;br /&gt;
At the lowest level, a score needs to be calculated anytime anyone fills out a rubric.  This score is calculated in Response.rb. &lt;br /&gt;
It is computed as a weighted sum of the (scorable) items in the rubric.  If, for example, the assignment has two rounds of review, and reviewer 'x' does a review in each round, there will be a score for the review done by reviewer 'x' in Round 1 and a score for the review done by reviewer 'x' in Round 2.&lt;br /&gt;
&lt;br /&gt;
In ResponseMap.rb, the scores given by an individual reviewer in different rounds are accumulated.  If, for example, the Round 1 review is weighted 70% and the Round 2 review 30%, the ... method in ResponseMap.rb computes Round 1 score from reviewer 'x' * 70% + Round 2 score from reviewer 'x' * 30%&lt;br /&gt;
.&lt;br /&gt;
&lt;br /&gt;
The scores from different reviewers are averaged in AssignmentTeam.rb.  This may be a simple average of reviewer 'x_i's score, for all i = 0, ..., m-1, or if the reviewers have been assigned different 'reputations', it may be an average where each reviewer's score is weighted by that reviewer's reputation.&lt;br /&gt;
&lt;br /&gt;
Then, to get a final score, we need to add together the scores for the different kind of reviews, e.g., teammate reviews, author feedback, and reviews of submitted work.  [Where is this done?]&lt;br /&gt;
&lt;br /&gt;
== Key Files &amp;amp; Methods ==&lt;br /&gt;
'''assignment_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Methods used in on_the_fly_calc were merged into this file as part of the refactor, since any previous calls to the methods took place through an instance of assignment. There is currently an attempt to further abstract these methods in assignment_helper.rb so that assignment is passed as a parameter (instead of using ''self''). &lt;br /&gt;
&lt;br /&gt;
The following methods in assignment_helper are part of the Scoring and Grading refactor:&lt;br /&gt;
&lt;br /&gt;
* compute_total_score(scores): When called with ''assignment.compute_total_score(scores)'' (such as in assignment_team.rb), it will sum the weighted scores of each questionnaire in an assignment using the scores passed to it and return the total.&lt;br /&gt;
&lt;br /&gt;
* compute_reviews_hash: When called with ''@assignment.compute_reviews_hash'' (such as in report_formatter_helper.rb), it will itself call the private methods ''scores_varying_rubrics'' or ''scores_non_varying_rubrics'' based on the ''@assignment.vary_by_round'' value. When calling these private methods, it passes an empty ''review_scores'' hash and the ''response_maps'' of the assignment. The chosen private method then iterates through each of the ''response_maps'' for the assignment and returns the filled ''review_scores'' hash in the format ''{response_map.reviewer_id: respective_scores}''. This ''respective_scores'' value is calculated through ''calc_review_score'' - another private method in assignment_helper.rb.&lt;br /&gt;
&lt;br /&gt;
* compute_avg_and_ranges_hash: When called with ''@assignment.compute_avg_and_ranges_hash'' (such as in report_formatter_helper.rb), it will find the contributors (''assignment_teams'') for the assignment, and then find two variables for each team - ''questions'' and ''assessments''. The first, ''questions'', are the peer review questions for that team. The second, ''assessments'' are the team's owned assessments in ''ReviewResponseMap''. Then ''Response.compute_scores(assessments, questions)'' is called to calculate scores. Finally, a hash of ''{contributor.id: &amp;lt;computed scores&amp;gt;}'' is returned.&lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from assignment_helper. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from assignment.rb and assignment_participant.rb into response_map.rb. Below are some of the most commonly used methods in response_map.rb.&lt;br /&gt;
&lt;br /&gt;
* self.scores(assignment, questions): Computes and returns the scores of assignment for participants and teams&lt;br /&gt;
* self.participant_scores(participant, questions): Return scores that this participant has been given&lt;br /&gt;
* self.compute_assignment_score(participant, questions, scores): Called by ''participant_scores()'' to retrieve the assignment score. This method itself calls ''Response.compute_scores()'' to find the total score for a list of responses to a questionnaire. It then fills out a ''scores'' hash filled with questionnaire symbols with this total score data. &lt;br /&gt;
* self.merge_scores(participant, scores): For each assignment review all scores and determine a max, min and average value&lt;br /&gt;
* self.update_max_or_min(scores, round_sym, review_sym, symbol): Called by ''merge_scores()'' to update a rounds min/max scores. &lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from response_map. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from answer.rb into response.rb. Below are some of the most commonly used methods in response.rb.&lt;br /&gt;
&lt;br /&gt;
* self.compute_scores(assessments, questions): Computes the total score for a list of assessments of some type (author feedback, teammate review). The ''questions'' parameter is a list of what was filled out in the process of doing those assessments. Called by several files, including bookmarks_controller, assignment_helper, assignment_team, and response_map.&lt;br /&gt;
* self.assessment_score(params): Computes the total score for a specific assessment (not a list). Called by ''compute_scores'' on each individual assessment. If there is no score, it returns ''-1.0''.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Display Files ==&lt;br /&gt;
&lt;br /&gt;
'''grades_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Largely generic methods, most of which assist in rendering views of grades. Includes redirection commands, a bar chart method, and a view model for  &lt;br /&gt;
&lt;br /&gt;
'''grades_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Helper methods for rendering views of grades. Includes notable methods regarding charts, vectors, and heatmaps of grades.&lt;br /&gt;
&lt;br /&gt;
== Significant Pull Requests ==&lt;br /&gt;
These are the pull requests responsible for the refactor:&lt;br /&gt;
&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2039 Refactor on_the_fly_calc]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2038 Refactor scores in assignment and participant]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2029 Grade refactoring]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2017 Answer refactoring]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=141144</id>
		<title>Scoring &amp; Grading Methods (Fall '21)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=141144"/>
		<updated>2021-11-07T20:58:30Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* Key Files &amp;amp; Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scoring and Grading was given a refactor in the Fall of 2021. This doc page describes the key files for scoring and grading, their methods, and how to use them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Key Files &amp;amp; Methods ==&lt;br /&gt;
'''assignment_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Methods used in on_the_fly_calc were merged into this file as part of the refactor, since any previous calls to the methods took place through an instance of assignment. There is currently an attempt to further abstract these methods in assignment_helper.rb so that assignment is passed as a parameter (instead of using ''self''). &lt;br /&gt;
&lt;br /&gt;
The following methods in assignment_helper are part of the Scoring and Grading refactor:&lt;br /&gt;
&lt;br /&gt;
* compute_total_score(scores): When called with ''assignment.compute_total_score(scores)'' (such as in assignment_team.rb), it will sum the weighted scores of each questionnaire in an assignment using the scores passed to it and return the total.&lt;br /&gt;
&lt;br /&gt;
* compute_reviews_hash: When called with ''@assignment.compute_reviews_hash'' (such as in report_formatter_helper.rb), it will itself call the private methods ''scores_varying_rubrics'' or ''scores_non_varying_rubrics'' based on the ''@assignment.vary_by_round'' value. When calling these private methods, it passes an empty ''review_scores'' hash and the ''response_maps'' of the assignment. The chosen private method then iterates through each of the ''response_maps'' for the assignment and returns the filled ''review_scores'' hash in the format ''{response_map.reviewer_id: respective_scores}''. This ''respective_scores'' value is calculated through ''calc_review_score'' - another private method in assignment_helper.rb.&lt;br /&gt;
&lt;br /&gt;
* compute_avg_and_ranges_hash: When called with ''@assignment.compute_avg_and_ranges_hash'' (such as in report_formatter_helper.rb), it will find the contributors (''assignment_teams'') for the assignment, and then find two variables for each team - ''questions'' and ''assessments''. The first, ''questions'', are the peer review questions for that team. The second, ''assessments'' are the team's owned assessments in ''ReviewResponseMap''. Then ''Response.compute_scores(assessments, questions)'' is called to calculate scores. Finally, a hash of ''{contributor.id: &amp;lt;computed scores&amp;gt;}'' is returned.&lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from assignment_helper. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
'''grades_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Largely generic methods, most of which assist in rendering views of grades. Includes redirection commands, a bar chart method, and a view model for  &lt;br /&gt;
&lt;br /&gt;
'''grades_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Helper methods for rendering views of grades. Includes notable methods regarding charts, vectors, and heatmaps of grades. &lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from assignment.rb and assignment_participant.rb into response_map.rb. Below are some of the most commonly used methods in response_map.rb.&lt;br /&gt;
&lt;br /&gt;
* self.scores(assignment, questions): Computes and returns the scores of assignment for participants and teams&lt;br /&gt;
* self.participant_scores(participant, questions): Return scores that this participant has been given&lt;br /&gt;
* self.compute_assignment_score(participant, questions, scores): Called by ''participant_scores()'' to retrieve the assignment score. This method itself calls ''Response.compute_scores()'' to find the total score for a list of responses to a questionnaire. It then fills out a ''scores'' hash filled with questionnaire symbols with this total score data. &lt;br /&gt;
* self.merge_scores(participant, scores): For each assignment review all scores and determine a max, min and average value&lt;br /&gt;
* self.update_max_or_min(scores, round_sym, review_sym, symbol): Called by ''merge_scores()'' to update a rounds min/max scores. &lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from response_map. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from answer.rb into response.rb. Below are some of the most commonly used methods in response.rb.&lt;br /&gt;
&lt;br /&gt;
* self.compute_scores(assessments, questions): Computes the total score for a list of assessments of some type (author feedback, teammate review). The ''questions'' parameter is a list of what was filled out in the process of doing those assessments. Called by several files, including bookmarks_controller, assignment_helper, assignment_team, and response_map.&lt;br /&gt;
* self.assessment_score(params): Computes the total score for a specific assessment (not a list). Called by ''compute_scores'' on each individual assessment. If there is no score, it returns ''-1.0''.&lt;br /&gt;
&lt;br /&gt;
== Significant Pull Requests ==&lt;br /&gt;
These are the pull requests responsible for the refactor:&lt;br /&gt;
&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2039 Refactor on_the_fly_calc]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2038 Refactor scores in assignment and participant]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2029 Grade refactoring]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2017 Answer refactoring]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=141143</id>
		<title>Scoring &amp; Grading Methods (Fall '21)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=141143"/>
		<updated>2021-11-07T20:58:10Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scoring and Grading was given a refactor in the Fall of 2021. This doc page describes the key files for scoring and grading, their methods, and how to use them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Key Files &amp;amp; Methods ==&lt;br /&gt;
'''assignment_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Methods used in on_the_fly_calc were merged into this file as part of the refactor, since any previous calls to the methods took place through an instance of assignment. There is currently an attempt to further abstract these methods in assignment_helper.rb so that assignment is passed as a parameter (instead of using ''self''). &lt;br /&gt;
&lt;br /&gt;
The following methods in assignment_helper are part of the Scoring and Grading refactor:&lt;br /&gt;
&lt;br /&gt;
* compute_total_score(scores): When called with ''assignment.compute_total_score(scores)'' (such as in assignment_team.rb), it will sum the weighted scores of each questionnaire in an assignment using the scores passed to it and return the total.&lt;br /&gt;
&lt;br /&gt;
* compute_reviews_hash: When called with ''@assignment.compute_reviews_hash'' (such as in report_formatter_helper.rb), it will itself call the private methods ''scores_varying_rubrics'' or ''scores_non_varying_rubrics'' based on the ''@assignment.vary_by_round'' value. When calling these private methods, it passes an empty ''review_scores'' hash and the ''response_maps'' of the assignment. The chosen private method then iterates through each of the ''response_maps'' for the assignment and returns the filled ''review_scores'' hash in the format ''{response_map.reviewer_id: respective_scores}''. This ''respective_scores'' value is calculated through ''calc_review_score'' - another private method in assignment_helper.rb.&lt;br /&gt;
&lt;br /&gt;
* compute_avg_and_ranges_hash: When called with ''@assignment.compute_avg_and_ranges_hash'' (such as in report_formatter_helper.rb), it will find the contributors (''assignment_teams'') for the assignment, and then find two variables for each team - ''questions'' and ''assessments''. The first, ''questions'', are the peer review questions for that team. The second, ''assessments'' are the team's owned assessments in ''ReviewResponseMap''. Then ''Response.compute_scores(assessments, questions)'' is called to calculate scores. Finally, a hash of ''{contributor.id: &amp;lt;computed scores&amp;gt;}'' is returned.&lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from assignment_helper. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
'''grades_controller.rb'''&lt;br /&gt;
Largely generic methods, most of which assist in rendering views of grades. Includes redirection commands, a bar chart method, and a view model for  &lt;br /&gt;
&lt;br /&gt;
'''grades_helper.rb'''&lt;br /&gt;
Helper methods for rendering views of grades. Includes notable methods regarding charts, vectors, and heatmaps of grades. &lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from assignment.rb and assignment_participant.rb into response_map.rb. Below are some of the most commonly used methods in response_map.rb.&lt;br /&gt;
&lt;br /&gt;
* self.scores(assignment, questions): Computes and returns the scores of assignment for participants and teams&lt;br /&gt;
* self.participant_scores(participant, questions): Return scores that this participant has been given&lt;br /&gt;
* self.compute_assignment_score(participant, questions, scores): Called by ''participant_scores()'' to retrieve the assignment score. This method itself calls ''Response.compute_scores()'' to find the total score for a list of responses to a questionnaire. It then fills out a ''scores'' hash filled with questionnaire symbols with this total score data. &lt;br /&gt;
* self.merge_scores(participant, scores): For each assignment review all scores and determine a max, min and average value&lt;br /&gt;
* self.update_max_or_min(scores, round_sym, review_sym, symbol): Called by ''merge_scores()'' to update a rounds min/max scores. &lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from response_map. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from answer.rb into response.rb. Below are some of the most commonly used methods in response.rb.&lt;br /&gt;
&lt;br /&gt;
* self.compute_scores(assessments, questions): Computes the total score for a list of assessments of some type (author feedback, teammate review). The ''questions'' parameter is a list of what was filled out in the process of doing those assessments. Called by several files, including bookmarks_controller, assignment_helper, assignment_team, and response_map.&lt;br /&gt;
* self.assessment_score(params): Computes the total score for a specific assessment (not a list). Called by ''compute_scores'' on each individual assessment. If there is no score, it returns ''-1.0''.&lt;br /&gt;
&lt;br /&gt;
== Significant Pull Requests ==&lt;br /&gt;
These are the pull requests responsible for the refactor:&lt;br /&gt;
&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2039 Refactor on_the_fly_calc]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2038 Refactor scores in assignment and participant]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2029 Grade refactoring]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2017 Answer refactoring]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=141142</id>
		<title>Scoring &amp; Grading Methods (Fall '21)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=141142"/>
		<updated>2021-11-07T20:51:50Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scoring and Grading was given a refactor in the Fall of 2021. This doc page describes the key files for scoring and grading, their methods, and how to use them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Key Files &amp;amp; Methods ==&lt;br /&gt;
'''assignment_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Methods used in on_the_fly_calc were merged into this file as part of the refactor, since any previous calls to the methods took place through an instance of assignment. There is currently an attempt to further abstract these methods in assignment_helper.rb so that assignment is passed as a parameter (instead of using ''self''). &lt;br /&gt;
&lt;br /&gt;
The following methods in assignment_helper are part of the Scoring and Grading refactor:&lt;br /&gt;
&lt;br /&gt;
* compute_total_score(scores): When called with ''assignment.compute_total_score(scores)'' (such as in assignment_team.rb), it will sum the weighted scores of each questionnaire in an assignment using the scores passed to it and return the total.&lt;br /&gt;
&lt;br /&gt;
* compute_reviews_hash: When called with ''@assignment.compute_reviews_hash'' (such as in report_formatter_helper.rb), it will itself call the private methods ''scores_varying_rubrics'' or ''scores_non_varying_rubrics'' based on the ''@assignment.vary_by_round'' value. When calling these private methods, it passes an empty ''review_scores'' hash and the ''response_maps'' of the assignment. The chosen private method then iterates through each of the ''response_maps'' for the assignment and returns the filled ''review_scores'' hash in the format ''{response_map.reviewer_id: respective_scores}''. This ''respective_scores'' value is calculated through ''calc_review_score'' - another private method in assignment_helper.rb.&lt;br /&gt;
&lt;br /&gt;
* compute_avg_and_ranges_hash: When called with ''@assignment.compute_avg_and_ranges_hash'' (such as in report_formatter_helper.rb), it will find the contributors (''assignment_teams'') for the assignment, and then find two variables for each team - ''questions'' and ''assessments''. The first, ''questions'', are the peer review questions for that team. The second, ''assessments'' are the team's owned assessments in ''ReviewResponseMap''. Then ''Response.compute_scores(assessments, questions)'' is called to calculate scores. Finally, a hash of ''{contributor.id: &amp;lt;computed scores&amp;gt;}'' is returned.&lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from assignment_helper. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
'''grades_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
'''grades_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from assignment.rb and assignment_participant.rb into response_map.rb. Below are some of the most commonly used methods in response_map.rb.&lt;br /&gt;
&lt;br /&gt;
* self.scores(assignment, questions): Computes and returns the scores of assignment for participants and teams&lt;br /&gt;
* self.participant_scores(participant, questions): Return scores that this participant has been given&lt;br /&gt;
* self.compute_assignment_score(participant, questions, scores): Called by ''participant_scores()'' to retrieve the assignment score. This method itself calls ''Response.compute_scores()'' to find the total score for a list of responses to a questionnaire. It then fills out a ''scores'' hash filled with questionnaire symbols with this total score data. &lt;br /&gt;
* self.merge_scores(participant, scores): For each assignment review all scores and determine a max, min and average value&lt;br /&gt;
* self.update_max_or_min(scores, round_sym, review_sym, symbol): Called by ''merge_scores()'' to update a rounds min/max scores. &lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from response_map. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from answer.rb into response.rb. Below are some of the most commonly used methods in response.rb.&lt;br /&gt;
&lt;br /&gt;
* self.compute_scores(assessments, questions): Computes the total score for a list of assessments of some type (author feedback, teammate review). The ''questions'' parameter is a list of what was filled out in the process of doing those assessments. Called by several files, including bookmarks_controller, assignment_helper, assignment_team, and response_map.&lt;br /&gt;
* self.assessment_score(params): Computes the total score for a specific assessment (not a list). Called by ''compute_scores'' on each individual assessment. If there is no score, it returns ''-1.0''.&lt;br /&gt;
&lt;br /&gt;
== Significant Pull Requests ==&lt;br /&gt;
These are the pull requests responsible for the refactor:&lt;br /&gt;
&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2039 Refactor on_the_fly_calc]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2038 Refactor scores in assignment and participant]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2029 Grade refactoring]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2017 Answer refactoring]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=141141</id>
		<title>Scoring &amp; Grading Methods (Fall '21)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=141141"/>
		<updated>2021-11-07T20:49:32Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* Key Files &amp;amp; Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scoring and Grading was given a refactor in the Fall of 2021. This doc page describes the key files for scoring and grading, their methods, and how to use them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Key Files &amp;amp; Methods ==&lt;br /&gt;
'''assignment_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Methods used in on_the_fly_calc were merged into this file as part of the refactor, since any previous calls to the methods took place through an instance of assignment. There is currently an attempt to further abstract these methods in assignment_helper.rb so that assignment is passed as a parameter (instead of using ''self''). &lt;br /&gt;
&lt;br /&gt;
The following methods in assignment_helper are part of the Scoring and Grading refactor:&lt;br /&gt;
&lt;br /&gt;
* compute_total_score(scores): When called with ''assignment.compute_total_score(scores)'' (such as in assignment_team.rb), it will sum the weighted scores of each questionnaire in an assignment using the scores passed to it and return the total.&lt;br /&gt;
&lt;br /&gt;
* compute_reviews_hash: When called with ''@assignment.compute_reviews_hash'' (such as in report_formatter_helper.rb), it will itself call the private methods ''scores_varying_rubrics'' or ''scores_non_varying_rubrics'' based on the ''@assignment.vary_by_round'' value. When calling these private methods, it passes an empty ''review_scores'' hash and the ''response_maps'' of the assignment. The chosen private method then iterates through each of the ''response_maps'' for the assignment and returns the filled ''review_scores'' hash in the format ''{response_map.reviewer_id: respective_scores}''. This ''respective_scores'' value is calculated through ''calc_review_score'' - another private method in assignment_helper.rb.&lt;br /&gt;
&lt;br /&gt;
* compute_avg_and_ranges_hash: When called with ''@assignment.compute_avg_and_ranges_hash'' (such as in report_formatter_helper.rb), it will find the contributors (''assignment_teams'') for the assignment, and then find two variables for each team - ''questions'' and ''assessments''. The first, ''questions'', are the peer review questions for that team. The second, ''assessments'' are the team's owned assessments in ''ReviewResponseMap''. Then ''Response.compute_scores(assessments, questions)'' is called to calculate scores. Finally, a hash of ''{contributor.id: &amp;lt;computed scores&amp;gt;}'' is returned.&lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from assignment_helper. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
'''grades_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
'''grades_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from assignment.rb and assignment_participant.rb into response_map.rb. Below are some of the most commonly used methods in response_map.rb.&lt;br /&gt;
&lt;br /&gt;
* self.scores(assignment, questions): Computes and returns the scores of assignment for participants and teams&lt;br /&gt;
* self.participant_scores(participant, questions): Return scores that this participant has been given&lt;br /&gt;
* self.compute_assignment_score(participant, questions, scores): Called by ''participant_scores()'' to retrieve the assignment score. This method itself calls ''Response.compute_scores()'' to find the total score for a list of responses to a questionnaire. It then fills out a ''scores'' hash filled with questionnaire symbols with this total score data. &lt;br /&gt;
* self.merge_scores(participant, scores): For each assignment review all scores and determine a max, min and average value&lt;br /&gt;
* self.update_max_or_min(scores, round_sym, review_sym, symbol): Called by ''merge_scores()'' to update a rounds min/max scores. &lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from response_map. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from answer.rb into response.rb. Below are some of the most commonly used methods in response.rb.&lt;br /&gt;
&lt;br /&gt;
* self.compute_scores(assessments, questions): Computes the total score for a list of assessments of some type (author feedback, teammate review). The ''questions'' parameter is a list of what was filled out in the process of doing those assessments. &lt;br /&gt;
* self.assessment_score(params): Computes the total score for a specific assessment (not a list). Called by ''compute_scores'' on each individual assessment. If there is no score, it returns ''-1.0''.&lt;br /&gt;
&lt;br /&gt;
== Significant Pull Requests ==&lt;br /&gt;
These are the pull requests responsible for the refactor:&lt;br /&gt;
&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2039 Refactor on_the_fly_calc]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2038 Refactor scores in assignment and participant]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2029 Grade refactoring]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2017 Answer refactoring]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=141136</id>
		<title>Scoring &amp; Grading Methods (Fall '21)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=141136"/>
		<updated>2021-11-07T20:32:43Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* Key Files */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scoring and Grading was given a refactor in the Fall of 2021. This doc page describes the key files for scoring and grading, their methods, and how to use them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Key Files &amp;amp; Methods ==&lt;br /&gt;
'''assignment_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Methods used in on_the_fly_calc were merged into this file as part of the refactor, since any previous calls to the methods took place through an instance of assignment. There is currently an attempt to further abstract these methods in assignment_helper.rb so that assignment is passed as a parameter (instead of using ''self''). &lt;br /&gt;
&lt;br /&gt;
The following methods in assignment_helper are part of the Scoring and Grading refactor:&lt;br /&gt;
&lt;br /&gt;
* compute_total_score(scores): When called with ''assignment.compute_total_score(scores)'' (such as in assignment_team.rb), it will sum the weighted scores of each questionnaire in an assignment using the scores passed to it and return the total.&lt;br /&gt;
&lt;br /&gt;
* compute_reviews_hash: When called with ''@assignment.compute_reviews_hash'' (such as in report_formatter_helper.rb), it will itself call the private methods ''scores_varying_rubrics'' or ''scores_non_varying_rubrics'' based on the ''@assignment.vary_by_round'' value. When calling these private methods, it passes an empty ''review_scores'' hash and the ''response_maps'' of the assignment. The chosen private method then iterates through each of the ''response_maps'' for the assignment and returns the filled ''review_scores'' hash in the format ''{response_map.reviewer_id: respective_scores}''. This ''respective_scores'' value is calculated through ''calc_review_score'' - another private method in assignment_helper.rb.&lt;br /&gt;
&lt;br /&gt;
* compute_avg_and_ranges_hash: When called with ''@assignment.compute_avg_and_ranges_hash'' (such as in report_formatter_helper.rb), it will find the contributors (''assignment_teams'') for the assignment, and then find two variables for each team - ''questions'' and ''assessments''. The first, ''questions'', are the peer review questions for that team. The second, ''assessments'' are the team's owned assessments in ''ReviewResponseMap''. Then ''Response.compute_scores(assessments, questions)'' is called to calculate scores. Finally, a hash of ''{contributor.id: &amp;lt;computed scores&amp;gt;}'' is returned.&lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from assignment_helper. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
'''grades_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
'''grades_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from assignment.rb and assignment_participant.rb into response_map.rb. Below are some of the most commonly used methods in response_map.rb.&lt;br /&gt;
&lt;br /&gt;
* self.scores(assignment, questions): Computes and returns the scores of assignment for participants and teams&lt;br /&gt;
* self.participant_scores(participant, questions): Return scores that this participant has been given&lt;br /&gt;
* self.compute_assignment_score(participant, questions, scores): Called by ''participant_scores()'' to retrieve the assignment score. This method itself calls ''Response.compute_scores()'' to find the total score for a list of responses to a questionnaire. It then fills out a ''scores'' hash filled with questionnaire symbols with this total score data. &lt;br /&gt;
* self.merge_scores(participant, scores): For each assignment review all scores and determine a max, min and average value&lt;br /&gt;
* self.update_max_or_min(scores, round_sym, review_sym, symbol): Called by ''merge_scores()'' to update a rounds min/max scores. &lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from response_map. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from answer.rb into response.rb.&lt;br /&gt;
&lt;br /&gt;
== Significant Pull Requests ==&lt;br /&gt;
These are the pull requests responsible for the refactor:&lt;br /&gt;
&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2039 Refactor on_the_fly_calc]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2038 Refactor scores in assignment and participant]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2029 Grade refactoring]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2017 Answer refactoring]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=141135</id>
		<title>Scoring &amp; Grading Methods (Fall '21)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=141135"/>
		<updated>2021-11-07T20:27:46Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: Add response_map methods&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scoring and Grading was given a refactor in the Fall of 2021. This doc page describes the key files for scoring and grading, their methods, and how to use them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Key Files ==&lt;br /&gt;
'''assignment_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Methods used in on_the_fly_calc were merged into this file as part of the refactor, since any previous calls to the methods took place through an instance of assignment. There is currently an attempt to further abstract these methods in assignment_helper.rb so that assignment is passed as a parameter (instead of using ''self''). &lt;br /&gt;
&lt;br /&gt;
The following methods in assignment_helper are part of the Scoring and Grading refactor:&lt;br /&gt;
&lt;br /&gt;
* compute_total_score(scores): When called with ''assignment.compute_total_score(scores)'' (such as in assignment_team.rb), it will sum the weighted scores of each questionnaire in an assignment using the scores passed to it and return the total.&lt;br /&gt;
&lt;br /&gt;
* compute_reviews_hash: When called with ''@assignment.compute_reviews_hash'' (such as in report_formatter_helper.rb), it will itself call the private methods ''scores_varying_rubrics'' or ''scores_non_varying_rubrics'' based on the ''@assignment.vary_by_round'' value. When calling these private methods, it passes an empty ''review_scores'' hash and the ''response_maps'' of the assignment. The chosen private method then iterates through each of the ''response_maps'' for the assignment and returns the filled ''review_scores'' hash in the format ''{response_map.reviewer_id: respective_scores}''. This ''respective_scores'' value is calculated through ''calc_review_score'' - another private method in assignment_helper.rb.&lt;br /&gt;
&lt;br /&gt;
* compute_avg_and_ranges_hash: When called with ''@assignment.compute_avg_and_ranges_hash'' (such as in report_formatter_helper.rb), it will find the contributors (''assignment_teams'') for the assignment, and then find two variables for each team - ''questions'' and ''assessments''. The first, ''questions'', are the peer review questions for that team. The second, ''assessments'' are the team's owned assessments in ''ReviewResponseMap''. Then ''Response.compute_scores(assessments, questions)'' is called to calculate scores. Finally, a hash of ''{contributor.id: &amp;lt;computed scores&amp;gt;}'' is returned.&lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from assignment_helper. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
'''grades_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
'''grades_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from assignment.rb and assignment_participant.rb into response_map.rb.&lt;br /&gt;
&lt;br /&gt;
* self.scores(assignment, questions): Computes and returns the scores of assignment for participants and teams&lt;br /&gt;
* self.participant_scores(participant, questions): Return scores that this participant has been given&lt;br /&gt;
* self.compute_assignment_score(participant, questions, scores): Called by ''participant_scores()'' to retrieve the assignment score. This method itself calls ''Response.compute_scores()'' to find the total score for a list of responses to a questionnaire. It then fills out a ''scores'' hash filled with questionnaire symbols with this total score data. &lt;br /&gt;
* self.merge_scores(participant, scores): For each assignment review all scores and determine a max, min and average value&lt;br /&gt;
* self.update_max_or_min(scores, round_sym, review_sym, symbol): Called by ''merge_scores()'' to update a rounds min/max scores. &lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from response_map. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from answer.rb into response.rb.&lt;br /&gt;
&lt;br /&gt;
== Significant Pull Requests ==&lt;br /&gt;
These are the pull requests responsible for the refactor:&lt;br /&gt;
&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2039 Refactor on_the_fly_calc]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2038 Refactor scores in assignment and participant]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2029 Grade refactoring]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2017 Answer refactoring]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=140984</id>
		<title>Scoring &amp; Grading Methods (Fall '21)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=140984"/>
		<updated>2021-11-05T18:29:05Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scoring and Grading was given a refactor in the Fall of 2021. This doc page describes the key files for scoring and grading, their methods, and how to use them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Key Files ==&lt;br /&gt;
'''assignment_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Methods used in on_the_fly_calc were merged into this file as part of the refactor, since any previous calls to the methods took place through an instance of assignment. There is currently an attempt to further abstract these methods in assignment_helper.rb so that assignment is passed as a parameter (instead of using ''self''). &lt;br /&gt;
&lt;br /&gt;
The following methods in assignment_helper are part of the Scoring and Grading refactor:&lt;br /&gt;
&lt;br /&gt;
* compute_total_score(scores): When called with ''assignment.compute_total_score(scores)'' (such as in assignment_team.rb), it will sum the weighted scores of each questionnaire in an assignment using the scores passed to it and return the total.&lt;br /&gt;
&lt;br /&gt;
* compute_reviews_hash: When called with ''@assignment.compute_reviews_hash'' (such as in report_formatter_helper.rb), it will itself call the private methods ''scores_varying_rubrics'' or ''scores_non_varying_rubrics'' based on the ''@assignment.vary_by_round'' value. When calling these private methods, it passes an empty ''review_scores'' hash and the ''response_maps'' of the assignment. The chosen private method then iterates through each of the ''response_maps'' for the assignment and returns the filled ''review_scores'' hash in the format ''{response_map.reviewer_id: respective_scores}''. This ''respective_scores'' value is calculated through ''calc_review_score'' - another private method in assignment_helper.rb.&lt;br /&gt;
&lt;br /&gt;
* compute_avg_and_ranges_hash: When called with ''@assignment.compute_avg_and_ranges_hash'' (such as in report_formatter_helper.rb), it will find the contributors (''assignment_teams'') for the assignment, and then find two variables for each team - ''questions'' and ''assessments''. The first, ''questions'', are the peer review questions for that team. The second, ''assessments'' are the team's owned assessments in ''ReviewResponseMap''. Then ''Response.compute_scores(assessments, questions)'' is called to calculate scores. Finally, a hash of ''{contributor.id: &amp;lt;computed scores&amp;gt;}'' is returned.&lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from assignment_helper. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
'''grades_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
'''grades_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from assignment.rb and assignment_participant.rb into response_map.rb.&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from answer.rb into response.rb.&lt;br /&gt;
&lt;br /&gt;
== Significant Pull Requests ==&lt;br /&gt;
These are the pull requests responsible for the refactor:&lt;br /&gt;
&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2039 Refactor on_the_fly_calc]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2038 Refactor scores in assignment and participant]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2029 Grade refactoring]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2017 Answer refactoring]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=140983</id>
		<title>Scoring &amp; Grading Methods (Fall '21)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=140983"/>
		<updated>2021-11-05T18:27:55Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: Future structure&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scoring and Grading was given a refactor in the Fall of 2021. This doc page describes the key files, methods, and how to use them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Key Files ==&lt;br /&gt;
'''assignment_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Methods used in on_the_fly_calc were merged into this file as part of the refactor, since any previous calls to the methods took place through an instance of assignment. There is currently an attempt to further abstract these methods in assignment_helper.rb so that assignment is passed as a parameter (instead of using ''self''). &lt;br /&gt;
&lt;br /&gt;
The following methods in assignment_helper are part of the Scoring and Grading refactor:&lt;br /&gt;
&lt;br /&gt;
* compute_total_score(scores): When called with ''assignment.compute_total_score(scores)'' (such as in assignment_team.rb), it will sum the weighted scores of each questionnaire in an assignment using the scores passed to it and return the total.&lt;br /&gt;
&lt;br /&gt;
* compute_reviews_hash: When called with ''@assignment.compute_reviews_hash'' (such as in report_formatter_helper.rb), it will itself call the private methods ''scores_varying_rubrics'' or ''scores_non_varying_rubrics'' based on the ''@assignment.vary_by_round'' value. When calling these private methods, it passes an empty ''review_scores'' hash and the ''response_maps'' of the assignment. The chosen private method then iterates through each of the ''response_maps'' for the assignment and returns the filled ''review_scores'' hash in the format ''{response_map.reviewer_id: respective_scores}''. This ''respective_scores'' value is calculated through ''calc_review_score'' - another private method in assignment_helper.rb.&lt;br /&gt;
&lt;br /&gt;
* compute_avg_and_ranges_hash: When called with ''@assignment.compute_avg_and_ranges_hash'' (such as in report_formatter_helper.rb), it will find the contributors (''assignment_teams'') for the assignment, and then find two variables for each team - ''questions'' and ''assessments''. The first, ''questions'', are the peer review questions for that team. The second, ''assessments'' are the team's owned assessments in ''ReviewResponseMap''. Then ''Response.compute_scores(assessments, questions)'' is called to calculate scores. Finally, a hash of ''{contributor.id: &amp;lt;computed scores&amp;gt;}'' is returned.&lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from assignment_helper. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
'''grades_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
'''grades_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
'''response_map.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from assignment.rb and assignment_participant.rb into response_map.rb.&lt;br /&gt;
&lt;br /&gt;
'''response.rb'''&lt;br /&gt;
&lt;br /&gt;
A significant part of this refactor involved moving methods from answer.rb into response.rb.&lt;br /&gt;
&lt;br /&gt;
== Significant Pull Requests ==&lt;br /&gt;
These are the pull requests responsible for the refactor:&lt;br /&gt;
&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2039 Refactor on_the_fly_calc]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2038 Refactor scores in assignment and participant]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2029 Grade refactoring]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2017 Answer refactoring]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=140982</id>
		<title>Scoring &amp; Grading Methods (Fall '21)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=140982"/>
		<updated>2021-11-05T18:20:16Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* Files Affected */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scoring and Grading was given a refactor in the Fall of 2021. This doc page describes the key files, methods, and how to use them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Key Files ==&lt;br /&gt;
'''assignment_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Methods used in on_the_fly_calc were merged into this file as part of the refactor, since any previous calls to the methods took place through an instance of assignment. There is currently an attempt to further abstract these methods in assignment_helper.rb so that assignment is passed as a parameter (instead of using ''self''). &lt;br /&gt;
&lt;br /&gt;
The following methods in assignment_helper are part of the Scoring and Grading refactor:&lt;br /&gt;
&lt;br /&gt;
* compute_total_score(scores): When called with ''assignment.compute_total_score(scores)'' (such as in assignment_team.rb), it will sum the weighted scores of each questionnaire in an assignment using the scores passed to it and return the total.&lt;br /&gt;
&lt;br /&gt;
* compute_reviews_hash: When called with ''@assignment.compute_reviews_hash'' (such as in report_formatter_helper.rb), it will itself call the private methods ''scores_varying_rubrics'' or ''scores_non_varying_rubrics'' based on the ''@assignment.vary_by_round'' value. When calling these private methods, it passes an empty ''review_scores'' hash and the ''response_maps'' of the assignment. The chosen private method then iterates through each of the ''response_maps'' for the assignment and returns the filled ''review_scores'' hash in the format ''{response_map.reviewer_id: respective_scores}''. This ''respective_scores'' value is calculated through ''calc_review_score'' - another private method in assignment_helper.rb.&lt;br /&gt;
&lt;br /&gt;
* compute_avg_and_ranges_hash: When called with ''@assignment.compute_avg_and_ranges_hash'' (such as in report_formatter_helper.rb), it will find the contributors (''assignment_teams'') for the assignment, and then find two variables for each team - ''questions'' and ''assessments''. The first, ''questions'', are the peer review questions for that team. The second, ''assessments'' are the team's owned assessments in ''ReviewResponseMap''. Then ''Response.compute_scores(assessments, questions)'' is called to calculate scores. Finally, a hash of ''{contributor.id: &amp;lt;computed scores&amp;gt;}'' is returned.&lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from assignment_helper. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
== Significant Pull Requests ==&lt;br /&gt;
These are the pull requests responsible for the refactor:&lt;br /&gt;
&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2039 Refactor on_the_fly_calc]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2038 Refactor scores in assignment and participant]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2029 Grade refactoring]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2017 Answer refactoring]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=140981</id>
		<title>Scoring &amp; Grading Methods (Fall '21)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=140981"/>
		<updated>2021-11-05T18:19:18Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scoring and Grading was given a refactor in the Fall of 2021. This doc page describes the key files, methods, and how to use them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Files Affected ==&lt;br /&gt;
'''assignment_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Methods used in on_the_fly_calc were merged into this file as part of the refactor, since any previous calls to the methods took place through an instance of assignment. There is currently an attempt to further abstract these methods in assignment_helper.rb so that assignment is passed as a parameter (instead of using ''self''). &lt;br /&gt;
&lt;br /&gt;
The following methods in assignment_helper are part of the Scoring and Grading refactor:&lt;br /&gt;
&lt;br /&gt;
* compute_total_score(scores): When called with ''assignment.compute_total_score(scores)'' (such as in assignment_team.rb), it will sum the weighted scores of each questionnaire in an assignment using the scores passed to it and return the total.&lt;br /&gt;
&lt;br /&gt;
* compute_reviews_hash: When called with ''@assignment.compute_reviews_hash'' (such as in report_formatter_helper.rb), it will itself call the private methods ''scores_varying_rubrics'' or ''scores_non_varying_rubrics'' based on the ''@assignment.vary_by_round'' value. When calling these private methods, it passes an empty ''review_scores'' hash and the ''response_maps'' of the assignment. The chosen private method then iterates through each of the ''response_maps'' for the assignment and returns the filled ''review_scores'' hash in the format ''{response_map.reviewer_id: respective_scores}''. This ''respective_scores'' value is calculated through ''calc_review_score'' - another private method in assignment_helper.rb.&lt;br /&gt;
&lt;br /&gt;
* compute_avg_and_ranges_hash: When called with ''@assignment.compute_avg_and_ranges_hash'' (such as in report_formatter_helper.rb), it will find the contributors (''assignment_teams'') for the assignment, and then find two variables for each team - ''questions'' and ''assessments''. The first, ''questions'', are the peer review questions for that team. The second, ''assessments'' are the team's owned assessments in ''ReviewResponseMap''. Then ''Response.compute_scores(assessments, questions)'' is called to calculate scores. Finally, a hash of ''{contributor.id: &amp;lt;computed scores&amp;gt;}'' is returned.&lt;br /&gt;
&lt;br /&gt;
These are the public methods which can be called from assignment_helper. The private methods are only called by these above methods.&lt;br /&gt;
&lt;br /&gt;
== Significant Pull Requests ==&lt;br /&gt;
These are the pull requests responsible for the refactor:&lt;br /&gt;
&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2039 Refactor on_the_fly_calc]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2038 Refactor scores in assignment and participant]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2029 Grade refactoring]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2017 Answer refactoring]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=140979</id>
		<title>Scoring &amp; Grading Methods (Fall '21)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=140979"/>
		<updated>2021-11-05T17:20:26Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scoring and Grading was given a refactor in the Fall of 2021. This doc page describes the key files, methods, and how to use them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Files Affected ==&lt;br /&gt;
'''assignment_helper.rb'''&lt;br /&gt;
&lt;br /&gt;
Methods used in on_the_fly_calc were merged into this file as part of the refactor, since any previous calls to the methods took place through an instance of assignment. There is currently an attempt to further abstract these methods in assignment_helper.rb so that assignment is passed as a parameter (instead of using ''self''). &lt;br /&gt;
&lt;br /&gt;
The following methods in assignment_helper are part of the Scoring and Grading refactor:&lt;br /&gt;
&lt;br /&gt;
* compute_total_score(scores): When called with ''assignment.compute_total_score(scores)'' (such as in assignment_team.rb), it will sum the weighted scores of each questionnaire in an assignment using the scores passed to it and return the total.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Significant Pull Requests ==&lt;br /&gt;
These are the pull requests responsible for the refactor:&lt;br /&gt;
&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2039 Refactor on_the_fly_calc]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2038 Refactor scores in assignment and participant]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2029 Grade refactoring]&lt;br /&gt;
*[https://github.com/expertiza/expertiza/pull/2017 Answer refactoring]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=140978</id>
		<title>Scoring &amp; Grading Methods (Fall '21)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=140978"/>
		<updated>2021-11-05T17:08:44Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: Add significant pull requests&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scoring and Grading was given a refactor in the Fall of 2021. This doc page describes the key files, methods, and how to use them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Files Affected ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Significant Pull Requests ==&lt;br /&gt;
These are the pull requests responsible for the refactor:&lt;br /&gt;
&lt;br /&gt;
1. [https://github.com/expertiza/expertiza/pull/2039 Refactor on_the_fly_calc]&lt;br /&gt;
&lt;br /&gt;
2. [https://github.com/expertiza/expertiza/pull/2038 Refactor scores in assignment and participant]&lt;br /&gt;
&lt;br /&gt;
3. [https://github.com/expertiza/expertiza/pull/2029 Grade refactoring]&lt;br /&gt;
&lt;br /&gt;
4. [https://github.com/expertiza/expertiza/pull/2017 Answer refactoring]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=140977</id>
		<title>Scoring &amp; Grading Methods (Fall '21)</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Scoring_%26_Grading_Methods_(Fall_%2721)&amp;diff=140977"/>
		<updated>2021-11-05T16:51:26Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: Init&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Scoring and Grading was given a refactor in the Fall of 2021. This doc page describes the key files, methods, and how to use them.&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=Expertiza_documentation&amp;diff=140976</id>
		<title>Expertiza documentation</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Expertiza_documentation&amp;diff=140976"/>
		<updated>2021-11-05T16:50:22Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* Misc */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Image:715px-EXPERTIZA.png|715px]]&lt;br /&gt;
&lt;br /&gt;
= Welcome to the Expertiza project! =&lt;br /&gt;
&lt;br /&gt;
The Expertiza project is software to create reusable learning objects through peer review. It also supports team projects, and the submission of almost any document type, including URLs and wiki pages.&lt;br /&gt;
&lt;br /&gt;
== Short Powerpoint introductions ==&lt;br /&gt;
*My [http://research.csc.ncsu.edu/efg/expertiza/presentations/ELI_11_wiki_textbook.ppt presentation] on using Expertiza to support wiki-textbook creation, at the 2011 EDUCAUSE Learning Initiative conference, February 15, 2011&lt;br /&gt;
*My [http://research.csc.ncsu.edu/efg/expertiza/presentations/Purdue_TLT_2009.ppt plenary talk] at the Purdue TLT Conference on April 22, 2009&lt;br /&gt;
*We invite you to view the original [http://research.csc.ncsu.edu/efg/expertiza/presentations/Expertiza-short.htm rationale] for the system.&lt;br /&gt;
*You can walk through a [http://research.csc.ncsu.edu/efg/expertiza/presentations/Expertiza%20in%20Action.ppt virtual demo] of the system.&lt;br /&gt;
&lt;br /&gt;
== Papers ==&lt;br /&gt;
*A [http://innovateonline.info/index.php?view=article&amp;amp;id=365 prose rendition] of the rationale was published in [http://innovateonline.info/ Innovate] in 2007. (To view it, you need to register, and you will receive e-mail each time a new issue of this very interesting and useful journal is published.)&lt;br /&gt;
*Other papers on Expertiza can be found [http://research.csc.ncsu.edu/efg/expertiza/papers/ here].&lt;br /&gt;
&lt;br /&gt;
== Video presentations ==&lt;br /&gt;
&lt;br /&gt;
*An [http://connectpro86502729.na6.acrobat.com/p99048610/ overview] of Expertiza (&amp;quot;Software support for teamwork and authentic assessment [http://research.csc.ncsu.edu/efg/expertiza/presentations/TLT_Live.ppt  (slides)]&amp;quot;) from the TLT Group's Friday Live, September 24, 2010&lt;br /&gt;
*[https://sas.elluminate.com/site/external/recording/playback/link/dropin.jnlp?sid=2008350&amp;amp;suid=D.2D2E269EE524FD263F89DA6872A41E Student-authored wiki textbooks: Composition and review] from the 2011 Global Education Consortium, November 18, 2011&lt;br /&gt;
*This [http://educause.mediasite.com/mediasite/SilverlightPlayer/Default.aspx?peid=cdeebca6d1a34610923bcabd4c2d2fd91d session from EDUCAUSE ELI 2011] describes how Expertiza can be used to review wiki-textbook contributions.  It is an earlier version of the presentation above that includes a live demo. &lt;br /&gt;
*This Innovate [http://breeze.uliveandlearn.com/p10263667/ Webcast] from July 2007 includes the rationale and a demo of the system.&lt;br /&gt;
*A six-minute [http://www.youtube.com/watch?v=hVpS7qvC5Zs interview] from the 2009 Lilly Conference on College Teaching describes the goals and realization of the project.  (&amp;lt;i&amp;gt;Note:&amp;lt;/i&amp;gt; Background noise may be distracting.)&lt;br /&gt;
*This Innovate [http://breeze.uliveandlearn.com/p84785847/ Ideagora] discussion from January 2009 describes the social-networking features planned for Expertiza.&lt;br /&gt;
*[https://sas.elluminate.com/site/external/jwsdetect/playback.jnlp?psid=2009-03-17.1032.M.F13AAE88367AEE982449E713075D42.vcr Forming and managing student teams and peer feedback in Expertiza], a presentation at the UNC TLT conference in March 2009.&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
&lt;br /&gt;
*An [http://research.csc.ncsu.edu/efg/expertiza/reports/Instructor_documentation.doc instructor manual], explaining how to create an deploy an assignment in Expertiza.&lt;br /&gt;
*An [http://research.csc.ncsu.edu/efg/expertiza/presentations/videos/instructor.swf instructor video], slightly dated, showing how to create and deploy an assignment&lt;br /&gt;
*A [http://rajanalwan.com/ui_guidelines/ design document] for the application.&lt;br /&gt;
* A guide for [[Creating_Custom_Rubric]]&lt;br /&gt;
*For students, a [http://research.csc.ncsu.edu/efg/expertiza/presentations/student_documentation.ppt Powerpoint] or [http://research.csc.ncsu.edu/efg/expertiza/presentations/student_documentation.pdf PDF] presentation explaining how to submit and review an assignment with Expertiza.&lt;br /&gt;
*For students, a [http://research.csc.ncsu.edu/efg/expertiza/presentations/videos/student.swf video] showing how to use the system to submit and review an assignment.&lt;br /&gt;
*For students, a [http://research.csc.ncsu.edu/efg/expertiza/presentations/student_wiki_documentation.ppt Powerpoint] or [http://research.csc.ncsu.edu/efg/expertiza/presentations/student_wiki_documentation.pdf PDF] presentation explaining how to submit and review wiki pages with Expertiza.&lt;br /&gt;
*For students, a [http://courses.ncsu.edu/csc517/common/homework/topic-signup-team-formation.ppt Powerpoint] or [http://courses.ncsu.edu/csc517/common/homework/topic-signup-team-formation.pdf PDF] presentation explaining how to form teams and sign up for topics.&lt;br /&gt;
&lt;br /&gt;
== Developers section ==&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;
=== Development Environment Setup Guides ===&lt;br /&gt;
* [[Creating a Linux Development Environment for Expertiza - Installation Guide]]&lt;br /&gt;
**[http://wiki.expertiza.ncsu.edu/index.php/Development:Setup:Linux:Debian Development setup for Ubuntu/Debian]&lt;br /&gt;
* [[Development:Setup:OSX]]&lt;br /&gt;
*[http://wiki.expertiza.ncsu.edu/index.php/Development:Setup:Linux:RHEL  Development setup for Linux RHEL ]&lt;br /&gt;
*[[Developing Expertiza on the VCL]]&lt;br /&gt;
*Developing Expertiza on Virtual Box&lt;br /&gt;
** [https://drive.google.com/a/ncsu.edu/file/d/0B2vDvVjH76uEUmNKVncxRUhUVVE/view?usp=sharing Download the VirtualBox Ubuntu image here]&lt;br /&gt;
** [https://drive.google.com/open?id=1YlqiSsbZl8TfPuQmIFG7TYo2npWzqqu4 or try the Lubuntu image here if the Ubuntu image is too heavy for your PC/Laptop ]&lt;br /&gt;
*Docker image (Only if you are familiar with docker. You will need it if you choose Expertiza to do OSS project.)&lt;br /&gt;
** Please follow the instruction in https://hub.docker.com/r/winbobob/expertiza-fall2016/&lt;br /&gt;
&lt;br /&gt;
=== Database Guides ===&lt;br /&gt;
*[[Deploying and importing production data with capistrano]]&lt;br /&gt;
*[[Documentation on Database Tables]]&lt;br /&gt;
=== Security Guidelines ===&lt;br /&gt;
*[[Security guidelines for Expertiza]]&lt;br /&gt;
=== Git ===&lt;br /&gt;
*[[Version Control with the Git repository]]&lt;br /&gt;
*[http://wiki.expertiza.ncsu.edu/index.php/How_to_Begin_a_Project_from_the_Current_Expertiza_Repository How to Begin a Project from the Current Expertiza Repository]&lt;br /&gt;
&lt;br /&gt;
=== Ruby and Rails ===&lt;br /&gt;
*[[Restart Instructions for Expertiza]]&lt;br /&gt;
*[[Deploying Expertiza to Production]]&lt;br /&gt;
*[[Gem dependencies]]&lt;br /&gt;
*[[http://wiki.expertiza.ncsu.edu/index.php?title=Using_Cucumber_with_Expertiza Using Cucumber with Expertiza]]&lt;br /&gt;
&lt;br /&gt;
=== Misc ===&lt;br /&gt;
*[[Setting up and using TA functionality]]&lt;br /&gt;
*[[Restart instructions for Wiki]]&lt;br /&gt;
*[[Scoring &amp;amp; Grading Methods (Fall '21)]]&lt;br /&gt;
&lt;br /&gt;
=== Final Projects on Expertiza for Fall 2015 ===&lt;br /&gt;
[https://docs.google.com/document/d/1t0keeNQ2kP0NmcgIrtQXGi5K_GhQYcKzEVWJPPRBOHE/edit?pli=1 The Expertiza Final Project Submission] &amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
[http://expertiza.ncsu.edu The Expertiza application] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://research.csc.ncsu.edu/efg/expertiza/papers Papers on Expertiza] &amp;lt;br&amp;gt;&lt;br /&gt;
[http://research.csc.ncsu.edu/efg/expertiza/presentations/Expertiza-short.htm PowerPoint Presentation - The Expertiza platform]&amp;lt;br&amp;gt;&lt;br /&gt;
[http://www.csc.ncsu.edu/news/463 Expertiza Platform Takes Honorable Mention in Gertrude Cox Awards]&lt;br /&gt;
&lt;br /&gt;
== Acknowledgments ==&lt;br /&gt;
&lt;br /&gt;
This material is based upon work supported by the National Science Foundation under Grant No. 0536558.  Additional funding from the NCSU Learning in a Technology-Rich Environment (LITRE) program, the NCSU Faculty Center for Teaching and Learning, the NCSU STEM Initiative, and the Center for Advanced Computing and Communication.&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138926</id>
		<title>CSC/ECE 517 Spring 2021 - E2110. 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_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138926"/>
		<updated>2021-05-03T20:07:34Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* app/views/mailer/notify_review_rubric_change.html.erb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Members ==&lt;br /&gt;
*Nicholas Himes&lt;br /&gt;
&lt;br /&gt;
*Surya Makthal&lt;br /&gt;
&lt;br /&gt;
*Jordan Boerger&lt;br /&gt;
&lt;br /&gt;
*Sai Krishna Wupadrashta Dhinakara Subrahmanya&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
While setting up an assignment, the instructor will 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.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
If the instructor does edit or change a rubric while an assignment is in progress:&lt;br /&gt;
* If the change affects only the wording of a particular rubric item (e.g., to clarify the statement), no action is necessary.&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.  The system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.  (However, the response_map should not be changed.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''This project was done in Fall 2019. However, it was not tested thoroughly. Our team's work in Spring 2021 is to improve the testing and readability of the code.'''&lt;br /&gt;
&lt;br /&gt;
== Design Diagrams ==&lt;br /&gt;
=== Use Case Diagrams ===&lt;br /&gt;
''*Using UML Use Case Diagram Syntax''&lt;br /&gt;
&lt;br /&gt;
[[File:E2110_Use_Case_Diagram.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Data Flow Diagrams ===&lt;br /&gt;
''Note: This data flow diagram was originally made by the team from project E1982 in Fall 2019. Their wiki link can be viewed here: &lt;br /&gt;
&lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1982._Regulate_changing_of_rubrics_while_projects_are_in_progress''&lt;br /&gt;
&lt;br /&gt;
[[File:DesignFlow.png]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
We will write comprehensive tests and fix any bugs in the code written already for changing rubrics while projects are in progress.&lt;br /&gt;
&lt;br /&gt;
Some known issues already have been identified:&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** A method comment is needed on in_active_period method in answer_helper.rb&lt;br /&gt;
** Line-by-line comments are needed for all added functions&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** The method find_review_period is possibly redundant as Find deadlines does exist already in the code. This method needs to be replaced/removed if possible&lt;br /&gt;
** Split delete_existing_responses into more functions as it's complexity is reletively high&lt;br /&gt;
*** Contains some nested loops so these should be removed&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Email functionality needs to be thoroughly tested&lt;br /&gt;
** Tests need to be more thorough and verify that correct rows are being deleted for delete_existing_responses function in answer_helper.rb&lt;br /&gt;
** Confirm changes do not affect students who have not yet submitted their reviews by doing UI testing&lt;br /&gt;
&lt;br /&gt;
== Completed Solution ==&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** Added more extensive comments to all added functions and lines of code for better readability&lt;br /&gt;
** Added a popup confirmation message when deleting a question during active period similar to when adding a question to ensure instructor wants to delete all responses&lt;br /&gt;
** Destroy response object instead of individual answers when editing a questionnaire during active period to return all students who submitted reviews to the 'begin' stage rather than 'edit' and give them a fresh questionnaire&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** Split complicated functions from previous team, such as delete_existing_responses(), into more manageable and modular functions which only complete 1 main task&lt;br /&gt;
** Fixed email formatting for email sent to users when questionnaire is edited&lt;br /&gt;
** find_review_period() now uses find_due_dates() to search for assignment due dates. Reduced number of database calls in find_review_period() to reduce interaction, number of iterating loops, and incorporate DRY principles&lt;br /&gt;
** answer data in log_response_info() now uses hash format for better readability&lt;br /&gt;
** Local array and hash variables now instantiated correctly.&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Improved rspec tests for all files&lt;br /&gt;
** Confirmed that changes do not affect students that have not yet submitted their reviews&lt;br /&gt;
&lt;br /&gt;
== Flow ==&lt;br /&gt;
The main actions this project affects are adding and removing questions from a questionnaire. These diagrams will show how these events now occur. Because these events are handled differently in Expertiza, the implementation is slightly different for both cases.&lt;br /&gt;
&lt;br /&gt;
'''*Note:''' As you can see in the diagrams below, the confirmation popup is thrown in different ways for &amp;quot;Add&amp;quot; vs &amp;quot;Remove&amp;quot;. This is because in _questionnaire.html.erb:&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Add&amp;quot;''' is implemented as a submit_tag which can easily have a confirm: attribute added to it causing it to throw a popup within expertiza.&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Remove&amp;quot;''' is an &amp;lt;a&amp;gt; tag hyperlink rendered to the page by line &amp;lt;%=question.edit(i)%&amp;gt; which iterates through all questions in the questionnaire and renders their edit() functions. Edit() is a function in each question types model (criterion.rb, cake.rb, etc.). Edit() adds lines to the html for each field in the question table, including the &amp;quot;Remove&amp;quot; link. The &amp;quot;Remove&amp;quot; hyperlink has an href attribute which dynamically links to /questions/ + self.id.to_s based on the desired questions id. It then uses a data-method=&amp;quot;delete&amp;quot; attribute to select the destroy method in questions_controller.rb. Because this hyperlink exists in each question types model, it is hard to implement a clean solution which does not edit all the model files. To do this, we added a short &amp;lt;script&amp;gt; to the end of _questionnaire.html.erb which scans for &amp;lt;a&amp;gt; hyperlink redirects with the [data-method=&amp;quot;delete&amp;quot;] attribute and throws a popup within the browser rather than expertiza. This popup works the same as the &amp;quot;Add&amp;quot; popup. The script returns the result (true/false) of this popup to the &amp;lt;a&amp;gt; tag. In html, the redirect is cancelled if a false is returned to the tag and continues if a true is returned.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: none; background: none;&amp;quot;&lt;br /&gt;
! Adding question during active period&lt;br /&gt;
! Removing question during active period&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Add_Question_Diagram.png|500px]] || [[File:Remove_Question_Diagram.png|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
Here is a list of files and the functions that were added or edited, excluding rspec files.&lt;br /&gt;
=== app/helpers/answer_helper.rb ===&lt;br /&gt;
Helper module containing important functions for deletion of responses and answers when editing a questionnaire during review period.&lt;br /&gt;
* '''delete_existing_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
[[File:2110 img1.png]]&lt;br /&gt;
&lt;br /&gt;
Calls log_answer_responses and log_answer_info to store responses users made to the questionnaire. If review_mailer can mail these responses to the user then delete_answers destroys the response object.&lt;br /&gt;
* '''log_answer_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Given a list of question_ids and a questionnaire_id, gathers reponse_ids for all users responses to the questionnaire.&lt;br /&gt;
* '''log_response_info(response_ids)'''&lt;br /&gt;
Given a list of response_ids, gathers users responses to a questionnaire and records their comments in a hash along with their name, email, and the assignment name.&lt;br /&gt;
&lt;br /&gt;
''NOTE:'' The only issue we have found on this project stems from the way this function gets ''answers''. Sometimes these review comments are sent to users in an email, and sometimes they are not. Our issue here [https://github.com/BoergerJ/expertiza/issues/29] explains it in more detail.&lt;br /&gt;
* '''review_mailer(email, answers, name, assignment_name)'''&lt;br /&gt;
Given an email, answer list, name, and assignment name, calls notify_review_rubric_change() to send given information about previous review submission to user at given email.&lt;br /&gt;
* '''delete_answers(response_id)'''&lt;br /&gt;
[[File:2110_img2.png]]&lt;br /&gt;
&lt;br /&gt;
Given a response_id, set the response to be no longer submitted then destroy the response object. This destroys designated dependencies as well such as answers.&lt;br /&gt;
* '''in_active_period(questionnaire_id, answer=nil)'''&lt;br /&gt;
Given a questionnaire and possibly an answer, determine the assignment and round number. Use these to determine if the assignment is in a review period. Return true if in active period, false if not.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questionnaires_controller.rb ===&lt;br /&gt;
* '''add_new_questions'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questions_controller.rb ===&lt;br /&gt;
* '''destroy'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/mailers/mailer.rb ===&lt;br /&gt;
* '''notify_review_rubric_change(defn)'''&lt;br /&gt;
Mailer function which set necessary attributes for sending an email about a deleted response including previous answers. Calls mail() to send email to desired user.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment.rb ===&lt;br /&gt;
* '''find_review_period(round)'''&lt;br /&gt;
Determines the start and end dates of the rounds of an assignment and returns them.&lt;br /&gt;
Using previous teams code as a base, we changed this function to make minimal database calls and iterate fewer times.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment_questionnaire.rb ===&lt;br /&gt;
* '''get_latest_assignment(questionnaire_id)'''&lt;br /&gt;
Given questionnaire_id, returns assignment and round where questionnaire is used (if multiple questionnaires are used in an assignment)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/views/questionnaires/_questionnaire.html.erb ===&lt;br /&gt;
* Added in_active_period() call to display warning about edited questionnaire during active period&lt;br /&gt;
* Added confirm: to submit_tag 'Add' to display confirmation popup when adding a question during active period&lt;br /&gt;
* Added script to catch &amp;lt;a&amp;gt; tag redirects with [data-method=&amp;quot;delete&amp;quot;] to display popup when removing a question. Script only active if in active period.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/views/mailer/notify_review_rubric_change.html.erb ===&lt;br /&gt;
[[File:2110_img4.PNG]]&lt;br /&gt;
[[File:2110 img3.png]]&lt;br /&gt;
&lt;br /&gt;
* New file containing email layout used when emailing students their answers after questionnaire is edited during active period.&lt;br /&gt;
&lt;br /&gt;
== Changed Files ==&lt;br /&gt;
* Added:&lt;br /&gt;
** app/helpers/answer_helper.rb&lt;br /&gt;
** app/views/mailer/notify_review_rubric_change.html.erb&lt;br /&gt;
&lt;br /&gt;
* Edited:&lt;br /&gt;
** app/controllers/questionnaires_controller.rb&lt;br /&gt;
** app/controllers/questions_controller.rb&lt;br /&gt;
** app/mailers/mailer.rb&lt;br /&gt;
** app/models/assignment.rb&lt;br /&gt;
** app/models/assignment_questionnaire.rb&lt;br /&gt;
** app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
&lt;br /&gt;
* Test Case Files&lt;br /&gt;
** spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
** spec/models/assignment_spec.rb&lt;br /&gt;
** spec/controllers/questions_controller_spec.rb&lt;br /&gt;
** spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
Tests are created in the following files:&lt;br /&gt;
* spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
* spec/models/assignment_spec.rb&lt;br /&gt;
* spec/controllers/questions_controller_spec.rb&lt;br /&gt;
* spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
These tests cover the following cases:&lt;br /&gt;
* Adding questions to a questionnaire during the review period&lt;br /&gt;
* Adding questions to a questionnaire outside the review period&lt;br /&gt;
* Determining if an assignment is in the review period&lt;br /&gt;
* Determining if an assignment is outside the review period&lt;br /&gt;
* Finding the start and end dates for a specific review period of an assignment&lt;br /&gt;
* Finding the start and end dates for all review periods of an assignment&lt;br /&gt;
* Deleting existing responses resulting from changes made to questionnaires during the review period&lt;br /&gt;
* Deleting questions&lt;br /&gt;
&lt;br /&gt;
The same cases were also tested manually through the Expertiza UI, as shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
== Team Links ==&lt;br /&gt;
Here is the video our team recorded to show functionality:&lt;br /&gt;
[https://youtu.be/yibtRg3MsyQ]&lt;br /&gt;
&lt;br /&gt;
The link to our team's repository:&lt;br /&gt;
[https://github.com/BoergerJ/expertiza]&lt;br /&gt;
&lt;br /&gt;
The link to the Expertiza pull request for our project:&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1941]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138925</id>
		<title>CSC/ECE 517 Spring 2021 - E2110. 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_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138925"/>
		<updated>2021-05-03T20:06:59Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* app/views/mailer/notify_review_rubric_change.html.erb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Members ==&lt;br /&gt;
*Nicholas Himes&lt;br /&gt;
&lt;br /&gt;
*Surya Makthal&lt;br /&gt;
&lt;br /&gt;
*Jordan Boerger&lt;br /&gt;
&lt;br /&gt;
*Sai Krishna Wupadrashta Dhinakara Subrahmanya&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
While setting up an assignment, the instructor will 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.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
If the instructor does edit or change a rubric while an assignment is in progress:&lt;br /&gt;
* If the change affects only the wording of a particular rubric item (e.g., to clarify the statement), no action is necessary.&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.  The system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.  (However, the response_map should not be changed.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''This project was done in Fall 2019. However, it was not tested thoroughly. Our team's work in Spring 2021 is to improve the testing and readability of the code.'''&lt;br /&gt;
&lt;br /&gt;
== Design Diagrams ==&lt;br /&gt;
=== Use Case Diagrams ===&lt;br /&gt;
''*Using UML Use Case Diagram Syntax''&lt;br /&gt;
&lt;br /&gt;
[[File:E2110_Use_Case_Diagram.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Data Flow Diagrams ===&lt;br /&gt;
''Note: This data flow diagram was originally made by the team from project E1982 in Fall 2019. Their wiki link can be viewed here: &lt;br /&gt;
&lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1982._Regulate_changing_of_rubrics_while_projects_are_in_progress''&lt;br /&gt;
&lt;br /&gt;
[[File:DesignFlow.png]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
We will write comprehensive tests and fix any bugs in the code written already for changing rubrics while projects are in progress.&lt;br /&gt;
&lt;br /&gt;
Some known issues already have been identified:&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** A method comment is needed on in_active_period method in answer_helper.rb&lt;br /&gt;
** Line-by-line comments are needed for all added functions&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** The method find_review_period is possibly redundant as Find deadlines does exist already in the code. This method needs to be replaced/removed if possible&lt;br /&gt;
** Split delete_existing_responses into more functions as it's complexity is reletively high&lt;br /&gt;
*** Contains some nested loops so these should be removed&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Email functionality needs to be thoroughly tested&lt;br /&gt;
** Tests need to be more thorough and verify that correct rows are being deleted for delete_existing_responses function in answer_helper.rb&lt;br /&gt;
** Confirm changes do not affect students who have not yet submitted their reviews by doing UI testing&lt;br /&gt;
&lt;br /&gt;
== Completed Solution ==&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** Added more extensive comments to all added functions and lines of code for better readability&lt;br /&gt;
** Added a popup confirmation message when deleting a question during active period similar to when adding a question to ensure instructor wants to delete all responses&lt;br /&gt;
** Destroy response object instead of individual answers when editing a questionnaire during active period to return all students who submitted reviews to the 'begin' stage rather than 'edit' and give them a fresh questionnaire&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** Split complicated functions from previous team, such as delete_existing_responses(), into more manageable and modular functions which only complete 1 main task&lt;br /&gt;
** Fixed email formatting for email sent to users when questionnaire is edited&lt;br /&gt;
** find_review_period() now uses find_due_dates() to search for assignment due dates. Reduced number of database calls in find_review_period() to reduce interaction, number of iterating loops, and incorporate DRY principles&lt;br /&gt;
** answer data in log_response_info() now uses hash format for better readability&lt;br /&gt;
** Local array and hash variables now instantiated correctly.&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Improved rspec tests for all files&lt;br /&gt;
** Confirmed that changes do not affect students that have not yet submitted their reviews&lt;br /&gt;
&lt;br /&gt;
== Flow ==&lt;br /&gt;
The main actions this project affects are adding and removing questions from a questionnaire. These diagrams will show how these events now occur. Because these events are handled differently in Expertiza, the implementation is slightly different for both cases.&lt;br /&gt;
&lt;br /&gt;
'''*Note:''' As you can see in the diagrams below, the confirmation popup is thrown in different ways for &amp;quot;Add&amp;quot; vs &amp;quot;Remove&amp;quot;. This is because in _questionnaire.html.erb:&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Add&amp;quot;''' is implemented as a submit_tag which can easily have a confirm: attribute added to it causing it to throw a popup within expertiza.&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Remove&amp;quot;''' is an &amp;lt;a&amp;gt; tag hyperlink rendered to the page by line &amp;lt;%=question.edit(i)%&amp;gt; which iterates through all questions in the questionnaire and renders their edit() functions. Edit() is a function in each question types model (criterion.rb, cake.rb, etc.). Edit() adds lines to the html for each field in the question table, including the &amp;quot;Remove&amp;quot; link. The &amp;quot;Remove&amp;quot; hyperlink has an href attribute which dynamically links to /questions/ + self.id.to_s based on the desired questions id. It then uses a data-method=&amp;quot;delete&amp;quot; attribute to select the destroy method in questions_controller.rb. Because this hyperlink exists in each question types model, it is hard to implement a clean solution which does not edit all the model files. To do this, we added a short &amp;lt;script&amp;gt; to the end of _questionnaire.html.erb which scans for &amp;lt;a&amp;gt; hyperlink redirects with the [data-method=&amp;quot;delete&amp;quot;] attribute and throws a popup within the browser rather than expertiza. This popup works the same as the &amp;quot;Add&amp;quot; popup. The script returns the result (true/false) of this popup to the &amp;lt;a&amp;gt; tag. In html, the redirect is cancelled if a false is returned to the tag and continues if a true is returned.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: none; background: none;&amp;quot;&lt;br /&gt;
! Adding question during active period&lt;br /&gt;
! Removing question during active period&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Add_Question_Diagram.png|500px]] || [[File:Remove_Question_Diagram.png|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
Here is a list of files and the functions that were added or edited, excluding rspec files.&lt;br /&gt;
=== app/helpers/answer_helper.rb ===&lt;br /&gt;
Helper module containing important functions for deletion of responses and answers when editing a questionnaire during review period.&lt;br /&gt;
* '''delete_existing_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
[[File:2110 img1.png]]&lt;br /&gt;
&lt;br /&gt;
Calls log_answer_responses and log_answer_info to store responses users made to the questionnaire. If review_mailer can mail these responses to the user then delete_answers destroys the response object.&lt;br /&gt;
* '''log_answer_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Given a list of question_ids and a questionnaire_id, gathers reponse_ids for all users responses to the questionnaire.&lt;br /&gt;
* '''log_response_info(response_ids)'''&lt;br /&gt;
Given a list of response_ids, gathers users responses to a questionnaire and records their comments in a hash along with their name, email, and the assignment name.&lt;br /&gt;
&lt;br /&gt;
''NOTE:'' The only issue we have found on this project stems from the way this function gets ''answers''. Sometimes these review comments are sent to users in an email, and sometimes they are not. Our issue here [https://github.com/BoergerJ/expertiza/issues/29] explains it in more detail.&lt;br /&gt;
* '''review_mailer(email, answers, name, assignment_name)'''&lt;br /&gt;
Given an email, answer list, name, and assignment name, calls notify_review_rubric_change() to send given information about previous review submission to user at given email.&lt;br /&gt;
* '''delete_answers(response_id)'''&lt;br /&gt;
[[File:2110_img2.png]]&lt;br /&gt;
&lt;br /&gt;
Given a response_id, set the response to be no longer submitted then destroy the response object. This destroys designated dependencies as well such as answers.&lt;br /&gt;
* '''in_active_period(questionnaire_id, answer=nil)'''&lt;br /&gt;
Given a questionnaire and possibly an answer, determine the assignment and round number. Use these to determine if the assignment is in a review period. Return true if in active period, false if not.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questionnaires_controller.rb ===&lt;br /&gt;
* '''add_new_questions'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questions_controller.rb ===&lt;br /&gt;
* '''destroy'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/mailers/mailer.rb ===&lt;br /&gt;
* '''notify_review_rubric_change(defn)'''&lt;br /&gt;
Mailer function which set necessary attributes for sending an email about a deleted response including previous answers. Calls mail() to send email to desired user.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment.rb ===&lt;br /&gt;
* '''find_review_period(round)'''&lt;br /&gt;
Determines the start and end dates of the rounds of an assignment and returns them.&lt;br /&gt;
Using previous teams code as a base, we changed this function to make minimal database calls and iterate fewer times.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment_questionnaire.rb ===&lt;br /&gt;
* '''get_latest_assignment(questionnaire_id)'''&lt;br /&gt;
Given questionnaire_id, returns assignment and round where questionnaire is used (if multiple questionnaires are used in an assignment)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/views/questionnaires/_questionnaire.html.erb ===&lt;br /&gt;
* Added in_active_period() call to display warning about edited questionnaire during active period&lt;br /&gt;
* Added confirm: to submit_tag 'Add' to display confirmation popup when adding a question during active period&lt;br /&gt;
* Added script to catch &amp;lt;a&amp;gt; tag redirects with [data-method=&amp;quot;delete&amp;quot;] to display popup when removing a question. Script only active if in active period.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/views/mailer/notify_review_rubric_change.html.erb ===&lt;br /&gt;
[[File:2110_img4.png]]&lt;br /&gt;
[[File:2110 img3.png]]&lt;br /&gt;
&lt;br /&gt;
* New file containing email layout used when emailing students their answers after questionnaire is edited during active period.&lt;br /&gt;
&lt;br /&gt;
== Changed Files ==&lt;br /&gt;
* Added:&lt;br /&gt;
** app/helpers/answer_helper.rb&lt;br /&gt;
** app/views/mailer/notify_review_rubric_change.html.erb&lt;br /&gt;
&lt;br /&gt;
* Edited:&lt;br /&gt;
** app/controllers/questionnaires_controller.rb&lt;br /&gt;
** app/controllers/questions_controller.rb&lt;br /&gt;
** app/mailers/mailer.rb&lt;br /&gt;
** app/models/assignment.rb&lt;br /&gt;
** app/models/assignment_questionnaire.rb&lt;br /&gt;
** app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
&lt;br /&gt;
* Test Case Files&lt;br /&gt;
** spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
** spec/models/assignment_spec.rb&lt;br /&gt;
** spec/controllers/questions_controller_spec.rb&lt;br /&gt;
** spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
Tests are created in the following files:&lt;br /&gt;
* spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
* spec/models/assignment_spec.rb&lt;br /&gt;
* spec/controllers/questions_controller_spec.rb&lt;br /&gt;
* spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
These tests cover the following cases:&lt;br /&gt;
* Adding questions to a questionnaire during the review period&lt;br /&gt;
* Adding questions to a questionnaire outside the review period&lt;br /&gt;
* Determining if an assignment is in the review period&lt;br /&gt;
* Determining if an assignment is outside the review period&lt;br /&gt;
* Finding the start and end dates for a specific review period of an assignment&lt;br /&gt;
* Finding the start and end dates for all review periods of an assignment&lt;br /&gt;
* Deleting existing responses resulting from changes made to questionnaires during the review period&lt;br /&gt;
* Deleting questions&lt;br /&gt;
&lt;br /&gt;
The same cases were also tested manually through the Expertiza UI, as shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
== Team Links ==&lt;br /&gt;
Here is the video our team recorded to show functionality:&lt;br /&gt;
[https://youtu.be/yibtRg3MsyQ]&lt;br /&gt;
&lt;br /&gt;
The link to our team's repository:&lt;br /&gt;
[https://github.com/BoergerJ/expertiza]&lt;br /&gt;
&lt;br /&gt;
The link to the Expertiza pull request for our project:&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1941]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138924</id>
		<title>CSC/ECE 517 Spring 2021 - E2110. 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_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138924"/>
		<updated>2021-05-03T20:06:33Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* app/views/mailer/notify_review_rubric_change.html.erb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Members ==&lt;br /&gt;
*Nicholas Himes&lt;br /&gt;
&lt;br /&gt;
*Surya Makthal&lt;br /&gt;
&lt;br /&gt;
*Jordan Boerger&lt;br /&gt;
&lt;br /&gt;
*Sai Krishna Wupadrashta Dhinakara Subrahmanya&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
While setting up an assignment, the instructor will 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.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
If the instructor does edit or change a rubric while an assignment is in progress:&lt;br /&gt;
* If the change affects only the wording of a particular rubric item (e.g., to clarify the statement), no action is necessary.&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.  The system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.  (However, the response_map should not be changed.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''This project was done in Fall 2019. However, it was not tested thoroughly. Our team's work in Spring 2021 is to improve the testing and readability of the code.'''&lt;br /&gt;
&lt;br /&gt;
== Design Diagrams ==&lt;br /&gt;
=== Use Case Diagrams ===&lt;br /&gt;
''*Using UML Use Case Diagram Syntax''&lt;br /&gt;
&lt;br /&gt;
[[File:E2110_Use_Case_Diagram.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Data Flow Diagrams ===&lt;br /&gt;
''Note: This data flow diagram was originally made by the team from project E1982 in Fall 2019. Their wiki link can be viewed here: &lt;br /&gt;
&lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1982._Regulate_changing_of_rubrics_while_projects_are_in_progress''&lt;br /&gt;
&lt;br /&gt;
[[File:DesignFlow.png]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
We will write comprehensive tests and fix any bugs in the code written already for changing rubrics while projects are in progress.&lt;br /&gt;
&lt;br /&gt;
Some known issues already have been identified:&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** A method comment is needed on in_active_period method in answer_helper.rb&lt;br /&gt;
** Line-by-line comments are needed for all added functions&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** The method find_review_period is possibly redundant as Find deadlines does exist already in the code. This method needs to be replaced/removed if possible&lt;br /&gt;
** Split delete_existing_responses into more functions as it's complexity is reletively high&lt;br /&gt;
*** Contains some nested loops so these should be removed&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Email functionality needs to be thoroughly tested&lt;br /&gt;
** Tests need to be more thorough and verify that correct rows are being deleted for delete_existing_responses function in answer_helper.rb&lt;br /&gt;
** Confirm changes do not affect students who have not yet submitted their reviews by doing UI testing&lt;br /&gt;
&lt;br /&gt;
== Completed Solution ==&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** Added more extensive comments to all added functions and lines of code for better readability&lt;br /&gt;
** Added a popup confirmation message when deleting a question during active period similar to when adding a question to ensure instructor wants to delete all responses&lt;br /&gt;
** Destroy response object instead of individual answers when editing a questionnaire during active period to return all students who submitted reviews to the 'begin' stage rather than 'edit' and give them a fresh questionnaire&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** Split complicated functions from previous team, such as delete_existing_responses(), into more manageable and modular functions which only complete 1 main task&lt;br /&gt;
** Fixed email formatting for email sent to users when questionnaire is edited&lt;br /&gt;
** find_review_period() now uses find_due_dates() to search for assignment due dates. Reduced number of database calls in find_review_period() to reduce interaction, number of iterating loops, and incorporate DRY principles&lt;br /&gt;
** answer data in log_response_info() now uses hash format for better readability&lt;br /&gt;
** Local array and hash variables now instantiated correctly.&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Improved rspec tests for all files&lt;br /&gt;
** Confirmed that changes do not affect students that have not yet submitted their reviews&lt;br /&gt;
&lt;br /&gt;
== Flow ==&lt;br /&gt;
The main actions this project affects are adding and removing questions from a questionnaire. These diagrams will show how these events now occur. Because these events are handled differently in Expertiza, the implementation is slightly different for both cases.&lt;br /&gt;
&lt;br /&gt;
'''*Note:''' As you can see in the diagrams below, the confirmation popup is thrown in different ways for &amp;quot;Add&amp;quot; vs &amp;quot;Remove&amp;quot;. This is because in _questionnaire.html.erb:&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Add&amp;quot;''' is implemented as a submit_tag which can easily have a confirm: attribute added to it causing it to throw a popup within expertiza.&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Remove&amp;quot;''' is an &amp;lt;a&amp;gt; tag hyperlink rendered to the page by line &amp;lt;%=question.edit(i)%&amp;gt; which iterates through all questions in the questionnaire and renders their edit() functions. Edit() is a function in each question types model (criterion.rb, cake.rb, etc.). Edit() adds lines to the html for each field in the question table, including the &amp;quot;Remove&amp;quot; link. The &amp;quot;Remove&amp;quot; hyperlink has an href attribute which dynamically links to /questions/ + self.id.to_s based on the desired questions id. It then uses a data-method=&amp;quot;delete&amp;quot; attribute to select the destroy method in questions_controller.rb. Because this hyperlink exists in each question types model, it is hard to implement a clean solution which does not edit all the model files. To do this, we added a short &amp;lt;script&amp;gt; to the end of _questionnaire.html.erb which scans for &amp;lt;a&amp;gt; hyperlink redirects with the [data-method=&amp;quot;delete&amp;quot;] attribute and throws a popup within the browser rather than expertiza. This popup works the same as the &amp;quot;Add&amp;quot; popup. The script returns the result (true/false) of this popup to the &amp;lt;a&amp;gt; tag. In html, the redirect is cancelled if a false is returned to the tag and continues if a true is returned.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: none; background: none;&amp;quot;&lt;br /&gt;
! Adding question during active period&lt;br /&gt;
! Removing question during active period&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Add_Question_Diagram.png|500px]] || [[File:Remove_Question_Diagram.png|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
Here is a list of files and the functions that were added or edited, excluding rspec files.&lt;br /&gt;
=== app/helpers/answer_helper.rb ===&lt;br /&gt;
Helper module containing important functions for deletion of responses and answers when editing a questionnaire during review period.&lt;br /&gt;
* '''delete_existing_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
[[File:2110 img1.png]]&lt;br /&gt;
&lt;br /&gt;
Calls log_answer_responses and log_answer_info to store responses users made to the questionnaire. If review_mailer can mail these responses to the user then delete_answers destroys the response object.&lt;br /&gt;
* '''log_answer_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Given a list of question_ids and a questionnaire_id, gathers reponse_ids for all users responses to the questionnaire.&lt;br /&gt;
* '''log_response_info(response_ids)'''&lt;br /&gt;
Given a list of response_ids, gathers users responses to a questionnaire and records their comments in a hash along with their name, email, and the assignment name.&lt;br /&gt;
&lt;br /&gt;
''NOTE:'' The only issue we have found on this project stems from the way this function gets ''answers''. Sometimes these review comments are sent to users in an email, and sometimes they are not. Our issue here [https://github.com/BoergerJ/expertiza/issues/29] explains it in more detail.&lt;br /&gt;
* '''review_mailer(email, answers, name, assignment_name)'''&lt;br /&gt;
Given an email, answer list, name, and assignment name, calls notify_review_rubric_change() to send given information about previous review submission to user at given email.&lt;br /&gt;
* '''delete_answers(response_id)'''&lt;br /&gt;
[[File:2110_img2.png]]&lt;br /&gt;
&lt;br /&gt;
Given a response_id, set the response to be no longer submitted then destroy the response object. This destroys designated dependencies as well such as answers.&lt;br /&gt;
* '''in_active_period(questionnaire_id, answer=nil)'''&lt;br /&gt;
Given a questionnaire and possibly an answer, determine the assignment and round number. Use these to determine if the assignment is in a review period. Return true if in active period, false if not.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questionnaires_controller.rb ===&lt;br /&gt;
* '''add_new_questions'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questions_controller.rb ===&lt;br /&gt;
* '''destroy'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/mailers/mailer.rb ===&lt;br /&gt;
* '''notify_review_rubric_change(defn)'''&lt;br /&gt;
Mailer function which set necessary attributes for sending an email about a deleted response including previous answers. Calls mail() to send email to desired user.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment.rb ===&lt;br /&gt;
* '''find_review_period(round)'''&lt;br /&gt;
Determines the start and end dates of the rounds of an assignment and returns them.&lt;br /&gt;
Using previous teams code as a base, we changed this function to make minimal database calls and iterate fewer times.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment_questionnaire.rb ===&lt;br /&gt;
* '''get_latest_assignment(questionnaire_id)'''&lt;br /&gt;
Given questionnaire_id, returns assignment and round where questionnaire is used (if multiple questionnaires are used in an assignment)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/views/questionnaires/_questionnaire.html.erb ===&lt;br /&gt;
* Added in_active_period() call to display warning about edited questionnaire during active period&lt;br /&gt;
* Added confirm: to submit_tag 'Add' to display confirmation popup when adding a question during active period&lt;br /&gt;
* Added script to catch &amp;lt;a&amp;gt; tag redirects with [data-method=&amp;quot;delete&amp;quot;] to display popup when removing a question. Script only active if in active period.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/views/mailer/notify_review_rubric_change.html.erb ===&lt;br /&gt;
[[File:2110 img4.png]]&lt;br /&gt;
[[File:2110 img3.png]]&lt;br /&gt;
&lt;br /&gt;
* New file containing email layout used when emailing students their answers after questionnaire is edited during active period.&lt;br /&gt;
&lt;br /&gt;
== Changed Files ==&lt;br /&gt;
* Added:&lt;br /&gt;
** app/helpers/answer_helper.rb&lt;br /&gt;
** app/views/mailer/notify_review_rubric_change.html.erb&lt;br /&gt;
&lt;br /&gt;
* Edited:&lt;br /&gt;
** app/controllers/questionnaires_controller.rb&lt;br /&gt;
** app/controllers/questions_controller.rb&lt;br /&gt;
** app/mailers/mailer.rb&lt;br /&gt;
** app/models/assignment.rb&lt;br /&gt;
** app/models/assignment_questionnaire.rb&lt;br /&gt;
** app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
&lt;br /&gt;
* Test Case Files&lt;br /&gt;
** spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
** spec/models/assignment_spec.rb&lt;br /&gt;
** spec/controllers/questions_controller_spec.rb&lt;br /&gt;
** spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
Tests are created in the following files:&lt;br /&gt;
* spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
* spec/models/assignment_spec.rb&lt;br /&gt;
* spec/controllers/questions_controller_spec.rb&lt;br /&gt;
* spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
These tests cover the following cases:&lt;br /&gt;
* Adding questions to a questionnaire during the review period&lt;br /&gt;
* Adding questions to a questionnaire outside the review period&lt;br /&gt;
* Determining if an assignment is in the review period&lt;br /&gt;
* Determining if an assignment is outside the review period&lt;br /&gt;
* Finding the start and end dates for a specific review period of an assignment&lt;br /&gt;
* Finding the start and end dates for all review periods of an assignment&lt;br /&gt;
* Deleting existing responses resulting from changes made to questionnaires during the review period&lt;br /&gt;
* Deleting questions&lt;br /&gt;
&lt;br /&gt;
The same cases were also tested manually through the Expertiza UI, as shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
== Team Links ==&lt;br /&gt;
Here is the video our team recorded to show functionality:&lt;br /&gt;
[https://youtu.be/yibtRg3MsyQ]&lt;br /&gt;
&lt;br /&gt;
The link to our team's repository:&lt;br /&gt;
[https://github.com/BoergerJ/expertiza]&lt;br /&gt;
&lt;br /&gt;
The link to the Expertiza pull request for our project:&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1941]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138923</id>
		<title>CSC/ECE 517 Spring 2021 - E2110. 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_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138923"/>
		<updated>2021-05-03T20:06:15Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* app/views/mailer/notify_review_rubric_change.html.erb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Members ==&lt;br /&gt;
*Nicholas Himes&lt;br /&gt;
&lt;br /&gt;
*Surya Makthal&lt;br /&gt;
&lt;br /&gt;
*Jordan Boerger&lt;br /&gt;
&lt;br /&gt;
*Sai Krishna Wupadrashta Dhinakara Subrahmanya&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
While setting up an assignment, the instructor will 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.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
If the instructor does edit or change a rubric while an assignment is in progress:&lt;br /&gt;
* If the change affects only the wording of a particular rubric item (e.g., to clarify the statement), no action is necessary.&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.  The system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.  (However, the response_map should not be changed.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''This project was done in Fall 2019. However, it was not tested thoroughly. Our team's work in Spring 2021 is to improve the testing and readability of the code.'''&lt;br /&gt;
&lt;br /&gt;
== Design Diagrams ==&lt;br /&gt;
=== Use Case Diagrams ===&lt;br /&gt;
''*Using UML Use Case Diagram Syntax''&lt;br /&gt;
&lt;br /&gt;
[[File:E2110_Use_Case_Diagram.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Data Flow Diagrams ===&lt;br /&gt;
''Note: This data flow diagram was originally made by the team from project E1982 in Fall 2019. Their wiki link can be viewed here: &lt;br /&gt;
&lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1982._Regulate_changing_of_rubrics_while_projects_are_in_progress''&lt;br /&gt;
&lt;br /&gt;
[[File:DesignFlow.png]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
We will write comprehensive tests and fix any bugs in the code written already for changing rubrics while projects are in progress.&lt;br /&gt;
&lt;br /&gt;
Some known issues already have been identified:&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** A method comment is needed on in_active_period method in answer_helper.rb&lt;br /&gt;
** Line-by-line comments are needed for all added functions&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** The method find_review_period is possibly redundant as Find deadlines does exist already in the code. This method needs to be replaced/removed if possible&lt;br /&gt;
** Split delete_existing_responses into more functions as it's complexity is reletively high&lt;br /&gt;
*** Contains some nested loops so these should be removed&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Email functionality needs to be thoroughly tested&lt;br /&gt;
** Tests need to be more thorough and verify that correct rows are being deleted for delete_existing_responses function in answer_helper.rb&lt;br /&gt;
** Confirm changes do not affect students who have not yet submitted their reviews by doing UI testing&lt;br /&gt;
&lt;br /&gt;
== Completed Solution ==&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** Added more extensive comments to all added functions and lines of code for better readability&lt;br /&gt;
** Added a popup confirmation message when deleting a question during active period similar to when adding a question to ensure instructor wants to delete all responses&lt;br /&gt;
** Destroy response object instead of individual answers when editing a questionnaire during active period to return all students who submitted reviews to the 'begin' stage rather than 'edit' and give them a fresh questionnaire&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** Split complicated functions from previous team, such as delete_existing_responses(), into more manageable and modular functions which only complete 1 main task&lt;br /&gt;
** Fixed email formatting for email sent to users when questionnaire is edited&lt;br /&gt;
** find_review_period() now uses find_due_dates() to search for assignment due dates. Reduced number of database calls in find_review_period() to reduce interaction, number of iterating loops, and incorporate DRY principles&lt;br /&gt;
** answer data in log_response_info() now uses hash format for better readability&lt;br /&gt;
** Local array and hash variables now instantiated correctly.&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Improved rspec tests for all files&lt;br /&gt;
** Confirmed that changes do not affect students that have not yet submitted their reviews&lt;br /&gt;
&lt;br /&gt;
== Flow ==&lt;br /&gt;
The main actions this project affects are adding and removing questions from a questionnaire. These diagrams will show how these events now occur. Because these events are handled differently in Expertiza, the implementation is slightly different for both cases.&lt;br /&gt;
&lt;br /&gt;
'''*Note:''' As you can see in the diagrams below, the confirmation popup is thrown in different ways for &amp;quot;Add&amp;quot; vs &amp;quot;Remove&amp;quot;. This is because in _questionnaire.html.erb:&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Add&amp;quot;''' is implemented as a submit_tag which can easily have a confirm: attribute added to it causing it to throw a popup within expertiza.&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Remove&amp;quot;''' is an &amp;lt;a&amp;gt; tag hyperlink rendered to the page by line &amp;lt;%=question.edit(i)%&amp;gt; which iterates through all questions in the questionnaire and renders their edit() functions. Edit() is a function in each question types model (criterion.rb, cake.rb, etc.). Edit() adds lines to the html for each field in the question table, including the &amp;quot;Remove&amp;quot; link. The &amp;quot;Remove&amp;quot; hyperlink has an href attribute which dynamically links to /questions/ + self.id.to_s based on the desired questions id. It then uses a data-method=&amp;quot;delete&amp;quot; attribute to select the destroy method in questions_controller.rb. Because this hyperlink exists in each question types model, it is hard to implement a clean solution which does not edit all the model files. To do this, we added a short &amp;lt;script&amp;gt; to the end of _questionnaire.html.erb which scans for &amp;lt;a&amp;gt; hyperlink redirects with the [data-method=&amp;quot;delete&amp;quot;] attribute and throws a popup within the browser rather than expertiza. This popup works the same as the &amp;quot;Add&amp;quot; popup. The script returns the result (true/false) of this popup to the &amp;lt;a&amp;gt; tag. In html, the redirect is cancelled if a false is returned to the tag and continues if a true is returned.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: none; background: none;&amp;quot;&lt;br /&gt;
! Adding question during active period&lt;br /&gt;
! Removing question during active period&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Add_Question_Diagram.png|500px]] || [[File:Remove_Question_Diagram.png|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
Here is a list of files and the functions that were added or edited, excluding rspec files.&lt;br /&gt;
=== app/helpers/answer_helper.rb ===&lt;br /&gt;
Helper module containing important functions for deletion of responses and answers when editing a questionnaire during review period.&lt;br /&gt;
* '''delete_existing_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
[[File:2110 img1.png]]&lt;br /&gt;
&lt;br /&gt;
Calls log_answer_responses and log_answer_info to store responses users made to the questionnaire. If review_mailer can mail these responses to the user then delete_answers destroys the response object.&lt;br /&gt;
* '''log_answer_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Given a list of question_ids and a questionnaire_id, gathers reponse_ids for all users responses to the questionnaire.&lt;br /&gt;
* '''log_response_info(response_ids)'''&lt;br /&gt;
Given a list of response_ids, gathers users responses to a questionnaire and records their comments in a hash along with their name, email, and the assignment name.&lt;br /&gt;
&lt;br /&gt;
''NOTE:'' The only issue we have found on this project stems from the way this function gets ''answers''. Sometimes these review comments are sent to users in an email, and sometimes they are not. Our issue here [https://github.com/BoergerJ/expertiza/issues/29] explains it in more detail.&lt;br /&gt;
* '''review_mailer(email, answers, name, assignment_name)'''&lt;br /&gt;
Given an email, answer list, name, and assignment name, calls notify_review_rubric_change() to send given information about previous review submission to user at given email.&lt;br /&gt;
* '''delete_answers(response_id)'''&lt;br /&gt;
[[File:2110_img2.png]]&lt;br /&gt;
&lt;br /&gt;
Given a response_id, set the response to be no longer submitted then destroy the response object. This destroys designated dependencies as well such as answers.&lt;br /&gt;
* '''in_active_period(questionnaire_id, answer=nil)'''&lt;br /&gt;
Given a questionnaire and possibly an answer, determine the assignment and round number. Use these to determine if the assignment is in a review period. Return true if in active period, false if not.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questionnaires_controller.rb ===&lt;br /&gt;
* '''add_new_questions'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questions_controller.rb ===&lt;br /&gt;
* '''destroy'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/mailers/mailer.rb ===&lt;br /&gt;
* '''notify_review_rubric_change(defn)'''&lt;br /&gt;
Mailer function which set necessary attributes for sending an email about a deleted response including previous answers. Calls mail() to send email to desired user.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment.rb ===&lt;br /&gt;
* '''find_review_period(round)'''&lt;br /&gt;
Determines the start and end dates of the rounds of an assignment and returns them.&lt;br /&gt;
Using previous teams code as a base, we changed this function to make minimal database calls and iterate fewer times.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment_questionnaire.rb ===&lt;br /&gt;
* '''get_latest_assignment(questionnaire_id)'''&lt;br /&gt;
Given questionnaire_id, returns assignment and round where questionnaire is used (if multiple questionnaires are used in an assignment)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/views/questionnaires/_questionnaire.html.erb ===&lt;br /&gt;
* Added in_active_period() call to display warning about edited questionnaire during active period&lt;br /&gt;
* Added confirm: to submit_tag 'Add' to display confirmation popup when adding a question during active period&lt;br /&gt;
* Added script to catch &amp;lt;a&amp;gt; tag redirects with [data-method=&amp;quot;delete&amp;quot;] to display popup when removing a question. Script only active if in active period.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/views/mailer/notify_review_rubric_change.html.erb ===&lt;br /&gt;
[[File:2110_img4.png]]&lt;br /&gt;
[[File:2110 img3.png]]&lt;br /&gt;
&lt;br /&gt;
* New file containing email layout used when emailing students their answers after questionnaire is edited during active period.&lt;br /&gt;
&lt;br /&gt;
== Changed Files ==&lt;br /&gt;
* Added:&lt;br /&gt;
** app/helpers/answer_helper.rb&lt;br /&gt;
** app/views/mailer/notify_review_rubric_change.html.erb&lt;br /&gt;
&lt;br /&gt;
* Edited:&lt;br /&gt;
** app/controllers/questionnaires_controller.rb&lt;br /&gt;
** app/controllers/questions_controller.rb&lt;br /&gt;
** app/mailers/mailer.rb&lt;br /&gt;
** app/models/assignment.rb&lt;br /&gt;
** app/models/assignment_questionnaire.rb&lt;br /&gt;
** app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
&lt;br /&gt;
* Test Case Files&lt;br /&gt;
** spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
** spec/models/assignment_spec.rb&lt;br /&gt;
** spec/controllers/questions_controller_spec.rb&lt;br /&gt;
** spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
Tests are created in the following files:&lt;br /&gt;
* spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
* spec/models/assignment_spec.rb&lt;br /&gt;
* spec/controllers/questions_controller_spec.rb&lt;br /&gt;
* spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
These tests cover the following cases:&lt;br /&gt;
* Adding questions to a questionnaire during the review period&lt;br /&gt;
* Adding questions to a questionnaire outside the review period&lt;br /&gt;
* Determining if an assignment is in the review period&lt;br /&gt;
* Determining if an assignment is outside the review period&lt;br /&gt;
* Finding the start and end dates for a specific review period of an assignment&lt;br /&gt;
* Finding the start and end dates for all review periods of an assignment&lt;br /&gt;
* Deleting existing responses resulting from changes made to questionnaires during the review period&lt;br /&gt;
* Deleting questions&lt;br /&gt;
&lt;br /&gt;
The same cases were also tested manually through the Expertiza UI, as shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
== Team Links ==&lt;br /&gt;
Here is the video our team recorded to show functionality:&lt;br /&gt;
[https://youtu.be/yibtRg3MsyQ]&lt;br /&gt;
&lt;br /&gt;
The link to our team's repository:&lt;br /&gt;
[https://github.com/BoergerJ/expertiza]&lt;br /&gt;
&lt;br /&gt;
The link to the Expertiza pull request for our project:&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1941]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138922</id>
		<title>CSC/ECE 517 Spring 2021 - E2110. 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_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138922"/>
		<updated>2021-05-03T20:06:05Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* app/views/mailer/notify_review_rubric_change.html.erb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Members ==&lt;br /&gt;
*Nicholas Himes&lt;br /&gt;
&lt;br /&gt;
*Surya Makthal&lt;br /&gt;
&lt;br /&gt;
*Jordan Boerger&lt;br /&gt;
&lt;br /&gt;
*Sai Krishna Wupadrashta Dhinakara Subrahmanya&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
While setting up an assignment, the instructor will 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.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
If the instructor does edit or change a rubric while an assignment is in progress:&lt;br /&gt;
* If the change affects only the wording of a particular rubric item (e.g., to clarify the statement), no action is necessary.&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.  The system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.  (However, the response_map should not be changed.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''This project was done in Fall 2019. However, it was not tested thoroughly. Our team's work in Spring 2021 is to improve the testing and readability of the code.'''&lt;br /&gt;
&lt;br /&gt;
== Design Diagrams ==&lt;br /&gt;
=== Use Case Diagrams ===&lt;br /&gt;
''*Using UML Use Case Diagram Syntax''&lt;br /&gt;
&lt;br /&gt;
[[File:E2110_Use_Case_Diagram.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Data Flow Diagrams ===&lt;br /&gt;
''Note: This data flow diagram was originally made by the team from project E1982 in Fall 2019. Their wiki link can be viewed here: &lt;br /&gt;
&lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1982._Regulate_changing_of_rubrics_while_projects_are_in_progress''&lt;br /&gt;
&lt;br /&gt;
[[File:DesignFlow.png]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
We will write comprehensive tests and fix any bugs in the code written already for changing rubrics while projects are in progress.&lt;br /&gt;
&lt;br /&gt;
Some known issues already have been identified:&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** A method comment is needed on in_active_period method in answer_helper.rb&lt;br /&gt;
** Line-by-line comments are needed for all added functions&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** The method find_review_period is possibly redundant as Find deadlines does exist already in the code. This method needs to be replaced/removed if possible&lt;br /&gt;
** Split delete_existing_responses into more functions as it's complexity is reletively high&lt;br /&gt;
*** Contains some nested loops so these should be removed&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Email functionality needs to be thoroughly tested&lt;br /&gt;
** Tests need to be more thorough and verify that correct rows are being deleted for delete_existing_responses function in answer_helper.rb&lt;br /&gt;
** Confirm changes do not affect students who have not yet submitted their reviews by doing UI testing&lt;br /&gt;
&lt;br /&gt;
== Completed Solution ==&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** Added more extensive comments to all added functions and lines of code for better readability&lt;br /&gt;
** Added a popup confirmation message when deleting a question during active period similar to when adding a question to ensure instructor wants to delete all responses&lt;br /&gt;
** Destroy response object instead of individual answers when editing a questionnaire during active period to return all students who submitted reviews to the 'begin' stage rather than 'edit' and give them a fresh questionnaire&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** Split complicated functions from previous team, such as delete_existing_responses(), into more manageable and modular functions which only complete 1 main task&lt;br /&gt;
** Fixed email formatting for email sent to users when questionnaire is edited&lt;br /&gt;
** find_review_period() now uses find_due_dates() to search for assignment due dates. Reduced number of database calls in find_review_period() to reduce interaction, number of iterating loops, and incorporate DRY principles&lt;br /&gt;
** answer data in log_response_info() now uses hash format for better readability&lt;br /&gt;
** Local array and hash variables now instantiated correctly.&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Improved rspec tests for all files&lt;br /&gt;
** Confirmed that changes do not affect students that have not yet submitted their reviews&lt;br /&gt;
&lt;br /&gt;
== Flow ==&lt;br /&gt;
The main actions this project affects are adding and removing questions from a questionnaire. These diagrams will show how these events now occur. Because these events are handled differently in Expertiza, the implementation is slightly different for both cases.&lt;br /&gt;
&lt;br /&gt;
'''*Note:''' As you can see in the diagrams below, the confirmation popup is thrown in different ways for &amp;quot;Add&amp;quot; vs &amp;quot;Remove&amp;quot;. This is because in _questionnaire.html.erb:&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Add&amp;quot;''' is implemented as a submit_tag which can easily have a confirm: attribute added to it causing it to throw a popup within expertiza.&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Remove&amp;quot;''' is an &amp;lt;a&amp;gt; tag hyperlink rendered to the page by line &amp;lt;%=question.edit(i)%&amp;gt; which iterates through all questions in the questionnaire and renders their edit() functions. Edit() is a function in each question types model (criterion.rb, cake.rb, etc.). Edit() adds lines to the html for each field in the question table, including the &amp;quot;Remove&amp;quot; link. The &amp;quot;Remove&amp;quot; hyperlink has an href attribute which dynamically links to /questions/ + self.id.to_s based on the desired questions id. It then uses a data-method=&amp;quot;delete&amp;quot; attribute to select the destroy method in questions_controller.rb. Because this hyperlink exists in each question types model, it is hard to implement a clean solution which does not edit all the model files. To do this, we added a short &amp;lt;script&amp;gt; to the end of _questionnaire.html.erb which scans for &amp;lt;a&amp;gt; hyperlink redirects with the [data-method=&amp;quot;delete&amp;quot;] attribute and throws a popup within the browser rather than expertiza. This popup works the same as the &amp;quot;Add&amp;quot; popup. The script returns the result (true/false) of this popup to the &amp;lt;a&amp;gt; tag. In html, the redirect is cancelled if a false is returned to the tag and continues if a true is returned.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: none; background: none;&amp;quot;&lt;br /&gt;
! Adding question during active period&lt;br /&gt;
! Removing question during active period&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Add_Question_Diagram.png|500px]] || [[File:Remove_Question_Diagram.png|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
Here is a list of files and the functions that were added or edited, excluding rspec files.&lt;br /&gt;
=== app/helpers/answer_helper.rb ===&lt;br /&gt;
Helper module containing important functions for deletion of responses and answers when editing a questionnaire during review period.&lt;br /&gt;
* '''delete_existing_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
[[File:2110 img1.png]]&lt;br /&gt;
&lt;br /&gt;
Calls log_answer_responses and log_answer_info to store responses users made to the questionnaire. If review_mailer can mail these responses to the user then delete_answers destroys the response object.&lt;br /&gt;
* '''log_answer_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Given a list of question_ids and a questionnaire_id, gathers reponse_ids for all users responses to the questionnaire.&lt;br /&gt;
* '''log_response_info(response_ids)'''&lt;br /&gt;
Given a list of response_ids, gathers users responses to a questionnaire and records their comments in a hash along with their name, email, and the assignment name.&lt;br /&gt;
&lt;br /&gt;
''NOTE:'' The only issue we have found on this project stems from the way this function gets ''answers''. Sometimes these review comments are sent to users in an email, and sometimes they are not. Our issue here [https://github.com/BoergerJ/expertiza/issues/29] explains it in more detail.&lt;br /&gt;
* '''review_mailer(email, answers, name, assignment_name)'''&lt;br /&gt;
Given an email, answer list, name, and assignment name, calls notify_review_rubric_change() to send given information about previous review submission to user at given email.&lt;br /&gt;
* '''delete_answers(response_id)'''&lt;br /&gt;
[[File:2110_img2.png]]&lt;br /&gt;
&lt;br /&gt;
Given a response_id, set the response to be no longer submitted then destroy the response object. This destroys designated dependencies as well such as answers.&lt;br /&gt;
* '''in_active_period(questionnaire_id, answer=nil)'''&lt;br /&gt;
Given a questionnaire and possibly an answer, determine the assignment and round number. Use these to determine if the assignment is in a review period. Return true if in active period, false if not.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questionnaires_controller.rb ===&lt;br /&gt;
* '''add_new_questions'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questions_controller.rb ===&lt;br /&gt;
* '''destroy'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/mailers/mailer.rb ===&lt;br /&gt;
* '''notify_review_rubric_change(defn)'''&lt;br /&gt;
Mailer function which set necessary attributes for sending an email about a deleted response including previous answers. Calls mail() to send email to desired user.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment.rb ===&lt;br /&gt;
* '''find_review_period(round)'''&lt;br /&gt;
Determines the start and end dates of the rounds of an assignment and returns them.&lt;br /&gt;
Using previous teams code as a base, we changed this function to make minimal database calls and iterate fewer times.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment_questionnaire.rb ===&lt;br /&gt;
* '''get_latest_assignment(questionnaire_id)'''&lt;br /&gt;
Given questionnaire_id, returns assignment and round where questionnaire is used (if multiple questionnaires are used in an assignment)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/views/questionnaires/_questionnaire.html.erb ===&lt;br /&gt;
* Added in_active_period() call to display warning about edited questionnaire during active period&lt;br /&gt;
* Added confirm: to submit_tag 'Add' to display confirmation popup when adding a question during active period&lt;br /&gt;
* Added script to catch &amp;lt;a&amp;gt; tag redirects with [data-method=&amp;quot;delete&amp;quot;] to display popup when removing a question. Script only active if in active period.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/views/mailer/notify_review_rubric_change.html.erb ===&lt;br /&gt;
[[File:2110 img4.png]]&lt;br /&gt;
[[File:2110 img3.png]]&lt;br /&gt;
&lt;br /&gt;
* New file containing email layout used when emailing students their answers after questionnaire is edited during active period.&lt;br /&gt;
&lt;br /&gt;
== Changed Files ==&lt;br /&gt;
* Added:&lt;br /&gt;
** app/helpers/answer_helper.rb&lt;br /&gt;
** app/views/mailer/notify_review_rubric_change.html.erb&lt;br /&gt;
&lt;br /&gt;
* Edited:&lt;br /&gt;
** app/controllers/questionnaires_controller.rb&lt;br /&gt;
** app/controllers/questions_controller.rb&lt;br /&gt;
** app/mailers/mailer.rb&lt;br /&gt;
** app/models/assignment.rb&lt;br /&gt;
** app/models/assignment_questionnaire.rb&lt;br /&gt;
** app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
&lt;br /&gt;
* Test Case Files&lt;br /&gt;
** spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
** spec/models/assignment_spec.rb&lt;br /&gt;
** spec/controllers/questions_controller_spec.rb&lt;br /&gt;
** spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
Tests are created in the following files:&lt;br /&gt;
* spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
* spec/models/assignment_spec.rb&lt;br /&gt;
* spec/controllers/questions_controller_spec.rb&lt;br /&gt;
* spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
These tests cover the following cases:&lt;br /&gt;
* Adding questions to a questionnaire during the review period&lt;br /&gt;
* Adding questions to a questionnaire outside the review period&lt;br /&gt;
* Determining if an assignment is in the review period&lt;br /&gt;
* Determining if an assignment is outside the review period&lt;br /&gt;
* Finding the start and end dates for a specific review period of an assignment&lt;br /&gt;
* Finding the start and end dates for all review periods of an assignment&lt;br /&gt;
* Deleting existing responses resulting from changes made to questionnaires during the review period&lt;br /&gt;
* Deleting questions&lt;br /&gt;
&lt;br /&gt;
The same cases were also tested manually through the Expertiza UI, as shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
== Team Links ==&lt;br /&gt;
Here is the video our team recorded to show functionality:&lt;br /&gt;
[https://youtu.be/yibtRg3MsyQ]&lt;br /&gt;
&lt;br /&gt;
The link to our team's repository:&lt;br /&gt;
[https://github.com/BoergerJ/expertiza]&lt;br /&gt;
&lt;br /&gt;
The link to the Expertiza pull request for our project:&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1941]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:2110_img4.PNG&amp;diff=138921</id>
		<title>File:2110 img4.PNG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:2110_img4.PNG&amp;diff=138921"/>
		<updated>2021-05-03T20:05:53Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138920</id>
		<title>CSC/ECE 517 Spring 2021 - E2110. 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_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138920"/>
		<updated>2021-05-03T20:05:04Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* app/views/mailer/notify_review_rubric_change.html.erb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Members ==&lt;br /&gt;
*Nicholas Himes&lt;br /&gt;
&lt;br /&gt;
*Surya Makthal&lt;br /&gt;
&lt;br /&gt;
*Jordan Boerger&lt;br /&gt;
&lt;br /&gt;
*Sai Krishna Wupadrashta Dhinakara Subrahmanya&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
While setting up an assignment, the instructor will 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.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
If the instructor does edit or change a rubric while an assignment is in progress:&lt;br /&gt;
* If the change affects only the wording of a particular rubric item (e.g., to clarify the statement), no action is necessary.&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.  The system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.  (However, the response_map should not be changed.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''This project was done in Fall 2019. However, it was not tested thoroughly. Our team's work in Spring 2021 is to improve the testing and readability of the code.'''&lt;br /&gt;
&lt;br /&gt;
== Design Diagrams ==&lt;br /&gt;
=== Use Case Diagrams ===&lt;br /&gt;
''*Using UML Use Case Diagram Syntax''&lt;br /&gt;
&lt;br /&gt;
[[File:E2110_Use_Case_Diagram.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Data Flow Diagrams ===&lt;br /&gt;
''Note: This data flow diagram was originally made by the team from project E1982 in Fall 2019. Their wiki link can be viewed here: &lt;br /&gt;
&lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1982._Regulate_changing_of_rubrics_while_projects_are_in_progress''&lt;br /&gt;
&lt;br /&gt;
[[File:DesignFlow.png]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
We will write comprehensive tests and fix any bugs in the code written already for changing rubrics while projects are in progress.&lt;br /&gt;
&lt;br /&gt;
Some known issues already have been identified:&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** A method comment is needed on in_active_period method in answer_helper.rb&lt;br /&gt;
** Line-by-line comments are needed for all added functions&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** The method find_review_period is possibly redundant as Find deadlines does exist already in the code. This method needs to be replaced/removed if possible&lt;br /&gt;
** Split delete_existing_responses into more functions as it's complexity is reletively high&lt;br /&gt;
*** Contains some nested loops so these should be removed&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Email functionality needs to be thoroughly tested&lt;br /&gt;
** Tests need to be more thorough and verify that correct rows are being deleted for delete_existing_responses function in answer_helper.rb&lt;br /&gt;
** Confirm changes do not affect students who have not yet submitted their reviews by doing UI testing&lt;br /&gt;
&lt;br /&gt;
== Completed Solution ==&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** Added more extensive comments to all added functions and lines of code for better readability&lt;br /&gt;
** Added a popup confirmation message when deleting a question during active period similar to when adding a question to ensure instructor wants to delete all responses&lt;br /&gt;
** Destroy response object instead of individual answers when editing a questionnaire during active period to return all students who submitted reviews to the 'begin' stage rather than 'edit' and give them a fresh questionnaire&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** Split complicated functions from previous team, such as delete_existing_responses(), into more manageable and modular functions which only complete 1 main task&lt;br /&gt;
** Fixed email formatting for email sent to users when questionnaire is edited&lt;br /&gt;
** find_review_period() now uses find_due_dates() to search for assignment due dates. Reduced number of database calls in find_review_period() to reduce interaction, number of iterating loops, and incorporate DRY principles&lt;br /&gt;
** answer data in log_response_info() now uses hash format for better readability&lt;br /&gt;
** Local array and hash variables now instantiated correctly.&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Improved rspec tests for all files&lt;br /&gt;
** Confirmed that changes do not affect students that have not yet submitted their reviews&lt;br /&gt;
&lt;br /&gt;
== Flow ==&lt;br /&gt;
The main actions this project affects are adding and removing questions from a questionnaire. These diagrams will show how these events now occur. Because these events are handled differently in Expertiza, the implementation is slightly different for both cases.&lt;br /&gt;
&lt;br /&gt;
'''*Note:''' As you can see in the diagrams below, the confirmation popup is thrown in different ways for &amp;quot;Add&amp;quot; vs &amp;quot;Remove&amp;quot;. This is because in _questionnaire.html.erb:&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Add&amp;quot;''' is implemented as a submit_tag which can easily have a confirm: attribute added to it causing it to throw a popup within expertiza.&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Remove&amp;quot;''' is an &amp;lt;a&amp;gt; tag hyperlink rendered to the page by line &amp;lt;%=question.edit(i)%&amp;gt; which iterates through all questions in the questionnaire and renders their edit() functions. Edit() is a function in each question types model (criterion.rb, cake.rb, etc.). Edit() adds lines to the html for each field in the question table, including the &amp;quot;Remove&amp;quot; link. The &amp;quot;Remove&amp;quot; hyperlink has an href attribute which dynamically links to /questions/ + self.id.to_s based on the desired questions id. It then uses a data-method=&amp;quot;delete&amp;quot; attribute to select the destroy method in questions_controller.rb. Because this hyperlink exists in each question types model, it is hard to implement a clean solution which does not edit all the model files. To do this, we added a short &amp;lt;script&amp;gt; to the end of _questionnaire.html.erb which scans for &amp;lt;a&amp;gt; hyperlink redirects with the [data-method=&amp;quot;delete&amp;quot;] attribute and throws a popup within the browser rather than expertiza. This popup works the same as the &amp;quot;Add&amp;quot; popup. The script returns the result (true/false) of this popup to the &amp;lt;a&amp;gt; tag. In html, the redirect is cancelled if a false is returned to the tag and continues if a true is returned.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: none; background: none;&amp;quot;&lt;br /&gt;
! Adding question during active period&lt;br /&gt;
! Removing question during active period&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Add_Question_Diagram.png|500px]] || [[File:Remove_Question_Diagram.png|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
Here is a list of files and the functions that were added or edited, excluding rspec files.&lt;br /&gt;
=== app/helpers/answer_helper.rb ===&lt;br /&gt;
Helper module containing important functions for deletion of responses and answers when editing a questionnaire during review period.&lt;br /&gt;
* '''delete_existing_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
[[File:2110 img1.png]]&lt;br /&gt;
&lt;br /&gt;
Calls log_answer_responses and log_answer_info to store responses users made to the questionnaire. If review_mailer can mail these responses to the user then delete_answers destroys the response object.&lt;br /&gt;
* '''log_answer_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Given a list of question_ids and a questionnaire_id, gathers reponse_ids for all users responses to the questionnaire.&lt;br /&gt;
* '''log_response_info(response_ids)'''&lt;br /&gt;
Given a list of response_ids, gathers users responses to a questionnaire and records their comments in a hash along with their name, email, and the assignment name.&lt;br /&gt;
&lt;br /&gt;
''NOTE:'' The only issue we have found on this project stems from the way this function gets ''answers''. Sometimes these review comments are sent to users in an email, and sometimes they are not. Our issue here [https://github.com/BoergerJ/expertiza/issues/29] explains it in more detail.&lt;br /&gt;
* '''review_mailer(email, answers, name, assignment_name)'''&lt;br /&gt;
Given an email, answer list, name, and assignment name, calls notify_review_rubric_change() to send given information about previous review submission to user at given email.&lt;br /&gt;
* '''delete_answers(response_id)'''&lt;br /&gt;
[[File:2110_img2.png]]&lt;br /&gt;
&lt;br /&gt;
Given a response_id, set the response to be no longer submitted then destroy the response object. This destroys designated dependencies as well such as answers.&lt;br /&gt;
* '''in_active_period(questionnaire_id, answer=nil)'''&lt;br /&gt;
Given a questionnaire and possibly an answer, determine the assignment and round number. Use these to determine if the assignment is in a review period. Return true if in active period, false if not.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questionnaires_controller.rb ===&lt;br /&gt;
* '''add_new_questions'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questions_controller.rb ===&lt;br /&gt;
* '''destroy'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/mailers/mailer.rb ===&lt;br /&gt;
* '''notify_review_rubric_change(defn)'''&lt;br /&gt;
Mailer function which set necessary attributes for sending an email about a deleted response including previous answers. Calls mail() to send email to desired user.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment.rb ===&lt;br /&gt;
* '''find_review_period(round)'''&lt;br /&gt;
Determines the start and end dates of the rounds of an assignment and returns them.&lt;br /&gt;
Using previous teams code as a base, we changed this function to make minimal database calls and iterate fewer times.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment_questionnaire.rb ===&lt;br /&gt;
* '''get_latest_assignment(questionnaire_id)'''&lt;br /&gt;
Given questionnaire_id, returns assignment and round where questionnaire is used (if multiple questionnaires are used in an assignment)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/views/questionnaires/_questionnaire.html.erb ===&lt;br /&gt;
* Added in_active_period() call to display warning about edited questionnaire during active period&lt;br /&gt;
* Added confirm: to submit_tag 'Add' to display confirmation popup when adding a question during active period&lt;br /&gt;
* Added script to catch &amp;lt;a&amp;gt; tag redirects with [data-method=&amp;quot;delete&amp;quot;] to display popup when removing a question. Script only active if in active period.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/views/mailer/notify_review_rubric_change.html.erb ===&lt;br /&gt;
[[File:2110 img3.png]]&lt;br /&gt;
&lt;br /&gt;
* New file containing email layout used when emailing students their answers after questionnaire is edited during active period.&lt;br /&gt;
&lt;br /&gt;
== Changed Files ==&lt;br /&gt;
* Added:&lt;br /&gt;
** app/helpers/answer_helper.rb&lt;br /&gt;
** app/views/mailer/notify_review_rubric_change.html.erb&lt;br /&gt;
&lt;br /&gt;
* Edited:&lt;br /&gt;
** app/controllers/questionnaires_controller.rb&lt;br /&gt;
** app/controllers/questions_controller.rb&lt;br /&gt;
** app/mailers/mailer.rb&lt;br /&gt;
** app/models/assignment.rb&lt;br /&gt;
** app/models/assignment_questionnaire.rb&lt;br /&gt;
** app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
&lt;br /&gt;
* Test Case Files&lt;br /&gt;
** spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
** spec/models/assignment_spec.rb&lt;br /&gt;
** spec/controllers/questions_controller_spec.rb&lt;br /&gt;
** spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
Tests are created in the following files:&lt;br /&gt;
* spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
* spec/models/assignment_spec.rb&lt;br /&gt;
* spec/controllers/questions_controller_spec.rb&lt;br /&gt;
* spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
These tests cover the following cases:&lt;br /&gt;
* Adding questions to a questionnaire during the review period&lt;br /&gt;
* Adding questions to a questionnaire outside the review period&lt;br /&gt;
* Determining if an assignment is in the review period&lt;br /&gt;
* Determining if an assignment is outside the review period&lt;br /&gt;
* Finding the start and end dates for a specific review period of an assignment&lt;br /&gt;
* Finding the start and end dates for all review periods of an assignment&lt;br /&gt;
* Deleting existing responses resulting from changes made to questionnaires during the review period&lt;br /&gt;
* Deleting questions&lt;br /&gt;
&lt;br /&gt;
The same cases were also tested manually through the Expertiza UI, as shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
== Team Links ==&lt;br /&gt;
Here is the video our team recorded to show functionality:&lt;br /&gt;
[https://youtu.be/yibtRg3MsyQ]&lt;br /&gt;
&lt;br /&gt;
The link to our team's repository:&lt;br /&gt;
[https://github.com/BoergerJ/expertiza]&lt;br /&gt;
&lt;br /&gt;
The link to the Expertiza pull request for our project:&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1941]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:2110_img3.png&amp;diff=138919</id>
		<title>File:2110 img3.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:2110_img3.png&amp;diff=138919"/>
		<updated>2021-05-03T20:04:47Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138918</id>
		<title>CSC/ECE 517 Spring 2021 - E2110. 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_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138918"/>
		<updated>2021-05-03T20:04:38Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* app/views/mailer/notify_review_rubric_change.html.erb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Members ==&lt;br /&gt;
*Nicholas Himes&lt;br /&gt;
&lt;br /&gt;
*Surya Makthal&lt;br /&gt;
&lt;br /&gt;
*Jordan Boerger&lt;br /&gt;
&lt;br /&gt;
*Sai Krishna Wupadrashta Dhinakara Subrahmanya&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
While setting up an assignment, the instructor will 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.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
If the instructor does edit or change a rubric while an assignment is in progress:&lt;br /&gt;
* If the change affects only the wording of a particular rubric item (e.g., to clarify the statement), no action is necessary.&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.  The system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.  (However, the response_map should not be changed.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''This project was done in Fall 2019. However, it was not tested thoroughly. Our team's work in Spring 2021 is to improve the testing and readability of the code.'''&lt;br /&gt;
&lt;br /&gt;
== Design Diagrams ==&lt;br /&gt;
=== Use Case Diagrams ===&lt;br /&gt;
''*Using UML Use Case Diagram Syntax''&lt;br /&gt;
&lt;br /&gt;
[[File:E2110_Use_Case_Diagram.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Data Flow Diagrams ===&lt;br /&gt;
''Note: This data flow diagram was originally made by the team from project E1982 in Fall 2019. Their wiki link can be viewed here: &lt;br /&gt;
&lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1982._Regulate_changing_of_rubrics_while_projects_are_in_progress''&lt;br /&gt;
&lt;br /&gt;
[[File:DesignFlow.png]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
We will write comprehensive tests and fix any bugs in the code written already for changing rubrics while projects are in progress.&lt;br /&gt;
&lt;br /&gt;
Some known issues already have been identified:&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** A method comment is needed on in_active_period method in answer_helper.rb&lt;br /&gt;
** Line-by-line comments are needed for all added functions&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** The method find_review_period is possibly redundant as Find deadlines does exist already in the code. This method needs to be replaced/removed if possible&lt;br /&gt;
** Split delete_existing_responses into more functions as it's complexity is reletively high&lt;br /&gt;
*** Contains some nested loops so these should be removed&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Email functionality needs to be thoroughly tested&lt;br /&gt;
** Tests need to be more thorough and verify that correct rows are being deleted for delete_existing_responses function in answer_helper.rb&lt;br /&gt;
** Confirm changes do not affect students who have not yet submitted their reviews by doing UI testing&lt;br /&gt;
&lt;br /&gt;
== Completed Solution ==&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** Added more extensive comments to all added functions and lines of code for better readability&lt;br /&gt;
** Added a popup confirmation message when deleting a question during active period similar to when adding a question to ensure instructor wants to delete all responses&lt;br /&gt;
** Destroy response object instead of individual answers when editing a questionnaire during active period to return all students who submitted reviews to the 'begin' stage rather than 'edit' and give them a fresh questionnaire&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** Split complicated functions from previous team, such as delete_existing_responses(), into more manageable and modular functions which only complete 1 main task&lt;br /&gt;
** Fixed email formatting for email sent to users when questionnaire is edited&lt;br /&gt;
** find_review_period() now uses find_due_dates() to search for assignment due dates. Reduced number of database calls in find_review_period() to reduce interaction, number of iterating loops, and incorporate DRY principles&lt;br /&gt;
** answer data in log_response_info() now uses hash format for better readability&lt;br /&gt;
** Local array and hash variables now instantiated correctly.&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Improved rspec tests for all files&lt;br /&gt;
** Confirmed that changes do not affect students that have not yet submitted their reviews&lt;br /&gt;
&lt;br /&gt;
== Flow ==&lt;br /&gt;
The main actions this project affects are adding and removing questions from a questionnaire. These diagrams will show how these events now occur. Because these events are handled differently in Expertiza, the implementation is slightly different for both cases.&lt;br /&gt;
&lt;br /&gt;
'''*Note:''' As you can see in the diagrams below, the confirmation popup is thrown in different ways for &amp;quot;Add&amp;quot; vs &amp;quot;Remove&amp;quot;. This is because in _questionnaire.html.erb:&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Add&amp;quot;''' is implemented as a submit_tag which can easily have a confirm: attribute added to it causing it to throw a popup within expertiza.&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Remove&amp;quot;''' is an &amp;lt;a&amp;gt; tag hyperlink rendered to the page by line &amp;lt;%=question.edit(i)%&amp;gt; which iterates through all questions in the questionnaire and renders their edit() functions. Edit() is a function in each question types model (criterion.rb, cake.rb, etc.). Edit() adds lines to the html for each field in the question table, including the &amp;quot;Remove&amp;quot; link. The &amp;quot;Remove&amp;quot; hyperlink has an href attribute which dynamically links to /questions/ + self.id.to_s based on the desired questions id. It then uses a data-method=&amp;quot;delete&amp;quot; attribute to select the destroy method in questions_controller.rb. Because this hyperlink exists in each question types model, it is hard to implement a clean solution which does not edit all the model files. To do this, we added a short &amp;lt;script&amp;gt; to the end of _questionnaire.html.erb which scans for &amp;lt;a&amp;gt; hyperlink redirects with the [data-method=&amp;quot;delete&amp;quot;] attribute and throws a popup within the browser rather than expertiza. This popup works the same as the &amp;quot;Add&amp;quot; popup. The script returns the result (true/false) of this popup to the &amp;lt;a&amp;gt; tag. In html, the redirect is cancelled if a false is returned to the tag and continues if a true is returned.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: none; background: none;&amp;quot;&lt;br /&gt;
! Adding question during active period&lt;br /&gt;
! Removing question during active period&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Add_Question_Diagram.png|500px]] || [[File:Remove_Question_Diagram.png|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
Here is a list of files and the functions that were added or edited, excluding rspec files.&lt;br /&gt;
=== app/helpers/answer_helper.rb ===&lt;br /&gt;
Helper module containing important functions for deletion of responses and answers when editing a questionnaire during review period.&lt;br /&gt;
* '''delete_existing_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
[[File:2110 img1.png]]&lt;br /&gt;
&lt;br /&gt;
Calls log_answer_responses and log_answer_info to store responses users made to the questionnaire. If review_mailer can mail these responses to the user then delete_answers destroys the response object.&lt;br /&gt;
* '''log_answer_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Given a list of question_ids and a questionnaire_id, gathers reponse_ids for all users responses to the questionnaire.&lt;br /&gt;
* '''log_response_info(response_ids)'''&lt;br /&gt;
Given a list of response_ids, gathers users responses to a questionnaire and records their comments in a hash along with their name, email, and the assignment name.&lt;br /&gt;
&lt;br /&gt;
''NOTE:'' The only issue we have found on this project stems from the way this function gets ''answers''. Sometimes these review comments are sent to users in an email, and sometimes they are not. Our issue here [https://github.com/BoergerJ/expertiza/issues/29] explains it in more detail.&lt;br /&gt;
* '''review_mailer(email, answers, name, assignment_name)'''&lt;br /&gt;
Given an email, answer list, name, and assignment name, calls notify_review_rubric_change() to send given information about previous review submission to user at given email.&lt;br /&gt;
* '''delete_answers(response_id)'''&lt;br /&gt;
[[File:2110_img2.png]]&lt;br /&gt;
&lt;br /&gt;
Given a response_id, set the response to be no longer submitted then destroy the response object. This destroys designated dependencies as well such as answers.&lt;br /&gt;
* '''in_active_period(questionnaire_id, answer=nil)'''&lt;br /&gt;
Given a questionnaire and possibly an answer, determine the assignment and round number. Use these to determine if the assignment is in a review period. Return true if in active period, false if not.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questionnaires_controller.rb ===&lt;br /&gt;
* '''add_new_questions'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questions_controller.rb ===&lt;br /&gt;
* '''destroy'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/mailers/mailer.rb ===&lt;br /&gt;
* '''notify_review_rubric_change(defn)'''&lt;br /&gt;
Mailer function which set necessary attributes for sending an email about a deleted response including previous answers. Calls mail() to send email to desired user.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment.rb ===&lt;br /&gt;
* '''find_review_period(round)'''&lt;br /&gt;
Determines the start and end dates of the rounds of an assignment and returns them.&lt;br /&gt;
Using previous teams code as a base, we changed this function to make minimal database calls and iterate fewer times.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment_questionnaire.rb ===&lt;br /&gt;
* '''get_latest_assignment(questionnaire_id)'''&lt;br /&gt;
Given questionnaire_id, returns assignment and round where questionnaire is used (if multiple questionnaires are used in an assignment)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/views/questionnaires/_questionnaire.html.erb ===&lt;br /&gt;
* Added in_active_period() call to display warning about edited questionnaire during active period&lt;br /&gt;
* Added confirm: to submit_tag 'Add' to display confirmation popup when adding a question during active period&lt;br /&gt;
* Added script to catch &amp;lt;a&amp;gt; tag redirects with [data-method=&amp;quot;delete&amp;quot;] to display popup when removing a question. Script only active if in active period.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/views/mailer/notify_review_rubric_change.html.erb ===&lt;br /&gt;
[[File:2110_img3.png]]&lt;br /&gt;
&lt;br /&gt;
* New file containing email layout used when emailing students their answers after questionnaire is edited during active period.&lt;br /&gt;
&lt;br /&gt;
== Changed Files ==&lt;br /&gt;
* Added:&lt;br /&gt;
** app/helpers/answer_helper.rb&lt;br /&gt;
** app/views/mailer/notify_review_rubric_change.html.erb&lt;br /&gt;
&lt;br /&gt;
* Edited:&lt;br /&gt;
** app/controllers/questionnaires_controller.rb&lt;br /&gt;
** app/controllers/questions_controller.rb&lt;br /&gt;
** app/mailers/mailer.rb&lt;br /&gt;
** app/models/assignment.rb&lt;br /&gt;
** app/models/assignment_questionnaire.rb&lt;br /&gt;
** app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
&lt;br /&gt;
* Test Case Files&lt;br /&gt;
** spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
** spec/models/assignment_spec.rb&lt;br /&gt;
** spec/controllers/questions_controller_spec.rb&lt;br /&gt;
** spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
Tests are created in the following files:&lt;br /&gt;
* spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
* spec/models/assignment_spec.rb&lt;br /&gt;
* spec/controllers/questions_controller_spec.rb&lt;br /&gt;
* spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
These tests cover the following cases:&lt;br /&gt;
* Adding questions to a questionnaire during the review period&lt;br /&gt;
* Adding questions to a questionnaire outside the review period&lt;br /&gt;
* Determining if an assignment is in the review period&lt;br /&gt;
* Determining if an assignment is outside the review period&lt;br /&gt;
* Finding the start and end dates for a specific review period of an assignment&lt;br /&gt;
* Finding the start and end dates for all review periods of an assignment&lt;br /&gt;
* Deleting existing responses resulting from changes made to questionnaires during the review period&lt;br /&gt;
* Deleting questions&lt;br /&gt;
&lt;br /&gt;
The same cases were also tested manually through the Expertiza UI, as shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
== Team Links ==&lt;br /&gt;
Here is the video our team recorded to show functionality:&lt;br /&gt;
[https://youtu.be/yibtRg3MsyQ]&lt;br /&gt;
&lt;br /&gt;
The link to our team's repository:&lt;br /&gt;
[https://github.com/BoergerJ/expertiza]&lt;br /&gt;
&lt;br /&gt;
The link to the Expertiza pull request for our project:&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1941]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138917</id>
		<title>CSC/ECE 517 Spring 2021 - E2110. 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_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138917"/>
		<updated>2021-05-03T20:03:31Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* app/helpers/answer_helper.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Members ==&lt;br /&gt;
*Nicholas Himes&lt;br /&gt;
&lt;br /&gt;
*Surya Makthal&lt;br /&gt;
&lt;br /&gt;
*Jordan Boerger&lt;br /&gt;
&lt;br /&gt;
*Sai Krishna Wupadrashta Dhinakara Subrahmanya&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
While setting up an assignment, the instructor will 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.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
If the instructor does edit or change a rubric while an assignment is in progress:&lt;br /&gt;
* If the change affects only the wording of a particular rubric item (e.g., to clarify the statement), no action is necessary.&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.  The system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.  (However, the response_map should not be changed.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''This project was done in Fall 2019. However, it was not tested thoroughly. Our team's work in Spring 2021 is to improve the testing and readability of the code.'''&lt;br /&gt;
&lt;br /&gt;
== Design Diagrams ==&lt;br /&gt;
=== Use Case Diagrams ===&lt;br /&gt;
''*Using UML Use Case Diagram Syntax''&lt;br /&gt;
&lt;br /&gt;
[[File:E2110_Use_Case_Diagram.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Data Flow Diagrams ===&lt;br /&gt;
''Note: This data flow diagram was originally made by the team from project E1982 in Fall 2019. Their wiki link can be viewed here: &lt;br /&gt;
&lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1982._Regulate_changing_of_rubrics_while_projects_are_in_progress''&lt;br /&gt;
&lt;br /&gt;
[[File:DesignFlow.png]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
We will write comprehensive tests and fix any bugs in the code written already for changing rubrics while projects are in progress.&lt;br /&gt;
&lt;br /&gt;
Some known issues already have been identified:&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** A method comment is needed on in_active_period method in answer_helper.rb&lt;br /&gt;
** Line-by-line comments are needed for all added functions&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** The method find_review_period is possibly redundant as Find deadlines does exist already in the code. This method needs to be replaced/removed if possible&lt;br /&gt;
** Split delete_existing_responses into more functions as it's complexity is reletively high&lt;br /&gt;
*** Contains some nested loops so these should be removed&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Email functionality needs to be thoroughly tested&lt;br /&gt;
** Tests need to be more thorough and verify that correct rows are being deleted for delete_existing_responses function in answer_helper.rb&lt;br /&gt;
** Confirm changes do not affect students who have not yet submitted their reviews by doing UI testing&lt;br /&gt;
&lt;br /&gt;
== Completed Solution ==&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** Added more extensive comments to all added functions and lines of code for better readability&lt;br /&gt;
** Added a popup confirmation message when deleting a question during active period similar to when adding a question to ensure instructor wants to delete all responses&lt;br /&gt;
** Destroy response object instead of individual answers when editing a questionnaire during active period to return all students who submitted reviews to the 'begin' stage rather than 'edit' and give them a fresh questionnaire&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** Split complicated functions from previous team, such as delete_existing_responses(), into more manageable and modular functions which only complete 1 main task&lt;br /&gt;
** Fixed email formatting for email sent to users when questionnaire is edited&lt;br /&gt;
** find_review_period() now uses find_due_dates() to search for assignment due dates. Reduced number of database calls in find_review_period() to reduce interaction, number of iterating loops, and incorporate DRY principles&lt;br /&gt;
** answer data in log_response_info() now uses hash format for better readability&lt;br /&gt;
** Local array and hash variables now instantiated correctly.&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Improved rspec tests for all files&lt;br /&gt;
** Confirmed that changes do not affect students that have not yet submitted their reviews&lt;br /&gt;
&lt;br /&gt;
== Flow ==&lt;br /&gt;
The main actions this project affects are adding and removing questions from a questionnaire. These diagrams will show how these events now occur. Because these events are handled differently in Expertiza, the implementation is slightly different for both cases.&lt;br /&gt;
&lt;br /&gt;
'''*Note:''' As you can see in the diagrams below, the confirmation popup is thrown in different ways for &amp;quot;Add&amp;quot; vs &amp;quot;Remove&amp;quot;. This is because in _questionnaire.html.erb:&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Add&amp;quot;''' is implemented as a submit_tag which can easily have a confirm: attribute added to it causing it to throw a popup within expertiza.&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Remove&amp;quot;''' is an &amp;lt;a&amp;gt; tag hyperlink rendered to the page by line &amp;lt;%=question.edit(i)%&amp;gt; which iterates through all questions in the questionnaire and renders their edit() functions. Edit() is a function in each question types model (criterion.rb, cake.rb, etc.). Edit() adds lines to the html for each field in the question table, including the &amp;quot;Remove&amp;quot; link. The &amp;quot;Remove&amp;quot; hyperlink has an href attribute which dynamically links to /questions/ + self.id.to_s based on the desired questions id. It then uses a data-method=&amp;quot;delete&amp;quot; attribute to select the destroy method in questions_controller.rb. Because this hyperlink exists in each question types model, it is hard to implement a clean solution which does not edit all the model files. To do this, we added a short &amp;lt;script&amp;gt; to the end of _questionnaire.html.erb which scans for &amp;lt;a&amp;gt; hyperlink redirects with the [data-method=&amp;quot;delete&amp;quot;] attribute and throws a popup within the browser rather than expertiza. This popup works the same as the &amp;quot;Add&amp;quot; popup. The script returns the result (true/false) of this popup to the &amp;lt;a&amp;gt; tag. In html, the redirect is cancelled if a false is returned to the tag and continues if a true is returned.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: none; background: none;&amp;quot;&lt;br /&gt;
! Adding question during active period&lt;br /&gt;
! Removing question during active period&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Add_Question_Diagram.png|500px]] || [[File:Remove_Question_Diagram.png|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
Here is a list of files and the functions that were added or edited, excluding rspec files.&lt;br /&gt;
=== app/helpers/answer_helper.rb ===&lt;br /&gt;
Helper module containing important functions for deletion of responses and answers when editing a questionnaire during review period.&lt;br /&gt;
* '''delete_existing_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
[[File:2110 img1.png]]&lt;br /&gt;
&lt;br /&gt;
Calls log_answer_responses and log_answer_info to store responses users made to the questionnaire. If review_mailer can mail these responses to the user then delete_answers destroys the response object.&lt;br /&gt;
* '''log_answer_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Given a list of question_ids and a questionnaire_id, gathers reponse_ids for all users responses to the questionnaire.&lt;br /&gt;
* '''log_response_info(response_ids)'''&lt;br /&gt;
Given a list of response_ids, gathers users responses to a questionnaire and records their comments in a hash along with their name, email, and the assignment name.&lt;br /&gt;
&lt;br /&gt;
''NOTE:'' The only issue we have found on this project stems from the way this function gets ''answers''. Sometimes these review comments are sent to users in an email, and sometimes they are not. Our issue here [https://github.com/BoergerJ/expertiza/issues/29] explains it in more detail.&lt;br /&gt;
* '''review_mailer(email, answers, name, assignment_name)'''&lt;br /&gt;
Given an email, answer list, name, and assignment name, calls notify_review_rubric_change() to send given information about previous review submission to user at given email.&lt;br /&gt;
* '''delete_answers(response_id)'''&lt;br /&gt;
[[File:2110_img2.png]]&lt;br /&gt;
&lt;br /&gt;
Given a response_id, set the response to be no longer submitted then destroy the response object. This destroys designated dependencies as well such as answers.&lt;br /&gt;
* '''in_active_period(questionnaire_id, answer=nil)'''&lt;br /&gt;
Given a questionnaire and possibly an answer, determine the assignment and round number. Use these to determine if the assignment is in a review period. Return true if in active period, false if not.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questionnaires_controller.rb ===&lt;br /&gt;
* '''add_new_questions'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questions_controller.rb ===&lt;br /&gt;
* '''destroy'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/mailers/mailer.rb ===&lt;br /&gt;
* '''notify_review_rubric_change(defn)'''&lt;br /&gt;
Mailer function which set necessary attributes for sending an email about a deleted response including previous answers. Calls mail() to send email to desired user.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment.rb ===&lt;br /&gt;
* '''find_review_period(round)'''&lt;br /&gt;
Determines the start and end dates of the rounds of an assignment and returns them.&lt;br /&gt;
Using previous teams code as a base, we changed this function to make minimal database calls and iterate fewer times.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment_questionnaire.rb ===&lt;br /&gt;
* '''get_latest_assignment(questionnaire_id)'''&lt;br /&gt;
Given questionnaire_id, returns assignment and round where questionnaire is used (if multiple questionnaires are used in an assignment)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/views/questionnaires/_questionnaire.html.erb ===&lt;br /&gt;
* Added in_active_period() call to display warning about edited questionnaire during active period&lt;br /&gt;
* Added confirm: to submit_tag 'Add' to display confirmation popup when adding a question during active period&lt;br /&gt;
* Added script to catch &amp;lt;a&amp;gt; tag redirects with [data-method=&amp;quot;delete&amp;quot;] to display popup when removing a question. Script only active if in active period.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/views/mailer/notify_review_rubric_change.html.erb ===&lt;br /&gt;
* New file containing email layout used when emailing students their answers after questionnaire is edited during active period.&lt;br /&gt;
&lt;br /&gt;
== Changed Files ==&lt;br /&gt;
* Added:&lt;br /&gt;
** app/helpers/answer_helper.rb&lt;br /&gt;
** app/views/mailer/notify_review_rubric_change.html.erb&lt;br /&gt;
&lt;br /&gt;
* Edited:&lt;br /&gt;
** app/controllers/questionnaires_controller.rb&lt;br /&gt;
** app/controllers/questions_controller.rb&lt;br /&gt;
** app/mailers/mailer.rb&lt;br /&gt;
** app/models/assignment.rb&lt;br /&gt;
** app/models/assignment_questionnaire.rb&lt;br /&gt;
** app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
&lt;br /&gt;
* Test Case Files&lt;br /&gt;
** spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
** spec/models/assignment_spec.rb&lt;br /&gt;
** spec/controllers/questions_controller_spec.rb&lt;br /&gt;
** spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
Tests are created in the following files:&lt;br /&gt;
* spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
* spec/models/assignment_spec.rb&lt;br /&gt;
* spec/controllers/questions_controller_spec.rb&lt;br /&gt;
* spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
These tests cover the following cases:&lt;br /&gt;
* Adding questions to a questionnaire during the review period&lt;br /&gt;
* Adding questions to a questionnaire outside the review period&lt;br /&gt;
* Determining if an assignment is in the review period&lt;br /&gt;
* Determining if an assignment is outside the review period&lt;br /&gt;
* Finding the start and end dates for a specific review period of an assignment&lt;br /&gt;
* Finding the start and end dates for all review periods of an assignment&lt;br /&gt;
* Deleting existing responses resulting from changes made to questionnaires during the review period&lt;br /&gt;
* Deleting questions&lt;br /&gt;
&lt;br /&gt;
The same cases were also tested manually through the Expertiza UI, as shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
== Team Links ==&lt;br /&gt;
Here is the video our team recorded to show functionality:&lt;br /&gt;
[https://youtu.be/yibtRg3MsyQ]&lt;br /&gt;
&lt;br /&gt;
The link to our team's repository:&lt;br /&gt;
[https://github.com/BoergerJ/expertiza]&lt;br /&gt;
&lt;br /&gt;
The link to the Expertiza pull request for our project:&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1941]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138916</id>
		<title>CSC/ECE 517 Spring 2021 - E2110. 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_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138916"/>
		<updated>2021-05-03T20:03:18Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* app/helpers/answer_helper.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Members ==&lt;br /&gt;
*Nicholas Himes&lt;br /&gt;
&lt;br /&gt;
*Surya Makthal&lt;br /&gt;
&lt;br /&gt;
*Jordan Boerger&lt;br /&gt;
&lt;br /&gt;
*Sai Krishna Wupadrashta Dhinakara Subrahmanya&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
While setting up an assignment, the instructor will 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.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
If the instructor does edit or change a rubric while an assignment is in progress:&lt;br /&gt;
* If the change affects only the wording of a particular rubric item (e.g., to clarify the statement), no action is necessary.&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.  The system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.  (However, the response_map should not be changed.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''This project was done in Fall 2019. However, it was not tested thoroughly. Our team's work in Spring 2021 is to improve the testing and readability of the code.'''&lt;br /&gt;
&lt;br /&gt;
== Design Diagrams ==&lt;br /&gt;
=== Use Case Diagrams ===&lt;br /&gt;
''*Using UML Use Case Diagram Syntax''&lt;br /&gt;
&lt;br /&gt;
[[File:E2110_Use_Case_Diagram.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Data Flow Diagrams ===&lt;br /&gt;
''Note: This data flow diagram was originally made by the team from project E1982 in Fall 2019. Their wiki link can be viewed here: &lt;br /&gt;
&lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1982._Regulate_changing_of_rubrics_while_projects_are_in_progress''&lt;br /&gt;
&lt;br /&gt;
[[File:DesignFlow.png]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
We will write comprehensive tests and fix any bugs in the code written already for changing rubrics while projects are in progress.&lt;br /&gt;
&lt;br /&gt;
Some known issues already have been identified:&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** A method comment is needed on in_active_period method in answer_helper.rb&lt;br /&gt;
** Line-by-line comments are needed for all added functions&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** The method find_review_period is possibly redundant as Find deadlines does exist already in the code. This method needs to be replaced/removed if possible&lt;br /&gt;
** Split delete_existing_responses into more functions as it's complexity is reletively high&lt;br /&gt;
*** Contains some nested loops so these should be removed&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Email functionality needs to be thoroughly tested&lt;br /&gt;
** Tests need to be more thorough and verify that correct rows are being deleted for delete_existing_responses function in answer_helper.rb&lt;br /&gt;
** Confirm changes do not affect students who have not yet submitted their reviews by doing UI testing&lt;br /&gt;
&lt;br /&gt;
== Completed Solution ==&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** Added more extensive comments to all added functions and lines of code for better readability&lt;br /&gt;
** Added a popup confirmation message when deleting a question during active period similar to when adding a question to ensure instructor wants to delete all responses&lt;br /&gt;
** Destroy response object instead of individual answers when editing a questionnaire during active period to return all students who submitted reviews to the 'begin' stage rather than 'edit' and give them a fresh questionnaire&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** Split complicated functions from previous team, such as delete_existing_responses(), into more manageable and modular functions which only complete 1 main task&lt;br /&gt;
** Fixed email formatting for email sent to users when questionnaire is edited&lt;br /&gt;
** find_review_period() now uses find_due_dates() to search for assignment due dates. Reduced number of database calls in find_review_period() to reduce interaction, number of iterating loops, and incorporate DRY principles&lt;br /&gt;
** answer data in log_response_info() now uses hash format for better readability&lt;br /&gt;
** Local array and hash variables now instantiated correctly.&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Improved rspec tests for all files&lt;br /&gt;
** Confirmed that changes do not affect students that have not yet submitted their reviews&lt;br /&gt;
&lt;br /&gt;
== Flow ==&lt;br /&gt;
The main actions this project affects are adding and removing questions from a questionnaire. These diagrams will show how these events now occur. Because these events are handled differently in Expertiza, the implementation is slightly different for both cases.&lt;br /&gt;
&lt;br /&gt;
'''*Note:''' As you can see in the diagrams below, the confirmation popup is thrown in different ways for &amp;quot;Add&amp;quot; vs &amp;quot;Remove&amp;quot;. This is because in _questionnaire.html.erb:&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Add&amp;quot;''' is implemented as a submit_tag which can easily have a confirm: attribute added to it causing it to throw a popup within expertiza.&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Remove&amp;quot;''' is an &amp;lt;a&amp;gt; tag hyperlink rendered to the page by line &amp;lt;%=question.edit(i)%&amp;gt; which iterates through all questions in the questionnaire and renders their edit() functions. Edit() is a function in each question types model (criterion.rb, cake.rb, etc.). Edit() adds lines to the html for each field in the question table, including the &amp;quot;Remove&amp;quot; link. The &amp;quot;Remove&amp;quot; hyperlink has an href attribute which dynamically links to /questions/ + self.id.to_s based on the desired questions id. It then uses a data-method=&amp;quot;delete&amp;quot; attribute to select the destroy method in questions_controller.rb. Because this hyperlink exists in each question types model, it is hard to implement a clean solution which does not edit all the model files. To do this, we added a short &amp;lt;script&amp;gt; to the end of _questionnaire.html.erb which scans for &amp;lt;a&amp;gt; hyperlink redirects with the [data-method=&amp;quot;delete&amp;quot;] attribute and throws a popup within the browser rather than expertiza. This popup works the same as the &amp;quot;Add&amp;quot; popup. The script returns the result (true/false) of this popup to the &amp;lt;a&amp;gt; tag. In html, the redirect is cancelled if a false is returned to the tag and continues if a true is returned.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: none; background: none;&amp;quot;&lt;br /&gt;
! Adding question during active period&lt;br /&gt;
! Removing question during active period&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Add_Question_Diagram.png|500px]] || [[File:Remove_Question_Diagram.png|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
Here is a list of files and the functions that were added or edited, excluding rspec files.&lt;br /&gt;
=== app/helpers/answer_helper.rb ===&lt;br /&gt;
Helper module containing important functions for deletion of responses and answers when editing a questionnaire during review period.&lt;br /&gt;
* '''delete_existing_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
[[File:2110 img1.png]]&lt;br /&gt;
Calls log_answer_responses and log_answer_info to store responses users made to the questionnaire. If review_mailer can mail these responses to the user then delete_answers destroys the response object.&lt;br /&gt;
* '''log_answer_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Given a list of question_ids and a questionnaire_id, gathers reponse_ids for all users responses to the questionnaire.&lt;br /&gt;
* '''log_response_info(response_ids)'''&lt;br /&gt;
Given a list of response_ids, gathers users responses to a questionnaire and records their comments in a hash along with their name, email, and the assignment name.&lt;br /&gt;
&lt;br /&gt;
''NOTE:'' The only issue we have found on this project stems from the way this function gets ''answers''. Sometimes these review comments are sent to users in an email, and sometimes they are not. Our issue here [https://github.com/BoergerJ/expertiza/issues/29] explains it in more detail.&lt;br /&gt;
* '''review_mailer(email, answers, name, assignment_name)'''&lt;br /&gt;
Given an email, answer list, name, and assignment name, calls notify_review_rubric_change() to send given information about previous review submission to user at given email.&lt;br /&gt;
* '''delete_answers(response_id)'''&lt;br /&gt;
[[File:2110_img2.png]]&lt;br /&gt;
Given a response_id, set the response to be no longer submitted then destroy the response object. This destroys designated dependencies as well such as answers.&lt;br /&gt;
* '''in_active_period(questionnaire_id, answer=nil)'''&lt;br /&gt;
Given a questionnaire and possibly an answer, determine the assignment and round number. Use these to determine if the assignment is in a review period. Return true if in active period, false if not.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questionnaires_controller.rb ===&lt;br /&gt;
* '''add_new_questions'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questions_controller.rb ===&lt;br /&gt;
* '''destroy'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/mailers/mailer.rb ===&lt;br /&gt;
* '''notify_review_rubric_change(defn)'''&lt;br /&gt;
Mailer function which set necessary attributes for sending an email about a deleted response including previous answers. Calls mail() to send email to desired user.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment.rb ===&lt;br /&gt;
* '''find_review_period(round)'''&lt;br /&gt;
Determines the start and end dates of the rounds of an assignment and returns them.&lt;br /&gt;
Using previous teams code as a base, we changed this function to make minimal database calls and iterate fewer times.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment_questionnaire.rb ===&lt;br /&gt;
* '''get_latest_assignment(questionnaire_id)'''&lt;br /&gt;
Given questionnaire_id, returns assignment and round where questionnaire is used (if multiple questionnaires are used in an assignment)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/views/questionnaires/_questionnaire.html.erb ===&lt;br /&gt;
* Added in_active_period() call to display warning about edited questionnaire during active period&lt;br /&gt;
* Added confirm: to submit_tag 'Add' to display confirmation popup when adding a question during active period&lt;br /&gt;
* Added script to catch &amp;lt;a&amp;gt; tag redirects with [data-method=&amp;quot;delete&amp;quot;] to display popup when removing a question. Script only active if in active period.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/views/mailer/notify_review_rubric_change.html.erb ===&lt;br /&gt;
* New file containing email layout used when emailing students their answers after questionnaire is edited during active period.&lt;br /&gt;
&lt;br /&gt;
== Changed Files ==&lt;br /&gt;
* Added:&lt;br /&gt;
** app/helpers/answer_helper.rb&lt;br /&gt;
** app/views/mailer/notify_review_rubric_change.html.erb&lt;br /&gt;
&lt;br /&gt;
* Edited:&lt;br /&gt;
** app/controllers/questionnaires_controller.rb&lt;br /&gt;
** app/controllers/questions_controller.rb&lt;br /&gt;
** app/mailers/mailer.rb&lt;br /&gt;
** app/models/assignment.rb&lt;br /&gt;
** app/models/assignment_questionnaire.rb&lt;br /&gt;
** app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
&lt;br /&gt;
* Test Case Files&lt;br /&gt;
** spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
** spec/models/assignment_spec.rb&lt;br /&gt;
** spec/controllers/questions_controller_spec.rb&lt;br /&gt;
** spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
Tests are created in the following files:&lt;br /&gt;
* spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
* spec/models/assignment_spec.rb&lt;br /&gt;
* spec/controllers/questions_controller_spec.rb&lt;br /&gt;
* spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
These tests cover the following cases:&lt;br /&gt;
* Adding questions to a questionnaire during the review period&lt;br /&gt;
* Adding questions to a questionnaire outside the review period&lt;br /&gt;
* Determining if an assignment is in the review period&lt;br /&gt;
* Determining if an assignment is outside the review period&lt;br /&gt;
* Finding the start and end dates for a specific review period of an assignment&lt;br /&gt;
* Finding the start and end dates for all review periods of an assignment&lt;br /&gt;
* Deleting existing responses resulting from changes made to questionnaires during the review period&lt;br /&gt;
* Deleting questions&lt;br /&gt;
&lt;br /&gt;
The same cases were also tested manually through the Expertiza UI, as shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
== Team Links ==&lt;br /&gt;
Here is the video our team recorded to show functionality:&lt;br /&gt;
[https://youtu.be/yibtRg3MsyQ]&lt;br /&gt;
&lt;br /&gt;
The link to our team's repository:&lt;br /&gt;
[https://github.com/BoergerJ/expertiza]&lt;br /&gt;
&lt;br /&gt;
The link to the Expertiza pull request for our project:&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1941]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138915</id>
		<title>CSC/ECE 517 Spring 2021 - E2110. 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_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138915"/>
		<updated>2021-05-03T20:02:48Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* app/helpers/answer_helper.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Members ==&lt;br /&gt;
*Nicholas Himes&lt;br /&gt;
&lt;br /&gt;
*Surya Makthal&lt;br /&gt;
&lt;br /&gt;
*Jordan Boerger&lt;br /&gt;
&lt;br /&gt;
*Sai Krishna Wupadrashta Dhinakara Subrahmanya&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
While setting up an assignment, the instructor will 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.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
If the instructor does edit or change a rubric while an assignment is in progress:&lt;br /&gt;
* If the change affects only the wording of a particular rubric item (e.g., to clarify the statement), no action is necessary.&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.  The system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.  (However, the response_map should not be changed.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''This project was done in Fall 2019. However, it was not tested thoroughly. Our team's work in Spring 2021 is to improve the testing and readability of the code.'''&lt;br /&gt;
&lt;br /&gt;
== Design Diagrams ==&lt;br /&gt;
=== Use Case Diagrams ===&lt;br /&gt;
''*Using UML Use Case Diagram Syntax''&lt;br /&gt;
&lt;br /&gt;
[[File:E2110_Use_Case_Diagram.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Data Flow Diagrams ===&lt;br /&gt;
''Note: This data flow diagram was originally made by the team from project E1982 in Fall 2019. Their wiki link can be viewed here: &lt;br /&gt;
&lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1982._Regulate_changing_of_rubrics_while_projects_are_in_progress''&lt;br /&gt;
&lt;br /&gt;
[[File:DesignFlow.png]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
We will write comprehensive tests and fix any bugs in the code written already for changing rubrics while projects are in progress.&lt;br /&gt;
&lt;br /&gt;
Some known issues already have been identified:&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** A method comment is needed on in_active_period method in answer_helper.rb&lt;br /&gt;
** Line-by-line comments are needed for all added functions&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** The method find_review_period is possibly redundant as Find deadlines does exist already in the code. This method needs to be replaced/removed if possible&lt;br /&gt;
** Split delete_existing_responses into more functions as it's complexity is reletively high&lt;br /&gt;
*** Contains some nested loops so these should be removed&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Email functionality needs to be thoroughly tested&lt;br /&gt;
** Tests need to be more thorough and verify that correct rows are being deleted for delete_existing_responses function in answer_helper.rb&lt;br /&gt;
** Confirm changes do not affect students who have not yet submitted their reviews by doing UI testing&lt;br /&gt;
&lt;br /&gt;
== Completed Solution ==&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** Added more extensive comments to all added functions and lines of code for better readability&lt;br /&gt;
** Added a popup confirmation message when deleting a question during active period similar to when adding a question to ensure instructor wants to delete all responses&lt;br /&gt;
** Destroy response object instead of individual answers when editing a questionnaire during active period to return all students who submitted reviews to the 'begin' stage rather than 'edit' and give them a fresh questionnaire&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** Split complicated functions from previous team, such as delete_existing_responses(), into more manageable and modular functions which only complete 1 main task&lt;br /&gt;
** Fixed email formatting for email sent to users when questionnaire is edited&lt;br /&gt;
** find_review_period() now uses find_due_dates() to search for assignment due dates. Reduced number of database calls in find_review_period() to reduce interaction, number of iterating loops, and incorporate DRY principles&lt;br /&gt;
** answer data in log_response_info() now uses hash format for better readability&lt;br /&gt;
** Local array and hash variables now instantiated correctly.&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Improved rspec tests for all files&lt;br /&gt;
** Confirmed that changes do not affect students that have not yet submitted their reviews&lt;br /&gt;
&lt;br /&gt;
== Flow ==&lt;br /&gt;
The main actions this project affects are adding and removing questions from a questionnaire. These diagrams will show how these events now occur. Because these events are handled differently in Expertiza, the implementation is slightly different for both cases.&lt;br /&gt;
&lt;br /&gt;
'''*Note:''' As you can see in the diagrams below, the confirmation popup is thrown in different ways for &amp;quot;Add&amp;quot; vs &amp;quot;Remove&amp;quot;. This is because in _questionnaire.html.erb:&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Add&amp;quot;''' is implemented as a submit_tag which can easily have a confirm: attribute added to it causing it to throw a popup within expertiza.&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Remove&amp;quot;''' is an &amp;lt;a&amp;gt; tag hyperlink rendered to the page by line &amp;lt;%=question.edit(i)%&amp;gt; which iterates through all questions in the questionnaire and renders their edit() functions. Edit() is a function in each question types model (criterion.rb, cake.rb, etc.). Edit() adds lines to the html for each field in the question table, including the &amp;quot;Remove&amp;quot; link. The &amp;quot;Remove&amp;quot; hyperlink has an href attribute which dynamically links to /questions/ + self.id.to_s based on the desired questions id. It then uses a data-method=&amp;quot;delete&amp;quot; attribute to select the destroy method in questions_controller.rb. Because this hyperlink exists in each question types model, it is hard to implement a clean solution which does not edit all the model files. To do this, we added a short &amp;lt;script&amp;gt; to the end of _questionnaire.html.erb which scans for &amp;lt;a&amp;gt; hyperlink redirects with the [data-method=&amp;quot;delete&amp;quot;] attribute and throws a popup within the browser rather than expertiza. This popup works the same as the &amp;quot;Add&amp;quot; popup. The script returns the result (true/false) of this popup to the &amp;lt;a&amp;gt; tag. In html, the redirect is cancelled if a false is returned to the tag and continues if a true is returned.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: none; background: none;&amp;quot;&lt;br /&gt;
! Adding question during active period&lt;br /&gt;
! Removing question during active period&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Add_Question_Diagram.png|500px]] || [[File:Remove_Question_Diagram.png|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
Here is a list of files and the functions that were added or edited, excluding rspec files.&lt;br /&gt;
=== app/helpers/answer_helper.rb ===&lt;br /&gt;
Helper module containing important functions for deletion of responses and answers when editing a questionnaire during review period.&lt;br /&gt;
[[File:2110 img1.png]]&lt;br /&gt;
* '''delete_existing_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Calls log_answer_responses and log_answer_info to store responses users made to the questionnaire. If review_mailer can mail these responses to the user then delete_answers destroys the response object.&lt;br /&gt;
* '''log_answer_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Given a list of question_ids and a questionnaire_id, gathers reponse_ids for all users responses to the questionnaire.&lt;br /&gt;
* '''log_response_info(response_ids)'''&lt;br /&gt;
Given a list of response_ids, gathers users responses to a questionnaire and records their comments in a hash along with their name, email, and the assignment name.&lt;br /&gt;
&lt;br /&gt;
''NOTE:'' The only issue we have found on this project stems from the way this function gets ''answers''. Sometimes these review comments are sent to users in an email, and sometimes they are not. Our issue here [https://github.com/BoergerJ/expertiza/issues/29] explains it in more detail.&lt;br /&gt;
* '''review_mailer(email, answers, name, assignment_name)'''&lt;br /&gt;
Given an email, answer list, name, and assignment name, calls notify_review_rubric_change() to send given information about previous review submission to user at given email.&lt;br /&gt;
[[File:2110_img2.png]]&lt;br /&gt;
* '''delete_answers(response_id)'''&lt;br /&gt;
Given a response_id, set the response to be no longer submitted then destroy the response object. This destroys designated dependencies as well such as answers.&lt;br /&gt;
* '''in_active_period(questionnaire_id, answer=nil)'''&lt;br /&gt;
Given a questionnaire and possibly an answer, determine the assignment and round number. Use these to determine if the assignment is in a review period. Return true if in active period, false if not.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questionnaires_controller.rb ===&lt;br /&gt;
* '''add_new_questions'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questions_controller.rb ===&lt;br /&gt;
* '''destroy'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/mailers/mailer.rb ===&lt;br /&gt;
* '''notify_review_rubric_change(defn)'''&lt;br /&gt;
Mailer function which set necessary attributes for sending an email about a deleted response including previous answers. Calls mail() to send email to desired user.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment.rb ===&lt;br /&gt;
* '''find_review_period(round)'''&lt;br /&gt;
Determines the start and end dates of the rounds of an assignment and returns them.&lt;br /&gt;
Using previous teams code as a base, we changed this function to make minimal database calls and iterate fewer times.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment_questionnaire.rb ===&lt;br /&gt;
* '''get_latest_assignment(questionnaire_id)'''&lt;br /&gt;
Given questionnaire_id, returns assignment and round where questionnaire is used (if multiple questionnaires are used in an assignment)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/views/questionnaires/_questionnaire.html.erb ===&lt;br /&gt;
* Added in_active_period() call to display warning about edited questionnaire during active period&lt;br /&gt;
* Added confirm: to submit_tag 'Add' to display confirmation popup when adding a question during active period&lt;br /&gt;
* Added script to catch &amp;lt;a&amp;gt; tag redirects with [data-method=&amp;quot;delete&amp;quot;] to display popup when removing a question. Script only active if in active period.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/views/mailer/notify_review_rubric_change.html.erb ===&lt;br /&gt;
* New file containing email layout used when emailing students their answers after questionnaire is edited during active period.&lt;br /&gt;
&lt;br /&gt;
== Changed Files ==&lt;br /&gt;
* Added:&lt;br /&gt;
** app/helpers/answer_helper.rb&lt;br /&gt;
** app/views/mailer/notify_review_rubric_change.html.erb&lt;br /&gt;
&lt;br /&gt;
* Edited:&lt;br /&gt;
** app/controllers/questionnaires_controller.rb&lt;br /&gt;
** app/controllers/questions_controller.rb&lt;br /&gt;
** app/mailers/mailer.rb&lt;br /&gt;
** app/models/assignment.rb&lt;br /&gt;
** app/models/assignment_questionnaire.rb&lt;br /&gt;
** app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
&lt;br /&gt;
* Test Case Files&lt;br /&gt;
** spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
** spec/models/assignment_spec.rb&lt;br /&gt;
** spec/controllers/questions_controller_spec.rb&lt;br /&gt;
** spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
Tests are created in the following files:&lt;br /&gt;
* spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
* spec/models/assignment_spec.rb&lt;br /&gt;
* spec/controllers/questions_controller_spec.rb&lt;br /&gt;
* spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
These tests cover the following cases:&lt;br /&gt;
* Adding questions to a questionnaire during the review period&lt;br /&gt;
* Adding questions to a questionnaire outside the review period&lt;br /&gt;
* Determining if an assignment is in the review period&lt;br /&gt;
* Determining if an assignment is outside the review period&lt;br /&gt;
* Finding the start and end dates for a specific review period of an assignment&lt;br /&gt;
* Finding the start and end dates for all review periods of an assignment&lt;br /&gt;
* Deleting existing responses resulting from changes made to questionnaires during the review period&lt;br /&gt;
* Deleting questions&lt;br /&gt;
&lt;br /&gt;
The same cases were also tested manually through the Expertiza UI, as shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
== Team Links ==&lt;br /&gt;
Here is the video our team recorded to show functionality:&lt;br /&gt;
[https://youtu.be/yibtRg3MsyQ]&lt;br /&gt;
&lt;br /&gt;
The link to our team's repository:&lt;br /&gt;
[https://github.com/BoergerJ/expertiza]&lt;br /&gt;
&lt;br /&gt;
The link to the Expertiza pull request for our project:&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1941]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:2110_img2.png&amp;diff=138914</id>
		<title>File:2110 img2.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:2110_img2.png&amp;diff=138914"/>
		<updated>2021-05-03T20:02:12Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138913</id>
		<title>CSC/ECE 517 Spring 2021 - E2110. 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_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138913"/>
		<updated>2021-05-03T20:01:56Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* app/helpers/answer_helper.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Members ==&lt;br /&gt;
*Nicholas Himes&lt;br /&gt;
&lt;br /&gt;
*Surya Makthal&lt;br /&gt;
&lt;br /&gt;
*Jordan Boerger&lt;br /&gt;
&lt;br /&gt;
*Sai Krishna Wupadrashta Dhinakara Subrahmanya&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
While setting up an assignment, the instructor will 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.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
If the instructor does edit or change a rubric while an assignment is in progress:&lt;br /&gt;
* If the change affects only the wording of a particular rubric item (e.g., to clarify the statement), no action is necessary.&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.  The system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.  (However, the response_map should not be changed.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''This project was done in Fall 2019. However, it was not tested thoroughly. Our team's work in Spring 2021 is to improve the testing and readability of the code.'''&lt;br /&gt;
&lt;br /&gt;
== Design Diagrams ==&lt;br /&gt;
=== Use Case Diagrams ===&lt;br /&gt;
''*Using UML Use Case Diagram Syntax''&lt;br /&gt;
&lt;br /&gt;
[[File:E2110_Use_Case_Diagram.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Data Flow Diagrams ===&lt;br /&gt;
''Note: This data flow diagram was originally made by the team from project E1982 in Fall 2019. Their wiki link can be viewed here: &lt;br /&gt;
&lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1982._Regulate_changing_of_rubrics_while_projects_are_in_progress''&lt;br /&gt;
&lt;br /&gt;
[[File:DesignFlow.png]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
We will write comprehensive tests and fix any bugs in the code written already for changing rubrics while projects are in progress.&lt;br /&gt;
&lt;br /&gt;
Some known issues already have been identified:&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** A method comment is needed on in_active_period method in answer_helper.rb&lt;br /&gt;
** Line-by-line comments are needed for all added functions&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** The method find_review_period is possibly redundant as Find deadlines does exist already in the code. This method needs to be replaced/removed if possible&lt;br /&gt;
** Split delete_existing_responses into more functions as it's complexity is reletively high&lt;br /&gt;
*** Contains some nested loops so these should be removed&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Email functionality needs to be thoroughly tested&lt;br /&gt;
** Tests need to be more thorough and verify that correct rows are being deleted for delete_existing_responses function in answer_helper.rb&lt;br /&gt;
** Confirm changes do not affect students who have not yet submitted their reviews by doing UI testing&lt;br /&gt;
&lt;br /&gt;
== Completed Solution ==&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** Added more extensive comments to all added functions and lines of code for better readability&lt;br /&gt;
** Added a popup confirmation message when deleting a question during active period similar to when adding a question to ensure instructor wants to delete all responses&lt;br /&gt;
** Destroy response object instead of individual answers when editing a questionnaire during active period to return all students who submitted reviews to the 'begin' stage rather than 'edit' and give them a fresh questionnaire&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** Split complicated functions from previous team, such as delete_existing_responses(), into more manageable and modular functions which only complete 1 main task&lt;br /&gt;
** Fixed email formatting for email sent to users when questionnaire is edited&lt;br /&gt;
** find_review_period() now uses find_due_dates() to search for assignment due dates. Reduced number of database calls in find_review_period() to reduce interaction, number of iterating loops, and incorporate DRY principles&lt;br /&gt;
** answer data in log_response_info() now uses hash format for better readability&lt;br /&gt;
** Local array and hash variables now instantiated correctly.&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Improved rspec tests for all files&lt;br /&gt;
** Confirmed that changes do not affect students that have not yet submitted their reviews&lt;br /&gt;
&lt;br /&gt;
== Flow ==&lt;br /&gt;
The main actions this project affects are adding and removing questions from a questionnaire. These diagrams will show how these events now occur. Because these events are handled differently in Expertiza, the implementation is slightly different for both cases.&lt;br /&gt;
&lt;br /&gt;
'''*Note:''' As you can see in the diagrams below, the confirmation popup is thrown in different ways for &amp;quot;Add&amp;quot; vs &amp;quot;Remove&amp;quot;. This is because in _questionnaire.html.erb:&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Add&amp;quot;''' is implemented as a submit_tag which can easily have a confirm: attribute added to it causing it to throw a popup within expertiza.&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Remove&amp;quot;''' is an &amp;lt;a&amp;gt; tag hyperlink rendered to the page by line &amp;lt;%=question.edit(i)%&amp;gt; which iterates through all questions in the questionnaire and renders their edit() functions. Edit() is a function in each question types model (criterion.rb, cake.rb, etc.). Edit() adds lines to the html for each field in the question table, including the &amp;quot;Remove&amp;quot; link. The &amp;quot;Remove&amp;quot; hyperlink has an href attribute which dynamically links to /questions/ + self.id.to_s based on the desired questions id. It then uses a data-method=&amp;quot;delete&amp;quot; attribute to select the destroy method in questions_controller.rb. Because this hyperlink exists in each question types model, it is hard to implement a clean solution which does not edit all the model files. To do this, we added a short &amp;lt;script&amp;gt; to the end of _questionnaire.html.erb which scans for &amp;lt;a&amp;gt; hyperlink redirects with the [data-method=&amp;quot;delete&amp;quot;] attribute and throws a popup within the browser rather than expertiza. This popup works the same as the &amp;quot;Add&amp;quot; popup. The script returns the result (true/false) of this popup to the &amp;lt;a&amp;gt; tag. In html, the redirect is cancelled if a false is returned to the tag and continues if a true is returned.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: none; background: none;&amp;quot;&lt;br /&gt;
! Adding question during active period&lt;br /&gt;
! Removing question during active period&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Add_Question_Diagram.png|500px]] || [[File:Remove_Question_Diagram.png|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
Here is a list of files and the functions that were added or edited, excluding rspec files.&lt;br /&gt;
=== app/helpers/answer_helper.rb ===&lt;br /&gt;
Helper module containing important functions for deletion of responses and answers when editing a questionnaire during review period.&lt;br /&gt;
[[File:2110 img1.png]]&lt;br /&gt;
* '''delete_existing_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Calls log_answer_responses and log_answer_info to store responses users made to the questionnaire. If review_mailer can mail these responses to the user then delete_answers destroys the response object.&lt;br /&gt;
* '''log_answer_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Given a list of question_ids and a questionnaire_id, gathers reponse_ids for all users responses to the questionnaire.&lt;br /&gt;
* '''log_response_info(response_ids)'''&lt;br /&gt;
Given a list of response_ids, gathers users responses to a questionnaire and records their comments in a hash along with their name, email, and the assignment name.&lt;br /&gt;
&lt;br /&gt;
''NOTE:'' The only issue we have found on this project stems from the way this function gets ''answers''. Sometimes these review comments are sent to users in an email, and sometimes they are not. Our issue here [https://github.com/BoergerJ/expertiza/issues/29] explains it in more detail.&lt;br /&gt;
* '''review_mailer(email, answers, name, assignment_name)'''&lt;br /&gt;
Given an email, answer list, name, and assignment name, calls notify_review_rubric_change() to send given information about previous review submission to user at given email.&lt;br /&gt;
[[File:2110 img2.png]]&lt;br /&gt;
* '''delete_answers(response_id)'''&lt;br /&gt;
Given a response_id, set the response to be no longer submitted then destroy the response object. This destroys designated dependencies as well such as answers.&lt;br /&gt;
* '''in_active_period(questionnaire_id, answer=nil)'''&lt;br /&gt;
Given a questionnaire and possibly an answer, determine the assignment and round number. Use these to determine if the assignment is in a review period. Return true if in active period, false if not.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questionnaires_controller.rb ===&lt;br /&gt;
* '''add_new_questions'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questions_controller.rb ===&lt;br /&gt;
* '''destroy'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/mailers/mailer.rb ===&lt;br /&gt;
* '''notify_review_rubric_change(defn)'''&lt;br /&gt;
Mailer function which set necessary attributes for sending an email about a deleted response including previous answers. Calls mail() to send email to desired user.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment.rb ===&lt;br /&gt;
* '''find_review_period(round)'''&lt;br /&gt;
Determines the start and end dates of the rounds of an assignment and returns them.&lt;br /&gt;
Using previous teams code as a base, we changed this function to make minimal database calls and iterate fewer times.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment_questionnaire.rb ===&lt;br /&gt;
* '''get_latest_assignment(questionnaire_id)'''&lt;br /&gt;
Given questionnaire_id, returns assignment and round where questionnaire is used (if multiple questionnaires are used in an assignment)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/views/questionnaires/_questionnaire.html.erb ===&lt;br /&gt;
* Added in_active_period() call to display warning about edited questionnaire during active period&lt;br /&gt;
* Added confirm: to submit_tag 'Add' to display confirmation popup when adding a question during active period&lt;br /&gt;
* Added script to catch &amp;lt;a&amp;gt; tag redirects with [data-method=&amp;quot;delete&amp;quot;] to display popup when removing a question. Script only active if in active period.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/views/mailer/notify_review_rubric_change.html.erb ===&lt;br /&gt;
* New file containing email layout used when emailing students their answers after questionnaire is edited during active period.&lt;br /&gt;
&lt;br /&gt;
== Changed Files ==&lt;br /&gt;
* Added:&lt;br /&gt;
** app/helpers/answer_helper.rb&lt;br /&gt;
** app/views/mailer/notify_review_rubric_change.html.erb&lt;br /&gt;
&lt;br /&gt;
* Edited:&lt;br /&gt;
** app/controllers/questionnaires_controller.rb&lt;br /&gt;
** app/controllers/questions_controller.rb&lt;br /&gt;
** app/mailers/mailer.rb&lt;br /&gt;
** app/models/assignment.rb&lt;br /&gt;
** app/models/assignment_questionnaire.rb&lt;br /&gt;
** app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
&lt;br /&gt;
* Test Case Files&lt;br /&gt;
** spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
** spec/models/assignment_spec.rb&lt;br /&gt;
** spec/controllers/questions_controller_spec.rb&lt;br /&gt;
** spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
Tests are created in the following files:&lt;br /&gt;
* spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
* spec/models/assignment_spec.rb&lt;br /&gt;
* spec/controllers/questions_controller_spec.rb&lt;br /&gt;
* spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
These tests cover the following cases:&lt;br /&gt;
* Adding questions to a questionnaire during the review period&lt;br /&gt;
* Adding questions to a questionnaire outside the review period&lt;br /&gt;
* Determining if an assignment is in the review period&lt;br /&gt;
* Determining if an assignment is outside the review period&lt;br /&gt;
* Finding the start and end dates for a specific review period of an assignment&lt;br /&gt;
* Finding the start and end dates for all review periods of an assignment&lt;br /&gt;
* Deleting existing responses resulting from changes made to questionnaires during the review period&lt;br /&gt;
* Deleting questions&lt;br /&gt;
&lt;br /&gt;
The same cases were also tested manually through the Expertiza UI, as shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
== Team Links ==&lt;br /&gt;
Here is the video our team recorded to show functionality:&lt;br /&gt;
[https://youtu.be/yibtRg3MsyQ]&lt;br /&gt;
&lt;br /&gt;
The link to our team's repository:&lt;br /&gt;
[https://github.com/BoergerJ/expertiza]&lt;br /&gt;
&lt;br /&gt;
The link to the Expertiza pull request for our project:&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1941]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138912</id>
		<title>CSC/ECE 517 Spring 2021 - E2110. 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_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138912"/>
		<updated>2021-05-03T19:59:35Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* Documentation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Members ==&lt;br /&gt;
*Nicholas Himes&lt;br /&gt;
&lt;br /&gt;
*Surya Makthal&lt;br /&gt;
&lt;br /&gt;
*Jordan Boerger&lt;br /&gt;
&lt;br /&gt;
*Sai Krishna Wupadrashta Dhinakara Subrahmanya&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
While setting up an assignment, the instructor will 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.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
If the instructor does edit or change a rubric while an assignment is in progress:&lt;br /&gt;
* If the change affects only the wording of a particular rubric item (e.g., to clarify the statement), no action is necessary.&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.  The system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.  (However, the response_map should not be changed.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''This project was done in Fall 2019. However, it was not tested thoroughly. Our team's work in Spring 2021 is to improve the testing and readability of the code.'''&lt;br /&gt;
&lt;br /&gt;
== Design Diagrams ==&lt;br /&gt;
=== Use Case Diagrams ===&lt;br /&gt;
''*Using UML Use Case Diagram Syntax''&lt;br /&gt;
&lt;br /&gt;
[[File:E2110_Use_Case_Diagram.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Data Flow Diagrams ===&lt;br /&gt;
''Note: This data flow diagram was originally made by the team from project E1982 in Fall 2019. Their wiki link can be viewed here: &lt;br /&gt;
&lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1982._Regulate_changing_of_rubrics_while_projects_are_in_progress''&lt;br /&gt;
&lt;br /&gt;
[[File:DesignFlow.png]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
We will write comprehensive tests and fix any bugs in the code written already for changing rubrics while projects are in progress.&lt;br /&gt;
&lt;br /&gt;
Some known issues already have been identified:&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** A method comment is needed on in_active_period method in answer_helper.rb&lt;br /&gt;
** Line-by-line comments are needed for all added functions&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** The method find_review_period is possibly redundant as Find deadlines does exist already in the code. This method needs to be replaced/removed if possible&lt;br /&gt;
** Split delete_existing_responses into more functions as it's complexity is reletively high&lt;br /&gt;
*** Contains some nested loops so these should be removed&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Email functionality needs to be thoroughly tested&lt;br /&gt;
** Tests need to be more thorough and verify that correct rows are being deleted for delete_existing_responses function in answer_helper.rb&lt;br /&gt;
** Confirm changes do not affect students who have not yet submitted their reviews by doing UI testing&lt;br /&gt;
&lt;br /&gt;
== Completed Solution ==&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** Added more extensive comments to all added functions and lines of code for better readability&lt;br /&gt;
** Added a popup confirmation message when deleting a question during active period similar to when adding a question to ensure instructor wants to delete all responses&lt;br /&gt;
** Destroy response object instead of individual answers when editing a questionnaire during active period to return all students who submitted reviews to the 'begin' stage rather than 'edit' and give them a fresh questionnaire&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** Split complicated functions from previous team, such as delete_existing_responses(), into more manageable and modular functions which only complete 1 main task&lt;br /&gt;
** Fixed email formatting for email sent to users when questionnaire is edited&lt;br /&gt;
** find_review_period() now uses find_due_dates() to search for assignment due dates. Reduced number of database calls in find_review_period() to reduce interaction, number of iterating loops, and incorporate DRY principles&lt;br /&gt;
** answer data in log_response_info() now uses hash format for better readability&lt;br /&gt;
** Local array and hash variables now instantiated correctly.&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Improved rspec tests for all files&lt;br /&gt;
** Confirmed that changes do not affect students that have not yet submitted their reviews&lt;br /&gt;
&lt;br /&gt;
== Flow ==&lt;br /&gt;
The main actions this project affects are adding and removing questions from a questionnaire. These diagrams will show how these events now occur. Because these events are handled differently in Expertiza, the implementation is slightly different for both cases.&lt;br /&gt;
&lt;br /&gt;
'''*Note:''' As you can see in the diagrams below, the confirmation popup is thrown in different ways for &amp;quot;Add&amp;quot; vs &amp;quot;Remove&amp;quot;. This is because in _questionnaire.html.erb:&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Add&amp;quot;''' is implemented as a submit_tag which can easily have a confirm: attribute added to it causing it to throw a popup within expertiza.&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Remove&amp;quot;''' is an &amp;lt;a&amp;gt; tag hyperlink rendered to the page by line &amp;lt;%=question.edit(i)%&amp;gt; which iterates through all questions in the questionnaire and renders their edit() functions. Edit() is a function in each question types model (criterion.rb, cake.rb, etc.). Edit() adds lines to the html for each field in the question table, including the &amp;quot;Remove&amp;quot; link. The &amp;quot;Remove&amp;quot; hyperlink has an href attribute which dynamically links to /questions/ + self.id.to_s based on the desired questions id. It then uses a data-method=&amp;quot;delete&amp;quot; attribute to select the destroy method in questions_controller.rb. Because this hyperlink exists in each question types model, it is hard to implement a clean solution which does not edit all the model files. To do this, we added a short &amp;lt;script&amp;gt; to the end of _questionnaire.html.erb which scans for &amp;lt;a&amp;gt; hyperlink redirects with the [data-method=&amp;quot;delete&amp;quot;] attribute and throws a popup within the browser rather than expertiza. This popup works the same as the &amp;quot;Add&amp;quot; popup. The script returns the result (true/false) of this popup to the &amp;lt;a&amp;gt; tag. In html, the redirect is cancelled if a false is returned to the tag and continues if a true is returned.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: none; background: none;&amp;quot;&lt;br /&gt;
! Adding question during active period&lt;br /&gt;
! Removing question during active period&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Add_Question_Diagram.png|500px]] || [[File:Remove_Question_Diagram.png|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
Here is a list of files and the functions that were added or edited, excluding rspec files.&lt;br /&gt;
=== app/helpers/answer_helper.rb ===&lt;br /&gt;
Helper module containing important functions for deletion of responses and answers when editing a questionnaire during review period.&lt;br /&gt;
[[File:2110 img1.png]]&lt;br /&gt;
* '''delete_existing_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Calls log_answer_responses and log_answer_info to store responses users made to the questionnaire. If review_mailer can mail these responses to the user then delete_answers destroys the response object.&lt;br /&gt;
* '''log_answer_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Given a list of question_ids and a questionnaire_id, gathers reponse_ids for all users responses to the questionnaire.&lt;br /&gt;
* '''log_response_info(response_ids)'''&lt;br /&gt;
Given a list of response_ids, gathers users responses to a questionnaire and records their comments in a hash along with their name, email, and the assignment name.&lt;br /&gt;
&lt;br /&gt;
''NOTE:'' The only issue we have found on this project stems from the way this function gets ''answers''. Sometimes these review comments are sent to users in an email, and sometimes they are not. Our issue here [https://github.com/BoergerJ/expertiza/issues/29] explains it in more detail.&lt;br /&gt;
* '''review_mailer(email, answers, name, assignment_name)'''&lt;br /&gt;
Given an email, answer list, name, and assignment name, calls notify_review_rubric_change() to send given information about previous review submission to user at given email.&lt;br /&gt;
* '''delete_answers(response_id)'''&lt;br /&gt;
Given a response_id, set the response to be no longer submitted then destroy the response object. This destroys designated dependencies as well such as answers.&lt;br /&gt;
* '''in_active_period(questionnaire_id, answer=nil)'''&lt;br /&gt;
Given a questionnaire and possibly an answer, determine the assignment and round number. Use these to determine if the assignment is in a review period. Return true if in active period, false if not.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questionnaires_controller.rb ===&lt;br /&gt;
* '''add_new_questions'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questions_controller.rb ===&lt;br /&gt;
* '''destroy'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/mailers/mailer.rb ===&lt;br /&gt;
* '''notify_review_rubric_change(defn)'''&lt;br /&gt;
Mailer function which set necessary attributes for sending an email about a deleted response including previous answers. Calls mail() to send email to desired user.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment.rb ===&lt;br /&gt;
* '''find_review_period(round)'''&lt;br /&gt;
Determines the start and end dates of the rounds of an assignment and returns them.&lt;br /&gt;
Using previous teams code as a base, we changed this function to make minimal database calls and iterate fewer times.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment_questionnaire.rb ===&lt;br /&gt;
* '''get_latest_assignment(questionnaire_id)'''&lt;br /&gt;
Given questionnaire_id, returns assignment and round where questionnaire is used (if multiple questionnaires are used in an assignment)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/views/questionnaires/_questionnaire.html.erb ===&lt;br /&gt;
* Added in_active_period() call to display warning about edited questionnaire during active period&lt;br /&gt;
* Added confirm: to submit_tag 'Add' to display confirmation popup when adding a question during active period&lt;br /&gt;
* Added script to catch &amp;lt;a&amp;gt; tag redirects with [data-method=&amp;quot;delete&amp;quot;] to display popup when removing a question. Script only active if in active period.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/views/mailer/notify_review_rubric_change.html.erb ===&lt;br /&gt;
* New file containing email layout used when emailing students their answers after questionnaire is edited during active period.&lt;br /&gt;
&lt;br /&gt;
== Changed Files ==&lt;br /&gt;
* Added:&lt;br /&gt;
** app/helpers/answer_helper.rb&lt;br /&gt;
** app/views/mailer/notify_review_rubric_change.html.erb&lt;br /&gt;
&lt;br /&gt;
* Edited:&lt;br /&gt;
** app/controllers/questionnaires_controller.rb&lt;br /&gt;
** app/controllers/questions_controller.rb&lt;br /&gt;
** app/mailers/mailer.rb&lt;br /&gt;
** app/models/assignment.rb&lt;br /&gt;
** app/models/assignment_questionnaire.rb&lt;br /&gt;
** app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
&lt;br /&gt;
* Test Case Files&lt;br /&gt;
** spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
** spec/models/assignment_spec.rb&lt;br /&gt;
** spec/controllers/questions_controller_spec.rb&lt;br /&gt;
** spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
Tests are created in the following files:&lt;br /&gt;
* spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
* spec/models/assignment_spec.rb&lt;br /&gt;
* spec/controllers/questions_controller_spec.rb&lt;br /&gt;
* spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
These tests cover the following cases:&lt;br /&gt;
* Adding questions to a questionnaire during the review period&lt;br /&gt;
* Adding questions to a questionnaire outside the review period&lt;br /&gt;
* Determining if an assignment is in the review period&lt;br /&gt;
* Determining if an assignment is outside the review period&lt;br /&gt;
* Finding the start and end dates for a specific review period of an assignment&lt;br /&gt;
* Finding the start and end dates for all review periods of an assignment&lt;br /&gt;
* Deleting existing responses resulting from changes made to questionnaires during the review period&lt;br /&gt;
* Deleting questions&lt;br /&gt;
&lt;br /&gt;
The same cases were also tested manually through the Expertiza UI, as shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
== Team Links ==&lt;br /&gt;
Here is the video our team recorded to show functionality:&lt;br /&gt;
[https://youtu.be/yibtRg3MsyQ]&lt;br /&gt;
&lt;br /&gt;
The link to our team's repository:&lt;br /&gt;
[https://github.com/BoergerJ/expertiza]&lt;br /&gt;
&lt;br /&gt;
The link to the Expertiza pull request for our project:&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1941]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:2110_img1.png&amp;diff=138911</id>
		<title>File:2110 img1.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:2110_img1.png&amp;diff=138911"/>
		<updated>2021-05-03T19:57:19Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138910</id>
		<title>CSC/ECE 517 Spring 2021 - E2110. 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_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138910"/>
		<updated>2021-05-03T19:57:00Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* app/helpers/answer_helper.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Members ==&lt;br /&gt;
*Nicholas Himes&lt;br /&gt;
&lt;br /&gt;
*Surya Makthal&lt;br /&gt;
&lt;br /&gt;
*Jordan Boerger&lt;br /&gt;
&lt;br /&gt;
*Sai Krishna Wupadrashta Dhinakara Subrahmanya&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
While setting up an assignment, the instructor will 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.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
If the instructor does edit or change a rubric while an assignment is in progress:&lt;br /&gt;
* If the change affects only the wording of a particular rubric item (e.g., to clarify the statement), no action is necessary.&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.  The system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.  (However, the response_map should not be changed.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''This project was done in Fall 2019. However, it was not tested thoroughly. Our team's work in Spring 2021 is to improve the testing and readability of the code.'''&lt;br /&gt;
&lt;br /&gt;
== Design Diagrams ==&lt;br /&gt;
=== Use Case Diagrams ===&lt;br /&gt;
''*Using UML Use Case Diagram Syntax''&lt;br /&gt;
&lt;br /&gt;
[[File:E2110_Use_Case_Diagram.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Data Flow Diagrams ===&lt;br /&gt;
''Note: This data flow diagram was originally made by the team from project E1982 in Fall 2019. Their wiki link can be viewed here: &lt;br /&gt;
&lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1982._Regulate_changing_of_rubrics_while_projects_are_in_progress''&lt;br /&gt;
&lt;br /&gt;
[[File:DesignFlow.png]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
We will write comprehensive tests and fix any bugs in the code written already for changing rubrics while projects are in progress.&lt;br /&gt;
&lt;br /&gt;
Some known issues already have been identified:&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** A method comment is needed on in_active_period method in answer_helper.rb&lt;br /&gt;
** Line-by-line comments are needed for all added functions&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** The method find_review_period is possibly redundant as Find deadlines does exist already in the code. This method needs to be replaced/removed if possible&lt;br /&gt;
** Split delete_existing_responses into more functions as it's complexity is reletively high&lt;br /&gt;
*** Contains some nested loops so these should be removed&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Email functionality needs to be thoroughly tested&lt;br /&gt;
** Tests need to be more thorough and verify that correct rows are being deleted for delete_existing_responses function in answer_helper.rb&lt;br /&gt;
** Confirm changes do not affect students who have not yet submitted their reviews by doing UI testing&lt;br /&gt;
&lt;br /&gt;
== Completed Solution ==&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** Added more extensive comments to all added functions and lines of code for better readability&lt;br /&gt;
** Added a popup confirmation message when deleting a question during active period similar to when adding a question to ensure instructor wants to delete all responses&lt;br /&gt;
** Destroy response object instead of individual answers when editing a questionnaire during active period to return all students who submitted reviews to the 'begin' stage rather than 'edit' and give them a fresh questionnaire&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** Split complicated functions from previous team, such as delete_existing_responses(), into more manageable and modular functions which only complete 1 main task&lt;br /&gt;
** Fixed email formatting for email sent to users when questionnaire is edited&lt;br /&gt;
** find_review_period() now uses find_due_dates() to search for assignment due dates. Reduced number of database calls in find_review_period() to reduce interaction, number of iterating loops, and incorporate DRY principles&lt;br /&gt;
** answer data in log_response_info() now uses hash format for better readability&lt;br /&gt;
** Local array and hash variables now instantiated correctly.&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Improved rspec tests for all files&lt;br /&gt;
** Confirmed that changes do not affect students that have not yet submitted their reviews&lt;br /&gt;
&lt;br /&gt;
== Flow ==&lt;br /&gt;
The main actions this project affects are adding and removing questions from a questionnaire. These diagrams will show how these events now occur. Because these events are handled differently in Expertiza, the implementation is slightly different for both cases.&lt;br /&gt;
&lt;br /&gt;
'''*Note:''' As you can see in the diagrams below, the confirmation popup is thrown in different ways for &amp;quot;Add&amp;quot; vs &amp;quot;Remove&amp;quot;. This is because in _questionnaire.html.erb:&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Add&amp;quot;''' is implemented as a submit_tag which can easily have a confirm: attribute added to it causing it to throw a popup within expertiza.&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Remove&amp;quot;''' is an &amp;lt;a&amp;gt; tag hyperlink rendered to the page by line &amp;lt;%=question.edit(i)%&amp;gt; which iterates through all questions in the questionnaire and renders their edit() functions. Edit() is a function in each question types model (criterion.rb, cake.rb, etc.). Edit() adds lines to the html for each field in the question table, including the &amp;quot;Remove&amp;quot; link. The &amp;quot;Remove&amp;quot; hyperlink has an href attribute which dynamically links to /questions/ + self.id.to_s based on the desired questions id. It then uses a data-method=&amp;quot;delete&amp;quot; attribute to select the destroy method in questions_controller.rb. Because this hyperlink exists in each question types model, it is hard to implement a clean solution which does not edit all the model files. To do this, we added a short &amp;lt;script&amp;gt; to the end of _questionnaire.html.erb which scans for &amp;lt;a&amp;gt; hyperlink redirects with the [data-method=&amp;quot;delete&amp;quot;] attribute and throws a popup within the browser rather than expertiza. This popup works the same as the &amp;quot;Add&amp;quot; popup. The script returns the result (true/false) of this popup to the &amp;lt;a&amp;gt; tag. In html, the redirect is cancelled if a false is returned to the tag and continues if a true is returned.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: none; background: none;&amp;quot;&lt;br /&gt;
! Adding question during active period&lt;br /&gt;
! Removing question during active period&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Add_Question_Diagram.png|500px]] || [[File:Remove_Question_Diagram.png|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
Here is a list of files and the functions that were added or edited, excluding rspec files.&lt;br /&gt;
=== app/helpers/answer_helper.rb ===&lt;br /&gt;
Helper module containing important functions for deletion of responses and answers when editing a questionnaire during review period.&lt;br /&gt;
[[File:2110_img1.png]]&lt;br /&gt;
* '''delete_existing_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Calls log_answer_responses and log_answer_info to store responses users made to the questionnaire. If review_mailer can mail these responses to the user then delete_answers destroys the response object.&lt;br /&gt;
* '''log_answer_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Given a list of question_ids and a questionnaire_id, gathers reponse_ids for all users responses to the questionnaire.&lt;br /&gt;
* '''log_response_info(response_ids)'''&lt;br /&gt;
Given a list of response_ids, gathers users responses to a questionnaire and records their comments in a hash along with their name, email, and the assignment name.&lt;br /&gt;
&lt;br /&gt;
''NOTE:'' The only issue we have found on this project stems from the way this function gets ''answers''. Sometimes these review comments are sent to users in an email, and sometimes they are not. Our issue here [https://github.com/BoergerJ/expertiza/issues/29] explains it in more detail.&lt;br /&gt;
* '''review_mailer(email, answers, name, assignment_name)'''&lt;br /&gt;
Given an email, answer list, name, and assignment name, calls notify_review_rubric_change() to send given information about previous review submission to user at given email.&lt;br /&gt;
* '''delete_answers(response_id)'''&lt;br /&gt;
Given a response_id, set the response to be no longer submitted then destroy the response object. This destroys designated dependencies as well such as answers.&lt;br /&gt;
* '''in_active_period(questionnaire_id, answer=nil)'''&lt;br /&gt;
Given a questionnaire and possibly an answer, determine the assignment and round number. Use these to determine if the assignment is in a review period. Return true if in active period, false if not.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questionnaires_controller.rb ===&lt;br /&gt;
* '''add_new_questions'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questions_controller.rb ===&lt;br /&gt;
* '''destroy'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/mailers/mailer.rb ===&lt;br /&gt;
* '''notify_review_rubric_change(defn)'''&lt;br /&gt;
Mailer function which set necessary attributes for sending an email about a deleted response including previous answers. Calls mail() to send email to desired user.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment.rb ===&lt;br /&gt;
* '''find_review_period(round)'''&lt;br /&gt;
Determines the start and end dates of the rounds of an assignment and returns them.&lt;br /&gt;
Using previous teams code as a base, we changed this function to make minimal database calls and iterate fewer times.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment_questionnaire.rb ===&lt;br /&gt;
* '''get_latest_assignment(questionnaire_id)'''&lt;br /&gt;
Given questionnaire_id, returns assignment and round where questionnaire is used (if multiple questionnaires are used in an assignment)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/views/questionnaires/_questionnaire.html.erb ===&lt;br /&gt;
* Added in_active_period() call to display warning about edited questionnaire during active period&lt;br /&gt;
* Added confirm: to submit_tag 'Add' to display confirmation popup when adding a question during active period&lt;br /&gt;
* Added script to catch &amp;lt;a&amp;gt; tag redirects with [data-method=&amp;quot;delete&amp;quot;] to display popup when removing a question. Script only active if in active period.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/views/mailer/notify_review_rubric_change.html.erb ===&lt;br /&gt;
* New file containing email layout used when emailing students their answers after questionnaire is edited during active period.&lt;br /&gt;
&lt;br /&gt;
== Changed Files ==&lt;br /&gt;
* Added:&lt;br /&gt;
** app/helpers/answer_helper.rb&lt;br /&gt;
** app/views/mailer/notify_review_rubric_change.html.erb&lt;br /&gt;
&lt;br /&gt;
* Edited:&lt;br /&gt;
** app/controllers/questionnaires_controller.rb&lt;br /&gt;
** app/controllers/questions_controller.rb&lt;br /&gt;
** app/mailers/mailer.rb&lt;br /&gt;
** app/models/assignment.rb&lt;br /&gt;
** app/models/assignment_questionnaire.rb&lt;br /&gt;
** app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
&lt;br /&gt;
* Test Case Files&lt;br /&gt;
** spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
** spec/models/assignment_spec.rb&lt;br /&gt;
** spec/controllers/questions_controller_spec.rb&lt;br /&gt;
** spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
Tests are created in the following files:&lt;br /&gt;
* spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
* spec/models/assignment_spec.rb&lt;br /&gt;
* spec/controllers/questions_controller_spec.rb&lt;br /&gt;
* spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
These tests cover the following cases:&lt;br /&gt;
* Adding questions to a questionnaire during the review period&lt;br /&gt;
* Adding questions to a questionnaire outside the review period&lt;br /&gt;
* Determining if an assignment is in the review period&lt;br /&gt;
* Determining if an assignment is outside the review period&lt;br /&gt;
* Finding the start and end dates for a specific review period of an assignment&lt;br /&gt;
* Finding the start and end dates for all review periods of an assignment&lt;br /&gt;
* Deleting existing responses resulting from changes made to questionnaires during the review period&lt;br /&gt;
* Deleting questions&lt;br /&gt;
&lt;br /&gt;
The same cases were also tested manually through the Expertiza UI, as shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
== Team Links ==&lt;br /&gt;
Here is the video our team recorded to show functionality:&lt;br /&gt;
[https://youtu.be/yibtRg3MsyQ]&lt;br /&gt;
&lt;br /&gt;
The link to our team's repository:&lt;br /&gt;
[https://github.com/BoergerJ/expertiza]&lt;br /&gt;
&lt;br /&gt;
The link to the Expertiza pull request for our project:&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1941]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138909</id>
		<title>CSC/ECE 517 Spring 2021 - E2110. 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_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138909"/>
		<updated>2021-05-03T19:53:15Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* Documentation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Members ==&lt;br /&gt;
*Nicholas Himes&lt;br /&gt;
&lt;br /&gt;
*Surya Makthal&lt;br /&gt;
&lt;br /&gt;
*Jordan Boerger&lt;br /&gt;
&lt;br /&gt;
*Sai Krishna Wupadrashta Dhinakara Subrahmanya&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
While setting up an assignment, the instructor will 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.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
If the instructor does edit or change a rubric while an assignment is in progress:&lt;br /&gt;
* If the change affects only the wording of a particular rubric item (e.g., to clarify the statement), no action is necessary.&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.  The system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.  (However, the response_map should not be changed.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''This project was done in Fall 2019. However, it was not tested thoroughly. Our team's work in Spring 2021 is to improve the testing and readability of the code.'''&lt;br /&gt;
&lt;br /&gt;
== Design Diagrams ==&lt;br /&gt;
=== Use Case Diagrams ===&lt;br /&gt;
''*Using UML Use Case Diagram Syntax''&lt;br /&gt;
&lt;br /&gt;
[[File:E2110_Use_Case_Diagram.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Data Flow Diagrams ===&lt;br /&gt;
''Note: This data flow diagram was originally made by the team from project E1982 in Fall 2019. Their wiki link can be viewed here: &lt;br /&gt;
&lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1982._Regulate_changing_of_rubrics_while_projects_are_in_progress''&lt;br /&gt;
&lt;br /&gt;
[[File:DesignFlow.png]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
We will write comprehensive tests and fix any bugs in the code written already for changing rubrics while projects are in progress.&lt;br /&gt;
&lt;br /&gt;
Some known issues already have been identified:&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** A method comment is needed on in_active_period method in answer_helper.rb&lt;br /&gt;
** Line-by-line comments are needed for all added functions&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** The method find_review_period is possibly redundant as Find deadlines does exist already in the code. This method needs to be replaced/removed if possible&lt;br /&gt;
** Split delete_existing_responses into more functions as it's complexity is reletively high&lt;br /&gt;
*** Contains some nested loops so these should be removed&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Email functionality needs to be thoroughly tested&lt;br /&gt;
** Tests need to be more thorough and verify that correct rows are being deleted for delete_existing_responses function in answer_helper.rb&lt;br /&gt;
** Confirm changes do not affect students who have not yet submitted their reviews by doing UI testing&lt;br /&gt;
&lt;br /&gt;
== Completed Solution ==&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** Added more extensive comments to all added functions and lines of code for better readability&lt;br /&gt;
** Added a popup confirmation message when deleting a question during active period similar to when adding a question to ensure instructor wants to delete all responses&lt;br /&gt;
** Destroy response object instead of individual answers when editing a questionnaire during active period to return all students who submitted reviews to the 'begin' stage rather than 'edit' and give them a fresh questionnaire&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** Split complicated functions from previous team, such as delete_existing_responses(), into more manageable and modular functions which only complete 1 main task&lt;br /&gt;
** Fixed email formatting for email sent to users when questionnaire is edited&lt;br /&gt;
** find_review_period() now uses find_due_dates() to search for assignment due dates. Reduced number of database calls in find_review_period() to reduce interaction, number of iterating loops, and incorporate DRY principles&lt;br /&gt;
** answer data in log_response_info() now uses hash format for better readability&lt;br /&gt;
** Local array and hash variables now instantiated correctly.&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Improved rspec tests for all files&lt;br /&gt;
** Confirmed that changes do not affect students that have not yet submitted their reviews&lt;br /&gt;
&lt;br /&gt;
== Flow ==&lt;br /&gt;
The main actions this project affects are adding and removing questions from a questionnaire. These diagrams will show how these events now occur. Because these events are handled differently in Expertiza, the implementation is slightly different for both cases.&lt;br /&gt;
&lt;br /&gt;
'''*Note:''' As you can see in the diagrams below, the confirmation popup is thrown in different ways for &amp;quot;Add&amp;quot; vs &amp;quot;Remove&amp;quot;. This is because in _questionnaire.html.erb:&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Add&amp;quot;''' is implemented as a submit_tag which can easily have a confirm: attribute added to it causing it to throw a popup within expertiza.&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Remove&amp;quot;''' is an &amp;lt;a&amp;gt; tag hyperlink rendered to the page by line &amp;lt;%=question.edit(i)%&amp;gt; which iterates through all questions in the questionnaire and renders their edit() functions. Edit() is a function in each question types model (criterion.rb, cake.rb, etc.). Edit() adds lines to the html for each field in the question table, including the &amp;quot;Remove&amp;quot; link. The &amp;quot;Remove&amp;quot; hyperlink has an href attribute which dynamically links to /questions/ + self.id.to_s based on the desired questions id. It then uses a data-method=&amp;quot;delete&amp;quot; attribute to select the destroy method in questions_controller.rb. Because this hyperlink exists in each question types model, it is hard to implement a clean solution which does not edit all the model files. To do this, we added a short &amp;lt;script&amp;gt; to the end of _questionnaire.html.erb which scans for &amp;lt;a&amp;gt; hyperlink redirects with the [data-method=&amp;quot;delete&amp;quot;] attribute and throws a popup within the browser rather than expertiza. This popup works the same as the &amp;quot;Add&amp;quot; popup. The script returns the result (true/false) of this popup to the &amp;lt;a&amp;gt; tag. In html, the redirect is cancelled if a false is returned to the tag and continues if a true is returned.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: none; background: none;&amp;quot;&lt;br /&gt;
! Adding question during active period&lt;br /&gt;
! Removing question during active period&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Add_Question_Diagram.png|500px]] || [[File:Remove_Question_Diagram.png|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
Here is a list of files and the functions that were added or edited, excluding rspec files.&lt;br /&gt;
=== app/helpers/answer_helper.rb ===&lt;br /&gt;
Helper module containing important functions for deletion of responses and answers when editing a questionnaire during review period.&lt;br /&gt;
* '''delete_existing_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Calls log_answer_responses and log_answer_info to store responses users made to the questionnaire. If review_mailer can mail these responses to the user then delete_answers destroys the response object.&lt;br /&gt;
* '''log_answer_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Given a list of question_ids and a questionnaire_id, gathers reponse_ids for all users responses to the questionnaire.&lt;br /&gt;
* '''log_response_info(response_ids)'''&lt;br /&gt;
Given a list of response_ids, gathers users responses to a questionnaire and records their comments in a hash along with their name, email, and the assignment name.&lt;br /&gt;
&lt;br /&gt;
''NOTE:'' The only issue we have found on this project stems from the way this function gets ''answers''. Sometimes these review comments are sent to users in an email, and sometimes they are not. Our issue here [https://github.com/BoergerJ/expertiza/issues/29] explains it in more detail.&lt;br /&gt;
* '''review_mailer(email, answers, name, assignment_name)'''&lt;br /&gt;
Given an email, answer list, name, and assignment name, calls notify_review_rubric_change() to send given information about previous review submission to user at given email.&lt;br /&gt;
* '''delete_answers(response_id)'''&lt;br /&gt;
Given a response_id, set the response to be no longer submitted then destroy the response object. This destroys designated dependencies as well such as answers.&lt;br /&gt;
* '''in_active_period(questionnaire_id, answer=nil)'''&lt;br /&gt;
Given a questionnaire and possibly an answer, determine the assignment and round number. Use these to determine if the assignment is in a review period. Return true if in active period, false if not.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questionnaires_controller.rb ===&lt;br /&gt;
* '''add_new_questions'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questions_controller.rb ===&lt;br /&gt;
* '''destroy'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/mailers/mailer.rb ===&lt;br /&gt;
* '''notify_review_rubric_change(defn)'''&lt;br /&gt;
Mailer function which set necessary attributes for sending an email about a deleted response including previous answers. Calls mail() to send email to desired user.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment.rb ===&lt;br /&gt;
* '''find_review_period(round)'''&lt;br /&gt;
Determines the start and end dates of the rounds of an assignment and returns them.&lt;br /&gt;
Using previous teams code as a base, we changed this function to make minimal database calls and iterate fewer times.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment_questionnaire.rb ===&lt;br /&gt;
* '''get_latest_assignment(questionnaire_id)'''&lt;br /&gt;
Given questionnaire_id, returns assignment and round where questionnaire is used (if multiple questionnaires are used in an assignment)&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/views/questionnaires/_questionnaire.html.erb ===&lt;br /&gt;
* Added in_active_period() call to display warning about edited questionnaire during active period&lt;br /&gt;
* Added confirm: to submit_tag 'Add' to display confirmation popup when adding a question during active period&lt;br /&gt;
* Added script to catch &amp;lt;a&amp;gt; tag redirects with [data-method=&amp;quot;delete&amp;quot;] to display popup when removing a question. Script only active if in active period.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
=== app/views/mailer/notify_review_rubric_change.html.erb ===&lt;br /&gt;
* New file containing email layout used when emailing students their answers after questionnaire is edited during active period.&lt;br /&gt;
&lt;br /&gt;
== Changed Files ==&lt;br /&gt;
* Added:&lt;br /&gt;
** app/helpers/answer_helper.rb&lt;br /&gt;
** app/views/mailer/notify_review_rubric_change.html.erb&lt;br /&gt;
&lt;br /&gt;
* Edited:&lt;br /&gt;
** app/controllers/questionnaires_controller.rb&lt;br /&gt;
** app/controllers/questions_controller.rb&lt;br /&gt;
** app/mailers/mailer.rb&lt;br /&gt;
** app/models/assignment.rb&lt;br /&gt;
** app/models/assignment_questionnaire.rb&lt;br /&gt;
** app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
&lt;br /&gt;
* Test Case Files&lt;br /&gt;
** spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
** spec/models/assignment_spec.rb&lt;br /&gt;
** spec/controllers/questions_controller_spec.rb&lt;br /&gt;
** spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
Tests are created in the following files:&lt;br /&gt;
* spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
* spec/models/assignment_spec.rb&lt;br /&gt;
* spec/controllers/questions_controller_spec.rb&lt;br /&gt;
* spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
These tests cover the following cases:&lt;br /&gt;
* Adding questions to a questionnaire during the review period&lt;br /&gt;
* Adding questions to a questionnaire outside the review period&lt;br /&gt;
* Determining if an assignment is in the review period&lt;br /&gt;
* Determining if an assignment is outside the review period&lt;br /&gt;
* Finding the start and end dates for a specific review period of an assignment&lt;br /&gt;
* Finding the start and end dates for all review periods of an assignment&lt;br /&gt;
* Deleting existing responses resulting from changes made to questionnaires during the review period&lt;br /&gt;
* Deleting questions&lt;br /&gt;
&lt;br /&gt;
The same cases were also tested manually through the Expertiza UI, as shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
== Team Links ==&lt;br /&gt;
Here is the video our team recorded to show functionality:&lt;br /&gt;
[https://youtu.be/yibtRg3MsyQ]&lt;br /&gt;
&lt;br /&gt;
The link to our team's repository:&lt;br /&gt;
[https://github.com/BoergerJ/expertiza]&lt;br /&gt;
&lt;br /&gt;
The link to the Expertiza pull request for our project:&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1941]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138908</id>
		<title>CSC/ECE 517 Spring 2021 - E2110. 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_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138908"/>
		<updated>2021-05-03T19:52:08Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* Completed Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Members ==&lt;br /&gt;
*Nicholas Himes&lt;br /&gt;
&lt;br /&gt;
*Surya Makthal&lt;br /&gt;
&lt;br /&gt;
*Jordan Boerger&lt;br /&gt;
&lt;br /&gt;
*Sai Krishna Wupadrashta Dhinakara Subrahmanya&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
While setting up an assignment, the instructor will 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.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
If the instructor does edit or change a rubric while an assignment is in progress:&lt;br /&gt;
* If the change affects only the wording of a particular rubric item (e.g., to clarify the statement), no action is necessary.&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.  The system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.  (However, the response_map should not be changed.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''This project was done in Fall 2019. However, it was not tested thoroughly. Our team's work in Spring 2021 is to improve the testing and readability of the code.'''&lt;br /&gt;
&lt;br /&gt;
== Design Diagrams ==&lt;br /&gt;
=== Use Case Diagrams ===&lt;br /&gt;
''*Using UML Use Case Diagram Syntax''&lt;br /&gt;
&lt;br /&gt;
[[File:E2110_Use_Case_Diagram.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Data Flow Diagrams ===&lt;br /&gt;
''Note: This data flow diagram was originally made by the team from project E1982 in Fall 2019. Their wiki link can be viewed here: &lt;br /&gt;
&lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1982._Regulate_changing_of_rubrics_while_projects_are_in_progress''&lt;br /&gt;
&lt;br /&gt;
[[File:DesignFlow.png]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
We will write comprehensive tests and fix any bugs in the code written already for changing rubrics while projects are in progress.&lt;br /&gt;
&lt;br /&gt;
Some known issues already have been identified:&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** A method comment is needed on in_active_period method in answer_helper.rb&lt;br /&gt;
** Line-by-line comments are needed for all added functions&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** The method find_review_period is possibly redundant as Find deadlines does exist already in the code. This method needs to be replaced/removed if possible&lt;br /&gt;
** Split delete_existing_responses into more functions as it's complexity is reletively high&lt;br /&gt;
*** Contains some nested loops so these should be removed&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Email functionality needs to be thoroughly tested&lt;br /&gt;
** Tests need to be more thorough and verify that correct rows are being deleted for delete_existing_responses function in answer_helper.rb&lt;br /&gt;
** Confirm changes do not affect students who have not yet submitted their reviews by doing UI testing&lt;br /&gt;
&lt;br /&gt;
== Completed Solution ==&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** Added more extensive comments to all added functions and lines of code for better readability&lt;br /&gt;
** Added a popup confirmation message when deleting a question during active period similar to when adding a question to ensure instructor wants to delete all responses&lt;br /&gt;
** Destroy response object instead of individual answers when editing a questionnaire during active period to return all students who submitted reviews to the 'begin' stage rather than 'edit' and give them a fresh questionnaire&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** Split complicated functions from previous team, such as delete_existing_responses(), into more manageable and modular functions which only complete 1 main task&lt;br /&gt;
** Fixed email formatting for email sent to users when questionnaire is edited&lt;br /&gt;
** find_review_period() now uses find_due_dates() to search for assignment due dates. Reduced number of database calls in find_review_period() to reduce interaction, number of iterating loops, and incorporate DRY principles&lt;br /&gt;
** answer data in log_response_info() now uses hash format for better readability&lt;br /&gt;
** Local array and hash variables now instantiated correctly.&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Improved rspec tests for all files&lt;br /&gt;
** Confirmed that changes do not affect students that have not yet submitted their reviews&lt;br /&gt;
&lt;br /&gt;
== Flow ==&lt;br /&gt;
The main actions this project affects are adding and removing questions from a questionnaire. These diagrams will show how these events now occur. Because these events are handled differently in Expertiza, the implementation is slightly different for both cases.&lt;br /&gt;
&lt;br /&gt;
'''*Note:''' As you can see in the diagrams below, the confirmation popup is thrown in different ways for &amp;quot;Add&amp;quot; vs &amp;quot;Remove&amp;quot;. This is because in _questionnaire.html.erb:&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Add&amp;quot;''' is implemented as a submit_tag which can easily have a confirm: attribute added to it causing it to throw a popup within expertiza.&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Remove&amp;quot;''' is an &amp;lt;a&amp;gt; tag hyperlink rendered to the page by line &amp;lt;%=question.edit(i)%&amp;gt; which iterates through all questions in the questionnaire and renders their edit() functions. Edit() is a function in each question types model (criterion.rb, cake.rb, etc.). Edit() adds lines to the html for each field in the question table, including the &amp;quot;Remove&amp;quot; link. The &amp;quot;Remove&amp;quot; hyperlink has an href attribute which dynamically links to /questions/ + self.id.to_s based on the desired questions id. It then uses a data-method=&amp;quot;delete&amp;quot; attribute to select the destroy method in questions_controller.rb. Because this hyperlink exists in each question types model, it is hard to implement a clean solution which does not edit all the model files. To do this, we added a short &amp;lt;script&amp;gt; to the end of _questionnaire.html.erb which scans for &amp;lt;a&amp;gt; hyperlink redirects with the [data-method=&amp;quot;delete&amp;quot;] attribute and throws a popup within the browser rather than expertiza. This popup works the same as the &amp;quot;Add&amp;quot; popup. The script returns the result (true/false) of this popup to the &amp;lt;a&amp;gt; tag. In html, the redirect is cancelled if a false is returned to the tag and continues if a true is returned.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: none; background: none;&amp;quot;&lt;br /&gt;
! Adding question during active period&lt;br /&gt;
! Removing question during active period&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Add_Question_Diagram.png|500px]] || [[File:Remove_Question_Diagram.png|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
Here is a list of files and the functions that were added or edited, excluding rspec files.&lt;br /&gt;
=== app/helpers/answer_helper.rb ===&lt;br /&gt;
Helper module containing important functions for deletion of responses and answers when editing a questionnaire during review period.&lt;br /&gt;
* '''delete_existing_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Calls log_answer_responses and log_answer_info to store responses users made to the questionnaire. If review_mailer can mail these responses to the user then delete_answers destroys the response object.&lt;br /&gt;
* '''log_answer_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Given a list of question_ids and a questionnaire_id, gathers reponse_ids for all users responses to the questionnaire.&lt;br /&gt;
* '''log_response_info(response_ids)'''&lt;br /&gt;
Given a list of response_ids, gathers users responses to a questionnaire and records their comments in a hash along with their name, email, and the assignment name.&lt;br /&gt;
&lt;br /&gt;
''NOTE:'' The only issue we have found on this project stems from the way this function gets ''answers''. Sometimes these review comments are sent to users in an email, and sometimes they are not. Our issue here [https://github.com/BoergerJ/expertiza/issues/29] explains it in more detail.&lt;br /&gt;
* '''review_mailer(email, answers, name, assignment_name)'''&lt;br /&gt;
Given an email, answer list, name, and assignment name, calls notify_review_rubric_change() to send given information about previous review submission to user at given email.&lt;br /&gt;
* '''delete_answers(response_id)'''&lt;br /&gt;
Given a response_id, set the response to be no longer submitted then destroy the response object. This destroys designated dependencies as well such as answers.&lt;br /&gt;
* '''in_active_period(questionnaire_id, answer=nil)'''&lt;br /&gt;
Given a questionnaire and possibly an answer, determine the assignment and round number. Use these to determine if the assignment is in a review period. Return true if in active period, false if not.&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questionnaires_controller.rb ===&lt;br /&gt;
* '''add_new_questions'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questions_controller.rb ===&lt;br /&gt;
* '''destroy'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
=== app/mailers/mailer.rb ===&lt;br /&gt;
* '''notify_review_rubric_change(defn)'''&lt;br /&gt;
Mailer function which set necessary attributes for sending an email about a deleted response including previous answers. Calls mail() to send email to desired user.&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment.rb ===&lt;br /&gt;
* '''find_review_period(round)'''&lt;br /&gt;
Determines the start and end dates of the rounds of an assignment and returns them.&lt;br /&gt;
Using previous teams code as a base, we changed this function to make minimal database calls and iterate fewer times.&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment_questionnaire.rb ===&lt;br /&gt;
* '''get_latest_assignment(questionnaire_id)'''&lt;br /&gt;
Given questionnaire_id, returns assignment and round where questionnaire is used (if multiple questionnaires are used in an assignment)&lt;br /&gt;
&lt;br /&gt;
=== app/views/questionnaires/_questionnaire.html.erb ===&lt;br /&gt;
* Added in_active_period() call to display warning about edited questionnaire during active period&lt;br /&gt;
* Added confirm: to submit_tag 'Add' to display confirmation popup when adding a question during active period&lt;br /&gt;
* Added script to catch &amp;lt;a&amp;gt; tag redirects with [data-method=&amp;quot;delete&amp;quot;] to display popup when removing a question. Script only active if in active period.&lt;br /&gt;
&lt;br /&gt;
=== app/views/mailer/notify_review_rubric_change.html.erb ===&lt;br /&gt;
* New file containing email layout used when emailing students their answers after questionnaire is edited during active period.&lt;br /&gt;
&lt;br /&gt;
== Changed Files ==&lt;br /&gt;
* Added:&lt;br /&gt;
** app/helpers/answer_helper.rb&lt;br /&gt;
** app/views/mailer/notify_review_rubric_change.html.erb&lt;br /&gt;
&lt;br /&gt;
* Edited:&lt;br /&gt;
** app/controllers/questionnaires_controller.rb&lt;br /&gt;
** app/controllers/questions_controller.rb&lt;br /&gt;
** app/mailers/mailer.rb&lt;br /&gt;
** app/models/assignment.rb&lt;br /&gt;
** app/models/assignment_questionnaire.rb&lt;br /&gt;
** app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
&lt;br /&gt;
* Test Case Files&lt;br /&gt;
** spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
** spec/models/assignment_spec.rb&lt;br /&gt;
** spec/controllers/questions_controller_spec.rb&lt;br /&gt;
** spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
Tests are created in the following files:&lt;br /&gt;
* spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
* spec/models/assignment_spec.rb&lt;br /&gt;
* spec/controllers/questions_controller_spec.rb&lt;br /&gt;
* spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
These tests cover the following cases:&lt;br /&gt;
* Adding questions to a questionnaire during the review period&lt;br /&gt;
* Adding questions to a questionnaire outside the review period&lt;br /&gt;
* Determining if an assignment is in the review period&lt;br /&gt;
* Determining if an assignment is outside the review period&lt;br /&gt;
* Finding the start and end dates for a specific review period of an assignment&lt;br /&gt;
* Finding the start and end dates for all review periods of an assignment&lt;br /&gt;
* Deleting existing responses resulting from changes made to questionnaires during the review period&lt;br /&gt;
* Deleting questions&lt;br /&gt;
&lt;br /&gt;
The same cases were also tested manually through the Expertiza UI, as shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
== Team Links ==&lt;br /&gt;
Here is the video our team recorded to show functionality:&lt;br /&gt;
[https://youtu.be/yibtRg3MsyQ]&lt;br /&gt;
&lt;br /&gt;
The link to our team's repository:&lt;br /&gt;
[https://github.com/BoergerJ/expertiza]&lt;br /&gt;
&lt;br /&gt;
The link to the Expertiza pull request for our project:&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1941]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138907</id>
		<title>CSC/ECE 517 Spring 2021 - E2110. 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_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138907"/>
		<updated>2021-05-03T19:51:26Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* Completed Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Members ==&lt;br /&gt;
*Nicholas Himes&lt;br /&gt;
&lt;br /&gt;
*Surya Makthal&lt;br /&gt;
&lt;br /&gt;
*Jordan Boerger&lt;br /&gt;
&lt;br /&gt;
*Sai Krishna Wupadrashta Dhinakara Subrahmanya&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
While setting up an assignment, the instructor will 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.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
If the instructor does edit or change a rubric while an assignment is in progress:&lt;br /&gt;
* If the change affects only the wording of a particular rubric item (e.g., to clarify the statement), no action is necessary.&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.  The system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.  (However, the response_map should not be changed.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''This project was done in Fall 2019. However, it was not tested thoroughly. Our team's work in Spring 2021 is to improve the testing and readability of the code.'''&lt;br /&gt;
&lt;br /&gt;
== Design Diagrams ==&lt;br /&gt;
=== Use Case Diagrams ===&lt;br /&gt;
''*Using UML Use Case Diagram Syntax''&lt;br /&gt;
&lt;br /&gt;
[[File:E2110_Use_Case_Diagram.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Data Flow Diagrams ===&lt;br /&gt;
''Note: This data flow diagram was originally made by the team from project E1982 in Fall 2019. Their wiki link can be viewed here: &lt;br /&gt;
&lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1982._Regulate_changing_of_rubrics_while_projects_are_in_progress''&lt;br /&gt;
&lt;br /&gt;
[[File:DesignFlow.png]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
We will write comprehensive tests and fix any bugs in the code written already for changing rubrics while projects are in progress.&lt;br /&gt;
&lt;br /&gt;
Some known issues already have been identified:&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** A method comment is needed on in_active_period method in answer_helper.rb&lt;br /&gt;
** Line-by-line comments are needed for all added functions&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** The method find_review_period is possibly redundant as Find deadlines does exist already in the code. This method needs to be replaced/removed if possible&lt;br /&gt;
** Split delete_existing_responses into more functions as it's complexity is reletively high&lt;br /&gt;
*** Contains some nested loops so these should be removed&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Email functionality needs to be thoroughly tested&lt;br /&gt;
** Tests need to be more thorough and verify that correct rows are being deleted for delete_existing_responses function in answer_helper.rb&lt;br /&gt;
** Confirm changes do not affect students who have not yet submitted their reviews by doing UI testing&lt;br /&gt;
&lt;br /&gt;
== Completed Solution ==&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** Added more extensive comments to all added functions and lines of code for better readability&lt;br /&gt;
** Added a popup confirmation message when deleting a question during active period similar to when adding a question to ensure instructor wants to delete all responses&lt;br /&gt;
** Destroy response object instead of individual answers when editing a questionnaire during active period to return all students who submitted reviews to the 'begin' stage rather than 'edit' and give them a fresh questionnaire&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** Split complicated functions from previous team, such as delete_existing_responses(), into more manageable and modular functions which only complete 1 main task&lt;br /&gt;
** Fixed email formatting for email sent to users when questionnaire is edited&lt;br /&gt;
** find_review_period() now uses find_due_dates() to search for assignment due dates. Reduced number of database calls in find_review_period() to reduce interaction, number of iterating loops, and incorporate DRY principles&lt;br /&gt;
** answer data in log_response_info() now uses hash format for better readability&lt;br /&gt;
** Local array and hash variables now instantiated correctly.&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Improved rspec tests for all files&lt;br /&gt;
&lt;br /&gt;
== Flow ==&lt;br /&gt;
The main actions this project affects are adding and removing questions from a questionnaire. These diagrams will show how these events now occur. Because these events are handled differently in Expertiza, the implementation is slightly different for both cases.&lt;br /&gt;
&lt;br /&gt;
'''*Note:''' As you can see in the diagrams below, the confirmation popup is thrown in different ways for &amp;quot;Add&amp;quot; vs &amp;quot;Remove&amp;quot;. This is because in _questionnaire.html.erb:&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Add&amp;quot;''' is implemented as a submit_tag which can easily have a confirm: attribute added to it causing it to throw a popup within expertiza.&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Remove&amp;quot;''' is an &amp;lt;a&amp;gt; tag hyperlink rendered to the page by line &amp;lt;%=question.edit(i)%&amp;gt; which iterates through all questions in the questionnaire and renders their edit() functions. Edit() is a function in each question types model (criterion.rb, cake.rb, etc.). Edit() adds lines to the html for each field in the question table, including the &amp;quot;Remove&amp;quot; link. The &amp;quot;Remove&amp;quot; hyperlink has an href attribute which dynamically links to /questions/ + self.id.to_s based on the desired questions id. It then uses a data-method=&amp;quot;delete&amp;quot; attribute to select the destroy method in questions_controller.rb. Because this hyperlink exists in each question types model, it is hard to implement a clean solution which does not edit all the model files. To do this, we added a short &amp;lt;script&amp;gt; to the end of _questionnaire.html.erb which scans for &amp;lt;a&amp;gt; hyperlink redirects with the [data-method=&amp;quot;delete&amp;quot;] attribute and throws a popup within the browser rather than expertiza. This popup works the same as the &amp;quot;Add&amp;quot; popup. The script returns the result (true/false) of this popup to the &amp;lt;a&amp;gt; tag. In html, the redirect is cancelled if a false is returned to the tag and continues if a true is returned.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: none; background: none;&amp;quot;&lt;br /&gt;
! Adding question during active period&lt;br /&gt;
! Removing question during active period&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Add_Question_Diagram.png|500px]] || [[File:Remove_Question_Diagram.png|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
Here is a list of files and the functions that were added or edited, excluding rspec files.&lt;br /&gt;
=== app/helpers/answer_helper.rb ===&lt;br /&gt;
Helper module containing important functions for deletion of responses and answers when editing a questionnaire during review period.&lt;br /&gt;
* '''delete_existing_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Calls log_answer_responses and log_answer_info to store responses users made to the questionnaire. If review_mailer can mail these responses to the user then delete_answers destroys the response object.&lt;br /&gt;
* '''log_answer_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Given a list of question_ids and a questionnaire_id, gathers reponse_ids for all users responses to the questionnaire.&lt;br /&gt;
* '''log_response_info(response_ids)'''&lt;br /&gt;
Given a list of response_ids, gathers users responses to a questionnaire and records their comments in a hash along with their name, email, and the assignment name.&lt;br /&gt;
&lt;br /&gt;
''NOTE:'' The only issue we have found on this project stems from the way this function gets ''answers''. Sometimes these review comments are sent to users in an email, and sometimes they are not. Our issue here [https://github.com/BoergerJ/expertiza/issues/29] explains it in more detail.&lt;br /&gt;
* '''review_mailer(email, answers, name, assignment_name)'''&lt;br /&gt;
Given an email, answer list, name, and assignment name, calls notify_review_rubric_change() to send given information about previous review submission to user at given email.&lt;br /&gt;
* '''delete_answers(response_id)'''&lt;br /&gt;
Given a response_id, set the response to be no longer submitted then destroy the response object. This destroys designated dependencies as well such as answers.&lt;br /&gt;
* '''in_active_period(questionnaire_id, answer=nil)'''&lt;br /&gt;
Given a questionnaire and possibly an answer, determine the assignment and round number. Use these to determine if the assignment is in a review period. Return true if in active period, false if not.&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questionnaires_controller.rb ===&lt;br /&gt;
* '''add_new_questions'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questions_controller.rb ===&lt;br /&gt;
* '''destroy'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
=== app/mailers/mailer.rb ===&lt;br /&gt;
* '''notify_review_rubric_change(defn)'''&lt;br /&gt;
Mailer function which set necessary attributes for sending an email about a deleted response including previous answers. Calls mail() to send email to desired user.&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment.rb ===&lt;br /&gt;
* '''find_review_period(round)'''&lt;br /&gt;
Determines the start and end dates of the rounds of an assignment and returns them.&lt;br /&gt;
Using previous teams code as a base, we changed this function to make minimal database calls and iterate fewer times.&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment_questionnaire.rb ===&lt;br /&gt;
* '''get_latest_assignment(questionnaire_id)'''&lt;br /&gt;
Given questionnaire_id, returns assignment and round where questionnaire is used (if multiple questionnaires are used in an assignment)&lt;br /&gt;
&lt;br /&gt;
=== app/views/questionnaires/_questionnaire.html.erb ===&lt;br /&gt;
* Added in_active_period() call to display warning about edited questionnaire during active period&lt;br /&gt;
* Added confirm: to submit_tag 'Add' to display confirmation popup when adding a question during active period&lt;br /&gt;
* Added script to catch &amp;lt;a&amp;gt; tag redirects with [data-method=&amp;quot;delete&amp;quot;] to display popup when removing a question. Script only active if in active period.&lt;br /&gt;
&lt;br /&gt;
=== app/views/mailer/notify_review_rubric_change.html.erb ===&lt;br /&gt;
* New file containing email layout used when emailing students their answers after questionnaire is edited during active period.&lt;br /&gt;
&lt;br /&gt;
== Changed Files ==&lt;br /&gt;
* Added:&lt;br /&gt;
** app/helpers/answer_helper.rb&lt;br /&gt;
** app/views/mailer/notify_review_rubric_change.html.erb&lt;br /&gt;
&lt;br /&gt;
* Edited:&lt;br /&gt;
** app/controllers/questionnaires_controller.rb&lt;br /&gt;
** app/controllers/questions_controller.rb&lt;br /&gt;
** app/mailers/mailer.rb&lt;br /&gt;
** app/models/assignment.rb&lt;br /&gt;
** app/models/assignment_questionnaire.rb&lt;br /&gt;
** app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
&lt;br /&gt;
* Test Case Files&lt;br /&gt;
** spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
** spec/models/assignment_spec.rb&lt;br /&gt;
** spec/controllers/questions_controller_spec.rb&lt;br /&gt;
** spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
Tests are created in the following files:&lt;br /&gt;
* spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
* spec/models/assignment_spec.rb&lt;br /&gt;
* spec/controllers/questions_controller_spec.rb&lt;br /&gt;
* spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
These tests cover the following cases:&lt;br /&gt;
* Adding questions to a questionnaire during the review period&lt;br /&gt;
* Adding questions to a questionnaire outside the review period&lt;br /&gt;
* Determining if an assignment is in the review period&lt;br /&gt;
* Determining if an assignment is outside the review period&lt;br /&gt;
* Finding the start and end dates for a specific review period of an assignment&lt;br /&gt;
* Finding the start and end dates for all review periods of an assignment&lt;br /&gt;
* Deleting existing responses resulting from changes made to questionnaires during the review period&lt;br /&gt;
* Deleting questions&lt;br /&gt;
&lt;br /&gt;
The same cases were also tested manually through the Expertiza UI, as shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
== Team Links ==&lt;br /&gt;
Here is the video our team recorded to show functionality:&lt;br /&gt;
[https://youtu.be/yibtRg3MsyQ]&lt;br /&gt;
&lt;br /&gt;
The link to our team's repository:&lt;br /&gt;
[https://github.com/BoergerJ/expertiza]&lt;br /&gt;
&lt;br /&gt;
The link to the Expertiza pull request for our project:&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1941]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138906</id>
		<title>CSC/ECE 517 Spring 2021 - E2110. 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_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138906"/>
		<updated>2021-05-03T19:49:11Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* Proposed Solution */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Members ==&lt;br /&gt;
*Nicholas Himes&lt;br /&gt;
&lt;br /&gt;
*Surya Makthal&lt;br /&gt;
&lt;br /&gt;
*Jordan Boerger&lt;br /&gt;
&lt;br /&gt;
*Sai Krishna Wupadrashta Dhinakara Subrahmanya&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
While setting up an assignment, the instructor will 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.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
If the instructor does edit or change a rubric while an assignment is in progress:&lt;br /&gt;
* If the change affects only the wording of a particular rubric item (e.g., to clarify the statement), no action is necessary.&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.  The system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.  (However, the response_map should not be changed.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''This project was done in Fall 2019. However, it was not tested thoroughly. Our team's work in Spring 2021 is to improve the testing and readability of the code.'''&lt;br /&gt;
&lt;br /&gt;
== Design Diagrams ==&lt;br /&gt;
=== Use Case Diagrams ===&lt;br /&gt;
''*Using UML Use Case Diagram Syntax''&lt;br /&gt;
&lt;br /&gt;
[[File:E2110_Use_Case_Diagram.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Data Flow Diagrams ===&lt;br /&gt;
''Note: This data flow diagram was originally made by the team from project E1982 in Fall 2019. Their wiki link can be viewed here: &lt;br /&gt;
&lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1982._Regulate_changing_of_rubrics_while_projects_are_in_progress''&lt;br /&gt;
&lt;br /&gt;
[[File:DesignFlow.png]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
We will write comprehensive tests and fix any bugs in the code written already for changing rubrics while projects are in progress.&lt;br /&gt;
&lt;br /&gt;
Some known issues already have been identified:&lt;br /&gt;
* ''Additions:''&lt;br /&gt;
** A method comment is needed on in_active_period method in answer_helper.rb&lt;br /&gt;
** Line-by-line comments are needed for all added functions&lt;br /&gt;
&lt;br /&gt;
* ''Refactoring:''&lt;br /&gt;
** The method find_review_period is possibly redundant as Find deadlines does exist already in the code. This method needs to be replaced/removed if possible&lt;br /&gt;
** Split delete_existing_responses into more functions as it's complexity is reletively high&lt;br /&gt;
*** Contains some nested loops so these should be removed&lt;br /&gt;
&lt;br /&gt;
* ''Testing:''&lt;br /&gt;
** Email functionality needs to be thoroughly tested&lt;br /&gt;
** Tests need to be more thorough and verify that correct rows are being deleted for delete_existing_responses function in answer_helper.rb&lt;br /&gt;
** Confirm changes do not affect students who have not yet submitted their reviews by doing UI testing&lt;br /&gt;
&lt;br /&gt;
== Completed Solution ==&lt;br /&gt;
* Added more extensive comments to all added functions and lines of code for better readability&lt;br /&gt;
* Added a popup confirmation message when deleting a question during active period similar to when adding a question to ensure instructor wants to delete all responses&lt;br /&gt;
* Destroy response object instead of individual answers when editing a questionnaire during active period to return all students who submitted reviews to the 'begin' stage rather than 'edit' and give them a fresh questionnaire&lt;br /&gt;
* Split complicated functions from previous team, such as delete_existing_responses(), into more manageable and modular functions which only complete 1 main task&lt;br /&gt;
* Fixed email formatting for email sent to users when questionnaire is edited&lt;br /&gt;
* find_review_period() now uses find_due_dates() to search for assignment due dates. Reduced number of database calls in find_review_period() to reduce interaction, number of iterating loops, and incorporate DRY principles&lt;br /&gt;
* answer data in log_response_info() now uses hash format for better readability&lt;br /&gt;
* Local array and hash variables now instantiated correctly.&lt;br /&gt;
* Improved rspec tests for all files&lt;br /&gt;
&lt;br /&gt;
== Flow ==&lt;br /&gt;
The main actions this project affects are adding and removing questions from a questionnaire. These diagrams will show how these events now occur. Because these events are handled differently in Expertiza, the implementation is slightly different for both cases.&lt;br /&gt;
&lt;br /&gt;
'''*Note:''' As you can see in the diagrams below, the confirmation popup is thrown in different ways for &amp;quot;Add&amp;quot; vs &amp;quot;Remove&amp;quot;. This is because in _questionnaire.html.erb:&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Add&amp;quot;''' is implemented as a submit_tag which can easily have a confirm: attribute added to it causing it to throw a popup within expertiza.&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Remove&amp;quot;''' is an &amp;lt;a&amp;gt; tag hyperlink rendered to the page by line &amp;lt;%=question.edit(i)%&amp;gt; which iterates through all questions in the questionnaire and renders their edit() functions. Edit() is a function in each question types model (criterion.rb, cake.rb, etc.). Edit() adds lines to the html for each field in the question table, including the &amp;quot;Remove&amp;quot; link. The &amp;quot;Remove&amp;quot; hyperlink has an href attribute which dynamically links to /questions/ + self.id.to_s based on the desired questions id. It then uses a data-method=&amp;quot;delete&amp;quot; attribute to select the destroy method in questions_controller.rb. Because this hyperlink exists in each question types model, it is hard to implement a clean solution which does not edit all the model files. To do this, we added a short &amp;lt;script&amp;gt; to the end of _questionnaire.html.erb which scans for &amp;lt;a&amp;gt; hyperlink redirects with the [data-method=&amp;quot;delete&amp;quot;] attribute and throws a popup within the browser rather than expertiza. This popup works the same as the &amp;quot;Add&amp;quot; popup. The script returns the result (true/false) of this popup to the &amp;lt;a&amp;gt; tag. In html, the redirect is cancelled if a false is returned to the tag and continues if a true is returned.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: none; background: none;&amp;quot;&lt;br /&gt;
! Adding question during active period&lt;br /&gt;
! Removing question during active period&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Add_Question_Diagram.png|500px]] || [[File:Remove_Question_Diagram.png|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
Here is a list of files and the functions that were added or edited, excluding rspec files.&lt;br /&gt;
=== app/helpers/answer_helper.rb ===&lt;br /&gt;
Helper module containing important functions for deletion of responses and answers when editing a questionnaire during review period.&lt;br /&gt;
* '''delete_existing_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Calls log_answer_responses and log_answer_info to store responses users made to the questionnaire. If review_mailer can mail these responses to the user then delete_answers destroys the response object.&lt;br /&gt;
* '''log_answer_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Given a list of question_ids and a questionnaire_id, gathers reponse_ids for all users responses to the questionnaire.&lt;br /&gt;
* '''log_response_info(response_ids)'''&lt;br /&gt;
Given a list of response_ids, gathers users responses to a questionnaire and records their comments in a hash along with their name, email, and the assignment name.&lt;br /&gt;
&lt;br /&gt;
''NOTE:'' The only issue we have found on this project stems from the way this function gets ''answers''. Sometimes these review comments are sent to users in an email, and sometimes they are not. Our issue here [https://github.com/BoergerJ/expertiza/issues/29] explains it in more detail.&lt;br /&gt;
* '''review_mailer(email, answers, name, assignment_name)'''&lt;br /&gt;
Given an email, answer list, name, and assignment name, calls notify_review_rubric_change() to send given information about previous review submission to user at given email.&lt;br /&gt;
* '''delete_answers(response_id)'''&lt;br /&gt;
Given a response_id, set the response to be no longer submitted then destroy the response object. This destroys designated dependencies as well such as answers.&lt;br /&gt;
* '''in_active_period(questionnaire_id, answer=nil)'''&lt;br /&gt;
Given a questionnaire and possibly an answer, determine the assignment and round number. Use these to determine if the assignment is in a review period. Return true if in active period, false if not.&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questionnaires_controller.rb ===&lt;br /&gt;
* '''add_new_questions'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questions_controller.rb ===&lt;br /&gt;
* '''destroy'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
=== app/mailers/mailer.rb ===&lt;br /&gt;
* '''notify_review_rubric_change(defn)'''&lt;br /&gt;
Mailer function which set necessary attributes for sending an email about a deleted response including previous answers. Calls mail() to send email to desired user.&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment.rb ===&lt;br /&gt;
* '''find_review_period(round)'''&lt;br /&gt;
Determines the start and end dates of the rounds of an assignment and returns them.&lt;br /&gt;
Using previous teams code as a base, we changed this function to make minimal database calls and iterate fewer times.&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment_questionnaire.rb ===&lt;br /&gt;
* '''get_latest_assignment(questionnaire_id)'''&lt;br /&gt;
Given questionnaire_id, returns assignment and round where questionnaire is used (if multiple questionnaires are used in an assignment)&lt;br /&gt;
&lt;br /&gt;
=== app/views/questionnaires/_questionnaire.html.erb ===&lt;br /&gt;
* Added in_active_period() call to display warning about edited questionnaire during active period&lt;br /&gt;
* Added confirm: to submit_tag 'Add' to display confirmation popup when adding a question during active period&lt;br /&gt;
* Added script to catch &amp;lt;a&amp;gt; tag redirects with [data-method=&amp;quot;delete&amp;quot;] to display popup when removing a question. Script only active if in active period.&lt;br /&gt;
&lt;br /&gt;
=== app/views/mailer/notify_review_rubric_change.html.erb ===&lt;br /&gt;
* New file containing email layout used when emailing students their answers after questionnaire is edited during active period.&lt;br /&gt;
&lt;br /&gt;
== Changed Files ==&lt;br /&gt;
* Added:&lt;br /&gt;
** app/helpers/answer_helper.rb&lt;br /&gt;
** app/views/mailer/notify_review_rubric_change.html.erb&lt;br /&gt;
&lt;br /&gt;
* Edited:&lt;br /&gt;
** app/controllers/questionnaires_controller.rb&lt;br /&gt;
** app/controllers/questions_controller.rb&lt;br /&gt;
** app/mailers/mailer.rb&lt;br /&gt;
** app/models/assignment.rb&lt;br /&gt;
** app/models/assignment_questionnaire.rb&lt;br /&gt;
** app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
&lt;br /&gt;
* Test Case Files&lt;br /&gt;
** spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
** spec/models/assignment_spec.rb&lt;br /&gt;
** spec/controllers/questions_controller_spec.rb&lt;br /&gt;
** spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
Tests are created in the following files:&lt;br /&gt;
* spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
* spec/models/assignment_spec.rb&lt;br /&gt;
* spec/controllers/questions_controller_spec.rb&lt;br /&gt;
* spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
These tests cover the following cases:&lt;br /&gt;
* Adding questions to a questionnaire during the review period&lt;br /&gt;
* Adding questions to a questionnaire outside the review period&lt;br /&gt;
* Determining if an assignment is in the review period&lt;br /&gt;
* Determining if an assignment is outside the review period&lt;br /&gt;
* Finding the start and end dates for a specific review period of an assignment&lt;br /&gt;
* Finding the start and end dates for all review periods of an assignment&lt;br /&gt;
* Deleting existing responses resulting from changes made to questionnaires during the review period&lt;br /&gt;
* Deleting questions&lt;br /&gt;
&lt;br /&gt;
The same cases were also tested manually through the Expertiza UI, as shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
== Team Links ==&lt;br /&gt;
Here is the video our team recorded to show functionality:&lt;br /&gt;
[https://youtu.be/yibtRg3MsyQ]&lt;br /&gt;
&lt;br /&gt;
The link to our team's repository:&lt;br /&gt;
[https://github.com/BoergerJ/expertiza]&lt;br /&gt;
&lt;br /&gt;
The link to the Expertiza pull request for our project:&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1941]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138801</id>
		<title>CSC/ECE 517 Spring 2021 - E2110. 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_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138801"/>
		<updated>2021-04-30T18:43:45Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* app/models/assignment_questionnaire.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Members ==&lt;br /&gt;
*Nicholas Himes&lt;br /&gt;
&lt;br /&gt;
*Surya Makthal&lt;br /&gt;
&lt;br /&gt;
*Jordan Boerger&lt;br /&gt;
&lt;br /&gt;
*Sai Krishna Wupadrashta Dhinakara Subrahmanya&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
While setting up an assignment, the instructor will 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.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
If the instructor does edit or change a rubric while an assignment is in progress:&lt;br /&gt;
* If the change affects only the wording of a particular rubric item (e.g., to clarify the statement), no action is necessary.&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.  The system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.  (However, the response_map should not be changed.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''This project was done in Fall 2019. However, it was not tested thoroughly. Our team's work in Spring 2021 is to improve the testing and readability of the code.'''&lt;br /&gt;
&lt;br /&gt;
== Design Diagrams ==&lt;br /&gt;
=== Use Case Diagrams ===&lt;br /&gt;
''*Using UML Use Case Diagram Syntax''&lt;br /&gt;
&lt;br /&gt;
[[File:E2110_Use_Case_Diagram.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Data Flow Diagrams ===&lt;br /&gt;
''Note: This data flow diagram was originally made by the team from project E1982 in Fall 2019. Their wiki link can be viewed here: &lt;br /&gt;
&lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1982._Regulate_changing_of_rubrics_while_projects_are_in_progress''&lt;br /&gt;
&lt;br /&gt;
[[File:DesignFlow.png]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
We will write comprehensive tests and fix any bugs in the code written already for changing rubrics while projects are in progress.&lt;br /&gt;
&lt;br /&gt;
Some known issues already have been identified:&lt;br /&gt;
* Email functionality needs to be thoroughly tested&lt;br /&gt;
&lt;br /&gt;
* The method find_review_period is possibly redundant as Find deadlines does exist already in the code. This method needs to be replaced/removed if possible&lt;br /&gt;
&lt;br /&gt;
* A method comment is needed on in_active_period method in answer_helper.rb&lt;br /&gt;
&lt;br /&gt;
* Tests need to be more thorough and verify that correct rows are being deleted for delete_existing_responses function in answer_helper.rb&lt;br /&gt;
&lt;br /&gt;
* Split delete_existing_responses into more functions as it's complexity is reletively high&lt;br /&gt;
** Contains some nested loops so these should be removed&lt;br /&gt;
&lt;br /&gt;
* Confirm changes do not affect students who have not yet submitted their reviews by doing UI testing&lt;br /&gt;
&lt;br /&gt;
* Line-by-line comments are needed for all added functions&lt;br /&gt;
&lt;br /&gt;
== Completed Solution ==&lt;br /&gt;
* Added more extensive comments to all added functions and lines of code for better readability&lt;br /&gt;
* Added a popup confirmation message when deleting a question during active period similar to when adding a question to ensure instructor wants to delete all responses&lt;br /&gt;
* Destroy response object instead of individual answers when editing a questionnaire during active period to return all students who submitted reviews to the 'begin' stage rather than 'edit' and give them a fresh questionnaire&lt;br /&gt;
* Split complicated functions from previous team, such as delete_existing_responses(), into more manageable and modular functions which only complete 1 main task&lt;br /&gt;
* Fixed email formatting for email sent to users when questionnaire is edited&lt;br /&gt;
* find_review_period() now uses find_due_dates() to search for assignment due dates. Reduced number of database calls in find_review_period() to reduce interaction, number of iterating loops, and incorporate DRY principles&lt;br /&gt;
* answer data in log_response_info() now uses hash format for better readability&lt;br /&gt;
* Local array and hash variables now instantiated correctly.&lt;br /&gt;
* Improved rspec tests for all files&lt;br /&gt;
&lt;br /&gt;
== Flow ==&lt;br /&gt;
The main actions this project affects are adding and removing questions from a questionnaire. These diagrams will show how these events now occur. Because these events are handled differently in Expertiza, the implementation is slightly different for both cases.&lt;br /&gt;
&lt;br /&gt;
'''*Note:''' As you can see in the diagrams below, the confirmation popup is thrown in different ways for &amp;quot;Add&amp;quot; vs &amp;quot;Remove&amp;quot;. This is because in _questionnaire.html.erb:&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Add&amp;quot;''' is implemented as a submit_tag which can easily have a confirm: attribute added to it causing it to throw a popup within expertiza.&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Remove&amp;quot;''' is an &amp;lt;a&amp;gt; tag hyperlink rendered to the page by line &amp;lt;%=question.edit(i)%&amp;gt; which iterates through all questions in the questionnaire and renders their edit() functions. Edit() is a function in each question types model (criterion.rb, cake.rb, etc.). Edit() adds lines to the html for each field in the question table, including the &amp;quot;Remove&amp;quot; link. The &amp;quot;Remove&amp;quot; hyperlink has an href attribute which dynamically links to /questions/ + self.id.to_s based on the desired questions id. It then uses a data-method=&amp;quot;delete&amp;quot; attribute to select the destroy method in questions_controller.rb. Because this hyperlink exists in each question types model, it is hard to implement a clean solution which does not edit all the model files. To do this, we added a short &amp;lt;script&amp;gt; to the end of _questionnaire.html.erb which scans for &amp;lt;a&amp;gt; hyperlink redirects with the [data-method=&amp;quot;delete&amp;quot;] attribute and throws a popup within the browser rather than expertiza. This popup works the same as the &amp;quot;Add&amp;quot; popup. The script returns the result (true/false) of this popup to the &amp;lt;a&amp;gt; tag. In html, the redirect is cancelled if a false is returned to the tag and continues if a true is returned.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: none; background: none;&amp;quot;&lt;br /&gt;
! Adding question during active period&lt;br /&gt;
! Removing question during active period&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Add_Question_Diagram.png|500px]] || [[File:Remove_Question_Diagram.png|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
Here is a list of files and the functions that were added or edited, excluding rspec files.&lt;br /&gt;
=== app/helpers/answer_helper.rb ===&lt;br /&gt;
Helper module containing important functions for deletion of responses and answers when editing a questionnaire during review period.&lt;br /&gt;
* '''delete_existing_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Calls log_answer_responses and log_answer_info to store responses users made to the questionnaire. If review_mailer can mail these responses to the user then delete_answers destroys the response object.&lt;br /&gt;
* '''log_answer_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Given a list of question_ids and a questionnaire_id, gathers reponse_ids for all users responses to the questionnaire.&lt;br /&gt;
* '''log_response_info(response_ids)'''&lt;br /&gt;
Given a list of response_ids, gathers users responses to a questionnaire and records their comments in a hash along with their name, email, and the assignment name.&lt;br /&gt;
&lt;br /&gt;
''NOTE:'' The only issue we have found on this project stems from the way this function gets ''answers''. Sometimes these review comments are sent to users in an email, and sometimes they are not. Our issue here [https://github.com/BoergerJ/expertiza/issues/29] explains it in more detail.&lt;br /&gt;
* '''review_mailer(email, answers, name, assignment_name)'''&lt;br /&gt;
Given an email, answer list, name, and assignment name, calls notify_review_rubric_change() to send given information about previous review submission to user at given email.&lt;br /&gt;
* '''delete_answers(response_id)'''&lt;br /&gt;
Given a response_id, set the response to be no longer submitted then destroy the response object. This destroys designated dependencies as well such as answers.&lt;br /&gt;
* '''in_active_period(questionnaire_id, answer=nil)'''&lt;br /&gt;
Given a questionnaire and possibly an answer, determine the assignment and round number. Use these to determine if the assignment is in a review period. Return true if in active period, false if not.&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questionnaires_controller.rb ===&lt;br /&gt;
* '''add_new_questions'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questions_controller.rb ===&lt;br /&gt;
* '''destroy'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
=== app/mailers/mailer.rb ===&lt;br /&gt;
* '''notify_review_rubric_change(defn)'''&lt;br /&gt;
Mailer function which set necessary attributes for sending an email about a deleted response including previous answers. Calls mail() to send email to desired user.&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment.rb ===&lt;br /&gt;
* '''find_review_period(round)'''&lt;br /&gt;
Determines the start and end dates of the rounds of an assignment and returns them.&lt;br /&gt;
Using previous teams code as a base, we changed this function to make minimal database calls and iterate fewer times.&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment_questionnaire.rb ===&lt;br /&gt;
* '''get_latest_assignment(questionnaire_id)'''&lt;br /&gt;
Given questionnaire_id, returns assignment and round where questionnaire is used (if multiple questionnaires are used in an assignment)&lt;br /&gt;
&lt;br /&gt;
=== app/views/questionnaires/_questionnaire.html.erb ===&lt;br /&gt;
* Added in_active_period() call to display warning about edited questionnaire during active period&lt;br /&gt;
* Added confirm: to submit_tag 'Add' to display confirmation popup when adding a question during active period&lt;br /&gt;
* Added script to catch &amp;lt;a&amp;gt; tag redirects with [data-method=&amp;quot;delete&amp;quot;] to display popup when removing a question. Script only active if in active period.&lt;br /&gt;
&lt;br /&gt;
=== app/views/mailer/notify_review_rubric_change.html.erb ===&lt;br /&gt;
* New file containing email layout used when emailing students their answers after questionnaire is edited during active period.&lt;br /&gt;
&lt;br /&gt;
== Changed Files ==&lt;br /&gt;
* Added:&lt;br /&gt;
** app/helpers/answer_helper.rb&lt;br /&gt;
** app/views/mailer/notify_review_rubric_change.html.erb&lt;br /&gt;
&lt;br /&gt;
* Edited:&lt;br /&gt;
** app/controllers/questionnaires_controller.rb&lt;br /&gt;
** app/controllers/questions_controller.rb&lt;br /&gt;
** app/mailers/mailer.rb&lt;br /&gt;
** app/models/assignment.rb&lt;br /&gt;
** app/models/assignment_questionnaire.rb&lt;br /&gt;
** app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
&lt;br /&gt;
* Test Case Files&lt;br /&gt;
** spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
** spec/models/assignment_spec.rb&lt;br /&gt;
** spec/controllers/questions_controller_spec.rb&lt;br /&gt;
** spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
Tests are created in the following files:&lt;br /&gt;
* spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
* spec/models/assignment_spec.rb&lt;br /&gt;
* spec/controllers/questions_controller_spec.rb&lt;br /&gt;
* spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
These tests cover the following cases:&lt;br /&gt;
* Adding questions to a questionnaire during the review period&lt;br /&gt;
* Adding questions to a questionnaire outside the review period&lt;br /&gt;
* Determining if an assignment is in the review period&lt;br /&gt;
* Determining if an assignment is outside the review period&lt;br /&gt;
* Finding the start and end dates for a specific review period of an assignment&lt;br /&gt;
* Finding the start and end dates for all review periods of an assignment&lt;br /&gt;
* Deleting existing responses resulting from changes made to questionnaires during the review period&lt;br /&gt;
* Deleting questions&lt;br /&gt;
&lt;br /&gt;
The same cases were also tested manually through the Expertiza UI, as shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
== Team Links ==&lt;br /&gt;
Here is the video our team recorded to show functionality:&lt;br /&gt;
[https://youtu.be/yibtRg3MsyQ]&lt;br /&gt;
&lt;br /&gt;
The link to our team's repository:&lt;br /&gt;
[https://github.com/BoergerJ/expertiza]&lt;br /&gt;
&lt;br /&gt;
The link to the Expertiza pull request for our project:&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1941]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138797</id>
		<title>CSC/ECE 517 Spring 2021 - E2110. 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_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138797"/>
		<updated>2021-04-30T18:41:44Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* app/helpers/answer_helper.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Members ==&lt;br /&gt;
*Nicholas Himes&lt;br /&gt;
&lt;br /&gt;
*Surya Makthal&lt;br /&gt;
&lt;br /&gt;
*Jordan Boerger&lt;br /&gt;
&lt;br /&gt;
*Sai Krishna Wupadrashta Dhinakara Subrahmanya&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
While setting up an assignment, the instructor will 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.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
If the instructor does edit or change a rubric while an assignment is in progress:&lt;br /&gt;
* If the change affects only the wording of a particular rubric item (e.g., to clarify the statement), no action is necessary.&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.  The system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.  (However, the response_map should not be changed.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''This project was done in Fall 2019. However, it was not tested thoroughly. Our team's work in Spring 2021 is to improve the testing and readability of the code.'''&lt;br /&gt;
&lt;br /&gt;
== Design Diagrams ==&lt;br /&gt;
=== Use Case Diagrams ===&lt;br /&gt;
''*Using UML Use Case Diagram Syntax''&lt;br /&gt;
&lt;br /&gt;
[[File:E2110_Use_Case_Diagram.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Data Flow Diagrams ===&lt;br /&gt;
''Note: This data flow diagram was originally made by the team from project E1982 in Fall 2019. Their wiki link can be viewed here: &lt;br /&gt;
&lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1982._Regulate_changing_of_rubrics_while_projects_are_in_progress''&lt;br /&gt;
&lt;br /&gt;
[[File:DesignFlow.png]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
We will write comprehensive tests and fix any bugs in the code written already for changing rubrics while projects are in progress.&lt;br /&gt;
&lt;br /&gt;
Some known issues already have been identified:&lt;br /&gt;
* Email functionality needs to be thoroughly tested&lt;br /&gt;
&lt;br /&gt;
* The method find_review_period is possibly redundant as Find deadlines does exist already in the code. This method needs to be replaced/removed if possible&lt;br /&gt;
&lt;br /&gt;
* A method comment is needed on in_active_period method in answer_helper.rb&lt;br /&gt;
&lt;br /&gt;
* Tests need to be more thorough and verify that correct rows are being deleted for delete_existing_responses function in answer_helper.rb&lt;br /&gt;
&lt;br /&gt;
* Split delete_existing_responses into more functions as it's complexity is reletively high&lt;br /&gt;
** Contains some nested loops so these should be removed&lt;br /&gt;
&lt;br /&gt;
* Confirm changes do not affect students who have not yet submitted their reviews by doing UI testing&lt;br /&gt;
&lt;br /&gt;
* Line-by-line comments are needed for all added functions&lt;br /&gt;
&lt;br /&gt;
== Completed Solution ==&lt;br /&gt;
* Added more extensive comments to all added functions and lines of code for better readability&lt;br /&gt;
* Added a popup confirmation message when deleting a question during active period similar to when adding a question to ensure instructor wants to delete all responses&lt;br /&gt;
* Destroy response object instead of individual answers when editing a questionnaire during active period to return all students who submitted reviews to the 'begin' stage rather than 'edit' and give them a fresh questionnaire&lt;br /&gt;
* Split complicated functions from previous team, such as delete_existing_responses(), into more manageable and modular functions which only complete 1 main task&lt;br /&gt;
* Fixed email formatting for email sent to users when questionnaire is edited&lt;br /&gt;
* find_review_period() now uses find_due_dates() to search for assignment due dates. Reduced number of database calls in find_review_period() to reduce interaction, number of iterating loops, and incorporate DRY principles&lt;br /&gt;
* answer data in log_response_info() now uses hash format for better readability&lt;br /&gt;
* Local array and hash variables now instantiated correctly.&lt;br /&gt;
* Improved rspec tests for all files&lt;br /&gt;
&lt;br /&gt;
== Flow ==&lt;br /&gt;
The main actions this project affects are adding and removing questions from a questionnaire. These diagrams will show how these events now occur. Because these events are handled differently in Expertiza, the implementation is slightly different for both cases.&lt;br /&gt;
&lt;br /&gt;
'''*Note:''' As you can see in the diagrams below, the confirmation popup is thrown in different ways for &amp;quot;Add&amp;quot; vs &amp;quot;Remove&amp;quot;. This is because in _questionnaire.html.erb:&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Add&amp;quot;''' is implemented as a submit_tag which can easily have a confirm: attribute added to it causing it to throw a popup within expertiza.&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Remove&amp;quot;''' is an &amp;lt;a&amp;gt; tag hyperlink rendered to the page by line &amp;lt;%=question.edit(i)%&amp;gt; which iterates through all questions in the questionnaire and renders their edit() functions. Edit() is a function in each question types model (criterion.rb, cake.rb, etc.). Edit() adds lines to the html for each field in the question table, including the &amp;quot;Remove&amp;quot; link. The &amp;quot;Remove&amp;quot; hyperlink has an href attribute which dynamically links to /questions/ + self.id.to_s based on the desired questions id. It then uses a data-method=&amp;quot;delete&amp;quot; attribute to select the destroy method in questions_controller.rb. Because this hyperlink exists in each question types model, it is hard to implement a clean solution which does not edit all the model files. To do this, we added a short &amp;lt;script&amp;gt; to the end of _questionnaire.html.erb which scans for &amp;lt;a&amp;gt; hyperlink redirects with the [data-method=&amp;quot;delete&amp;quot;] attribute and throws a popup within the browser rather than expertiza. This popup works the same as the &amp;quot;Add&amp;quot; popup. The script returns the result (true/false) of this popup to the &amp;lt;a&amp;gt; tag. In html, the redirect is cancelled if a false is returned to the tag and continues if a true is returned.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: none; background: none;&amp;quot;&lt;br /&gt;
! Adding question during active period&lt;br /&gt;
! Removing question during active period&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Add_Question_Diagram.png|500px]] || [[File:Remove_Question_Diagram.png|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
Here is a list of files and the functions that were added or edited, excluding rspec files.&lt;br /&gt;
=== app/helpers/answer_helper.rb ===&lt;br /&gt;
Helper module containing important functions for deletion of responses and answers when editing a questionnaire during review period.&lt;br /&gt;
* '''delete_existing_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Calls log_answer_responses and log_answer_info to store responses users made to the questionnaire. If review_mailer can mail these responses to the user then delete_answers destroys the response object.&lt;br /&gt;
* '''log_answer_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Given a list of question_ids and a questionnaire_id, gathers reponse_ids for all users responses to the questionnaire.&lt;br /&gt;
* '''log_response_info(response_ids)'''&lt;br /&gt;
Given a list of response_ids, gathers users responses to a questionnaire and records their comments in a hash along with their name, email, and the assignment name.&lt;br /&gt;
&lt;br /&gt;
''NOTE:'' The only issue we have found on this project stems from the way this function gets ''answers''. Sometimes these review comments are sent to users in an email, and sometimes they are not. Our issue here [https://github.com/BoergerJ/expertiza/issues/29] explains it in more detail.&lt;br /&gt;
* '''review_mailer(email, answers, name, assignment_name)'''&lt;br /&gt;
Given an email, answer list, name, and assignment name, calls notify_review_rubric_change() to send given information about previous review submission to user at given email.&lt;br /&gt;
* '''delete_answers(response_id)'''&lt;br /&gt;
Given a response_id, set the response to be no longer submitted then destroy the response object. This destroys designated dependencies as well such as answers.&lt;br /&gt;
* '''in_active_period(questionnaire_id, answer=nil)'''&lt;br /&gt;
Given a questionnaire and possibly an answer, determine the assignment and round number. Use these to determine if the assignment is in a review period. Return true if in active period, false if not.&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questionnaires_controller.rb ===&lt;br /&gt;
* '''add_new_questions'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questions_controller.rb ===&lt;br /&gt;
* '''destroy'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
=== app/mailers/mailer.rb ===&lt;br /&gt;
* '''notify_review_rubric_change(defn)'''&lt;br /&gt;
Mailer function which set necessary attributes for sending an email about a deleted response including previous answers. Calls mail() to send email to desired user.&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment.rb ===&lt;br /&gt;
* '''find_review_period(round)'''&lt;br /&gt;
Determines the start and end dates of the rounds of an assignment and returns them.&lt;br /&gt;
Using previous teams code as a base, we changed this function to make minimal database calls and iterate fewer times.&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment_questionnaire.rb ===&lt;br /&gt;
* '''get_latest_assignment(questionnaire_id)'''&lt;br /&gt;
Given questinnaire_id, returns assignment and round where questionnaire is used (if multiple questionnaires are used in an assignment)&lt;br /&gt;
&lt;br /&gt;
=== app/views/questionnaires/_questionnaire.html.erb ===&lt;br /&gt;
* Added in_active_period() call to display warning about edited questionnaire during active period&lt;br /&gt;
* Added confirm: to submit_tag 'Add' to display confirmation popup when adding a question during active period&lt;br /&gt;
* Added script to catch &amp;lt;a&amp;gt; tag redirects with [data-method=&amp;quot;delete&amp;quot;] to display popup when removing a question. Script only active if in active period.&lt;br /&gt;
&lt;br /&gt;
=== app/views/mailer/notify_review_rubric_change.html.erb ===&lt;br /&gt;
* New file containing email layout used when emailing students their answers after questionnaire is edited during active period.&lt;br /&gt;
&lt;br /&gt;
== Changed Files ==&lt;br /&gt;
* Added:&lt;br /&gt;
** app/helpers/answer_helper.rb&lt;br /&gt;
** app/views/mailer/notify_review_rubric_change.html.erb&lt;br /&gt;
&lt;br /&gt;
* Edited:&lt;br /&gt;
** app/controllers/questionnaires_controller.rb&lt;br /&gt;
** app/controllers/questions_controller.rb&lt;br /&gt;
** app/mailers/mailer.rb&lt;br /&gt;
** app/models/assignment.rb&lt;br /&gt;
** app/models/assignment_questionnaire.rb&lt;br /&gt;
** app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
&lt;br /&gt;
* Test Case Files&lt;br /&gt;
** spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
** spec/models/assignment_spec.rb&lt;br /&gt;
** spec/controllers/questions_controller_spec.rb&lt;br /&gt;
** spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
Tests are created in the following files:&lt;br /&gt;
* spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
* spec/models/assignment_spec.rb&lt;br /&gt;
* spec/controllers/questions_controller_spec.rb&lt;br /&gt;
* spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
These tests cover the following cases:&lt;br /&gt;
* Adding questions to a questionnaire during the review period&lt;br /&gt;
* Adding questions to a questionnaire outside the review period&lt;br /&gt;
* Determining if an assignment is in the review period&lt;br /&gt;
* Determining if an assignment is outside the review period&lt;br /&gt;
* Finding the start and end dates for a specific review period of an assignment&lt;br /&gt;
* Finding the start and end dates for all review periods of an assignment&lt;br /&gt;
* Deleting existing responses resulting from changes made to questionnaires during the review period&lt;br /&gt;
* Deleting questions&lt;br /&gt;
&lt;br /&gt;
The same cases were also tested manually through the Expertiza UI, as shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
== Team Links ==&lt;br /&gt;
Here is the video our team recorded to show functionality:&lt;br /&gt;
[https://youtu.be/yibtRg3MsyQ]&lt;br /&gt;
&lt;br /&gt;
The link to our team's repository:&lt;br /&gt;
[https://github.com/BoergerJ/expertiza]&lt;br /&gt;
&lt;br /&gt;
The link to the Expertiza pull request for our project:&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1941]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138796</id>
		<title>CSC/ECE 517 Spring 2021 - E2110. 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_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138796"/>
		<updated>2021-04-30T18:41:00Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* app/helpers/answer_helper.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Members ==&lt;br /&gt;
*Nicholas Himes&lt;br /&gt;
&lt;br /&gt;
*Surya Makthal&lt;br /&gt;
&lt;br /&gt;
*Jordan Boerger&lt;br /&gt;
&lt;br /&gt;
*Sai Krishna Wupadrashta Dhinakara Subrahmanya&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
While setting up an assignment, the instructor will 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.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
If the instructor does edit or change a rubric while an assignment is in progress:&lt;br /&gt;
* If the change affects only the wording of a particular rubric item (e.g., to clarify the statement), no action is necessary.&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.  The system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.  (However, the response_map should not be changed.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''This project was done in Fall 2019. However, it was not tested thoroughly. Our team's work in Spring 2021 is to improve the testing and readability of the code.'''&lt;br /&gt;
&lt;br /&gt;
== Design Diagrams ==&lt;br /&gt;
=== Use Case Diagrams ===&lt;br /&gt;
''*Using UML Use Case Diagram Syntax''&lt;br /&gt;
&lt;br /&gt;
[[File:E2110_Use_Case_Diagram.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Data Flow Diagrams ===&lt;br /&gt;
''Note: This data flow diagram was originally made by the team from project E1982 in Fall 2019. Their wiki link can be viewed here: &lt;br /&gt;
&lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1982._Regulate_changing_of_rubrics_while_projects_are_in_progress''&lt;br /&gt;
&lt;br /&gt;
[[File:DesignFlow.png]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
We will write comprehensive tests and fix any bugs in the code written already for changing rubrics while projects are in progress.&lt;br /&gt;
&lt;br /&gt;
Some known issues already have been identified:&lt;br /&gt;
* Email functionality needs to be thoroughly tested&lt;br /&gt;
&lt;br /&gt;
* The method find_review_period is possibly redundant as Find deadlines does exist already in the code. This method needs to be replaced/removed if possible&lt;br /&gt;
&lt;br /&gt;
* A method comment is needed on in_active_period method in answer_helper.rb&lt;br /&gt;
&lt;br /&gt;
* Tests need to be more thorough and verify that correct rows are being deleted for delete_existing_responses function in answer_helper.rb&lt;br /&gt;
&lt;br /&gt;
* Split delete_existing_responses into more functions as it's complexity is reletively high&lt;br /&gt;
** Contains some nested loops so these should be removed&lt;br /&gt;
&lt;br /&gt;
* Confirm changes do not affect students who have not yet submitted their reviews by doing UI testing&lt;br /&gt;
&lt;br /&gt;
* Line-by-line comments are needed for all added functions&lt;br /&gt;
&lt;br /&gt;
== Completed Solution ==&lt;br /&gt;
* Added more extensive comments to all added functions and lines of code for better readability&lt;br /&gt;
* Added a popup confirmation message when deleting a question during active period similar to when adding a question to ensure instructor wants to delete all responses&lt;br /&gt;
* Destroy response object instead of individual answers when editing a questionnaire during active period to return all students who submitted reviews to the 'begin' stage rather than 'edit' and give them a fresh questionnaire&lt;br /&gt;
* Split complicated functions from previous team, such as delete_existing_responses(), into more manageable and modular functions which only complete 1 main task&lt;br /&gt;
* Fixed email formatting for email sent to users when questionnaire is edited&lt;br /&gt;
* find_review_period() now uses find_due_dates() to search for assignment due dates. Reduced number of database calls in find_review_period() to reduce interaction, number of iterating loops, and incorporate DRY principles&lt;br /&gt;
* answer data in log_response_info() now uses hash format for better readability&lt;br /&gt;
* Local array and hash variables now instantiated correctly.&lt;br /&gt;
* Improved rspec tests for all files&lt;br /&gt;
&lt;br /&gt;
== Flow ==&lt;br /&gt;
The main actions this project affects are adding and removing questions from a questionnaire. These diagrams will show how these events now occur. Because these events are handled differently in Expertiza, the implementation is slightly different for both cases.&lt;br /&gt;
&lt;br /&gt;
'''*Note:''' As you can see in the diagrams below, the confirmation popup is thrown in different ways for &amp;quot;Add&amp;quot; vs &amp;quot;Remove&amp;quot;. This is because in _questionnaire.html.erb:&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Add&amp;quot;''' is implemented as a submit_tag which can easily have a confirm: attribute added to it causing it to throw a popup within expertiza.&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Remove&amp;quot;''' is an &amp;lt;a&amp;gt; tag hyperlink rendered to the page by line &amp;lt;%=question.edit(i)%&amp;gt; which iterates through all questions in the questionnaire and renders their edit() functions. Edit() is a function in each question types model (criterion.rb, cake.rb, etc.). Edit() adds lines to the html for each field in the question table, including the &amp;quot;Remove&amp;quot; link. The &amp;quot;Remove&amp;quot; hyperlink has an href attribute which dynamically links to /questions/ + self.id.to_s based on the desired questions id. It then uses a data-method=&amp;quot;delete&amp;quot; attribute to select the destroy method in questions_controller.rb. Because this hyperlink exists in each question types model, it is hard to implement a clean solution which does not edit all the model files. To do this, we added a short &amp;lt;script&amp;gt; to the end of _questionnaire.html.erb which scans for &amp;lt;a&amp;gt; hyperlink redirects with the [data-method=&amp;quot;delete&amp;quot;] attribute and throws a popup within the browser rather than expertiza. This popup works the same as the &amp;quot;Add&amp;quot; popup. The script returns the result (true/false) of this popup to the &amp;lt;a&amp;gt; tag. In html, the redirect is cancelled if a false is returned to the tag and continues if a true is returned.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: none; background: none;&amp;quot;&lt;br /&gt;
! Adding question during active period&lt;br /&gt;
! Removing question during active period&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Add_Question_Diagram.png|500px]] || [[File:Remove_Question_Diagram.png|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
Here is a list of files and the functions that were added or edited, excluding rspec files.&lt;br /&gt;
=== app/helpers/answer_helper.rb ===&lt;br /&gt;
Helper module containing important functions for deletion of responses and answers when editing a questionnaire during review period.&lt;br /&gt;
* '''delete_existing_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Calls log_answer_responses and log_answer_info to store responses users made to the questionnaire. If review_mailer can mail these responses to the user then delete_answers destroys the response object.&lt;br /&gt;
* '''log_answer_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Given a list of question_ids and a questionnaire_id, gathers reponse_ids for all users responses to the questionnaire.&lt;br /&gt;
* '''log_response_info(response_ids)'''&lt;br /&gt;
Given a list of response_ids, gathers users responses to a questionnaire and records their comments in a hash along with their name, email, and the assignment name.&lt;br /&gt;
''NOTE:'' The only issue we have found on this project stems from the way this function gets ''answers''. Sometimes these review comments are sent to users in an email, and sometimes they are not. Our issue here [https://github.com/BoergerJ/expertiza/issues/29] explains it in more detail.&lt;br /&gt;
* '''review_mailer(email, answers, name, assignment_name)'''&lt;br /&gt;
Given an email, answer list, name, and assignment name, calls notify_review_rubric_change() to send given information about previous review submission to user at given email.&lt;br /&gt;
* '''delete_answers(response_id)'''&lt;br /&gt;
Given a response_id, set the response to be no longer submitted then destroy the response object. This destroys designated dependencies as well such as answers.&lt;br /&gt;
* '''in_active_period(questionnaire_id, answer=nil)'''&lt;br /&gt;
Given a questionnaire and possibly an answer, determine the assignment and round number. Use these to determine if the assignment is in a review period. Return true if in active period, false if not.&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questionnaires_controller.rb ===&lt;br /&gt;
* '''add_new_questions'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questions_controller.rb ===&lt;br /&gt;
* '''destroy'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
=== app/mailers/mailer.rb ===&lt;br /&gt;
* '''notify_review_rubric_change(defn)'''&lt;br /&gt;
Mailer function which set necessary attributes for sending an email about a deleted response including previous answers. Calls mail() to send email to desired user.&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment.rb ===&lt;br /&gt;
* '''find_review_period(round)'''&lt;br /&gt;
Determines the start and end dates of the rounds of an assignment and returns them.&lt;br /&gt;
Using previous teams code as a base, we changed this function to make minimal database calls and iterate fewer times.&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment_questionnaire.rb ===&lt;br /&gt;
* '''get_latest_assignment(questionnaire_id)'''&lt;br /&gt;
Given questinnaire_id, returns assignment and round where questionnaire is used (if multiple questionnaires are used in an assignment)&lt;br /&gt;
&lt;br /&gt;
=== app/views/questionnaires/_questionnaire.html.erb ===&lt;br /&gt;
* Added in_active_period() call to display warning about edited questionnaire during active period&lt;br /&gt;
* Added confirm: to submit_tag 'Add' to display confirmation popup when adding a question during active period&lt;br /&gt;
* Added script to catch &amp;lt;a&amp;gt; tag redirects with [data-method=&amp;quot;delete&amp;quot;] to display popup when removing a question. Script only active if in active period.&lt;br /&gt;
&lt;br /&gt;
=== app/views/mailer/notify_review_rubric_change.html.erb ===&lt;br /&gt;
* New file containing email layout used when emailing students their answers after questionnaire is edited during active period.&lt;br /&gt;
&lt;br /&gt;
== Changed Files ==&lt;br /&gt;
* Added:&lt;br /&gt;
** app/helpers/answer_helper.rb&lt;br /&gt;
** app/views/mailer/notify_review_rubric_change.html.erb&lt;br /&gt;
&lt;br /&gt;
* Edited:&lt;br /&gt;
** app/controllers/questionnaires_controller.rb&lt;br /&gt;
** app/controllers/questions_controller.rb&lt;br /&gt;
** app/mailers/mailer.rb&lt;br /&gt;
** app/models/assignment.rb&lt;br /&gt;
** app/models/assignment_questionnaire.rb&lt;br /&gt;
** app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
&lt;br /&gt;
* Test Case Files&lt;br /&gt;
** spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
** spec/models/assignment_spec.rb&lt;br /&gt;
** spec/controllers/questions_controller_spec.rb&lt;br /&gt;
** spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
Tests are created in the following files:&lt;br /&gt;
* spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
* spec/models/assignment_spec.rb&lt;br /&gt;
* spec/controllers/questions_controller_spec.rb&lt;br /&gt;
* spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
These tests cover the following cases:&lt;br /&gt;
* Adding questions to a questionnaire during the review period&lt;br /&gt;
* Adding questions to a questionnaire outside the review period&lt;br /&gt;
* Determining if an assignment is in the review period&lt;br /&gt;
* Determining if an assignment is outside the review period&lt;br /&gt;
* Finding the start and end dates for a specific review period of an assignment&lt;br /&gt;
* Finding the start and end dates for all review periods of an assignment&lt;br /&gt;
* Deleting existing responses resulting from changes made to questionnaires during the review period&lt;br /&gt;
* Deleting questions&lt;br /&gt;
&lt;br /&gt;
The same cases were also tested manually through the Expertiza UI, as shown in the demo video.&lt;br /&gt;
&lt;br /&gt;
== Team Links ==&lt;br /&gt;
Here is the video our team recorded to show functionality:&lt;br /&gt;
[https://youtu.be/yibtRg3MsyQ]&lt;br /&gt;
&lt;br /&gt;
The link to our team's repository:&lt;br /&gt;
[https://github.com/BoergerJ/expertiza]&lt;br /&gt;
&lt;br /&gt;
The link to the Expertiza pull request for our project:&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1941]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138778</id>
		<title>CSC/ECE 517 Spring 2021 - E2110. 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_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138778"/>
		<updated>2021-04-30T17:03:33Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: /* Team Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Members ==&lt;br /&gt;
*Nicholas Himes&lt;br /&gt;
&lt;br /&gt;
*Surya Makthal&lt;br /&gt;
&lt;br /&gt;
*Jordan Boerger&lt;br /&gt;
&lt;br /&gt;
*Sai Krishna Wupadrashta Dhinakara Subrahmanya&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
While setting up an assignment, the instructor will 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.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
If the instructor does edit or change a rubric while an assignment is in progress:&lt;br /&gt;
* If the change affects only the wording of a particular rubric item (e.g., to clarify the statement), no action is necessary.&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.  The system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.  (However, the response_map should not be changed.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''This project was done in Fall 2019. However, it was not tested thoroughly. Our team's work in Spring 2021 is to improve the testing and readability of the code.'''&lt;br /&gt;
&lt;br /&gt;
== Design Diagrams ==&lt;br /&gt;
=== Use Case Diagrams ===&lt;br /&gt;
''*Using UML Use Case Diagram Syntax''&lt;br /&gt;
&lt;br /&gt;
[[File:E2110_Use_Case_Diagram.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Data Flow Diagrams ===&lt;br /&gt;
''Note: This data flow diagram was originally made by the team from project E1982 in Fall 2019. Their wiki link can be viewed here: &lt;br /&gt;
&lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1982._Regulate_changing_of_rubrics_while_projects_are_in_progress''&lt;br /&gt;
&lt;br /&gt;
[[File:DesignFlow.png]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
We will write comprehensive tests and fix any bugs in the code written already for changing rubrics while projects are in progress.&lt;br /&gt;
&lt;br /&gt;
Some known issues already have been identified:&lt;br /&gt;
* Email functionality needs to be thoroughly tested&lt;br /&gt;
&lt;br /&gt;
* The method find_review_period is possibly redundant as Find deadlines does exist already in the code. This method needs to be replaced/removed if possible&lt;br /&gt;
&lt;br /&gt;
* A method comment is needed on in_active_period method in answer_helper.rb&lt;br /&gt;
&lt;br /&gt;
* Tests need to be more thorough and verify that correct rows are being deleted for delete_existing_responses function in answer_helper.rb&lt;br /&gt;
&lt;br /&gt;
* Split delete_existing_responses into more functions as it's complexity is reletively high&lt;br /&gt;
** Contains some nested loops so these should be removed&lt;br /&gt;
&lt;br /&gt;
* Confirm changes do not affect students who have not yet submitted their reviews by doing UI testing&lt;br /&gt;
&lt;br /&gt;
* Line-by-line comments are needed for all added functions&lt;br /&gt;
&lt;br /&gt;
== Completed Solution ==&lt;br /&gt;
* Added more extensive comments to all added functions and lines of code for better readability&lt;br /&gt;
* Added a popup confirmation message when deleting a question during active period similar to when adding a question to ensure instructor wants to delete all responses&lt;br /&gt;
* Destroy response object instead of individual answers when editing a questionnaire during active period to return all students who submitted reviews to the 'begin' stage rather than 'edit' and give them a fresh questionnaire&lt;br /&gt;
* Split complicated functions from previous team, such as delete_existing_responses(), into more manageable and modular functions which only complete 1 main task&lt;br /&gt;
* Fixed email formatting for email sent to users when questionnaire is edited&lt;br /&gt;
* find_review_period() now uses find_due_dates() to search for assignment due dates. Reduced number of database calls in find_review_period() to reduce interaction, number of iterating loops, and incorporate DRY principles&lt;br /&gt;
* answer data in log_response_info() now uses hash format for better readability&lt;br /&gt;
* Local array and hash variables now instantiated correctly.&lt;br /&gt;
* Improved rspec tests for all files&lt;br /&gt;
&lt;br /&gt;
== Flow ==&lt;br /&gt;
The main actions this project affects are adding and removing questions from a questionnaire. These diagrams will show how these events now occur. Because these events are handled differently in Expertiza, the implementation is slightly different for both cases.&lt;br /&gt;
&lt;br /&gt;
'''*Note:''' As you can see in the diagrams below, the confirmation popup is thrown in different ways for &amp;quot;Add&amp;quot; vs &amp;quot;Remove&amp;quot;. This is because in _questionnaire.html.erb:&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Add&amp;quot;''' is implemented as a submit_tag which can easily have a confirm: attribute added to it causing it to throw a popup within expertiza.&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Remove&amp;quot;''' is an &amp;lt;a&amp;gt; tag hyperlink rendered to the page by line &amp;lt;%=question.edit(i)%&amp;gt; which iterates through all questions in the questionnaire and renders their edit() functions. Edit() is a function in each question types model (criterion.rb, cake.rb, etc.). Edit() adds lines to the html for each field in the question table, including the &amp;quot;Remove&amp;quot; link. The &amp;quot;Remove&amp;quot; hyperlink has an href attribute which dynamically links to /questions/ + self.id.to_s based on the desired questions id. It then uses a data-method=&amp;quot;delete&amp;quot; attribute to select the destroy method in questions_controller.rb. Because this hyperlink exists in each question types model, it is hard to implement a clean solution which does not edit all the model files. To do this, we added a short &amp;lt;script&amp;gt; to the end of _questionnaire.html.erb which scans for &amp;lt;a&amp;gt; hyperlink redirects with the [data-method=&amp;quot;delete&amp;quot;] attribute and throws a popup within the browser rather than expertiza. This popup works the same as the &amp;quot;Add&amp;quot; popup. The script returns the result (true/false) of this popup to the &amp;lt;a&amp;gt; tag. In html, the redirect is cancelled if a false is returned to the tag and continues if a true is returned.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: none; background: none;&amp;quot;&lt;br /&gt;
! Adding question during active period&lt;br /&gt;
! Removing question during active period&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Add_Question_Diagram.png|500px]] || [[File:Remove_Question_Diagram.png|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
Here is a list of files and the functions that were added or edited, excluding rspec files.&lt;br /&gt;
=== app/helpers/answer_helper.rb ===&lt;br /&gt;
Helper module containing important functions for deletion of responses and answers when editing a questionnaire during review period.&lt;br /&gt;
* '''delete_existing_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Calls log_answer_responses and log_answer_info to store responses users made to the questionnaire. If review_mailer can mail these responses to the user then delete_answers destroys the response object.&lt;br /&gt;
* '''log_answer_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Given a list of question_ids and a questionnaire_id, gathers reponse_ids for all users responses to the questionnaire.&lt;br /&gt;
* '''log_response_info(response_ids)'''&lt;br /&gt;
Given a list of response_ids, gathers users responses to a questionnaire and records their comments in a hash along with their name, email, and the assignment name.&lt;br /&gt;
* '''review_mailer(email, answers, name, assignment_name)'''&lt;br /&gt;
Given an email, answer list, name, and assignment name, calls notify_review_rubric_change() to send given information about previous review submission to user at given email.&lt;br /&gt;
* '''delete_answers(response_id)'''&lt;br /&gt;
Given a response_id, set the response to be no longer submitted then destroy the response object. This destroys designated dependencies as well such as answers.&lt;br /&gt;
* '''in_active_period(questionnaire_id, answer=nil)'''&lt;br /&gt;
Given a questionnaire and possibly an answer, determine the assignment and round number. Use these to determine if the assignment is in a review period. Return true if in active period, false if not.&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questionnaires_controller.rb ===&lt;br /&gt;
* '''add_new_questions'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questions_controller.rb ===&lt;br /&gt;
* '''destroy'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
=== app/mailers/mailer.rb ===&lt;br /&gt;
* '''notify_review_rubric_change(defn)'''&lt;br /&gt;
Mailer function which set necessary attributes for sending an email about a deleted response including previous answers. Calls mail() to send email to desired user.&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment.rb ===&lt;br /&gt;
* '''find_review_period(round)'''&lt;br /&gt;
Determines the start and end dates of the rounds of an assignment and returns them.&lt;br /&gt;
Using previous teams code as a base, we changed this function to make minimal database calls and iterate fewer times.&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment_questionnaire.rb ===&lt;br /&gt;
* '''get_latest_assignment(questionnaire_id)'''&lt;br /&gt;
Given questinnaire_id, returns assignment and round where questionnaire is used (if multiple questionnaires are used in an assignment)&lt;br /&gt;
&lt;br /&gt;
=== app/views/questionnaires/_questionnaire.html.erb ===&lt;br /&gt;
* Added in_active_period() call to display warning about edited questionnaire during active period&lt;br /&gt;
* Added confirm: to submit_tag 'Add' to display confirmation popup when adding a question during active period&lt;br /&gt;
* Added script to catch &amp;lt;a&amp;gt; tag redirects with [data-method=&amp;quot;delete&amp;quot;] to display popup when removing a question. Script only active if in active period.&lt;br /&gt;
&lt;br /&gt;
=== app/views/mailer/notify_review_rubric_change.html.erb ===&lt;br /&gt;
* New file containing email layout used when emailing students their answers after questionnaire is edited during active period.&lt;br /&gt;
&lt;br /&gt;
== Changed Files ==&lt;br /&gt;
* Added:&lt;br /&gt;
** app/helpers/answer_helper.rb&lt;br /&gt;
** app/views/mailer/notify_review_rubric_change.html.erb&lt;br /&gt;
&lt;br /&gt;
* Edited:&lt;br /&gt;
** app/controllers/questionnaires_controller.rb&lt;br /&gt;
** app/controllers/questions_controller.rb&lt;br /&gt;
** app/mailers/mailer.rb&lt;br /&gt;
** app/models/assignment.rb&lt;br /&gt;
** app/models/assignment_questionnaire.rb&lt;br /&gt;
** app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
&lt;br /&gt;
* Test Case Files&lt;br /&gt;
** spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
** spec/models/assignment_spec.rb&lt;br /&gt;
** spec/controllers/questions_controller_spec.rb&lt;br /&gt;
** spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
Tests are created in the following files:&lt;br /&gt;
* spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
* spec/models/assignment_spec.rb&lt;br /&gt;
* spec/controllers/questions_controller_spec.rb&lt;br /&gt;
* spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Team Links ==&lt;br /&gt;
Here is the video our team recorded to show functionality:&lt;br /&gt;
[https://youtu.be/yibtRg3MsyQ]&lt;br /&gt;
&lt;br /&gt;
The link to our team's repository:&lt;br /&gt;
[https://github.com/BoergerJ/expertiza]&lt;br /&gt;
&lt;br /&gt;
The link to the Expertiza pull request for our project:&lt;br /&gt;
[https://github.com/expertiza/expertiza/pull/1941]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Spring_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138775</id>
		<title>CSC/ECE 517 Spring 2021 - E2110. 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_2021_-_E2110._Regulate_changing_of_rubrics_while_projects_are_in_progress&amp;diff=138775"/>
		<updated>2021-04-30T16:59:31Z</updated>

		<summary type="html">&lt;p&gt;Nnhimes: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Members ==&lt;br /&gt;
*Nicholas Himes&lt;br /&gt;
&lt;br /&gt;
*Surya Makthal&lt;br /&gt;
&lt;br /&gt;
*Jordan Boerger&lt;br /&gt;
&lt;br /&gt;
*Sai Krishna Wupadrashta Dhinakara Subrahmanya&lt;br /&gt;
&lt;br /&gt;
== Project Description ==&lt;br /&gt;
While setting up an assignment, the instructor will 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.&lt;br /&gt;
&lt;br /&gt;
== Goal ==&lt;br /&gt;
If the instructor does edit or change a rubric while an assignment is in progress:&lt;br /&gt;
* If the change affects only the wording of a particular rubric item (e.g., to clarify the statement), no action is necessary.&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.  The system should then email the previously done reviews to the reviewer and delete the response object and all associated answer objects.  (However, the response_map should not be changed.)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''This project was done in Fall 2019. However, it was not tested thoroughly. Our team's work in Spring 2021 is to improve the testing and readability of the code.'''&lt;br /&gt;
&lt;br /&gt;
== Design Diagrams ==&lt;br /&gt;
=== Use Case Diagrams ===&lt;br /&gt;
''*Using UML Use Case Diagram Syntax''&lt;br /&gt;
&lt;br /&gt;
[[File:E2110_Use_Case_Diagram.png|900px]]&lt;br /&gt;
&lt;br /&gt;
=== Data Flow Diagrams ===&lt;br /&gt;
''Note: This data flow diagram was originally made by the team from project E1982 in Fall 2019. Their wiki link can be viewed here: &lt;br /&gt;
&lt;br /&gt;
https://expertiza.csc.ncsu.edu/index.php/CSC/ECE_517_Fall_2019_-_E1982._Regulate_changing_of_rubrics_while_projects_are_in_progress''&lt;br /&gt;
&lt;br /&gt;
[[File:DesignFlow.png]]&lt;br /&gt;
&lt;br /&gt;
== Proposed Solution ==&lt;br /&gt;
We will write comprehensive tests and fix any bugs in the code written already for changing rubrics while projects are in progress.&lt;br /&gt;
&lt;br /&gt;
Some known issues already have been identified:&lt;br /&gt;
* Email functionality needs to be thoroughly tested&lt;br /&gt;
&lt;br /&gt;
* The method find_review_period is possibly redundant as Find deadlines does exist already in the code. This method needs to be replaced/removed if possible&lt;br /&gt;
&lt;br /&gt;
* A method comment is needed on in_active_period method in answer_helper.rb&lt;br /&gt;
&lt;br /&gt;
* Tests need to be more thorough and verify that correct rows are being deleted for delete_existing_responses function in answer_helper.rb&lt;br /&gt;
&lt;br /&gt;
* Split delete_existing_responses into more functions as it's complexity is reletively high&lt;br /&gt;
** Contains some nested loops so these should be removed&lt;br /&gt;
&lt;br /&gt;
* Confirm changes do not affect students who have not yet submitted their reviews by doing UI testing&lt;br /&gt;
&lt;br /&gt;
* Line-by-line comments are needed for all added functions&lt;br /&gt;
&lt;br /&gt;
== Completed Solution ==&lt;br /&gt;
* Added more extensive comments to all added functions and lines of code for better readability&lt;br /&gt;
* Added a popup confirmation message when deleting a question during active period similar to when adding a question to ensure instructor wants to delete all responses&lt;br /&gt;
* Destroy response object instead of individual answers when editing a questionnaire during active period to return all students who submitted reviews to the 'begin' stage rather than 'edit' and give them a fresh questionnaire&lt;br /&gt;
* Split complicated functions from previous team, such as delete_existing_responses(), into more manageable and modular functions which only complete 1 main task&lt;br /&gt;
* Fixed email formatting for email sent to users when questionnaire is edited&lt;br /&gt;
* find_review_period() now uses find_due_dates() to search for assignment due dates. Reduced number of database calls in find_review_period() to reduce interaction, number of iterating loops, and incorporate DRY principles&lt;br /&gt;
* answer data in log_response_info() now uses hash format for better readability&lt;br /&gt;
* Local array and hash variables now instantiated correctly.&lt;br /&gt;
* Improved rspec tests for all files&lt;br /&gt;
&lt;br /&gt;
== Flow ==&lt;br /&gt;
The main actions this project affects are adding and removing questions from a questionnaire. These diagrams will show how these events now occur. Because these events are handled differently in Expertiza, the implementation is slightly different for both cases.&lt;br /&gt;
&lt;br /&gt;
'''*Note:''' As you can see in the diagrams below, the confirmation popup is thrown in different ways for &amp;quot;Add&amp;quot; vs &amp;quot;Remove&amp;quot;. This is because in _questionnaire.html.erb:&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Add&amp;quot;''' is implemented as a submit_tag which can easily have a confirm: attribute added to it causing it to throw a popup within expertiza.&lt;br /&gt;
&lt;br /&gt;
'''&amp;quot;Remove&amp;quot;''' is an &amp;lt;a&amp;gt; tag hyperlink rendered to the page by line &amp;lt;%=question.edit(i)%&amp;gt; which iterates through all questions in the questionnaire and renders their edit() functions. Edit() is a function in each question types model (criterion.rb, cake.rb, etc.). Edit() adds lines to the html for each field in the question table, including the &amp;quot;Remove&amp;quot; link. The &amp;quot;Remove&amp;quot; hyperlink has an href attribute which dynamically links to /questions/ + self.id.to_s based on the desired questions id. It then uses a data-method=&amp;quot;delete&amp;quot; attribute to select the destroy method in questions_controller.rb. Because this hyperlink exists in each question types model, it is hard to implement a clean solution which does not edit all the model files. To do this, we added a short &amp;lt;script&amp;gt; to the end of _questionnaire.html.erb which scans for &amp;lt;a&amp;gt; hyperlink redirects with the [data-method=&amp;quot;delete&amp;quot;] attribute and throws a popup within the browser rather than expertiza. This popup works the same as the &amp;quot;Add&amp;quot; popup. The script returns the result (true/false) of this popup to the &amp;lt;a&amp;gt; tag. In html, the redirect is cancelled if a false is returned to the tag and continues if a true is returned.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; style=&amp;quot;border: none; background: none;&amp;quot;&lt;br /&gt;
! Adding question during active period&lt;br /&gt;
! Removing question during active period&lt;br /&gt;
|-&lt;br /&gt;
| [[File:Add_Question_Diagram.png|500px]] || [[File:Remove_Question_Diagram.png|600px]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Documentation ==&lt;br /&gt;
Here is a list of files and the functions that were added or edited, excluding rspec files.&lt;br /&gt;
=== app/helpers/answer_helper.rb ===&lt;br /&gt;
Helper module containing important functions for deletion of responses and answers when editing a questionnaire during review period.&lt;br /&gt;
* '''delete_existing_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Calls log_answer_responses and log_answer_info to store responses users made to the questionnaire. If review_mailer can mail these responses to the user then delete_answers destroys the response object.&lt;br /&gt;
* '''log_answer_responses(question_ids, questionnaire_id)'''&lt;br /&gt;
Given a list of question_ids and a questionnaire_id, gathers reponse_ids for all users responses to the questionnaire.&lt;br /&gt;
* '''log_response_info(response_ids)'''&lt;br /&gt;
Given a list of response_ids, gathers users responses to a questionnaire and records their comments in a hash along with their name, email, and the assignment name.&lt;br /&gt;
* '''review_mailer(email, answers, name, assignment_name)'''&lt;br /&gt;
Given an email, answer list, name, and assignment name, calls notify_review_rubric_change() to send given information about previous review submission to user at given email.&lt;br /&gt;
* '''delete_answers(response_id)'''&lt;br /&gt;
Given a response_id, set the response to be no longer submitted then destroy the response object. This destroys designated dependencies as well such as answers.&lt;br /&gt;
* '''in_active_period(questionnaire_id, answer=nil)'''&lt;br /&gt;
Given a questionnaire and possibly an answer, determine the assignment and round number. Use these to determine if the assignment is in a review period. Return true if in active period, false if not.&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questionnaires_controller.rb ===&lt;br /&gt;
* '''add_new_questions'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
=== app/controllers/questions_controller.rb ===&lt;br /&gt;
* '''destroy'''&lt;br /&gt;
Added call to in_active_period. If in active period, call delete_existing_responses(). If not, continue as normal.&lt;br /&gt;
&lt;br /&gt;
=== app/mailers/mailer.rb ===&lt;br /&gt;
* '''notify_review_rubric_change(defn)'''&lt;br /&gt;
Mailer function which set necessary attributes for sending an email about a deleted response including previous answers. Calls mail() to send email to desired user.&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment.rb ===&lt;br /&gt;
* '''find_review_period(round)'''&lt;br /&gt;
Determines the start and end dates of the rounds of an assignment and returns them.&lt;br /&gt;
Using previous teams code as a base, we changed this function to make minimal database calls and iterate fewer times.&lt;br /&gt;
&lt;br /&gt;
=== app/models/assignment_questionnaire.rb ===&lt;br /&gt;
* '''get_latest_assignment(questionnaire_id)'''&lt;br /&gt;
Given questinnaire_id, returns assignment and round where questionnaire is used (if multiple questionnaires are used in an assignment)&lt;br /&gt;
&lt;br /&gt;
=== app/views/questionnaires/_questionnaire.html.erb ===&lt;br /&gt;
* Added in_active_period() call to display warning about edited questionnaire during active period&lt;br /&gt;
* Added confirm: to submit_tag 'Add' to display confirmation popup when adding a question during active period&lt;br /&gt;
* Added script to catch &amp;lt;a&amp;gt; tag redirects with [data-method=&amp;quot;delete&amp;quot;] to display popup when removing a question. Script only active if in active period.&lt;br /&gt;
&lt;br /&gt;
=== app/views/mailer/notify_review_rubric_change.html.erb ===&lt;br /&gt;
* New file containing email layout used when emailing students their answers after questionnaire is edited during active period.&lt;br /&gt;
&lt;br /&gt;
== Changed Files ==&lt;br /&gt;
* Added:&lt;br /&gt;
** app/helpers/answer_helper.rb&lt;br /&gt;
** app/views/mailer/notify_review_rubric_change.html.erb&lt;br /&gt;
&lt;br /&gt;
* Edited:&lt;br /&gt;
** app/controllers/questionnaires_controller.rb&lt;br /&gt;
** app/controllers/questions_controller.rb&lt;br /&gt;
** app/mailers/mailer.rb&lt;br /&gt;
** app/models/assignment.rb&lt;br /&gt;
** app/models/assignment_questionnaire.rb&lt;br /&gt;
** app/views/questionnaires/_questionnaire.html.erb&lt;br /&gt;
&lt;br /&gt;
* Test Case Files&lt;br /&gt;
** spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
** spec/models/assignment_spec.rb&lt;br /&gt;
** spec/controllers/questions_controller_spec.rb&lt;br /&gt;
** spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
Tests are created in the following files:&lt;br /&gt;
* spec/controllers/questionnaires_controller_spec.rb&lt;br /&gt;
* spec/models/assignment_spec.rb&lt;br /&gt;
* spec/controllers/questions_controller_spec.rb&lt;br /&gt;
* spec/helpers/answer_helper_spec.rb&lt;br /&gt;
&lt;br /&gt;
== Team Video ==&lt;br /&gt;
Here is the video our team recorded to show functionality:&lt;br /&gt;
[https://youtu.be/yibtRg3MsyQ]&lt;/div&gt;</summary>
		<author><name>Nnhimes</name></author>
	</entry>
</feed>