Skip to content

Commit

Permalink
Fixing a few code climate issues in review_response_map.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
qureshi-ali committed Apr 1, 2024
1 parent 57889a8 commit 9275cad
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/models/review_response_map.rb
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def self.prepare_final_review_versions(assignment, maps)
(1..rounds_num).each do |round|
prepare_review_response(assignment, maps, review_final_versions, round)
end
elsif assignment.vary_by_topic?
elsif assignment.vary_by_topic?
prepare_review_response_by_topic(assignment, maps, review_final_versions)
else
prepare_review_response(assignment, maps, review_final_versions, nil)
Expand Down Expand Up @@ -220,15 +220,15 @@ def self.prepare_review_response_by_topic(assignment, maps, review_final_version
questionnaire = AssignmentQuestionnaire.where(assignment_id: assignment.id, topic_id: topic_id).first
questionnaire_id = questionnaire.questionnaire_id
# Get the responses for the response map
where_map = { map_id: map.id, round: 1}
where_map = { map_id: map.id, round: 1 }
responses = Response.where(where_map)
# Append the response ID to the corresponding response_ids array
responses_by_questionnaire[questionnaire_id] << responses.last.id unless responses.empty?
end

# Iterate through the grouped responses
responses_by_questionnaire.each_with_index do |(questionnaire_id, response_ids), index|
symbol = ("review for rubric #{index + 1}").to_sym
symbol = "review for rubric #{index + 1}".to_sym
review_final_versions[symbol] = {
questionnaire_id: questionnaire_id,
response_ids: response_ids
Expand Down

0 comments on commit 9275cad

Please sign in to comment.