Show More
Commit Description:
problem manage
Commit Description:
problem manage
References:
File last commit:
Show/Diff file:
Action:
app/views/problems/stat.html.haml
| 90 lines
| 2.3 KiB
| text/x-haml
| HamlLexer
|
r448 | :css | |||
.fix-width { | ||||
font-family: "Consolas, Monaco, Droid Sans Mono,Mono, Monospace,Courier" | ||||
} | ||||
%h1 Problem stat: #{@problem.name} | ||||
r880 | ||||
.row.mb-3 | ||||
.col-md-8 | ||||
.card | ||||
.card-body | ||||
%h2.card-title Submission History | ||||
%canvas#chart{height: '50px'} | ||||
r448 | ||||
r880 | .col-md-4 | |||
.card | ||||
.card-body | ||||
%h2.card-title General Info | ||||
.row | ||||
.col-sm-6 | ||||
Name | ||||
.col-sm-6 | ||||
= @problem.full_name #in_place_editor_field :problem, :full_name, {}, :rows=>1 | ||||
= link_to_description_if_any "[#{t 'main.problem_desc'}] <span class='glyphicon glyphicon-file'></span>".html_safe, @problem | ||||
.row | ||||
.col-sm-6 | ||||
Subs | ||||
.col-sm-6 | ||||
= @submissions.count | ||||
.row | ||||
.col-sm-6 | ||||
Solved/Attempted User | ||||
.col-sm-6 | ||||
#{@summary[:solve]}/#{@summary[:attempt]} (#{(@summary[:solve]*100.0/@summary[:attempt]).round(1)}%) | ||||
r457 | ||||
r448 | %h2 Submissions | |||
- if @submissions and @submissions.count > 0 | ||||
r694 | %table#main_table.table.table-condensed.table-striped | |||
r448 | %thead | |||
r694 | %tr | |||
r448 | %th ID | |||
%th Login | ||||
%th Name | ||||
%th Submitted_at | ||||
r697 | %th language | |||
r448 | %th Points | |||
%th comment | ||||
r501 | %th IP | |||
r448 | %tbody | |||
- row_odd,curr = true,'' | ||||
- @submissions.each do |sub| | ||||
- next unless sub.user | ||||
- row_odd,curr = !row_odd, sub.user if curr != sub.user | ||||
r694 | %tr | |||
r606 | %td= link_to sub.id, submission_path(sub) | |||
%td= link_to sub.user.login, stat_user_path(sub.user) | ||||
r448 | %td= sub.user.full_name | |||
r694 | %td{data: {order: sub.submitted_at}}= time_ago_in_words(sub.submitted_at) + " ago" | |||
r697 | %td= sub.language.name | |||
r448 | %td= sub.points | |||
%td.fix-width= sub.grader_comment | ||||
r501 | %td= sub.ip_address | |||
r448 | - else | |||
No submission | ||||
r694 | :javascript | |||
r880 | $(document).on('import-map-loaded',(e) => { | |||
//init datatable | ||||
$("#main_table").DataTable({ | ||||
paging: false | ||||
}); | ||||
//history graph | ||||
data = #{@chart_dataset} | ||||
config = { | ||||
type: 'bar', | ||||
data: data, | ||||
options: { | ||||
plugins: { | ||||
legend: { | ||||
display: false | ||||
}, | ||||
}, | ||||
} | ||||
} | ||||
Chart.defaults.font.size = 15 | ||||
//Chart.defaults.font.family = 'Sarabun Light' | ||||
chart = new Chart($('#chart'),config) | ||||
r694 | }); | |||
r880 | ||||