Description:
fix link in grader
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r800:e3df93478b03 - - 4 files changed: 27 inserted, 22 deleted

@@ -1,64 +1,64
1 - content_for :head do
1 - content_for :head do
2 <meta http-equiv ="refresh" content="60"/>
2 <meta http-equiv ="refresh" content="60"/>
3
3
4 %h1 Grader information
4 %h1 Grader information
5
5
6 %p
6 %p
7 = link_to 'Refresh', { :action => 'list' }, class: 'btn btn-info'
7 = link_to 'Refresh', { :action => 'list' }, class: 'btn btn-info'
8
8
9 .panel.panel-primary
9 .panel.panel-primary
10 .panel-heading
10 .panel-heading
11 Grader control:
11 Grader control:
12 .panel-body
12 .panel-body
13 - =link_to 'Start Graders in grading env', { action: 'start_grading'}, class: 'btn btn-default', method: 'post'
13 + =link_to 'Start Graders in grading env', { action: 'start_grading'}, class: 'btn btn-default'
14 - =link_to 'Start Graders in exam env', { action: 'start_exam'}, class: 'btn btn-default', method: 'post'
14 + =link_to 'Start Graders in exam env', { action: 'start_exam'}, class: 'btn btn-default'
15 - =link_to 'Stop all running Graders', { action: 'stop_all'}, class: 'btn btn-default', method: 'post'
15 + =link_to 'Stop all running Graders', { action: 'stop_all'}, class: 'btn btn-default'
16 - =link_to 'Clear all data', { action: 'clear_all'}, class: 'btn btn-default', method: 'post'
16 + =link_to 'Clear all data', { action: 'clear_all'}, class: 'btn btn-default'
17
17
18 .row
18 .row
19 .col-md-6
19 .col-md-6
20 - if @last_task
20 - if @last_task
21 Last task:
21 Last task:
22 = link_to "#{@last_task.id}", :action => 'view', :id => @last_task.id, :type => 'Task'
22 = link_to "#{@last_task.id}", :action => 'view', :id => @last_task.id, :type => 'Task'
23
23
24 %br/
24 %br/
25
25
26 - if @last_test_request
26 - if @last_test_request
27 Last test_request:
27 Last test_request:
28 = link_to "#{@last_test_request.id}", :action => 'view', :id => @last_test_request.id, :type => 'TestRequest'
28 = link_to "#{@last_test_request.id}", :action => 'view', :id => @last_test_request.id, :type => 'TestRequest'
29
29
30 %h2 Current graders
30 %h2 Current graders
31
31
32 = render :partial => 'grader_list', :locals => {:grader_list => @grader_processes}
32 = render :partial => 'grader_list', :locals => {:grader_list => @grader_processes}
33
33
34 %h2 Stalled graders
34 %h2 Stalled graders
35
35
36 = render :partial => 'grader_list', :locals => {:grader_list => @stalled_processes}
36 = render :partial => 'grader_list', :locals => {:grader_list => @stalled_processes}
37
37
38 %h2 Terminated graders
38 %h2 Terminated graders
39
39
40 %p= link_to 'Clear data for terminated graders', { action: 'clear_terminated'}, class: 'btn btn-default', method: 'post'
40 %p= link_to 'Clear data for terminated graders', { action: 'clear_terminated'}, class: 'btn btn-default', method: 'post'
41
41
42 = render :partial => 'grader_list', :locals => {:grader_list => @terminated_processes}
42 = render :partial => 'grader_list', :locals => {:grader_list => @terminated_processes}
43 .col-md-6
43 .col-md-6
44 %h2 Last 20 submissions
44 %h2 Last 20 submissions
45 %table.table.table-striped.table-condensed
45 %table.table.table-striped.table-condensed
46 %thead
46 %thead
47 %th ID
47 %th ID
48 %th User
48 %th User
49 %th Problem
49 %th Problem
50 %th Submitted
50 %th Submitted
51 %th Graded
51 %th Graded
52 %th Result
52 %th Result
53 %tbody
53 %tbody
54 - @submission.each do |sub|
54 - @submission.each do |sub|
55 %tr.inactive
55 %tr.inactive
56 %td= link_to sub.id, submission_path(sub.id)
56 %td= link_to sub.id, submission_path(sub.id)
57 %td= ("" unless sub.user) || link_to(sub.try(:user).try(:full_name), stat_user_path(sub.user.id))
57 %td= ("" unless sub.user) || link_to(sub.try(:user).try(:full_name), stat_user_path(sub.user.id))
58 %td= ("" unless sub.problem) || link_to(sub.try(:problem).try(:full_name), stat_problem_path(sub.problem.id))
58 %td= ("" unless sub.problem) || link_to(sub.try(:problem).try(:full_name), stat_problem_path(sub.problem.id))
59 %td= "#{time_ago_in_words(sub.submitted_at)} ago"
59 %td= "#{time_ago_in_words(sub.submitted_at)} ago"
60 %td= sub.graded_at ? "#{time_ago_in_words(sub.graded_at)} ago" : " "
60 %td= sub.graded_at ? "#{time_ago_in_words(sub.graded_at)} ago" : " "
61 %td= sub.grader_comment
61 %td= sub.grader_comment
62 %h2 Ungraded submission
62 %h2 Ungraded submission
63 %table.table.table-striped.table-condensed
63 %table.table.table-striped.table-condensed
64 %thead
64 %thead
@@ -22,74 +22,74
22 = add_menu("View", 'submissions', 'index')
22 = add_menu("View", 'submissions', 'index')
23 = add_menu("Self Test", 'test', 'index')
23 = add_menu("Self Test", 'test', 'index')
24 / hall of fame
24 / hall of fame
25 - if GraderConfiguration['right.user_hall_of_fame']
25 - if GraderConfiguration['right.user_hall_of_fame']
26 = add_menu("#{I18n.t 'menu.hall_of_fame'}", 'report', 'problem_hof')
26 = add_menu("#{I18n.t 'menu.hall_of_fame'}", 'report', 'problem_hof')
27 / display MODE button (with countdown in contest mode)
27 / display MODE button (with countdown in contest mode)
28 - if GraderConfiguration.analysis_mode?
28 - if GraderConfiguration.analysis_mode?
29 %div.navbar-btn.btn.btn-success#countdown= "ANALYSIS MODE"
29 %div.navbar-btn.btn.btn-success#countdown= "ANALYSIS MODE"
30 - elsif GraderConfiguration.time_limit_mode?
30 - elsif GraderConfiguration.time_limit_mode?
31 - if @current_user.contest_finished?
31 - if @current_user.contest_finished?
32 %div.navbar-btn.btn.btn-danger#countdown= "Contest is over"
32 %div.navbar-btn.btn.btn-danger#countdown= "Contest is over"
33 - elsif !@current_user.contest_started?
33 - elsif !@current_user.contest_started?
34 %div.navbar-btn.btn.btn-primary#countdown= (t 'title_bar.contest_not_started')
34 %div.navbar-btn.btn.btn-primary#countdown= (t 'title_bar.contest_not_started')
35 - else
35 - else
36 %div.navbar-btn.btn.btn-primary#countdown asdf
36 %div.navbar-btn.btn.btn-primary#countdown asdf
37 :javascript
37 :javascript
38 $("#countdown").countdown({until: "+#{@current_user.contest_time_left.to_i}s", layout: 'Time left: {hnn}:{mnn}:{snn}'});
38 $("#countdown").countdown({until: "+#{@current_user.contest_time_left.to_i}s", layout: 'Time left: {hnn}:{mnn}:{snn}'});
39 / admin section
39 / admin section
40 - if (@current_user!=nil) and (session[:admin])
40 - if (@current_user!=nil) and (session[:admin])
41 / management
41 / management
42 %li.dropdown
42 %li.dropdown
43 %a.dropdown-toggle{href: '#', data: {toggle:'dropdown'}, aria: {haspopup:"true", expanded:"false"}, role: "button"}
43 %a.dropdown-toggle{href: '#', data: {toggle:'dropdown'}, aria: {haspopup:"true", expanded:"false"}, role: "button"}
44 Manage
44 Manage
45 %span.caret
45 %span.caret
46 %ul.dropdown-menu
46 %ul.dropdown-menu
47 = add_menu( 'Announcements', 'announcements', 'index')
47 = add_menu( 'Announcements', 'announcements', 'index')
48 = add_menu( 'Problems', 'problems', 'index')
48 = add_menu( 'Problems', 'problems', 'index')
49 = add_menu( 'Tags', 'tags', 'index')
49 = add_menu( 'Tags', 'tags', 'index')
50 = add_menu( 'Users', 'user_admin', 'index')
50 = add_menu( 'Users', 'user_admin', 'index')
51 = add_menu( 'User Groups', 'groups', 'index')
51 = add_menu( 'User Groups', 'groups', 'index')
52 = add_menu( 'Graders', 'graders', 'list')
52 = add_menu( 'Graders', 'graders', 'list')
53 = add_menu( 'Message ', 'messages', 'console')
53 = add_menu( 'Message ', 'messages', 'console')
54 %li.divider{role: 'separator'}
54 %li.divider{role: 'separator'}
55 = add_menu( 'System config', 'configurations', 'index')
55 = add_menu( 'System config', 'configurations', 'index')
56 %li.divider{role: 'separator'}
56 %li.divider{role: 'separator'}
57 = add_menu( 'Sites', 'sites', 'index')
57 = add_menu( 'Sites', 'sites', 'index')
58 = add_menu( 'Contests', 'contest_management', 'index')
58 = add_menu( 'Contests', 'contest_management', 'index')
59 / report
59 / report
60 %li.dropdown
60 %li.dropdown
61 %a.dropdown-toggle{href: '#', data: {toggle:'dropdown'}, aria: {haspopup:"true", expanded:"false"}, role: "button"}
61 %a.dropdown-toggle{href: '#', data: {toggle:'dropdown'}, aria: {haspopup:"true", expanded:"false"}, role: "button"}
62 Report
62 Report
63 %span.caret
63 %span.caret
64 %ul.dropdown-menu
64 %ul.dropdown-menu
65 = add_menu( 'Current Score', 'report', 'current_score')
65 = add_menu( 'Current Score', 'report', 'current_score')
66 = add_menu( 'Score Report', 'report', 'max_score')
66 = add_menu( 'Score Report', 'report', 'max_score')
67 = add_menu( 'Report', 'report', 'multiple_login')
67 = add_menu( 'Report', 'report', 'multiple_login')
68 - if (ungraded = Submission.where('graded_at is null').where('submitted_at < ?', 1.minutes.ago).count) > 0
68 - if (ungraded = Submission.where('graded_at is null').where('submitted_at < ?', 1.minutes.ago).count) > 0
69 =link_to "#{ungraded} backlogs!",
69 =link_to "#{ungraded} backlogs!",
70 - grader_list_path,
70 + graders_list_path,
71 class: 'navbar-btn btn btn-default btn-warning', data: {toggle: 'tooltip'},title: 'Number of ungraded submission'
71 class: 'navbar-btn btn btn-default btn-warning', data: {toggle: 'tooltip'},title: 'Number of ungraded submission'
72
72
73 %ul.nav.navbar-nav.navbar-right
73 %ul.nav.navbar-nav.navbar-right
74 = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-question-sign')}".html_safe, 'main', 'help')
74 = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-question-sign')}".html_safe, 'main', 'help')
75 = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-comment')}".html_safe, 'messages', 'index', {title: I18n.t('menu.messages'), data: {toggle: 'tooltip'}})
75 = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-comment')}".html_safe, 'messages', 'index', {title: I18n.t('menu.messages'), data: {toggle: 'tooltip'}})
76 - if GraderConfiguration['system.user_setting_enabled']
76 - if GraderConfiguration['system.user_setting_enabled']
77 = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-cog', id: 'user_profile')}".html_safe, 'users', 'profile', {title: I18n.t('menu.settings'), data: {toggle: 'tooltip'}})
77 = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-cog', id: 'user_profile')}".html_safe, 'users', 'profile', {title: I18n.t('menu.settings'), data: {toggle: 'tooltip'}})
78 = 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'}})
78 = 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'}})
79
79
80 /
80 /
81 - if (@current_user!=nil) and (session[:admin])
81 - if (@current_user!=nil) and (session[:admin])
82 %nav.navbar.navbar-fixed-top.navbar-inverse.secondnavbar
82 %nav.navbar.navbar-fixed-top.navbar-inverse.secondnavbar
83 .container-fluid
83 .container-fluid
84 .collapse.navbar-collapse
84 .collapse.navbar-collapse
85 %ul.nav.navbar-nav
85 %ul.nav.navbar-nav
86 = add_menu( '[Announcements]', 'announcements', 'index')
86 = add_menu( '[Announcements]', 'announcements', 'index')
87 = add_menu( '[Msg console]', 'messages', 'console')
87 = add_menu( '[Msg console]', 'messages', 'console')
88 = add_menu( '[Problems]', 'problems', 'index')
88 = add_menu( '[Problems]', 'problems', 'index')
89 = add_menu( '[Users]', 'user_admin', 'index')
89 = add_menu( '[Users]', 'user_admin', 'index')
90 = add_menu( '[Results]', 'user_admin', 'user_stat')
90 = add_menu( '[Results]', 'user_admin', 'user_stat')
91 = add_menu( '[Report]', 'report', 'multiple_login')
91 = add_menu( '[Report]', 'report', 'multiple_login')
92 = add_menu( '[Graders]', 'graders', 'list')
92 = add_menu( '[Graders]', 'graders', 'list')
93 = add_menu( '[Contests]', 'contest_management', 'index')
93 = add_menu( '[Contests]', 'contest_management', 'index')
94 = add_menu( '[Sites]', 'sites', 'index')
94 = add_menu( '[Sites]', 'sites', 'index')
95 = add_menu( '[System config]', 'configurations', 'index')
95 = add_menu( '[System config]', 'configurations', 'index')
@@ -1,59 +1,63
1 :css
1 :css
2 .fix-width {
2 .fix-width {
3 font-family: "Consolas, Monaco, Droid Sans Mono,Mono, Monospace,Courier"
3 font-family: "Consolas, Monaco, Droid Sans Mono,Mono, Monospace,Courier"
4 }
4 }
5
5
6 %h1 Problem stat: #{@problem.name}
6 %h1 Problem stat: #{@problem.name}
7 %h2 Overview
7 %h2 Overview
8
8
9 + .row
10 + .col-md-2
11 + %strong Name:
12 + .col-md-10
13 + = @problem.full_name #in_place_editor_field :problem, :full_name, {}, :rows=>1
14 + = link_to_description_if_any "[#{t 'main.problem_desc'}] <span class='glyphicon glyphicon-file'></span>".html_safe, @problem
15 + .row
16 + .col-md-2.strong
17 + %strong Submissions:
18 + .col-md-10
19 + = @submissions.count
20 + .row
21 + .col-md-2.strong
22 + %strong Solved/Attemped User
23 + .col-md-10
24 + #{@summary[:solve]}/#{@summary[:attempt]} (#{(@summary[:solve]*100.0/@summary[:attempt]).round(1)}%)
9
25
10 - %table.info
11 - %thead
12 - %tr.info-head
13 - %th Stat
14 - %th Value
15 - %tbody
16 - %tr{class: cycle('info-even','info-odd')}
17 - %td Submissions
18 - %td= @submissions.count
19 - %tr{class: cycle('info-even','info-odd')}
20 - %td Solved/Attempted User
21 - %td #{@summary[:solve]}/#{@summary[:attempt]} (#{(@summary[:solve]*100.0/@summary[:attempt]).round(1)}%)
22
26
23 %h2 Submissions Count
27 %h2 Submissions Count
24 = render partial: 'application/bar_graph', locals: { histogram: @histogram }
28 = render partial: 'application/bar_graph', locals: { histogram: @histogram }
25
29
26 %h2 Submissions
30 %h2 Submissions
27 - if @submissions and @submissions.count > 0
31 - if @submissions and @submissions.count > 0
28 %table#main_table.table.table-condensed.table-striped
32 %table#main_table.table.table-condensed.table-striped
29 %thead
33 %thead
30 %tr
34 %tr
31 %th ID
35 %th ID
32 %th Login
36 %th Login
33 %th Name
37 %th Name
34 %th Submitted_at
38 %th Submitted_at
35 %th language
39 %th language
36 %th Points
40 %th Points
37 %th comment
41 %th comment
38 %th IP
42 %th IP
39 %tbody
43 %tbody
40 - row_odd,curr = true,''
44 - row_odd,curr = true,''
41 - @submissions.each do |sub|
45 - @submissions.each do |sub|
42 - next unless sub.user
46 - next unless sub.user
43 - row_odd,curr = !row_odd, sub.user if curr != sub.user
47 - row_odd,curr = !row_odd, sub.user if curr != sub.user
44 %tr
48 %tr
45 %td= link_to sub.id, submission_path(sub)
49 %td= link_to sub.id, submission_path(sub)
46 %td= link_to sub.user.login, stat_user_path(sub.user)
50 %td= link_to sub.user.login, stat_user_path(sub.user)
47 %td= sub.user.full_name
51 %td= sub.user.full_name
48 %td{data: {order: sub.submitted_at}}= time_ago_in_words(sub.submitted_at) + " ago"
52 %td{data: {order: sub.submitted_at}}= time_ago_in_words(sub.submitted_at) + " ago"
49 %td= sub.language.name
53 %td= sub.language.name
50 %td= sub.points
54 %td= sub.points
51 %td.fix-width= sub.grader_comment
55 %td.fix-width= sub.grader_comment
52 %td= sub.ip_address
56 %td= sub.ip_address
53 - else
57 - else
54 No submission
58 No submission
55
59
56 :javascript
60 :javascript
57 $("#main_table").DataTable({
61 $("#main_table").DataTable({
58 paging: false
62 paging: false
59 });
63 });
@@ -135,69 +135,70
135 #get 'user_admin/bulk_manage', to: 'user_admin#bulk_manage', as: 'bulk_manage_user_admin'
135 #get 'user_admin/bulk_manage', to: 'user_admin#bulk_manage', as: 'bulk_manage_user_admin'
136 #post 'user_admin', to: 'user_admin#create'
136 #post 'user_admin', to: 'user_admin#create'
137 #delete 'user_admin/:id', to: 'user_admin#destroy', as: 'user_admin_destroy'
137 #delete 'user_admin/:id', to: 'user_admin#destroy', as: 'user_admin_destroy'
138
138
139 #singular resource
139 #singular resource
140 #---- BEWARE ---- singular resource maps to plural controller by default, we can override by provide controller name directly
140 #---- BEWARE ---- singular resource maps to plural controller by default, we can override by provide controller name directly
141 #report
141 #report
142 resource :report, only: [], controller: 'report' do
142 resource :report, only: [], controller: 'report' do
143 get 'login'
143 get 'login'
144 get 'multiple_login'
144 get 'multiple_login'
145 get 'problem_hof(/:id)', action: 'problem_hof', as: 'problem_hof'
145 get 'problem_hof(/:id)', action: 'problem_hof', as: 'problem_hof'
146 get 'current_score(/:group_id)', action: 'current_score', as: 'current_score'
146 get 'current_score(/:group_id)', action: 'current_score', as: 'current_score'
147 get 'max_score'
147 get 'max_score'
148 post 'show_max_score'
148 post 'show_max_score'
149 get 'stuck'
149 get 'stuck'
150 get 'cheat_report'
150 get 'cheat_report'
151 post 'cheat_report'
151 post 'cheat_report'
152 get 'cheat_scruntinize'
152 get 'cheat_scruntinize'
153 post 'cheat_scruntinize'
153 post 'cheat_scruntinize'
154 end
154 end
155 #get 'report/current_score', to: 'report#current_score', as: 'report_current_score'
155 #get 'report/current_score', to: 'report#current_score', as: 'report_current_score'
156 #get 'report/problem_hof(/:id)', to: 'report#problem_hof', as: 'report_problem_hof'
156 #get 'report/problem_hof(/:id)', to: 'report#problem_hof', as: 'report_problem_hof'
157 #get "report/login"
157 #get "report/login"
158 #get 'report/max_score', to: 'report#max_score', as: 'report_max_score'
158 #get 'report/max_score', to: 'report#max_score', as: 'report_max_score'
159 #post 'report/show_max_score', to: 'report#show_max_score', as: 'report_show_max_score'
159 #post 'report/show_max_score', to: 'report#show_max_score', as: 'report_show_max_score'
160
160
161 resource :main, only: [], controller: 'main' do
161 resource :main, only: [], controller: 'main' do
162 get 'login'
162 get 'login'
163 get 'logout'
163 get 'logout'
164 get 'list'
164 get 'list'
165 get 'submission(/:id)', action: 'submission', as: 'main_submission'
165 get 'submission(/:id)', action: 'submission', as: 'main_submission'
166 get 'announcements'
166 get 'announcements'
167 get 'help'
167 get 'help'
168 post 'submit'
168 post 'submit'
169 end
169 end
170 #main
170 #main
171 #get "main/list"
171 #get "main/list"
172 #get 'main/submission(/:id)', to: 'main#submission', as: 'main_submission'
172 #get 'main/submission(/:id)', to: 'main#submission', as: 'main_submission'
173 #post 'main/submit', to: 'main#submit'
173 #post 'main/submit', to: 'main#submit'
174 #get 'main/announcements', to: 'main#announcements'
174 #get 'main/announcements', to: 'main#announcements'
175
175
176
176
177 #
177 #
178 get 'tasks/view/:file.:ext' => 'tasks#view'
178 get 'tasks/view/:file.:ext' => 'tasks#view'
179 get 'tasks/download/:id/:file.:ext' => 'tasks#download', as: 'download_task'
179 get 'tasks/download/:id/:file.:ext' => 'tasks#download', as: 'download_task'
180 get 'heartbeat/:id/edit' => 'heartbeat#edit'
180 get 'heartbeat/:id/edit' => 'heartbeat#edit'
181
181
182 #grader
182 #grader
183 - get 'graders/list', to: 'graders#list', as: 'grader_list'
183 + #get 'graders/list', to: 'graders#list', as: 'grader_list'
184 namespace :graders do
184 namespace :graders do
185 get 'task/:id/:type', action: 'task', as: 'task'
185 get 'task/:id/:type', action: 'task', as: 'task'
186 get 'view/:id/:type', action: 'view', as: 'view'
186 get 'view/:id/:type', action: 'view', as: 'view'
187 get 'clear/:id', action: 'clear', as: 'clear'
187 get 'clear/:id', action: 'clear', as: 'clear'
188 - get 'stop'
189 - get 'stop_all'
190 - get 'clear_all'
191 - get 'clear_terminated'
192 get 'start_grading'
188 get 'start_grading'
193 get 'start_exam'
189 get 'start_exam'
190 + get 'clear_all'
191 + get 'stop_all'
194
192
193 + get 'stop'
194 + get 'clear_terminated'
195 + get 'list'
195 end
196 end
196
197
197
198
198 # See how all your routes lay out with "rake routes"
199 # See how all your routes lay out with "rake routes"
199
200
200 # This is a legacy wild controller route that's not recommended for RESTful applications.
201 # This is a legacy wild controller route that's not recommended for RESTful applications.
201 # Note: This route will make all actions in every controller accessible via GET requests.
202 # Note: This route will make all actions in every controller accessible via GET requests.
202 # match ':controller(/:action(/:id))(.:format)', via: [:get, :post]
203 # match ':controller(/:action(/:id))(.:format)', via: [:get, :post]
203 end
204 end
You need to be logged in to leave comments. Login now