Show testrun results in statistics
This commit is contained in:
@ -21,6 +21,7 @@ module CodeOcean
|
||||
belongs_to :file_type
|
||||
|
||||
has_many :files
|
||||
has_many :testruns
|
||||
alias_method :descendants, :files
|
||||
|
||||
mount_uploader :native_file, FileUploader
|
||||
|
@ -7,6 +7,8 @@ class Submission < ActiveRecord::Base
|
||||
|
||||
belongs_to :exercise
|
||||
|
||||
has_many :testruns
|
||||
|
||||
delegate :execution_environment, to: :exercise
|
||||
|
||||
scope :final, -> { where(cause: 'submit') }
|
||||
|
@ -38,7 +38,7 @@ h1 = "#{@exercise} (external user #{@external_user})"
|
||||
table.table
|
||||
thead
|
||||
tr
|
||||
- ['.time', '.cause', '.score', '.time_difference'].each do |title|
|
||||
- ['.time', '.cause', '.score', '.tests', '.time_difference'].each do |title|
|
||||
th.header = t(title)
|
||||
tbody
|
||||
- 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}
|
||||
@ -47,6 +47,7 @@ h1 = "#{@exercise} (external user #{@external_user})"
|
||||
td.clickable = submission.created_at.strftime("%F %T")
|
||||
td = submission.cause
|
||||
td = submission.score
|
||||
td = submission.testruns.map{|run| run.passed ? 'p' : 'f'}.join(' ')
|
||||
td = Time.at(deltas[1..index].inject(:+)).utc.strftime("%H:%M:%S") if index > 0
|
||||
p = t('.addendum')
|
||||
|
||||
|
@ -269,6 +269,7 @@ de:
|
||||
time: Zeit
|
||||
cause: Grund
|
||||
score: Punktzahl
|
||||
tests: Unit Tests
|
||||
time_difference: 'Arbeitszeit bis hier*'
|
||||
addendum: '* Differenzen von mehr als 30 Minuten werden ignoriert.'
|
||||
external_users:
|
||||
|
@ -269,6 +269,7 @@ en:
|
||||
time: Time
|
||||
cause: Cause
|
||||
score: Score
|
||||
tests: Unit Test Results
|
||||
time_difference: 'Working Time until here*'
|
||||
addendum: '* Deltas longer than 30 minutes are ignored.'
|
||||
external_users:
|
||||
|
Reference in New Issue
Block a user