Format anomaly data in mails
This commit is contained in:
@ -2,12 +2,37 @@
|
||||
receiver_displayname: @receiver_displayname,
|
||||
collection_name: @collection.name)
|
||||
|
||||
- @anomalies.keys.each do | key |
|
||||
=key
|
||||
=@anomalies[key]
|
||||
table(border=1)
|
||||
thead
|
||||
tr
|
||||
td = t('activerecord.attributes.exercise.title', locale: :de)
|
||||
td = t('exercises.statistics.average_worktime', locale: :de)
|
||||
td = t('shared.actions', locale: :de)
|
||||
tbody
|
||||
- @anomalies.keys.each do | id |
|
||||
- exercise = Exercise.find(id)
|
||||
tr
|
||||
td = link_to(exercise.title, exercise_path(exercise))
|
||||
td = @anomalies[id]
|
||||
td = link_to(t('shared.statistics', locale: :de), statistics_exercise_path(exercise))
|
||||
|
||||
|
||||
== t('mailers.user_mailer.exercise_anomaly_detected.body2',
|
||||
receiver_displayname: @receiver_displayname,
|
||||
collection_name: @collection.name)
|
||||
|
||||
table(border=1)
|
||||
thead
|
||||
tr
|
||||
td = t('activerecord.attributes.exercise.title', locale: :en)
|
||||
td = t('exercises.statistics.average_worktime', locale: :en)
|
||||
td = t('shared.actions', locale: :en)
|
||||
tbody
|
||||
- @anomalies.keys.each do | id |
|
||||
- exercise = Exercise.find(id)
|
||||
tr
|
||||
td = link_to(exercise.title, exercise_path(exercise))
|
||||
td = @anomalies[id]
|
||||
td = link_to(t('shared.statistics', locale: :en), statistics_exercise_path(exercise))
|
||||
|
||||
== t('mailers.user_mailer.exercise_anomaly_detected.body3')
|
||||
|
@ -528,6 +528,7 @@ de:
|
||||
eine oder mehrere Aufgaben Ihrer Aufgabensammlung "%{collection_name}" zeigen Unregelmäßigkeiten in der Bearbeitungszeit. Möglicherweise sind sie zu schwer oder zu leicht.
|
||||
<br>
|
||||
Die Aufgaben sind:
|
||||
<br>
|
||||
body2: |
|
||||
<br>
|
||||
Falls Sie beim Klick auf einen 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>
|
||||
@ -541,6 +542,7 @@ de:
|
||||
at least one exercise in your exercise collection "%{collection_name}" has a much longer or much shorter average working time than the average. Perhaps they are too difficult or too easy.
|
||||
<br>
|
||||
The exercises are:
|
||||
<br>
|
||||
body3: |
|
||||
<br>
|
||||
If you receive an error that you are not authorized to perform this action when clicking a link, please log-in through any course exercise beforehand and click the link again. <br>
|
||||
|
@ -528,6 +528,7 @@ en:
|
||||
eine oder mehrere Aufgaben Ihrer Aufgabensammlung "%{collection_name}" zeigen Unregelmäßigkeiten in der Bearbeitungszeit. Möglicherweise sind sie zu schwer oder zu leicht.
|
||||
<br>
|
||||
Die Aufgaben sind:
|
||||
<br>
|
||||
body2: |
|
||||
<br>
|
||||
Falls Sie beim Klick auf einen 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>
|
||||
@ -541,6 +542,7 @@ en:
|
||||
at least one exercise in your exercise collection "%{collection_name}" has a much longer or much shorter average working time than the average. Perhaps they are too difficult or too easy.
|
||||
<br>
|
||||
The exercises are:
|
||||
<br>
|
||||
body3: |
|
||||
<br>
|
||||
If you receive an error that you are not authorized to perform this action when clicking a link, please log-in through any course exercise beforehand and click the link again. <br>
|
||||
|
7
test/mailers/previews/user_mailer_preview.rb
Normal file
7
test/mailers/previews/user_mailer_preview.rb
Normal file
@ -0,0 +1,7 @@
|
||||
class UserMailerPreview < ActionMailer::Preview
|
||||
def exercise_anomaly_detected()
|
||||
collection = ExerciseCollection.new(name: 'Hello World', user: FactoryGirl.create(:admin))
|
||||
anomalies = {49 => 879.325828, 51 => 924.870057, 31 => 1031.21233, 69 => 2159.182116}
|
||||
UserMailer.exercise_anomaly_detected(collection, anomalies)
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user