diff --git a/app/views/report/_all_time_hof.html.haml b/app/views/report/_all_time_hof.html.haml new file mode 100644 --- /dev/null +++ b/app/views/report/_all_time_hof.html.haml @@ -0,0 +1,8 @@ +%h2 Paid in Full +User with highest number of problem solved + +%h2 Polymaths +User with highest number of problems each solved by more than 1 languages. + +%h2 Icebreakers +If you solve the problem before 95% of your friends, you are an icebreaker. diff --git a/app/views/report/_task_hof.html.haml b/app/views/report/_task_hof.html.haml new file mode 100644 --- /dev/null +++ b/app/views/report/_task_hof.html.haml @@ -0,0 +1,62 @@ +:css + .hof_user { color: orangered; font-style: italic; } + .hof_language { color: green; font-style: italic; } + .hof_value { color: deeppink;font-style: italic; } + +%h2 Overall + +- if @best + %b Best Runtime: + by #{@best[:runtime][:user]} using #{@best[:runtime][:lang]} with #{@best[:runtime][:value] * 1000} milliseconds at submission + = link_to("#" + @best[:runtime][:sub_id].to_s, controller: 'graders', action: 'submission', id:@best[:runtime][:sub_id]) + %br/ + + %b Best Memory Usage: + by #{@best[:memory][:user]} using #{@best[:memory][:lang]} with #{@best[:memory][:value]} kbytes at submission + = link_to("#" + @best[:memory][:sub_id].to_s, controller: 'graders' , action: 'submission', id:@best[:memory][:sub_id]) + %br/ + + %b Shortest Code: + by #{@best[:length][:user]} using #{@best[:length][:lang]} with #{@best[:length][:value]} bytes at submission + = link_to("#" + @best[:length][:sub_id].to_s, controller: 'graders' , action: 'submission', id: @best[:length][:sub_id]) + %br/ + + %b First solver: + #{@best[:first][:user]} is the first solver using #{@best[:first][:lang]} on #{@best[:first][:value]} at submission + = link_to("#" + @best[:first][:sub_id].to_s, controller: 'graders' , action: 'submission', id: @best[:first][:sub_id]) + %br/ + + + %p + This counts only for submission with 100% score
+ Right now, java is excluded from memory usage competition. (Because it always uses 2GB memory...) + + %h2 By language + + %table.info + %thead + %tr.info-head + %th Language + %th Best runtime (ms) + %th Best memory (kbytes) + %th Shortest Code (bytes) + %th First solver + %tbody + - @by_lang.each do |lang,value| + %tr{class: cycle('info-even','info-odd')} + %td= lang + %td + = "#{value[:runtime][:user]} (#{(value[:runtime][:value] * 1000).to_i} @" + = "#{link_to("#" + value[:runtime][:sub_id].to_s, controller: 'graders' , action: 'submission', id: value[:runtime][:sub_id])} )".html_safe + %td + = "#{value[:memory][:user]} (#{value[:memory][:value]} @" + = "#{link_to("#" + value[:memory][:sub_id].to_s, controller: 'graders' , action: 'submission', id: value[:memory][:sub_id])} )".html_safe + %td + = "#{value[:length][:user]} (#{value[:length][:value]} @" + = "#{link_to("#" + value[:length][:sub_id].to_s, controller: 'graders' , action: 'submission', id: value[:length][:sub_id])} )".html_safe + %td + = "#{value[:first][:user]} (#{value[:first][:value]} @" + = "#{link_to("#" + value[:first][:sub_id].to_s, controller: 'graders' , action: 'submission', id: value[:first][:sub_id])} )".html_safe + +- else + %h3 No submissions