CSC/ECE 517 Fall 2021 - E2125. Refactor review mapping helper.rb

From Expertiza_Wiki
Revision as of 01:22, 24 October 2021 by Aho (talk | contribs)
Jump to navigation Jump to search

E2125. Refactor review mapping helper.rb

This page describes the Expertiza based OSS project.

Expertiza

Expertiza is an open-source project contributed by both the students and the faculty at NCSU. It is developed on Ruby-on-Rails and software to create reusable learning objects through peer review. Expertiza allows the instructor to create new assignments, customize new or existing assignments, and create a topic list for students to sign up. It also supports students to form teams for team projects and allows submission with almost any document type, including URLs and wiki pages.

Background

Modifications in review_mapping_helper.rb

get_team_color

The original code did not return the correct color.

 def get_team_color(response_map)
    # Storing redundantly computed value in a variable
    assignment_created = @assignment.created_at

    # Storing redundantly computed value in a variable
    assignment_due_dates = DueDate.where(parent_id: response_map.reviewed_object_id)

    # Returning colour based on conditions
    if Response.exists?(map_id: response_map.id)
      if !response_map.try(:reviewer).try(:review_grade).grade_for_reviewer.nil?
        'brown'
      elsif response_for_each_round?(response_map)
        'blue'
      else
        check_submission_state(response_map, assignment_created, assignment_due_dates, @assignment.num_review_rounds)
      end
    else
      'red'
    end
  end
check_submission_state


 def check_submission_state(response_map, assignment_created, assignment_due_dates, round)
    if submitted_within_round?(round, response_map, assignment_created, assignment_due_dates)
      'purple'
    else
      link = submitted_hyperlink(round, response_map, assignment_created, assignment_due_dates)
      if link.nil? or (link !~ %r{https*:\/\/wiki(.*)}) # can be extended for github links in future
        'green'
      else
        link_updated_at = get_link_updated_at(link)
        link_updated_since_last?(round, assignment_due_dates, link_updated_at) ? 'purple' : 'green'
      end
    end
  end


obtain_team_color

This method has been removed due to duplicity.

Testing Details in review_mapping_helper.rb

RSpec


All 32 test cases are currently passing.

Progress

This project is currently in progress. This page will be updated accordingly.

Peer Review Credentials

Username: instructor6
Password: password