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 | 127 | end |
|
128 | 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 | 138 | def turn_all_off |
|
131 | 139 | Problem.find(:all, |
|
132 | 140 | :conditions => "available = 1").each do |problem| |
@@ -41,9 +41,12 | |||
|
41 | 41 | %ul.dropdown-menu |
|
42 | 42 | = add_menu( 'Results', 'user_admin', 'user_stat') |
|
43 | 43 | = add_menu( 'Report', 'report', 'multiple_login') |
|
44 | - %button.navbar-btn.btn.btn-default.btn-warning | |
|
45 | - hahaha | |
|
46 | - | |
|
44 | + - if (ungraded = Submission.where('graded_at is null').where('submitted_at < ?', 1.minutes.ago).count) > 0 | |
|
45 | + =link_to "#{ungraded} backlogs!", | |
|
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 | 51 | %ul.nav.navbar-nav.navbar-right |
|
49 | 52 | = add_menu("#{content_tag(:span,'',class: 'glyphicon glyphicon-question-sign')}".html_safe, 'main', 'help') |
@@ -20,10 +20,14 | |||
|
20 | 20 | %thead |
|
21 | 21 | %th Name |
|
22 | 22 | %th Full name |
|
23 | - %th Full score | |
|
23 | + %th.text-right Full score | |
|
24 | 24 | %th Date added |
|
25 | - %th Avail? | |
|
26 | - %th Test? | |
|
25 | + %th.text-center | |
|
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 | 31 | - if GraderConfiguration.multicontests? |
|
28 | 32 | %th Contests |
|
29 | 33 | - for problem in @problems |
@@ -31,11 +35,10 | |||
|
31 | 35 | - @problem=problem |
|
32 | 36 | %td= in_place_editor_field :problem, :name, {}, :rows=>1 |
|
33 | 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 | 39 | %td= problem.date_added |
|
36 |
- %td= toggle_button(@problem.available?, |
|
|
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' } } | |
|
38 | - %td= problem.test_allowed | |
|
40 | + %td= toggle_button(@problem.available?, toggle_problem_url(@problem), "problem-avail-#{@problem.id}") | |
|
41 | + %td= toggle_button(@problem.test_allowed?, toggle_test_problem_url(@problem), "problem-test-#{@problem.id}") | |
|
39 | 42 | - if GraderConfiguration.multicontests? |
|
40 | 43 | %td |
|
41 | 44 | = problem.contests.collect { |c| c.name }.join(', ') |
@@ -3,7 +3,6 | |||
|
3 | 3 | |
|
4 | 4 | root :to => 'main#login' |
|
5 | 5 | |
|
6 | - | |
|
7 | 6 | resources :contests |
|
8 | 7 | |
|
9 | 8 | resources :sites |
@@ -14,10 +13,10 | |||
|
14 | 13 | end |
|
15 | 14 | end |
|
16 | 15 | |
|
17 | - | |
|
18 | 16 | resources :problems do |
|
19 | 17 | member do |
|
20 | 18 | get 'toggle' |
|
19 | + get 'toggle_test' | |
|
21 | 20 | end |
|
22 | 21 | collection do |
|
23 | 22 | get 'turn_all_off' |
@@ -35,10 +34,6 | |||
|
35 | 34 | end |
|
36 | 35 | end |
|
37 | 36 | |
|
38 | - #resources :sources do | |
|
39 | - # collection do | |
|
40 | - # end | |
|
41 | - #end | |
|
42 | 37 | get 'sources/direct_edit/:pid', to: 'sources#direct_edit', as: 'direct_edit' |
|
43 | 38 | get 'sources/direct_edit_submission/:sid', to: 'sources#direct_edit_submission', as: 'direct_edit_submission' |
|
44 | 39 | |
@@ -55,6 +50,9 | |||
|
55 | 50 | get 'report/problem_hof(/:id)', to: 'report#problem_hof', as: 'report_problem_hof' |
|
56 | 51 | get "report/login" |
|
57 | 52 | |
|
53 | + #grader | |
|
54 | + get 'graders/list', to: 'graders#list', as: 'grader_list' | |
|
55 | + | |
|
58 | 56 | # See how all your routes lay out with "rake routes" |
|
59 | 57 | |
|
60 | 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