diff --git a/config/locales/de/mailers/user_mailer.yml b/config/locales/de/mailers/user_mailer.yml
index 476577b1..51c00b7e 100644
--- a/config/locales/de/mailers/user_mailer.yml
+++ b/config/locales/de/mailers/user_mailer.yml
@@ -47,8 +47,6 @@ de:
%{exercise} - %{link}
- 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.
-
Diese Mail wurde automatisch von CodeOcean verschickt.
_________________________
@@ -59,8 +57,6 @@ de:
%{exercise} - %{link}
- 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.
-
This mail was automatically sent by CodeOcean.
subject: Eine Aufgabe auf CodeOcean benötigt Ihr Feedback
got_new_comment:
diff --git a/config/locales/en/mailers/user_mailer.yml b/config/locales/en/mailers/user_mailer.yml
index 9801b546..cbdca683 100644
--- a/config/locales/en/mailers/user_mailer.yml
+++ b/config/locales/en/mailers/user_mailer.yml
@@ -47,8 +47,6 @@ en:
%{exercise} - %{link}
- 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.
-
Diese Mail wurde automatisch von CodeOcean verschickt.
_________________________
@@ -59,8 +57,6 @@ en:
%{exercise} - %{link}
- 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.
-
This mail was automatically sent by CodeOcean.
subject: An exercise on CodeOcean needs your feedback
got_new_comment:
diff --git a/lib/tasks/detect_exercise_anomalies.rake b/lib/tasks/detect_exercise_anomalies.rake
index 44e1aecb..09568306 100644
--- a/lib/tasks/detect_exercise_anomalies.rake
+++ b/lib/tasks/detect_exercise_anomalies.rake
@@ -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