<?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=Rsah</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=Rsah"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Rsah"/>
	<updated>2026-09-27T20:38:28Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142286</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142286"/>
		<updated>2021-11-30T03:49:53Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Relevant Links */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
The ER diagram of the parent tables is given below for reference ([https://expertiza.csc.ncsu.edu/index.php/Answer_tags Source: Answer_tags]).&lt;br /&gt;
&lt;br /&gt;
[[File:answer_tags_imported.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The flow diagrams below show how controllers in this project are connected with interrelated classes, methods, and views.&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 answer tags controller.png|900px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 tag prompt deployment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the answer tags.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, answer tags specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is provided, answer tags specific to that questionnaire should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is provided, answer tags specific to that assignment should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When only one parameter is passed, the corresponding answer tags should be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when user_id is nil expect an error&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has given any response then count of taggable answer &amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a question or a response does not exists then count of taggable answer = 0 (extreme case) &amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* user_id (parameter) is nil&lt;br /&gt;
* response is empty&lt;br /&gt;
* question is empty&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* There are no teams associated with the assignment.&lt;br /&gt;
* There are no questions in the questionnaire that have the question type specified in the TagPromptDeployment object.&lt;br /&gt;
* The assignment is set to vary by round.&lt;br /&gt;
* The assignment is set not to vary by round.&lt;br /&gt;
* There are multiple tags.&lt;br /&gt;
* There are no tags.&lt;br /&gt;
&lt;br /&gt;
== Bug Fixing of Additional Issues ==&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: get_number_of_taggable_answers)===&lt;br /&gt;
&lt;br /&gt;
An additional issue in the method get_number_of_taggable_answers. The error message is as shown below which indicates string concatenation fails between integer and string data types.&lt;br /&gt;
&lt;br /&gt;
''TypeError:''&lt;br /&gt;
no implicit conversion of Fixnum into String at line 23 https://github.com/expertiza/expertiza/blob/beta/app/models/tag_prompt_deployment.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:Get_number_of_taggable_answers_bug.JPG]]&lt;br /&gt;
&lt;br /&gt;
This issue is fixed by correcting the syntax of the two-strings concatenation. After fixing the code is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; answers = answers.where(conditions: &amp;quot;length(comments) &amp;lt; #{self.answer_length_threshold}&amp;quot; ) unless self.answer_length_threshold.nil? &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: assignment_tagging_progress)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Failure/Error: answers = answers.where(&amp;quot;length(comments) &amp;gt; ?&amp;quot;, self.answer_length_threshold.to_s) unless self.answer_length_threshold.nil?&lt;br /&gt;
     &lt;br /&gt;
     NoMethodError:&lt;br /&gt;
       undefined method `where' for #&amp;lt;Array:0x00000003424b60&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This issue was resolved by using &amp;lt;code&amp;gt;Arrays.select&amp;lt;/code&amp;gt; to achieve the same functionality.&lt;br /&gt;
&lt;br /&gt;
There was another small error in which the TeamsUser &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; was not found, and the resolution was to find the User model for each &amp;lt;code&amp;gt;TeamsUser.user_id&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
Test cases are added to cover all functionality. With the cases added the coverage has reached to 100%.&lt;br /&gt;
&lt;br /&gt;
Test cases demo can be found at [https://youtu.be/WYSUmL6jcHc OSS Final Project Testing Video]&lt;br /&gt;
&lt;br /&gt;
tag_prompt_deployment.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
[[File:Tag_prompt_deployment_coverage.jpeg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
answer_tags_controller.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
[[File:Answer_tag_controller_coverage.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Parab&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;br /&gt;
&lt;br /&gt;
== Video Link ==&lt;br /&gt;
&lt;br /&gt;
Test case run and coverage recording [https://www.youtube.com/watch?v=WYSUmL6jcHc]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Answer_tag_controller_coverage.jpeg&amp;diff=142253</id>
		<title>File:Answer tag controller coverage.jpeg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Answer_tag_controller_coverage.jpeg&amp;diff=142253"/>
		<updated>2021-11-30T02:51:55Z</updated>

		<summary type="html">&lt;p&gt;Rsah: Rsah uploaded a new version of File:Answer tag controller coverage.jpeg&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Answer_tag_controller_coverage&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142252</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142252"/>
		<updated>2021-11-30T02:48:21Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
The ER diagram of the parent tables is given below for reference ([https://expertiza.csc.ncsu.edu/index.php/Answer_tags Source: Answer_tags]).&lt;br /&gt;
&lt;br /&gt;
[[File:answer_tags_imported.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The flow diagrams below show how controllers in this project are connected with interrelated classes, methods, and views.&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 answer tags controller.png|900px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 tag prompt deployment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the answer tags.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, answer tags specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is provided, answer tags specific to that questionnaire should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is provided, answer tags specific to that assignment should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When only one parameter is passed, the corresponding answer tags should be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when user_id is nil expect an error&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has given any response then count of taggable answer &amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a question or a response does not exists then count of taggable answer = 0 (extreme case) &amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* user_id (parameter) is nil&lt;br /&gt;
* response is empty&lt;br /&gt;
* question is empty&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* There are no teams associated with the assignment.&lt;br /&gt;
* There are no questions in the questionnaire that have the question type specified in the TagPromptDeployment object.&lt;br /&gt;
* The assignment is set to vary by round.&lt;br /&gt;
* The assignment is set not to vary by round.&lt;br /&gt;
* There are multiple tags.&lt;br /&gt;
* There are no tags.&lt;br /&gt;
&lt;br /&gt;
== Bug Fixing of Additional Issues ==&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: get_number_of_taggable_answers)===&lt;br /&gt;
&lt;br /&gt;
An additional issue in the method get_number_of_taggable_answers. The error message is as shown below which indicates string concatenation fails between integer and string data types.&lt;br /&gt;
&lt;br /&gt;
''TypeError:''&lt;br /&gt;
no implicit conversion of Fixnum into String at line 23 https://github.com/expertiza/expertiza/blob/beta/app/models/tag_prompt_deployment.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:Get_number_of_taggable_answers_bug.JPG]]&lt;br /&gt;
&lt;br /&gt;
This issue is fixed by correcting the syntax of the two-strings concatenation. After fixing the code is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; answers = answers.where(conditions: &amp;quot;length(comments) &amp;lt; #{self.answer_length_threshold}&amp;quot; ) unless self.answer_length_threshold.nil? &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: assignment_tagging_progress)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Failure/Error: answers = answers.where(&amp;quot;length(comments) &amp;gt; ?&amp;quot;, self.answer_length_threshold.to_s) unless self.answer_length_threshold.nil?&lt;br /&gt;
     &lt;br /&gt;
     NoMethodError:&lt;br /&gt;
       undefined method `where' for #&amp;lt;Array:0x00000003424b60&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This issue was resolved by using &amp;lt;code&amp;gt;Arrays.select&amp;lt;/code&amp;gt; to achieve the same functionality.&lt;br /&gt;
&lt;br /&gt;
There was another small error in which the TeamsUser &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; was not found, and the resolution was to find the User model for each &amp;lt;code&amp;gt;TeamsUser.user_id&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
Test cases are added to cover all functionality. With the cases added the coverage has reached to 100%.&lt;br /&gt;
&lt;br /&gt;
tag_prompt_deployment.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
[[File:Tag_prompt_deployment_coverage.jpeg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
answer_tags_controller.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
[[File:Answer_tag_controller_coverage.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142250</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142250"/>
		<updated>2021-11-30T02:46:51Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
The ER diagram of the parent tables is given below for reference ([https://expertiza.csc.ncsu.edu/index.php/Answer_tags Source: Answer_tags]).&lt;br /&gt;
&lt;br /&gt;
[[File:answer_tags_imported.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The flow diagrams below show how controllers in this project are connected with interrelated classes, methods, and views.&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 answer tags controller.png|900px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 tag prompt deployment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the answer tags.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, answer tags specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is provided, answer tags specific to that questionnaire should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is provided, answer tags specific to that assignment should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When only one parameter is passed, the corresponding answer tags should be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when user_id is nil expect an error&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has given any response then count of taggable answer &amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a question or a response does not exists then count of taggable answer = 0 (extreme case) &amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* user_id (parameter) is nil&lt;br /&gt;
* response is empty&lt;br /&gt;
* question is empty&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* There are no teams associated with the assignment.&lt;br /&gt;
* There are no questions in the questionnaire that have the question type specified in the TagPromptDeployment object.&lt;br /&gt;
* The assignment is set to vary by round.&lt;br /&gt;
* The assignment is set not to vary by round.&lt;br /&gt;
* There are multiple tags.&lt;br /&gt;
* There are no tags.&lt;br /&gt;
&lt;br /&gt;
== Bug Fixing of Additional Issues ==&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: get_number_of_taggable_answers)===&lt;br /&gt;
&lt;br /&gt;
An additional issue in the method get_number_of_taggable_answers. The error message is as shown below which indicates string concatenation fails between integer and string data types.&lt;br /&gt;
&lt;br /&gt;
''TypeError:''&lt;br /&gt;
no implicit conversion of Fixnum into String at line 23 https://github.com/expertiza/expertiza/blob/beta/app/models/tag_prompt_deployment.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:Get_number_of_taggable_answers_bug.JPG]]&lt;br /&gt;
&lt;br /&gt;
This issue is fixed by correcting the syntax of the two-strings concatenation. After fixing the code is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; answers = answers.where(conditions: &amp;quot;length(comments) &amp;lt; #{self.answer_length_threshold}&amp;quot; ) unless self.answer_length_threshold.nil? &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: assignment_tagging_progress)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Failure/Error: answers = answers.where(&amp;quot;length(comments) &amp;gt; ?&amp;quot;, self.answer_length_threshold.to_s) unless self.answer_length_threshold.nil?&lt;br /&gt;
     &lt;br /&gt;
     NoMethodError:&lt;br /&gt;
       undefined method `where' for #&amp;lt;Array:0x00000003424b60&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This issue was resolved by using &amp;lt;code&amp;gt;Arrays.select&amp;lt;/code&amp;gt; to achieve the same functionality.&lt;br /&gt;
&lt;br /&gt;
There was another small error in which the TeamsUser &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; was not found, and the resolution was to find the User model for each &amp;lt;code&amp;gt;TeamsUser.user_id&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
Test cases are added to cover all functionality.&lt;br /&gt;
&lt;br /&gt;
tag_prompt_deployment.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
[[File:Tag_prompt_deployment_coverage.jpeg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
answer_tags_controller.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
[[File:Answer_tag_controller_coverage.jpeg]]&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Answer_tag_controller_coverage.jpeg&amp;diff=142249</id>
		<title>File:Answer tag controller coverage.jpeg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Answer_tag_controller_coverage.jpeg&amp;diff=142249"/>
		<updated>2021-11-30T02:44:14Z</updated>

		<summary type="html">&lt;p&gt;Rsah: Answer_tag_controller_coverage&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Answer_tag_controller_coverage&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142248</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142248"/>
		<updated>2021-11-30T02:42:43Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
The ER diagram of the parent tables is given below for reference ([https://expertiza.csc.ncsu.edu/index.php/Answer_tags Source: Answer_tags]).&lt;br /&gt;
&lt;br /&gt;
[[File:answer_tags_imported.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The flow diagrams below show how controllers in this project are connected with interrelated classes, methods, and views.&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 answer tags controller.png|900px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 tag prompt deployment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the answer tags.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, answer tags specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is provided, answer tags specific to that questionnaire should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is provided, answer tags specific to that assignment should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When only one parameter is passed, the corresponding answer tags should be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when user_id is nil expect an error&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has given any response then count of taggable answer &amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a question or a response does not exists then count of taggable answer = 0 (extreme case) &amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* user_id (parameter) is nil&lt;br /&gt;
* response is empty&lt;br /&gt;
* question is empty&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* There are no teams associated with the assignment.&lt;br /&gt;
* There are no questions in the questionnaire that have the question type specified in the TagPromptDeployment object.&lt;br /&gt;
* The assignment is set to vary by round.&lt;br /&gt;
* The assignment is set not to vary by round.&lt;br /&gt;
* There are multiple tags.&lt;br /&gt;
* There are no tags.&lt;br /&gt;
&lt;br /&gt;
== Bug Fixing of Additional Issues ==&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: get_number_of_taggable_answers)===&lt;br /&gt;
&lt;br /&gt;
An additional issue in the method get_number_of_taggable_answers. The error message is as shown below which indicates string concatenation fails between integer and string data types.&lt;br /&gt;
&lt;br /&gt;
''TypeError:''&lt;br /&gt;
no implicit conversion of Fixnum into String at line 23 https://github.com/expertiza/expertiza/blob/beta/app/models/tag_prompt_deployment.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:Get_number_of_taggable_answers_bug.JPG]]&lt;br /&gt;
&lt;br /&gt;
This issue is fixed by correcting the syntax of the two-strings concatenation. After fixing the code is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; answers = answers.where(conditions: &amp;quot;length(comments) &amp;lt; #{self.answer_length_threshold}&amp;quot; ) unless self.answer_length_threshold.nil? &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: assignment_tagging_progress)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Failure/Error: answers = answers.where(&amp;quot;length(comments) &amp;gt; ?&amp;quot;, self.answer_length_threshold.to_s) unless self.answer_length_threshold.nil?&lt;br /&gt;
     &lt;br /&gt;
     NoMethodError:&lt;br /&gt;
       undefined method `where' for #&amp;lt;Array:0x00000003424b60&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This issue was resolved by using &amp;lt;code&amp;gt;Arrays.select&amp;lt;/code&amp;gt; to achieve the same functionality.&lt;br /&gt;
&lt;br /&gt;
There was another small error in which the TeamsUser &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; was not found, and the resolution was to find the User model for each &amp;lt;code&amp;gt;TeamsUser.user_id&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
Test cases are added to cover all functionality.&lt;br /&gt;
&lt;br /&gt;
tag_prompt_deployment.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
[[File:Tag_prompt_deployment_coverage.jpeg]]&lt;br /&gt;
&lt;br /&gt;
answer_tags_controller.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Tag_prompt_deployment_coverage.jpeg&amp;diff=142246</id>
		<title>File:Tag prompt deployment coverage.jpeg</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Tag_prompt_deployment_coverage.jpeg&amp;diff=142246"/>
		<updated>2021-11-30T02:41:36Z</updated>

		<summary type="html">&lt;p&gt;Rsah: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142245</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142245"/>
		<updated>2021-11-30T02:36:17Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Results */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
The ER diagram of the parent tables is given below for reference ([https://expertiza.csc.ncsu.edu/index.php/Answer_tags Source: Answer_tags]).&lt;br /&gt;
&lt;br /&gt;
[[File:answer_tags_imported.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The flow diagrams below show how controllers in this project are connected with interrelated classes, methods, and views.&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 answer tags controller.png|900px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 tag prompt deployment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the answer tags.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, answer tags specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is provided, answer tags specific to that questionnaire should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is provided, answer tags specific to that assignment should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When only one parameter is passed, the corresponding answer tags should be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when user_id is nil expect an error&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has given any response then count of taggable answer &amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a question or a response does not exists then count of taggable answer = 0 (extreme case) &amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* user_id (parameter) is nil&lt;br /&gt;
* response is empty&lt;br /&gt;
* question is empty&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* There are no teams associated with the assignment.&lt;br /&gt;
* There are no questions in the questionnaire that have the question type specified in the TagPromptDeployment object.&lt;br /&gt;
* The assignment is set to vary by round.&lt;br /&gt;
* The assignment is set not to vary by round.&lt;br /&gt;
* There are multiple tags.&lt;br /&gt;
&lt;br /&gt;
== Bug Fixing of Additional Issues ==&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: get_number_of_taggable_answers)===&lt;br /&gt;
&lt;br /&gt;
An additional issue in the method get_number_of_taggable_answers. The error message is as shown below which indicates string concatenation fails between integer and string data types.&lt;br /&gt;
&lt;br /&gt;
''TypeError:''&lt;br /&gt;
no implicit conversion of Fixnum into String at line 23 https://github.com/expertiza/expertiza/blob/beta/app/models/tag_prompt_deployment.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:Get_number_of_taggable_answers_bug.JPG]]&lt;br /&gt;
&lt;br /&gt;
This issue is fixed by correcting the syntax of the two-strings concatenation. After fixing the code is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; answers = answers.where(conditions: &amp;quot;length(comments) &amp;lt; #{self.answer_length_threshold}&amp;quot; ) unless self.answer_length_threshold.nil? &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: assignment_tagging_progress)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Failure/Error: answers = answers.where(&amp;quot;length(comments) &amp;gt; ?&amp;quot;, self.answer_length_threshold.to_s) unless self.answer_length_threshold.nil?&lt;br /&gt;
     &lt;br /&gt;
     NoMethodError:&lt;br /&gt;
       undefined method `where' for #&amp;lt;Array:0x00000003424b60&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This issue was resolved by using &amp;lt;code&amp;gt;Arrays.select&amp;lt;/code&amp;gt; to achieve the same functionality.&lt;br /&gt;
&lt;br /&gt;
There was another small error in which the TeamsUser &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; was not found, and the resolution was to find the User model for each &amp;lt;code&amp;gt;TeamsUser.user_id&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
Test cases are added to cover all functionality.&lt;br /&gt;
&lt;br /&gt;
tag_prompt_deployment.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
answer_tags_controller.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142244</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142244"/>
		<updated>2021-11-30T02:28:08Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Controller: tag_prompt_deployment.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
The ER diagram of the parent tables is given below for reference ([https://expertiza.csc.ncsu.edu/index.php/Answer_tags Source: Answer_tags]).&lt;br /&gt;
&lt;br /&gt;
[[File:answer_tags_imported.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The flow diagrams below show how controllers in this project are connected with interrelated classes, methods, and views.&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 answer tags controller.png|900px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 tag prompt deployment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the answer tags.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, answer tags specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is provided, answer tags specific to that questionnaire should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is provided, answer tags specific to that assignment should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When only one parameter is passed, the corresponding answer tags should be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when user_id is nil expect an error&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has given any response then count of taggable answer &amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a question or a response does not exists then count of taggable answer = 0 (extreme case) &amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* user_id (parameter) is nil&lt;br /&gt;
* response is empty&lt;br /&gt;
* question is empty&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* There are no teams associated with the assignment.&lt;br /&gt;
* There are no questions in the questionnaire that have the question type specified in the TagPromptDeployment object.&lt;br /&gt;
* The assignment is set to vary by round.&lt;br /&gt;
* The assignment is set not to vary by round.&lt;br /&gt;
* There are multiple tags.&lt;br /&gt;
&lt;br /&gt;
== Bug Fixing of Additional Issues ==&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: get_number_of_taggable_answers)===&lt;br /&gt;
&lt;br /&gt;
An additional issue in the method get_number_of_taggable_answers. The error message is as shown below which indicates string concatenation fails between integer and string data types.&lt;br /&gt;
&lt;br /&gt;
''TypeError:''&lt;br /&gt;
no implicit conversion of Fixnum into String at line 23 https://github.com/expertiza/expertiza/blob/beta/app/models/tag_prompt_deployment.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:Get_number_of_taggable_answers_bug.JPG]]&lt;br /&gt;
&lt;br /&gt;
This issue is fixed by correcting the syntax of the two-strings concatenation. After fixing the code is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; answers = answers.where(conditions: &amp;quot;length(comments) &amp;lt; #{self.answer_length_threshold}&amp;quot; ) unless self.answer_length_threshold.nil? &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: assignment_tagging_progress)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Failure/Error: answers = answers.where(&amp;quot;length(comments) &amp;gt; ?&amp;quot;, self.answer_length_threshold.to_s) unless self.answer_length_threshold.nil?&lt;br /&gt;
     &lt;br /&gt;
     NoMethodError:&lt;br /&gt;
       undefined method `where' for #&amp;lt;Array:0x00000003424b60&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This issue was resolved by using &amp;lt;code&amp;gt;Arrays.select&amp;lt;/code&amp;gt; to achieve the same functionality.&lt;br /&gt;
&lt;br /&gt;
There was another small error in which the TeamsUser &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; was not found, and the resolution was to find the User model for each &amp;lt;code&amp;gt;TeamsUser.user_id&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
Test cases are added to cover all functionality. With test cases the new coverage is as follows:&lt;br /&gt;
&lt;br /&gt;
tag_prompt_deployment.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
answer_tags_controller.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142242</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142242"/>
		<updated>2021-11-30T02:24:29Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Controller: tag_prompt_deployment.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
The ER diagram of the parent tables is given below for reference ([https://expertiza.csc.ncsu.edu/index.php/Answer_tags Source: Answer_tags]).&lt;br /&gt;
&lt;br /&gt;
[[File:answer_tags_imported.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The flow diagrams below show how controllers in this project are connected with interrelated classes, methods, and views.&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 answer tags controller.png|900px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 tag prompt deployment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the answer tags.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, answer tags specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is provided, answer tags specific to that questionnaire should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is provided, answer tags specific to that assignment should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When only one parameter is passed, the corresponding answer tags should be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when user_id is nil expect an error&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has given any response then count of taggable answer &amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a question or a response does not exists then count of taggable answer = 0 (extreme case) &amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* user_id (parameter) is nil&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* There are no teams associated with the assignment.&lt;br /&gt;
* There are no questions in the questionnaire that have the question type specified in the TagPromptDeployment object.&lt;br /&gt;
* The assignment is set to vary by round.&lt;br /&gt;
* The assignment is set not to vary by round.&lt;br /&gt;
* There are multiple tags.&lt;br /&gt;
&lt;br /&gt;
== Bug Fixing of Additional Issues ==&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: get_number_of_taggable_answers)===&lt;br /&gt;
&lt;br /&gt;
An additional issue in the method get_number_of_taggable_answers. The error message is as shown below which indicates string concatenation fails between integer and string data types.&lt;br /&gt;
&lt;br /&gt;
''TypeError:''&lt;br /&gt;
no implicit conversion of Fixnum into String at line 23 https://github.com/expertiza/expertiza/blob/beta/app/models/tag_prompt_deployment.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:Get_number_of_taggable_answers_bug.JPG]]&lt;br /&gt;
&lt;br /&gt;
This issue is fixed by correcting the syntax of the two-strings concatenation. After fixing the code is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; answers = answers.where(conditions: &amp;quot;length(comments) &amp;lt; #{self.answer_length_threshold}&amp;quot; ) unless self.answer_length_threshold.nil? &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: assignment_tagging_progress)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Failure/Error: answers = answers.where(&amp;quot;length(comments) &amp;gt; ?&amp;quot;, self.answer_length_threshold.to_s) unless self.answer_length_threshold.nil?&lt;br /&gt;
     &lt;br /&gt;
     NoMethodError:&lt;br /&gt;
       undefined method `where' for #&amp;lt;Array:0x00000003424b60&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This issue was resolved by using &amp;lt;code&amp;gt;Arrays.select&amp;lt;/code&amp;gt; to achieve the same functionality.&lt;br /&gt;
&lt;br /&gt;
There was another small error in which the TeamsUser &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; was not found, and the resolution was to find the User model for each &amp;lt;code&amp;gt;TeamsUser.user_id&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
Test cases are added to cover all functionality. With test cases the new coverage is as follows:&lt;br /&gt;
&lt;br /&gt;
tag_prompt_deployment.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
answer_tags_controller.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142236</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142236"/>
		<updated>2021-11-30T02:22:03Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Controller: tag_prompt_deployment.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
The ER diagram of the parent tables is given below for reference ([https://expertiza.csc.ncsu.edu/index.php/Answer_tags Source: Answer_tags]).&lt;br /&gt;
&lt;br /&gt;
[[File:answer_tags_imported.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The flow diagrams below show how controllers in this project are connected with interrelated classes, methods, and views.&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 answer tags controller.png|900px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 tag prompt deployment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the answer tags.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, answer tags specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is provided, answer tags specific to that questionnaire should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is provided, answer tags specific to that assignment should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When only one parameter is passed, the corresponding answer tags should be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when user_id is nil expect an error&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has given any response then count of taggable answer &amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a question or a response does not exists then count of taggable answer = 0 (extreme case) &amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* There are no teams associated with the assignment.&lt;br /&gt;
* There are no questions in the questionnaire that have the question type specified in the TagPromptDeployment object.&lt;br /&gt;
* The assignment is set to vary by round.&lt;br /&gt;
* The assignment is set not to vary by round.&lt;br /&gt;
* There are multiple tags.&lt;br /&gt;
&lt;br /&gt;
== Bug Fixing of Additional Issues ==&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: get_number_of_taggable_answers)===&lt;br /&gt;
&lt;br /&gt;
An additional issue in the method get_number_of_taggable_answers. The error message is as shown below which indicates string concatenation fails between integer and string data types.&lt;br /&gt;
&lt;br /&gt;
''TypeError:''&lt;br /&gt;
no implicit conversion of Fixnum into String at line 23 https://github.com/expertiza/expertiza/blob/beta/app/models/tag_prompt_deployment.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:Get_number_of_taggable_answers_bug.JPG]]&lt;br /&gt;
&lt;br /&gt;
This issue is fixed by correcting the syntax of the two-strings concatenation. After fixing the code is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; answers = answers.where(conditions: &amp;quot;length(comments) &amp;lt; #{self.answer_length_threshold}&amp;quot; ) unless self.answer_length_threshold.nil? &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: assignment_tagging_progress)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Failure/Error: answers = answers.where(&amp;quot;length(comments) &amp;gt; ?&amp;quot;, self.answer_length_threshold.to_s) unless self.answer_length_threshold.nil?&lt;br /&gt;
     &lt;br /&gt;
     NoMethodError:&lt;br /&gt;
       undefined method `where' for #&amp;lt;Array:0x00000003424b60&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This issue was resolved by using &amp;lt;code&amp;gt;Arrays.select&amp;lt;/code&amp;gt; to achieve the same functionality.&lt;br /&gt;
&lt;br /&gt;
There was another small error in which the TeamsUser &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; was not found, and the resolution was to find the User model for each &amp;lt;code&amp;gt;TeamsUser.user_id&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
Test cases are added to cover all functionality. With test cases the new coverage is as follows:&lt;br /&gt;
&lt;br /&gt;
tag_prompt_deployment.rb: Coverage = 99%&lt;br /&gt;
&lt;br /&gt;
answer_tags_controller.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142235</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=142235"/>
		<updated>2021-11-30T02:21:41Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Controller: tag_prompt_deployment.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
The ER diagram of the parent tables is given below for reference ([https://expertiza.csc.ncsu.edu/index.php/Answer_tags Source: Answer_tags]).&lt;br /&gt;
&lt;br /&gt;
[[File:answer_tags_imported.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The flow diagrams below show how controllers in this project are connected with interrelated classes, methods, and views.&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 answer tags controller.png|900px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 tag prompt deployment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the answer tags.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, answer tags specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is provided, answer tags specific to that questionnaire should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is provided, answer tags specific to that assignment should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When only one parameter is passed, the corresponding answer tags should be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When questionnaire_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When assignment_id is nil, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when user_id is nil expect an error&amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has given any response then count of taggable answer &amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a question or a response does not exists then count of taggable answer = 0 (extreme case) &amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Edge cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* There are no teams associated with the assignment.&lt;br /&gt;
* There are no questions in the questionnaire that have the question type specified in the TagPromptDeployment object.&lt;br /&gt;
* The assignment is set to vary by round.&lt;br /&gt;
* The assignment is set not to vary by round.&lt;br /&gt;
* There are multiple tags.&lt;br /&gt;
&lt;br /&gt;
== Bug Fixing of Additional Issues ==&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: get_number_of_taggable_answers)===&lt;br /&gt;
&lt;br /&gt;
An additional issue in the method get_number_of_taggable_answers. The error message is as shown below which indicates string concatenation fails between integer and string data types.&lt;br /&gt;
&lt;br /&gt;
''TypeError:''&lt;br /&gt;
no implicit conversion of Fixnum into String at line 23 https://github.com/expertiza/expertiza/blob/beta/app/models/tag_prompt_deployment.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:Get_number_of_taggable_answers_bug.JPG]]&lt;br /&gt;
&lt;br /&gt;
This issue is fixed by correcting the syntax of the two-strings concatenation. After fixing the code is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; answers = answers.where(conditions: &amp;quot;length(comments) &amp;lt; #{self.answer_length_threshold}&amp;quot; ) unless self.answer_length_threshold.nil? &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: assignment_tagging_progress)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Failure/Error: answers = answers.where(&amp;quot;length(comments) &amp;gt; ?&amp;quot;, self.answer_length_threshold.to_s) unless self.answer_length_threshold.nil?&lt;br /&gt;
     &lt;br /&gt;
     NoMethodError:&lt;br /&gt;
       undefined method `where' for #&amp;lt;Array:0x00000003424b60&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This issue was resolved by using &amp;lt;code&amp;gt;Arrays.select&amp;lt;/code&amp;gt; to achieve the same functionality.&lt;br /&gt;
&lt;br /&gt;
There was another small error in which the TeamsUser &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; was not found, and the resolution was to find the User model for each &amp;lt;code&amp;gt;TeamsUser.user_id&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
Test cases are added to cover all functionality. With test cases the new coverage is as follows:&lt;br /&gt;
&lt;br /&gt;
tag_prompt_deployment.rb: Coverage = 99%&lt;br /&gt;
&lt;br /&gt;
answer_tags_controller.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=141840</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=141840"/>
		<updated>2021-11-29T13:21:18Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Collaborators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
The ER diagram of the parent tables is given below for reference ([https://expertiza.csc.ncsu.edu/index.php/Answer_tags Source: Answer_tags]).&lt;br /&gt;
&lt;br /&gt;
[[File:answer_tags_imported.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The flow diagrams below show how controllers in this project are connected with interrelated classes, methods, and views.&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 answer tags controller.png|900px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 tag prompt deployment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has given any response then count of taggable answer &amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a question or a response does not exists then count of taggable answer = 0 (extreme case) &amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Bug Fixing of Additional Issues ==&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: get_number_of_taggable_answers)===&lt;br /&gt;
&lt;br /&gt;
An additional issue in the method get_number_of_taggable_answers. The error message is as shown below which indicates string concatenation fails between integer and string data types.&lt;br /&gt;
&lt;br /&gt;
''TypeError:''&lt;br /&gt;
no implicit conversion of Fixnum into String at line 23 https://github.com/expertiza/expertiza/blob/beta/app/models/tag_prompt_deployment.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:Get_number_of_taggable_answers_bug.JPG]]&lt;br /&gt;
&lt;br /&gt;
This issue is fixed by correcting the syntax of the two-strings concatenation. After fixing the code is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; answers = answers.where(conditions: &amp;quot;length(comments) &amp;lt; #{self.answer_length_threshold}&amp;quot; ) unless self.answer_length_threshold.nil? &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: assignment_tagging_progress)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Failure/Error: answers = answers.where(&amp;quot;length(comments) &amp;gt; ?&amp;quot;, self.answer_length_threshold.to_s) unless self.answer_length_threshold.nil?&lt;br /&gt;
     &lt;br /&gt;
     NoMethodError:&lt;br /&gt;
       undefined method `where' for #&amp;lt;Array:0x00000003424b60&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This issue was resolved by using &amp;lt;code&amp;gt;Arrays.select&amp;lt;/code&amp;gt; to achieve the same functionality.&lt;br /&gt;
&lt;br /&gt;
There was another small error in which the TeamsUser &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; was not found, and the resolution was to find the User model for each &amp;lt;code&amp;gt;TeamsUser.user_id&amp;lt;/code&amp;gt;.&lt;br /&gt;
A similar issue was found with TeamsUser&lt;br /&gt;
&lt;br /&gt;
== Results ==&lt;br /&gt;
Test cases are added to cover all functionality. With test cases the new coverage is as follows:&lt;br /&gt;
&lt;br /&gt;
tag_prompt_deployment.rb: Coverage = 99%&lt;br /&gt;
&lt;br /&gt;
answer_tags_controller.rb: Coverage = 100%&lt;br /&gt;
&lt;br /&gt;
Edge cases that are considered in the project are:&lt;br /&gt;
&lt;br /&gt;
- &lt;br /&gt;
- &lt;br /&gt;
- &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=141839</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=141839"/>
		<updated>2021-11-29T13:16:02Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Controller: tag_prompt_deployment.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
The ER diagram of the parent tables is given below for reference ([https://expertiza.csc.ncsu.edu/index.php/Answer_tags Source: Answer_tags]).&lt;br /&gt;
&lt;br /&gt;
[[File:answer_tags_imported.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The flow diagrams below show how controllers in this project are connected with interrelated classes, methods, and views.&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 answer tags controller.png|900px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 tag prompt deployment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has given any response then count of taggable answer &amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a question or a response does not exists then count of taggable answer = 0 (extreme case) &amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Bug Fixing of Additional Issues ==&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: get_number_of_taggable_answers)===&lt;br /&gt;
&lt;br /&gt;
An additional issue in the method get_number_of_taggable_answers. The error message is as shown below which indicates string concatenation fails between integer and string data types.&lt;br /&gt;
&lt;br /&gt;
''TypeError:''&lt;br /&gt;
no implicit conversion of Fixnum into String at line 23 https://github.com/expertiza/expertiza/blob/beta/app/models/tag_prompt_deployment.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:Get_number_of_taggable_answers_bug.JPG]]&lt;br /&gt;
&lt;br /&gt;
This issue is fixed by correcting the syntax of the two-strings concatenation. After fixing the code is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; answers = answers.where(conditions: &amp;quot;length(comments) &amp;lt; #{self.answer_length_threshold}&amp;quot; ) unless self.answer_length_threshold.nil? &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: assignment_tagging_progress)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Failure/Error: answers = answers.where(&amp;quot;length(comments) &amp;gt; ?&amp;quot;, self.answer_length_threshold.to_s) unless self.answer_length_threshold.nil?&lt;br /&gt;
     &lt;br /&gt;
     NoMethodError:&lt;br /&gt;
       undefined method `where' for #&amp;lt;Array:0x00000003424b60&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This issue was resolved by using &amp;lt;code&amp;gt;Arrays.select&amp;lt;/code&amp;gt; to achieve the same functionality.&lt;br /&gt;
&lt;br /&gt;
There was another small error in which the TeamsUser &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; was not found, and the resolution was to find the User model for each &amp;lt;code&amp;gt;TeamsUser.user_id&amp;lt;/code&amp;gt;.&lt;br /&gt;
A similar issue was found with TeamsUser&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=141838</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=141838"/>
		<updated>2021-11-29T13:15:10Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Controller: tag_prompt_deployment.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
The ER diagram of the parent tables is given below for reference ([https://expertiza.csc.ncsu.edu/index.php/Answer_tags Source: Answer_tags]).&lt;br /&gt;
&lt;br /&gt;
[[File:answer_tags_imported.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The flow diagrams below show how controllers in this project are connected with interrelated classes, methods, and views.&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 answer tags controller.png|900px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 tag prompt deployment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Before change coverage = 18% &lt;br /&gt;
&lt;br /&gt;
After  change coverage = 99% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has given any response then count of taggable answer &amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a question or a response does not exists then count of taggable answer = 0 (extreme case) &amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Bug Fixing of Additional Issues ==&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: get_number_of_taggable_answers)===&lt;br /&gt;
&lt;br /&gt;
An additional issue in the method get_number_of_taggable_answers. The error message is as shown below which indicates string concatenation fails between integer and string data types.&lt;br /&gt;
&lt;br /&gt;
''TypeError:''&lt;br /&gt;
no implicit conversion of Fixnum into String at line 23 https://github.com/expertiza/expertiza/blob/beta/app/models/tag_prompt_deployment.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:Get_number_of_taggable_answers_bug.JPG]]&lt;br /&gt;
&lt;br /&gt;
This issue is fixed by correcting the syntax of the two-strings concatenation. After fixing the code is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; answers = answers.where(conditions: &amp;quot;length(comments) &amp;lt; #{self.answer_length_threshold}&amp;quot; ) unless self.answer_length_threshold.nil? &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Model: tag_prompt_deployment.rb (method: assignment_tagging_progress)===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Failure/Error: answers = answers.where(&amp;quot;length(comments) &amp;gt; ?&amp;quot;, self.answer_length_threshold.to_s) unless self.answer_length_threshold.nil?&lt;br /&gt;
     &lt;br /&gt;
     NoMethodError:&lt;br /&gt;
       undefined method `where' for #&amp;lt;Array:0x00000003424b60&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This issue was resolved by using &amp;lt;code&amp;gt;Arrays.select&amp;lt;/code&amp;gt; to achieve the same functionality.&lt;br /&gt;
&lt;br /&gt;
There was another small error in which the TeamsUser &amp;lt;code&amp;gt;user&amp;lt;/code&amp;gt; was not found, and the resolution was to find the User model for each &amp;lt;code&amp;gt;TeamsUser.user_id&amp;lt;/code&amp;gt;.&lt;br /&gt;
A similar issue was found with TeamsUser&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=141719</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=141719"/>
		<updated>2021-11-28T05:23:08Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Controller: tag_prompt_deployment.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
The ER diagram of the parent tables is given below for reference ([https://expertiza.csc.ncsu.edu/index.php/Answer_tags Source: Answer_tags]).&lt;br /&gt;
&lt;br /&gt;
[[File:answer_tags_imported.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The flow diagrams below show how controllers in this project are connected with interrelated classes, methods, and views.&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 answer tags controller.png|900px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 tag prompt deployment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Before change coverage = 18% &lt;br /&gt;
&lt;br /&gt;
After  change coverage = 38% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has given any response then count of taggable answer &amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a question or a response does not exists then count of taggable answer = 0 (extreme case) &amp;lt;/code&amp;gt; &lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Bug Fixing of Additional Issues ==&lt;br /&gt;
&lt;br /&gt;
'''Model: tag_prompt_deployment.rb (method: get_number_of_taggable_answers)'''&lt;br /&gt;
&lt;br /&gt;
An additional issue in the method get_number_of_taggable_answers. The error message is as shown below which indicates string concatenation fails between integer and string data types.&lt;br /&gt;
&lt;br /&gt;
''TypeError:''&lt;br /&gt;
no implicit conversion of Fixnum into String at line 23 https://github.com/expertiza/expertiza/blob/beta/app/models/tag_prompt_deployment.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:Get_number_of_taggable_answers_bug.JPG]]&lt;br /&gt;
&lt;br /&gt;
This issue is fixed by correcting the syntax of the two-strings concatenation. After fixing the code is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; answers = answers.where(conditions: &amp;quot;length(comments) &amp;lt; #{self.answer_length_threshold}&amp;quot; ) unless self.answer_length_threshold.nil? &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=141718</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=141718"/>
		<updated>2021-11-28T05:21:59Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Controller: tag_prompt_deployment.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
The ER diagram of the parent tables is given below for reference ([https://expertiza.csc.ncsu.edu/index.php/Answer_tags Source: Answer_tags]).&lt;br /&gt;
&lt;br /&gt;
[[File:answer_tags_imported.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The flow diagrams below show how controllers in this project are connected with interrelated classes, methods, and views.&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 answer tags controller.png|900px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 tag prompt deployment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Before change coverage = 18% &lt;br /&gt;
&lt;br /&gt;
After  change coverage = 38% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has given any response then count of taggable answer &amp;gt; 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a question or a response does not exists then count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Bug Fixing of Additional Issues ==&lt;br /&gt;
&lt;br /&gt;
'''Model: tag_prompt_deployment.rb (method: get_number_of_taggable_answers)'''&lt;br /&gt;
&lt;br /&gt;
An additional issue in the method get_number_of_taggable_answers. The error message is as shown below which indicates string concatenation fails between integer and string data types.&lt;br /&gt;
&lt;br /&gt;
''TypeError:''&lt;br /&gt;
no implicit conversion of Fixnum into String at line 23 https://github.com/expertiza/expertiza/blob/beta/app/models/tag_prompt_deployment.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:Get_number_of_taggable_answers_bug.JPG]]&lt;br /&gt;
&lt;br /&gt;
This issue is fixed by correcting the syntax of the two-strings concatenation. After fixing the code is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; answers = answers.where(conditions: &amp;quot;length(comments) &amp;lt; #{self.answer_length_threshold}&amp;quot; ) unless self.answer_length_threshold.nil? &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=141716</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=141716"/>
		<updated>2021-11-28T05:18:53Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Controller: tag_prompt_deployment.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
The ER diagram of the parent tables is given below for reference ([https://expertiza.csc.ncsu.edu/index.php/Answer_tags Source: Answer_tags]).&lt;br /&gt;
&lt;br /&gt;
[[File:answer_tags_imported.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The flow diagrams below show how controllers in this project are connected with interrelated classes, methods, and views.&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 answer tags controller.png|900px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 tag prompt deployment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Before change coverage = 18% &lt;br /&gt;
&lt;br /&gt;
After  change coverage = 38% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has not given any response then assert count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When question does not exists then count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a valid response exists, count of taggable answer (answer.count should be greater than zero)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Bug Fixing of Additional Issues ==&lt;br /&gt;
&lt;br /&gt;
'''Model: tag_prompt_deployment.rb (method: get_number_of_taggable_answers)'''&lt;br /&gt;
&lt;br /&gt;
An additional issue in the method get_number_of_taggable_answers. The error message is as shown below which indicates string concatenation fails between integer and string data types.&lt;br /&gt;
&lt;br /&gt;
''TypeError:''&lt;br /&gt;
no implicit conversion of Fixnum into String at line 23 https://github.com/expertiza/expertiza/blob/beta/app/models/tag_prompt_deployment.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:Get_number_of_taggable_answers_bug.JPG]]&lt;br /&gt;
&lt;br /&gt;
This issue is fixed by correcting the syntax of the two-strings concatenation. After fixing the code is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; answers = answers.where(conditions: &amp;quot;length(comments) &amp;lt; #{self.answer_length_threshold}&amp;quot; ) unless self.answer_length_threshold.nil? &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=141715</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=141715"/>
		<updated>2021-11-28T05:18:41Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Controller: tag_prompt_deployment.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
The ER diagram of the parent tables is given below for reference ([https://expertiza.csc.ncsu.edu/index.php/Answer_tags Source: Answer_tags]).&lt;br /&gt;
&lt;br /&gt;
[[File:answer_tags_imported.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The flow diagrams below show how controllers in this project are connected with interrelated classes, methods, and views.&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 answer tags controller.png|900px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 tag prompt deployment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Before change coverage = 18% &lt;br /&gt;
After  change coverage = 38% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has not given any response then assert count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When question does not exists then count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a valid response exists, count of taggable answer (answer.count should be greater than zero)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Bug Fixing of Additional Issues ==&lt;br /&gt;
&lt;br /&gt;
'''Model: tag_prompt_deployment.rb (method: get_number_of_taggable_answers)'''&lt;br /&gt;
&lt;br /&gt;
An additional issue in the method get_number_of_taggable_answers. The error message is as shown below which indicates string concatenation fails between integer and string data types.&lt;br /&gt;
&lt;br /&gt;
''TypeError:''&lt;br /&gt;
no implicit conversion of Fixnum into String at line 23 https://github.com/expertiza/expertiza/blob/beta/app/models/tag_prompt_deployment.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:Get_number_of_taggable_answers_bug.JPG]]&lt;br /&gt;
&lt;br /&gt;
This issue is fixed by correcting the syntax of the two-strings concatenation. After fixing the code is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; answers = answers.where(conditions: &amp;quot;length(comments) &amp;lt; #{self.answer_length_threshold}&amp;quot; ) unless self.answer_length_threshold.nil? &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=141675</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=141675"/>
		<updated>2021-11-27T20:37:53Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Additional Issues Bug Fix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
The ER diagram of the parent tables is given below for reference ([https://expertiza.csc.ncsu.edu/index.php/Answer_tags Source: Answer_tags]).&lt;br /&gt;
&lt;br /&gt;
[[File:answer_tags_imported.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The flow diagrams below show how controllers in this project are connected with interrelated classes, methods, and views.&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 answer tags controller.png|900px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 tag prompt deployment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has not given any response then assert count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When question does not exists then count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a valid response exists, count of taggable answer (answer.count should be greater than zero)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Bug Fixing of Additional Issues ==&lt;br /&gt;
&lt;br /&gt;
'''Model: tag_prompt_deployment.rb (method: get_number_of_taggable_answers)'''&lt;br /&gt;
&lt;br /&gt;
An additional issue in the method get_number_of_taggable_answers. The error message is as shown below which indicates string concatenation fails between integer and string data types.&lt;br /&gt;
&lt;br /&gt;
''TypeError:''&lt;br /&gt;
no implicit conversion of Fixnum into String at line 23 https://github.com/expertiza/expertiza/blob/beta/app/models/tag_prompt_deployment.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:Get_number_of_taggable_answers_bug.JPG]]&lt;br /&gt;
&lt;br /&gt;
This issue is fixed by correcting the syntax of the two-strings concatenation. After fixing the code is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; answers = answers.where(conditions: &amp;quot;length(comments) &amp;lt; #{self.answer_length_threshold}&amp;quot; ) unless self.answer_length_threshold.nil? &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=141674</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=141674"/>
		<updated>2021-11-27T20:37:00Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Collaborators */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
The ER diagram of the parent tables is given below for reference ([https://expertiza.csc.ncsu.edu/index.php/Answer_tags Source: Answer_tags]).&lt;br /&gt;
&lt;br /&gt;
[[File:answer_tags_imported.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The flow diagrams below show how controllers in this project are connected with interrelated classes, methods, and views.&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 answer tags controller.png|900px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 tag prompt deployment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has not given any response then assert count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When question does not exists then count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a valid response exists, count of taggable answer (answer.count should be greater than zero)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Additional Issues Bug Fix==&lt;br /&gt;
&lt;br /&gt;
'''Model: tag_prompt_deployment.rb (method: get_number_of_taggable_answers)'''&lt;br /&gt;
&lt;br /&gt;
An additional issue in the method get_number_of_taggable_answers. The error message is as shown below which indicates string concatenation fails between integer and string data types.&lt;br /&gt;
&lt;br /&gt;
''TypeError:''&lt;br /&gt;
no implicit conversion of Fixnum into String at line 23 https://github.com/expertiza/expertiza/blob/beta/app/models/tag_prompt_deployment.rb.&lt;br /&gt;
&lt;br /&gt;
[[File:Get_number_of_taggable_answers_bug.JPG]]&lt;br /&gt;
&lt;br /&gt;
This issue is fixed by correcting the syntax of the two-strings concatenation. After fixing the code is&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt; answers = answers.where(conditions: &amp;quot;length(comments) &amp;lt; #{self.answer_length_threshold}&amp;quot; ) unless self.answer_length_threshold.nil? &amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Get_number_of_taggable_answers_bug.JPG&amp;diff=141673</id>
		<title>File:Get number of taggable answers bug.JPG</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Get_number_of_taggable_answers_bug.JPG&amp;diff=141673"/>
		<updated>2021-11-27T20:28:09Z</updated>

		<summary type="html">&lt;p&gt;Rsah: TypeError:
no implicit conversion of Fixnum into String at line 23 https://github.com/expertiza/expertiza/blob/beta/app/models/tag_prompt_deployment.rb.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;TypeError:&lt;br /&gt;
no implicit conversion of Fixnum into String at line 23 https://github.com/expertiza/expertiza/blob/beta/app/models/tag_prompt_deployment.rb.&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=141626</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=141626"/>
		<updated>2021-11-17T02:28:11Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Controller: tag_prompt_deployment.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
The ER diagram of the parent tables is given below for reference ([https://expertiza.csc.ncsu.edu/index.php/Answer_tags Source: Answer_tags]).&lt;br /&gt;
&lt;br /&gt;
[[File:answer_tags_imported.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The flow diagrams below show how controllers in this project are connected with interrelated classes, methods, and views.&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 answer tags controller.png|900px]]&lt;br /&gt;
&lt;br /&gt;
[[File:E2169 tag prompt deployment.png|900px]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has not given any response then assert count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When question does not exists then count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a valid response exists, count of taggable answer (answer.count should be greater than zero)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140975</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140975"/>
		<updated>2021-11-05T03:57:14Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Project Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
The ER diagram of the parent tables is given below for reference. &lt;br /&gt;
&lt;br /&gt;
[[File:answer_tags_imported.png]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The UML diagram shows how controllers in this project are connected with interrelated controllers.&lt;br /&gt;
&lt;br /&gt;
[[File:E1953_UML.png]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has not given any response then assert count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When question does not exists then count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a valid response exists, count of taggable answer (answer.count should be integer type)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140974</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140974"/>
		<updated>2021-11-05T03:54:30Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Project Design */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
The ER diagram of the parent tables is given below for reference. &lt;br /&gt;
&lt;br /&gt;
[[File:answer_tags_imported.png]]&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has not given any response then assert count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When question does not exists then count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a valid response exists, count of taggable answer (answer.count should be integer type)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140909</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140909"/>
		<updated>2021-11-04T17:36:57Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Type of testing */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Design ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has not given any response then assert count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When question does not exists then count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a valid response exists, count of taggable answer (answer.count should be integer type)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140908</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140908"/>
		<updated>2021-11-04T17:32:54Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Type of testing ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
== Testing Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has not given any response then assert count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When question does not exists then count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a valid response exists, count of taggable answer (answer.count should be integer type)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140907</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140907"/>
		<updated>2021-11-04T17:31:07Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Project Purpose */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in these two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] &lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Type of testing ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has not given any response then assert count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When question does not exists then count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a valid response exists, count of taggable answer (answer.count should be integer type)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140906</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140906"/>
		<updated>2021-11-04T17:29:47Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Background */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Project Purpose==&lt;br /&gt;
The objective of the project is unit testing of functionality in two ruby files and increasing the coverage.&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Type of testing ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has not given any response then assert count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When question does not exists then count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a valid response exists, count of taggable answer (answer.count should be integer type)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140905</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140905"/>
		<updated>2021-11-04T17:02:56Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Initial Coverage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Type of testing ==&lt;br /&gt;
In this project, we have two controllers to be tested using Rspec Unit testing.&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has not given any response then assert count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When question does not exists then count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a valid response exists, count of taggable answer (answer.count should be integer type)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140904</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140904"/>
		<updated>2021-11-04T16:43:43Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has not given any response then assert count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When question does not exists then count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a valid response exists, count of taggable answer (answer.count should be integer type)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140903</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140903"/>
		<updated>2021-11-04T16:43:12Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Controller: answer_tags_controller.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has not given any response then assert count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When question does not exists then count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a valid response exists, count of taggable answer (answer.count should be integer type)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140902</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140902"/>
		<updated>2021-11-04T16:42:57Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Controller: tag_prompt_deployment.rb */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has not given any response then assert count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When question does not exists then count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a valid response exists, count of taggable answer (answer.count should be integer type)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Use cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140901</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140901"/>
		<updated>2021-11-04T16:38:50Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Team members */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has not given any response then assert count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When question does not exists then count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a valid response exists, count of taggable answer (answer.count should be integer type)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Collaborators ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alec Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Relevant Links ==&lt;br /&gt;
Main Expertiza repository can be found at [https://github.com/expertiza/expertiza/tree/beta GitHubExp]&lt;br /&gt;
&lt;br /&gt;
Our forked repository can be found at [https://github.com/akk5597/expertiza Github]&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140557</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140557"/>
		<updated>2021-11-03T02:35:59Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Team members */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has not given any response then assert count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When question does not exists then count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a valid response exists, count of taggable answer (answer.count should be integer type)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Team members ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
&lt;br /&gt;
2. Alex Landow&lt;br /&gt;
&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
&lt;br /&gt;
4. Sayali Pranab&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140556</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140556"/>
		<updated>2021-11-03T02:35:19Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has not given any response then assert count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When question does not exists then count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a valid response exists, count of taggable answer (answer.count should be integer type)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Team members ==&lt;br /&gt;
Nicholas Himes (Mentor)&lt;br /&gt;
1. Aditya Khadse&lt;br /&gt;
2. Alex Landow&lt;br /&gt;
3. Rageeni Sah&lt;br /&gt;
4. Sayali Pranab&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140482</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140482"/>
		<updated>2021-11-02T23:16:06Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage. Additional testing is not required.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has not given any response then assert count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When question does not exists then count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a valid response exists, count of taggable answer (answer.count should be integer type)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140473</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140473"/>
		<updated>2021-11-02T21:54:50Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Background */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|thumb|center|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has not given any response then assert count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When question does not exists then count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a valid response exists, count of taggable answer (answer.count should be integer type)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140472</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140472"/>
		<updated>2021-11-02T21:53:18Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Background */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|center|frameless|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has not given any response then assert count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When question does not exists then count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a valid response exists, count of taggable answer (answer.count should be integer type)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140471</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140471"/>
		<updated>2021-11-02T21:51:53Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Initial Coverage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|left|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has not given any response then assert count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When question does not exists then count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a valid response exists, count of taggable answer (answer.count should be integer type)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140470</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140470"/>
		<updated>2021-11-02T21:51:31Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Background */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
[[File:Tagging_report.png|left|Fig. 1]]&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has not given any response then assert count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When question does not exists then count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a valid response exists, count of taggable answer (answer.count should be integer type)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=File:Tagging_report.png&amp;diff=140469</id>
		<title>File:Tagging report.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=File:Tagging_report.png&amp;diff=140469"/>
		<updated>2021-11-02T21:46:22Z</updated>

		<summary type="html">&lt;p&gt;Rsah: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140468</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140468"/>
		<updated>2021-11-02T21:43:35Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
=== Controller: answer_tags_controller.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== Controller: tag_prompt_deployment.rb ===&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
'''Methods'''&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has not given any response then assert count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When question does not exists then count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a valid response exists, count of taggable answer (answer.count should be integer type)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140467</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140467"/>
		<updated>2021-11-02T21:40:29Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
'''Controller: answer_tags_controller.rb'''&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
=== Methods ===&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Controller: tag_prompt_deployment.rb'''&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
=== Methods ===&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has not given any response then assert count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When question does not exists then count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a valid response exists, count of taggable answer (answer.count should be integer type)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140466</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140466"/>
		<updated>2021-11-02T21:36:16Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Methods */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
Controller: answer_tags_controller.rb&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
=== Methods ===&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Controller: tag_prompt_deployment.rb&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
=== Methods ===&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt (params: tag_id)&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has not given any response then assert count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When question does not exists then count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a valid response exists, count of taggable answer (answer.count should be integer type)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140465</id>
		<title>CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2021_-_E2169._Testing_-_Answer_Tagging&amp;diff=140465"/>
		<updated>2021-11-02T21:34:41Z</updated>

		<summary type="html">&lt;p&gt;Rsah: /* Test Plan */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;__TOC__&lt;br /&gt;
&lt;br /&gt;
== Background ==&lt;br /&gt;
Answer tagging (see [https://github.com/expertiza/expertiza/blob/25713567e5e5e1c0b363409715e6d8797b45b01a/app/models/answer_tag.rb answer_tab.rb] and [[Answer_tags|wiki]]) helps determine a few metrics on a student’s responses to a questionnaire. Students can tag these metrics for other students for things such as “Positive Tone” or “Suggest Solutions”. &lt;br /&gt;
&lt;br /&gt;
These specs below all need to be further developed to cover missing methods/lines. Some structures currently exist at the top of spec files (such as assignments, participants, etc) to help make writing tests easier. Please feel free to add to these and write extra tests to cover any edge cases you may think of. &lt;br /&gt;
&lt;br /&gt;
As an instructor on an assignment, going to Etc/View Reports/Answer Tagging Report will show student answer tagging. You will be able to see the percentage of answers tagged, # of answers tagged, # not tagged, and # of taggable answers for each student on a questionnaire.&lt;br /&gt;
&lt;br /&gt;
== Initial Coverage ==&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fcontrollers%2Fanswer_tags_controller.rb Answer_tags_controller_spec] : 0% Covered&lt;br /&gt;
&lt;br /&gt;
[https://coveralls.io/builds/43656335/source?filename=app%2Fmodels%2Ftag_prompt_deployment.rb Tag_prompt_deployment_spec] : 18% Covered&lt;br /&gt;
&lt;br /&gt;
=== Missed Methods ===&lt;br /&gt;
* &amp;lt;code&amp;gt;app/controllers/answer_tags_controller.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;action_allowed?&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;index&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;create_edit&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;destroy&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;app/models/tag_prompt_deployment.rb&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;get_number_of_taggable_answers&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;assignment_tagging_progress&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Test Plan ==&lt;br /&gt;
Controller: answer_tags_controller.rb&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 0% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
The purpose of this controller is to track down the total number of tags done by the students. The database structure for the answer_tags can be found here [https://expertiza.csc.ncsu.edu/index.php/Answer_tags]&lt;br /&gt;
&lt;br /&gt;
=== Methods ===&lt;br /&gt;
1. action_allowed?  ( params: action )&lt;br /&gt;
&lt;br /&gt;
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is null, Access should be denied&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the session is of student type, access should be allowed and operation should be executed.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. index ( params : assignment_id, questionnaire_id, user_id )&lt;br /&gt;
&lt;br /&gt;
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When all valid params are passed, the function should populate the tag prompts.&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When user_id is provided, tag prompts specific to that user should only be populated.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )&lt;br /&gt;
&lt;br /&gt;
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt; When the existing tag is found based on the params passed, the existing tag should be updated with new values.&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Controller: tag_prompt_deployment.rb&lt;br /&gt;
&lt;br /&gt;
Existing coverage = 18% &lt;br /&gt;
&lt;br /&gt;
Description: &lt;br /&gt;
This Controller is when a user (with instructor privilege) wants to see tagging summary of every user that participated in a tagging assignment. &lt;br /&gt;
&lt;br /&gt;
There are three methods as follows:&lt;br /&gt;
1. tag_prompt finds a tag prompt given a tag_id.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers is used &lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress method computes the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
1. tag_prompt (params: tag_id)&lt;br /&gt;
Description: tag_prompt has existing test cases scoring 18 percentage coverage.&lt;br /&gt;
&lt;br /&gt;
2. get_number_of_taggable_answers ( params: user_id)&lt;br /&gt;
&lt;br /&gt;
Description: To calculate total taggable answers reviewed by a user that participated in the given tagging assignment. user_id is the parameter passed to this method.  An individual and his team will have the same score. Fig 1: The last column values are processed by this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;when a team has not given any response then assert count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When question does not exists then count of taggable answer = 0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When a valid response exists, count of taggable answer (answer.count should be integer type)&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold not set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is set, count taggable answer&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. assignment_tagging_progress&lt;br /&gt;
&lt;br /&gt;
Description: To compute the number of tagged answers, number of untagged answers, and percentage of answers tagged by the users that participated in the tagging Assignment to a particular question.&lt;br /&gt;
Fig 1: First three columns after the 2nd column onwards are updated with results obtained from this method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Test cases:&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When not team participated in the assignment, assert count(user_answer_tagging) =0&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When the question does not exist, assert count(user_answer_tagging) =0 &amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When multiple rounds of review, render ReviewResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When single round of review, render ResponseMap and assert response object&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When answer_length_threshold is SET, number of answers and when answer_length_threshold is NOT SET, number of answers&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;When route is success answer_tagging object structure matching&amp;lt;/code&amp;gt;&lt;/div&gt;</summary>
		<author><name>Rsah</name></author>
	</entry>
</feed>