Description:
- add problem manage toggle test interface
- remove old erb file
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r569:47e6e54a036a - - 6 files changed: 28 inserted, 171 deleted
@@ -127,6 +127,14 | |||||
|
127 | end |
|
127 | end |
|
128 | end |
|
128 | end |
|
129 |
|
129 | ||
|
|
130 | + def toggle_test | ||
|
|
131 | + @problem = Problem.find(params[:id]) | ||
|
|
132 | + @problem.update_attributes(test_allowed: !(@problem.test_allowed?) ) | ||
|
|
133 | + respond_to do |format| | ||
|
|
134 | + format.js { } | ||
|
|
135 | + end | ||
|
|
136 | + end | ||
|
|
137 | + | ||
|
130 | def turn_all_off |
|
138 | def turn_all_off |
|
131 | Problem.find(:all, |
|
139 | Problem.find(:all, |
|
132 | :conditions => "available = 1").each do |problem| |
|
140 | :conditions => "available = 1").each do |problem| |
@@ -41,9 +41,12 | |||||
|
41 | %ul.dropdown-menu |
|
41 | %ul.dropdown-menu |
|
42 | = add_menu( 'Results', 'user_admin', 'user_stat') |
|
42 | = add_menu( 'Results', 'user_admin', 'user_stat') |
|
43 | = add_menu( 'Report', 'report', 'multiple_login') |
|
43 | = add_menu( 'Report', 'report', 'multiple_login') |
|
44 | - %button.navbar-btn.btn.btn-default.btn-warning |
|
44 | + - if (ungraded = Submission.where('graded_at is null').where('submitted_at < ?', 1.minutes.ago).count) > 0 |
|
45 | - hahaha |
|
45 | + =link_to "#{ungraded} backlogs!", |
|
46 | - |
|
46 | + grader_list_path, |
|
|
47 | + class: 'navbar-btn btn btn-default btn-warning', data: {toggle: 'tooltip'},title: 'Number of ungraded submission' | ||
|
|
48 | + =link_to 'Contest Mode, time remain: 00:20:33',grader_list_path, | ||
|
|
49 | + class: 'navbar-btn btn btn-primary' | ||
|
47 |
|
50 | ||
|
48 | %ul.nav.navbar-nav.navbar-right |
|
51 | %ul.nav.navbar-nav.navbar-right |
|
49 | = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-question-sign')}".html_safe, 'main', 'help') |
|
52 | = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-question-sign')}".html_safe, 'main', 'help') |
@@ -20,10 +20,14 | |||||
|
20 | %thead |
|
20 | %thead |
|
21 | %th Name |
|
21 | %th Name |
|
22 | %th Full name |
|
22 | %th Full name |
|
23 | - %th Full score |
|
23 | + %th.text-right Full score |
|
24 | %th Date added |
|
24 | %th Date added |
|
25 | - %th Avail? |
|
25 | + %th.text-center |
|
26 | - %th Test? |
|
26 | + Avail? |
|
|
27 | + %sup{class: 'text-primary',data: {toggle: 'tooltip'}, title: 'Let user submits to this problem?' } [?] | ||
|
|
28 | + %th.text-center | ||
|
|
29 | + Test? | ||
|
|
30 | + %sup{class: 'text-primary',data: {toggle: 'tooltip'}, title: 'Let user uses test interface on this problem?' } [?] | ||
|
27 | - if GraderConfiguration.multicontests? |
|
31 | - if GraderConfiguration.multicontests? |
|
28 | %th Contests |
|
32 | %th Contests |
|
29 | - for problem in @problems |
|
33 | - for problem in @problems |
@@ -31,11 +35,10 | |||||
|
31 | - @problem=problem |
|
35 | - @problem=problem |
|
32 | %td= in_place_editor_field :problem, :name, {}, :rows=>1 |
|
36 | %td= in_place_editor_field :problem, :name, {}, :rows=>1 |
|
33 | %td= in_place_editor_field :problem, :full_name, {}, :rows=>1 |
|
37 | %td= in_place_editor_field :problem, :full_name, {}, :rows=>1 |
|
34 | - %td= in_place_editor_field :problem, :full_score, {}, :rows=>1 |
|
38 | + %td.text-right= in_place_editor_field :problem, :full_score, {}, :rows=>1 |
|
35 | %td= problem.date_added |
|
39 | %td= problem.date_added |
|
36 |
- %td= toggle_button(@problem.available?, |
|
40 | + %td= toggle_button(@problem.available?, toggle_problem_url(@problem), "problem-avail-#{@problem.id}") |
|
37 | - //%td{}= link_to (@problem.available? ? "Yes" : "No"), url_for(controller: :problems, action: :toggle, id: @problem), { class: "btn btn-block btn-sm btn-#{(@problem.available? ? 'success' : 'default')} ajax-toggle", id: "problem-avail-#{@problem.id}", data: {remote: true, method: 'post' } } |
|
41 | + %td= toggle_button(@problem.test_allowed?, toggle_test_problem_url(@problem), "problem-test-#{@problem.id}") |
|
38 | - %td= problem.test_allowed |
|
||
|
39 | - if GraderConfiguration.multicontests? |
|
42 | - if GraderConfiguration.multicontests? |
|
40 | %td |
|
43 | %td |
|
41 | = problem.contests.collect { |c| c.name }.join(', ') |
|
44 | = problem.contests.collect { |c| c.name }.join(', ') |
@@ -3,7 +3,6 | |||||
|
3 |
|
3 | ||
|
4 | root :to => 'main#login' |
|
4 | root :to => 'main#login' |
|
5 |
|
5 | ||
|
6 | - |
|
||
|
7 | resources :contests |
|
6 | resources :contests |
|
8 |
|
7 | ||
|
9 | resources :sites |
|
8 | resources :sites |
@@ -14,10 +13,10 | |||||
|
14 | end |
|
13 | end |
|
15 | end |
|
14 | end |
|
16 |
|
15 | ||
|
17 | - |
|
||
|
18 | resources :problems do |
|
16 | resources :problems do |
|
19 | member do |
|
17 | member do |
|
20 | get 'toggle' |
|
18 | get 'toggle' |
|
|
19 | + get 'toggle_test' | ||
|
21 | end |
|
20 | end |
|
22 | collection do |
|
21 | collection do |
|
23 | get 'turn_all_off' |
|
22 | get 'turn_all_off' |
@@ -35,10 +34,6 | |||||
|
35 | end |
|
34 | end |
|
36 | end |
|
35 | end |
|
37 |
|
36 | ||
|
38 | - #resources :sources do |
|
||
|
39 | - # collection do |
|
||
|
40 | - # end |
|
||
|
41 | - #end |
|
||
|
42 | get 'sources/direct_edit/:pid', to: 'sources#direct_edit', as: 'direct_edit' |
|
37 | get 'sources/direct_edit/:pid', to: 'sources#direct_edit', as: 'direct_edit' |
|
43 | get 'sources/direct_edit_submission/:sid', to: 'sources#direct_edit_submission', as: 'direct_edit_submission' |
|
38 | get 'sources/direct_edit_submission/:sid', to: 'sources#direct_edit_submission', as: 'direct_edit_submission' |
|
44 |
|
39 | ||
@@ -55,6 +50,9 | |||||
|
55 | get 'report/problem_hof(/:id)', to: 'report#problem_hof', as: 'report_problem_hof' |
|
50 | get 'report/problem_hof(/:id)', to: 'report#problem_hof', as: 'report_problem_hof' |
|
56 | get "report/login" |
|
51 | get "report/login" |
|
57 |
|
52 | ||
|
|
53 | + #grader | ||
|
|
54 | + get 'graders/list', to: 'graders#list', as: 'grader_list' | ||
|
|
55 | + | ||
|
58 | # See how all your routes lay out with "rake routes" |
|
56 | # See how all your routes lay out with "rake routes" |
|
59 |
|
57 | ||
|
60 | # This is a legacy wild controller route that's not recommended for RESTful applications. |
|
58 | # This is a legacy wild controller route that's not recommended for RESTful applications. |
deleted file |
deleted file |
You need to be logged in to leave comments.
Login now