Add working time delta for each submission
This commit is contained in:
@ -38,14 +38,17 @@ h1 = "#{@exercise} (external user #{@external_user})"
|
|||||||
table.table
|
table.table
|
||||||
thead
|
thead
|
||||||
tr
|
tr
|
||||||
- ['.time', '.cause', '.score'].each do |title|
|
- ['.time', '.cause', '.score', '.time_difference'].each do |title|
|
||||||
th.header = t(title)
|
th.header = t(title)
|
||||||
tbody
|
tbody
|
||||||
- submissions.each do |submission|
|
- deltas = submissions.map.with_index {|item, index| delta = item.created_at - submissions[index - 1].created_at if index > 0; if delta == nil or delta > 30*60 then 0 else delta end}
|
||||||
|
- submissions.each_with_index do |submission, index|
|
||||||
tr data-id=submission.id
|
tr data-id=submission.id
|
||||||
td.clickable = submission.created_at.strftime("%F %T")
|
td.clickable = submission.created_at.strftime("%F %T")
|
||||||
td = submission.cause
|
td = submission.cause
|
||||||
td = submission.score
|
td = submission.score
|
||||||
|
td = Time.at(deltas[1..index].inject(:+)).utc.strftime("%H:%M:%S") if index > 0
|
||||||
|
p = t('.addendum')
|
||||||
|
|
||||||
- else
|
- else
|
||||||
p = t('.no_data_available')
|
p = t('.no_data_available')
|
||||||
|
@ -264,6 +264,8 @@ de:
|
|||||||
time: Zeit
|
time: Zeit
|
||||||
cause: Grund
|
cause: Grund
|
||||||
score: Punktzahl
|
score: Punktzahl
|
||||||
|
time_difference: 'Arbeitszeit bis hier*'
|
||||||
|
addendum: '* Differenzen von mehr als 30 Minuten werden ignoriert.'
|
||||||
external_users:
|
external_users:
|
||||||
statistics:
|
statistics:
|
||||||
title: Statistiken für Externe Benutzer
|
title: Statistiken für Externe Benutzer
|
||||||
|
@ -264,6 +264,8 @@ en:
|
|||||||
time: Time
|
time: Time
|
||||||
cause: Cause
|
cause: Cause
|
||||||
score: Score
|
score: Score
|
||||||
|
time_difference: 'Working Time until here*'
|
||||||
|
addendum: '* Deltas longer than 30 minutes are ignored.'
|
||||||
external_users:
|
external_users:
|
||||||
statistics:
|
statistics:
|
||||||
title: External User Statistics
|
title: External User Statistics
|
||||||
|
Reference in New Issue
Block a user