CSC/ECE 517 Fall 2021 - E2132. Add tests cases for review mapping helper.rb: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
Line 38: Line 38:
=== response_for_each_round? ===
=== response_for_each_round? ===


This method checks the response record if the assignment is submitted on time, that is, before due date. Setting up two submissions on two different due date, so in the unit test there would be four situations to discuss. If all the works are submitted on time, the response is expected to be true. Otherwise, the response depends on the last submission's status.
This method checks the response record if the assignment is submitted on time,
 
<pre>
<pre>


</pre>
</pre>


=== submitted_within_round? ===
=== submitted_within_round? ===


This method checks the response record if the assignment is submitted on time, that is, before due date. Setting up two submissions on two different due date, so in the unit test there would be four situations to discuss. If all the works are submitted on time, the response is expected to be true. Otherwise, the response depends on the last submission's status.
This method checks the record if the assignment is submitted on time, that is, before due date. Setting up two submissions on two different due date, so in the unit test there would be four situations to discuss. If all the works are submitted on time, the response is expected to be true. Otherwise, the response depends on the last submission's status.


<pre>
<pre>
Line 59: Line 62:
</pre
</pre
=== get_team_reviewed_link_name ===
=== get_team_reviewed_link_name ===
This method checks if the max_team_size is 1 or not and gives appropriate team reviewed link name. Given the input max_team_size, response, reviewee_id, ip_address, if the team size is 1, it is expected to get the return of the student's name. If not, it is expected to return "Team 1".


<pre>
<pre>
it 'should return (Team_1) if max_team_size = 3' do
      max_team_size = 3
      @response = create(:response, response_map: @response_map)
      ip_address = '0.0.0.0'
      reviewed_team_name = get_team_reviewed_link_name(max_team_size, @response, @reviewee.id, ip_address)
      expect(reviewed_team_name).to eq('(Team_1)')
    end
    it 'should return (Team_1) if max_team_size = 2' do
      max_team_size = 2
      @response = create(:response, response_map: @response_map)
      ip_address = '0.0.0.0'
      reviewed_team_name = get_team_reviewed_link_name(max_team_size, @response, @reviewee.id, ip_address)
      expect(reviewed_team_name).to eq('(Team_1)')
    end
    it 'should return (Adam) if max_team_size = 1' do
      max_team_size = 1
      student = create(:student, fullname: 'Adam')
      create(:team_user, user: student, team: @reviewee)
      @response = create(:response, response_map: @response_map)
      ip_address = '0.0.0.0'
      reviewed_team_name = get_team_reviewed_link_name(max_team_size, @response, @reviewee.id, ip_address)
      expect(reviewed_team_name).to eq('(Adam)')
    end


    it 'should return (Team_1) if max_team_size = 0' do
      max_team_size = 0
      @response = create(:response, response_map: @response_map)
      ip_address = '0.0.0.0'
      reviewed_team_name = get_team_reviewed_link_name(max_team_size, @response, @reviewee.id, ip_address)
      expect(reviewed_team_name).to eq('(Team_1)')
    end
</pre
</pre

Revision as of 20:40, 15 October 2021

About Expertiza

Expertiza is an open source project based on Ruby on Rails framework that supports submission across different document types, including theURLs and wiki pages. It allows the instructor not only to create and customize new or existing assignments but also to create a list of topics the students can sign up for. Students can form teams in Expertiza to work on various projects and assignments. Students can also peer review other students' submissions.


Description about project

This page is a description of Expertiza OSS project E2132 which is adding unit tests for review_mapping_helper.rb. The ReviewMappingHelper works as a class that is responsible for mapping reviews and feedback to assignment teams and reviewers. Also, This helper class reports of the status of project reviews.

Team

Chen-Ni Liu (cliu43) Shao-Yo Chao (schao2) Fu-Jen Yen (fyen)

Files Involved

review_mapping_helper.rb

review_mapping_helper_spec.rb

Running Tests

  rspec spec/helpers/review_mapping_helper_spec.rb

Relevant Methods

  • response_for_each_round?
  • submitted_within_round?
  • submitted_hyperlink
  • get_team_reviewed_link_name
  • sort_reviewer_by_review_volume_desc
  • list_review_submission
  • list_hyperlink_submission
  • get_certain_review_and_feedback_response_map
  • get_css_style_for_calibration_report

response_for_each_round?

This method checks the response record if the assignment is submitted on time,



submitted_within_round?

This method checks the record if the assignment is submitted on time, that is, before due date. Setting up two submissions on two different due date, so in the unit test there would be four situations to discuss. If all the works are submitted on time, the response is expected to be true. Otherwise, the response depends on the last submission's status.


</pre

submitted_hyperlink

This method reports the hyperlink that is submitted on time. For multiple assignments, no matter how many assignments are submitted on time, it shows the hyperlink of the last on-time submission.

</pre

get_team_reviewed_link_name

This method checks if the max_team_size is 1 or not and gives appropriate team reviewed link name. Given the input max_team_size, response, reviewee_id, ip_address, if the team size is 1, it is expected to get the return of the student's name. If not, it is expected to return "Team 1".
it 'should return (Team_1) if max_team_size = 3' do
      max_team_size = 3
      @response = create(:response, response_map: @response_map)
      ip_address = '0.0.0.0'
      reviewed_team_name = get_team_reviewed_link_name(max_team_size, @response, @reviewee.id, ip_address)
      expect(reviewed_team_name).to eq('(Team_1)')
    end

    it 'should return (Team_1) if max_team_size = 2' do
      max_team_size = 2
      @response = create(:response, response_map: @response_map)
      ip_address = '0.0.0.0'
      reviewed_team_name = get_team_reviewed_link_name(max_team_size, @response, @reviewee.id, ip_address)
      expect(reviewed_team_name).to eq('(Team_1)')
    end

    it 'should return (Adam) if max_team_size = 1' do
      max_team_size = 1
      student = create(:student, fullname: 'Adam')
      create(:team_user, user: student, team: @reviewee)

      @response = create(:response, response_map: @response_map)
      ip_address = '0.0.0.0'
      reviewed_team_name = get_team_reviewed_link_name(max_team_size, @response, @reviewee.id, ip_address)
      expect(reviewed_team_name).to eq('(Adam)')
    end

    it 'should return (Team_1) if max_team_size = 0' do
      max_team_size = 0
      @response = create(:response, response_map: @response_map)
      ip_address = '0.0.0.0'
      reviewed_team_name = get_team_reviewed_link_name(max_team_size, @response, @reviewee.id, ip_address)
      expect(reviewed_team_name).to eq('(Team_1)')
    end
</pre