Add AuthenticationToken to UserMailer.exercise_anomaly_needs_feedback
This commit is contained in:

committed by
Sebastian Serth

parent
e1d87b51e9
commit
0a379721a1
@ -47,8 +47,6 @@ de:
|
||||
<br>
|
||||
%{exercise} - %{link}
|
||||
<br>
|
||||
Falls Sie beim Klick auf diesen Link eine Fehlermeldung erhalten, dass Sie nicht berechtigt wären diese Aktion auszuführen, öffnen Sie bitte eine beliebige Programmieraufgabe aus einem Kurs heraus und klicken den Link danach noch einmal.<br>
|
||||
<br>
|
||||
Diese Mail wurde automatisch von CodeOcean verschickt.<br>
|
||||
<br>
|
||||
_________________________<br>
|
||||
@ -59,8 +57,6 @@ de:
|
||||
<br>
|
||||
%{exercise} - %{link}
|
||||
<br>
|
||||
If you receive an error that you are not authorized to perform this action when clicking the link, please log-in through any course exercise beforehand and click the link again. <br>
|
||||
<br>
|
||||
This mail was automatically sent by CodeOcean. <br>
|
||||
subject: Eine Aufgabe auf CodeOcean benötigt Ihr Feedback
|
||||
got_new_comment:
|
||||
|
@ -47,8 +47,6 @@ en:
|
||||
<br>
|
||||
%{exercise} - %{link}
|
||||
<br>
|
||||
Falls Sie beim Klick auf diesen Link eine Fehlermeldung erhalten, dass Sie nicht berechtigt wären diese Aktion auszuführen, öffnen Sie bitte eine beliebige Programmieraufgabe aus einem Kurs heraus und klicken den Link danach noch einmal.<br>
|
||||
<br>
|
||||
Diese Mail wurde automatisch von CodeOcean verschickt.<br>
|
||||
<br>
|
||||
_________________________<br>
|
||||
@ -59,8 +57,6 @@ en:
|
||||
<br>
|
||||
%{exercise} - %{link}
|
||||
<br>
|
||||
If you receive an error that you are not authorized to perform this action when clicking the link, please log-in through any course exercise beforehand and click the link again. <br>
|
||||
<br>
|
||||
This mail was automatically sent by CodeOcean. <br>
|
||||
subject: An exercise on CodeOcean needs your feedback
|
||||
got_new_comment:
|
||||
|
@ -153,8 +153,10 @@ namespace :detect_exercise_anomalies do
|
||||
users = contributor.try(:users) || [contributor]
|
||||
users.each do |user|
|
||||
host = CodeOcean::Application.config.action_mailer.default_url_options[:host]
|
||||
last_submission = user.submissions.where(exercise:).latest
|
||||
token = AuthenticationToken.generate!(user, last_submission.study_group).shared_secret
|
||||
feedback_link = Rails.application.routes.url_helpers.url_for(action: :new,
|
||||
controller: :user_exercise_feedbacks, exercise_id: exercise.id, host:)
|
||||
controller: :user_exercise_feedbacks, exercise_id: exercise.id, host:, token:)
|
||||
UserMailer.exercise_anomaly_needs_feedback(user, exercise, feedback_link).deliver
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user