Skip to content

Commit

Permalink
Addressed the first issue of the first implementation by placing the …
Browse files Browse the repository at this point in the history
…Reviews grading history link in the correct place. Updated the previous teams GradingHistory.create method call to match the current expertiza since it was using outdated names and such
  • Loading branch information
ErikLG360 committed Dec 3, 2023
1 parent a77dbfd commit c0352cb
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
13 changes: 7 additions & 6 deletions app/controllers/review_mapping_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -419,15 +419,16 @@ def save_grade_and_comment_for_reviewer
review_grade.reviewer_id = session[:user].id
# E2237 create a grading history entry for this review
# save the grade, comment, receiver, and instructor
# this should be updated to Rails 5 convention at some point
# but it works for now
# E2383 Update the previous teams creation to match
# the current expertiza since it was outdated
begin
puts "Assignment ID: #{Participant.find(params[:review_grade][:participant_id]).parent_id}"
GradingHistory.create(instructor_id: session[:user].id,
assignment_id: params[:assignment_id],
assignment_id: Participant.find(params[:review_grade][:participant_id]).parent_id,
grading_type: "Review",
grade_receiver_id: Participant.find(params[:participant_id]).user_id,
grade: params[:grade_for_reviewer],
comment: params[:comment_for_reviewer])
grade_receiver_id: Participant.find(params[:review_grade][:participant_id]).user_id,
grade: review_grade.grade_for_reviewer,
comment: review_grade.comment_for_reviewer)
review_grade.save!
flash[:success] = 'Grade and comment for reviewer successfully saved.'
rescue StandardError
Expand Down
6 changes: 3 additions & 3 deletions app/views/grading_histories/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
else
if record.grading_type == "Submission"
receiver = "of " + Team.where(id: record.grade_receiver_id).pluck(:name).first
assignment = "for the submission " + Assignment.where(id: record.assignment_id).pluck(:name).first
assignment = "for the submission " + Assignment.where(id: record.assignment_id).pluck(:name).first.to_s
else
receiver = "of " + User.where(id: record.grade_receiver_id).pluck(:fullname).first
assignment = "for review in " + Assignment.where(id: record.assignment_id).pluck(:name).first
assignment = "for review in " + Assignment.where(id: record.assignment_id).pluck(:name).first.to_s
end

end
Expand All @@ -35,4 +35,4 @@
</tr>
<% end %>
</tbody>
</table>
</table>
4 changes: 4 additions & 0 deletions app/views/reports/_review_report.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@
<td>
<%= form.submit 'Save' %>
</td>
<!--E2383 Added the Grading History link to the appropriate place-->
<td>
<%= link_to "Grading History", grading_histories_path(grade_receiver_id: Participant.where(id: reviewer.id).pluck(:user_id).first, participant_id: reviewer.id, grade_type: "Review")%>
</td>
</tr>
</table>
<% end %>
Expand Down

0 comments on commit c0352cb

Please sign in to comment.