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')
|
||||
|
||||
|
Reference in New Issue
Block a user