Description:
- streamline current score report and fix some bug
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r610:0c5b815f0163 - - 3 files changed: 12 inserted, 9 deleted
@@ -512,25 +512,25 | |||
|
512 | 512 | problem.each { |p| header << p.name } |
|
513 | 513 | header += ['Total','Passed'] |
|
514 | 514 | csv << header |
|
515 | 515 | #add data |
|
516 | 516 | scorearray.each do |sc| |
|
517 | 517 | total = num_passed = 0 |
|
518 | 518 | row = Array.new |
|
519 | 519 | sc.each_index do |i| |
|
520 | 520 | if i == 0 |
|
521 | 521 | row << sc[i].login |
|
522 | 522 | row << sc[i].full_name |
|
523 | 523 | row << sc[i].activated |
|
524 | - row << (sc[i].try(:contest_stat).try(:started_at).nil? 'no' : 'yes') | |
|
524 | + row << (sc[i].try(:contest_stat).try(:started_at).nil? ? 'no' : 'yes') | |
|
525 | 525 | row << sc[i].contests.collect {|c| c.name}.join(', ') |
|
526 | 526 | else |
|
527 | 527 | row << sc[i][0] |
|
528 | 528 | total += sc[i][0] |
|
529 | 529 | num_passed += 1 if sc[i][1] |
|
530 | 530 | end |
|
531 | 531 | end |
|
532 | 532 | row << total |
|
533 | 533 | row << num_passed |
|
534 | 534 | csv << row |
|
535 | 535 | end |
|
536 | 536 | end |
@@ -23,45 +23,48 | |||
|
23 | 23 | %div.navbar-btn.btn.btn-success#countdown= "ANALYSIS MODE" |
|
24 | 24 | - elsif GraderConfiguration.time_limit_mode? |
|
25 | 25 | - if @current_user.contest_finished? |
|
26 | 26 | %div.navbar-btn.btn.btn-danger#countdown= "Contest is over" |
|
27 | 27 | - elsif !@current_user.contest_started? |
|
28 | 28 | %div.navbar-btn.btn.btn-primary#countdown= (t 'title_bar.contest_not_started') |
|
29 | 29 | - else |
|
30 | 30 | %div.navbar-btn.btn.btn-primary#countdown asdf |
|
31 | 31 | :javascript |
|
32 | 32 | $("#countdown").countdown({until: "+#{@current_user.contest_time_left.to_i}s", layout: 'Time left: {hnn}:{mnn}:{snn}'}); |
|
33 | 33 | / admin section |
|
34 | 34 | - if (@current_user!=nil) and (session[:admin]) |
|
35 | + / management | |
|
35 | 36 | %li.dropdown |
|
36 | 37 | %a.dropdown-toggle{href: '#', data: {toggle:'dropdown'}, aria: {haspopup:"true", expanded:"false"}, role: "button"} |
|
37 | 38 | Manage |
|
38 | 39 | %span.caret |
|
39 | 40 | %ul.dropdown-menu |
|
40 | 41 | = add_menu( 'Announcements', 'announcements', 'index') |
|
41 | 42 | = add_menu( 'Problems', 'problems', 'index') |
|
42 | 43 | = add_menu( 'Users', 'user_admin', 'index') |
|
43 | 44 | = add_menu( 'Graders', 'graders', 'list') |
|
44 | 45 | = add_menu( 'Message ', 'messages', 'console') |
|
45 | 46 | %li.divider{role: 'separator'} |
|
46 | 47 | = add_menu( 'System config', 'configurations', 'index') |
|
47 | 48 | %li.divider{role: 'separator'} |
|
48 | 49 | = add_menu( 'Sites', 'sites', 'index') |
|
49 | 50 | = add_menu( 'Contests', 'contest_management', 'index') |
|
51 | + / report | |
|
50 | 52 | %li.dropdown |
|
51 | 53 | %a.dropdown-toggle{href: '#', data: {toggle:'dropdown'}, aria: {haspopup:"true", expanded:"false"}, role: "button"} |
|
52 | 54 | Report |
|
53 | 55 | %span.caret |
|
54 | 56 | %ul.dropdown-menu |
|
55 |
- = add_menu( ' |
|
|
57 | + = add_menu( 'Current Score', 'report', 'current_score') | |
|
58 | + = add_menu( 'Score Report', 'report', 'max_score') | |
|
56 | 59 | = add_menu( 'Report', 'report', 'multiple_login') |
|
57 | 60 | - if (ungraded = Submission.where('graded_at is null').where('submitted_at < ?', 1.minutes.ago).count) > 0 |
|
58 | 61 | =link_to "#{ungraded} backlogs!", |
|
59 | 62 | grader_list_path, |
|
60 | 63 | class: 'navbar-btn btn btn-default btn-warning', data: {toggle: 'tooltip'},title: 'Number of ungraded submission' |
|
61 | 64 | |
|
62 | 65 | %ul.nav.navbar-nav.navbar-right |
|
63 | 66 | = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-question-sign')}".html_safe, 'main', 'help') |
|
64 | 67 | = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-comment')}".html_safe, 'messages', 'list', {title: I18n.t('menu.messages'), data: {toggle: 'tooltip'}}) |
|
65 | 68 | - if GraderConfiguration['system.user_setting_enabled'] |
|
66 | 69 | = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-cog')}".html_safe, 'users', 'index', {title: I18n.t('menu.settings'), data: {toggle: 'tooltip'}}) |
|
67 | 70 | = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-log-out')} #{@current_user.full_name}".html_safe, 'main', 'login', {title: I18n.t('menu.log_out'), data: {toggle: 'tooltip'}}) |
@@ -1,34 +1,34 | |||
|
1 | 1 | %table.table.sortable.table-striped.table-bordered.table-condensed |
|
2 | 2 | %thead |
|
3 | 3 | %tr |
|
4 | 4 | %th Login |
|
5 | 5 | %th Name |
|
6 | - %th Activated? | |
|
7 | - %th Logged_in | |
|
8 | - %th Contest(s) | |
|
6 | + / %th Activated? | |
|
7 | + / %th Logged_in | |
|
8 | + / %th Contest(s) | |
|
9 | 9 | %th Remark |
|
10 | 10 | - @problems.each do |p| |
|
11 | - %th.text-right= p.name | |
|
11 | + %th.text-right= p.name.gsub('_',' ') | |
|
12 | 12 | %th.text-right Total |
|
13 | 13 | %th.text-right Passed |
|
14 | 14 | %tbody |
|
15 | 15 | - @scorearray.each do |sc| |
|
16 | 16 | %tr |
|
17 | 17 | - total,num_passed = 0,0 |
|
18 | 18 | - sc.each_index do |i| |
|
19 | 19 | - if i == 0 |
|
20 | 20 | %td= link_to sc[i].login, controller: 'users', action: 'profile', id: sc[i] |
|
21 | 21 | %td= sc[i].full_name |
|
22 | - %td= sc[i].activated | |
|
23 | - %td= sc[i].try(:contest_stat).try(:started_at) ? 'yes' : 'no' | |
|
24 | - %td= sc[i].contests.collect {|c| c.name}.join(', ') | |
|
22 | + / %td= sc[i].activated | |
|
23 | + / %td= sc[i].try(:contest_stat).try(:started_at) ? 'yes' : 'no' | |
|
24 | + / %td= sc[i].contests.collect {|c| c.name}.join(', ') | |
|
25 | 25 | %td= sc[i].remark |
|
26 | 26 | - else |
|
27 | 27 | %td.text-right= sc[i][0] |
|
28 | 28 | - total += sc[i][0] |
|
29 | 29 | - num_passed += 1 if sc[i][1] |
|
30 | 30 | %td.text-right= total |
|
31 | 31 | %td.text-right= num_passed |
|
32 | 32 | |
|
33 | 33 | :javascript |
|
34 | 34 | $.bootstrapSortable(true,'reversed') |
You need to be logged in to leave comments.
Login now