CSC/ECE 517 Fall 2021 - E2169. Testing - Answer Tagging: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
(Initial Setup)
 
No edit summary
Line 23: Line 23:
** <code>get_number_of_taggable_answers</code>
** <code>get_number_of_taggable_answers</code>
** <code>assignment_tagging_progress</code>
** <code>assignment_tagging_progress</code>
== Test Plan ==
Controller: answer_tags_controller.rb
Existing coverage = 0%
Description:
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]
=== Methods ===
1. action_allowed?  ( params: action )
Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)
<code>Test cases:</code>
* <code>When the session is null, Access should be denied</code>
* <code>When the session is of student type, access should be allowed and operation should be executed.</code>
2. index ( params : assignment_id, questionnaire_id, user_id )
Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.
<code>Test cases:</code>
* <code> When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.</code>
* <code> When all valid params are passed, the function should populate the tag prompts.</code>
* <code> When user_id is provided, tag prompts specific to that user should only be populated.</code>
3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )
Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.
<code>Test cases:</code>
* <code> When the existing tag is found based on the params passed, the existing tag should be updated with new values.</code>

Revision as of 21:20, 1 November 2021

Background

Answer tagging (see answer_tab.rb and 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”.

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.

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.

Initial Coverage

Answer_tags_controller_spec : 0% Covered

Tag_prompt_deployment_spec : 18% Covered

Missed Methods

  • app/controllers/answer_tags_controller.rb
    • action_allowed?
    • index
    • create_edit
    • destroy
  • app/models/tag_prompt_deployment.rb
    • get_number_of_taggable_answers
    • assignment_tagging_progress

Test Plan

Controller: answer_tags_controller.rb

Existing coverage = 0%

Description: 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 [1]

Methods

1. action_allowed? ( params: action )

Description: To allow the functionality only if the accessing user is having student privileges (current_user_has_student_privileges?)

Test cases:

  • When the session is null, Access should be denied
  • When the session is of student type, access should be allowed and operation should be executed.


2. index ( params : assignment_id, questionnaire_id, user_id )

Description: Populates the tags by fetching the records from AnswerTag corresponding to each TagPromptDeployment based on the filers provided as params.

Test cases:

  • When the params for fetching TagPromptDeployment are null, 0 tags prompts should be returned.
  • When all valid params are passed, the function should populate the tag prompts.
  • When user_id is provided, tag prompts specific to that user should only be populated.


3. create_edit ( params : answer_id, tag_prompt_deployment_id, value )

Description: Fetches the answer tag with the params provided and then updates the respective tag values by the updated values provided as params.

Test cases:

  • When the existing tag is found based on the params passed, the existing tag should be updated with new values.