app/controllers/review_mapping_controller.rb
def start_self_review
    assignment = Assignment.find(params[:assignment_id])
    team_id = TeamsUser.find_by_sql(["SELECT t.id as t_id FROM teams_users u, teams t WHERE u.team_id = t.id and t.parent_id = ? and user_id = ?", assignment.id, params[:reviewer_userid]])
    begin
      # ACS Removed the if condition(and corressponding else) which differentiate assignments as team and individual assignments
      # to treat all assignments as team assignments
      if SelfReviewResponseMap.where(reviewee_id: team_id[0].t_id, reviewer_id: params[:reviewer_id]).first.nil?
        SelfReviewResponseMap.create(self_review_response_map_params(reviewee_id: team_id[0].t_id,
                                                                     reviewer_id: params[:reviewer_id],
                                                                     reviewed_object_id: assignment.id))
      else
        raise "Self review already assigned!"
      end
      redirect_to controller: 'submitted_content', action: 'edit', id: params[:reviewer_id]
    rescue StandardError => e
      redirect_to controller: 'submitted_content', action: 'edit', id: params[:reviewer_id], msg: e.message
    end
  end
# E1600
# Start self review if not started yet - Creates a self-review mapping when user requests a self-review
E1600
Start self review if not started yet - Creates a self-review mapping when user requests a self-review
E1600 Start self review if not started yet - Creates a self - review mapping when user requests a self - review
def start_self_review
    assignment = Assignment.find(params[:assignment_id])
    team_id = TeamsUser.find_by_sql(["SELECT t.id as t_id FROM teams_users u, teams t WHERE u.team_id = t.id and t.parent_id = ? and user_id = ?", assignment.id, params[:reviewer_userid]])
    begin
      if SelfReviewResponseMap.where(reviewee_id: team_id[0].t_id, reviewer_id: params[:reviewer_id]).first.nil?
        SelfReviewResponseMap.create(self_review_response_map_params(reviewee_id: team_id[0].t_id,
                                                                     reviewer_id: params[:reviewer_id],
                                                                     reviewed_object_id: assignment.id))
      else
        raise "Self review already assigned!"
      end
      redirect_to controller: 'submitted_content', action: 'edit', id: params[:reviewer_id]
    rescue StandardError => e
      redirect_to controller: 'submitted_content', action: 'edit', id: params[:reviewer_id], msg: e.message
    end
  end
def start_self_review assignment = Assignment . find ( params [ :assignment_id ] ) team_id = TeamsUser . find_by_sql ( [ "SELECT t.id as t_id FROM teams_users u, teams t WHERE u.team_id = t.id and t.parent_id = ? and user_id = ?" , assignment . id , params [ :reviewer_userid ] ] ) begin if SelfReviewResponseMap . where ( reviewee_id : team_id [ 0 ] . t_id , reviewer_id : params [ :reviewer_id ] ) . first . nil? SelfReviewResponseMap . create ( self_review_response_map_params ( reviewee_id : team_id [ 0 ] . t_id , reviewer_id : params [ :reviewer_id ] , reviewed_object_id : assignment . id ) ) else raise "Self review already assigned!" end redirect_to controller : 'submitted_content' , action : 'edit' , id : params [ :reviewer_id ] rescue StandardError => e redirect_to controller : 'submitted_content' , action : 'edit' , id : params [ :reviewer_id ] , msg : e . message end end
E1600
Start self review if not started yet - Creates a self-review mapping when user requests a self-review
E1600 Start self review if not started yet - Creates a self - review mapping when user requests a self - review
# ACS Removed the if condition(and corressponding else) which differentiate assignments as team and individual assignments # to treat all assignments as team assignments