Description:
update message console
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r766:4b83dfaa53e2 - - 7 files changed: 66 inserted, 62 deleted
@@ -0,0 +1,24 | |||||
|
|
1 | + .announcementbox | ||
|
|
2 | + %span{:class => 'title'} | ||
|
|
3 | + How to submit clarification requests | ||
|
|
4 | + .announcement | ||
|
|
5 | + %p | ||
|
|
6 | + :markdown | ||
|
|
7 | + The clarification requests should be phrased as yes/no questions. | ||
|
|
8 | + The answers will be one of the following: | ||
|
|
9 | + (1) **YES**, | ||
|
|
10 | + (2) <b>NO</b>, | ||
|
|
11 | + (3) **ANSWERED IN TASK DESCRIPTION (EXPLICITLY OR IMPLICITLY)**, | ||
|
|
12 | + (4) **INVALID QUESTION**, and | ||
|
|
13 | + (5) **NO COMMENT**. | ||
|
|
14 | + | ||
|
|
15 | + = form_for 'message', :url => { :action => 'create'} do |f| | ||
|
|
16 | + %p | ||
|
|
17 | + %b New clarification request | ||
|
|
18 | + = submit_tag "Post" | ||
|
|
19 | + %br/ | ||
|
|
20 | + = f.text_area :body, :rows => 5, :cols => 100 | ||
|
|
21 | + | ||
|
|
22 | + %hr/ | ||
|
|
23 | + | ||
|
|
24 | + = render :partial => 'message', :collection => @messages, :locals => {:reply => false} |
@@ -1,84 +1,88 | |||||
|
1 | class MessagesController < ApplicationController |
|
1 | class MessagesController < ApplicationController |
|
2 |
|
2 | ||
|
3 |
- before_action : |
|
3 | + before_action :check_valid_login |
|
4 |
|
4 | ||
|
|
5 | + before_action :set_message, only: ['show', 'reply'] | ||
|
5 |
|
6 | ||
|
6 |
- before_ |
|
7 | + before_action :admin_authorization, :only => ['console','show', |
|
7 | 'reply','hide','list_all'] |
|
8 | 'reply','hide','list_all'] |
|
8 |
|
9 | ||
|
9 |
- def |
|
10 | + def index |
|
10 | - @user = User.find(session[:user_id]) |
|
11 | + @messages = Message.find_all_sent_by_user(@current_user) |
|
11 | - @messages = Message.find_all_sent_by_user(@user) |
|
||
|
12 | end |
|
12 | end |
|
13 |
|
13 | ||
|
14 | def console |
|
14 | def console |
|
15 | - @user = User.find(session[:user_id]) |
|
||
|
16 | @messages = Message.find_all_system_unreplied_messages |
|
15 | @messages = Message.find_all_system_unreplied_messages |
|
17 | end |
|
16 | end |
|
18 |
|
17 | ||
|
19 | def show |
|
18 | def show |
|
20 | - @message = Message.find(params[:id]) |
|
||
|
21 | end |
|
19 | end |
|
22 |
|
20 | ||
|
23 | def list_all |
|
21 | def list_all |
|
24 | - @user = User.find(session[:user_id]) |
|
||
|
25 | @messages = Message.where(receiver_id: nil).order(:created_at) |
|
22 | @messages = Message.where(receiver_id: nil).order(:created_at) |
|
26 | end |
|
23 | end |
|
27 |
|
24 | ||
|
28 | def create |
|
25 | def create |
|
29 | - user = User.find(session[:user_id]) |
|
26 | + @message = Message.new(message_params) |
|
30 | - @message = Message.new(params[:message]) |
|
27 | + @message.sender = @current_user |
|
31 | - @message.sender = user |
|
||
|
32 | if @message.body == '' or !@message.save |
|
28 | if @message.body == '' or !@message.save |
|
33 | flash[:notice] = 'An error occurred' |
|
29 | flash[:notice] = 'An error occurred' |
|
34 | else |
|
30 | else |
|
35 | flash[:notice] = 'New message posted' |
|
31 | flash[:notice] = 'New message posted' |
|
36 | end |
|
32 | end |
|
37 |
- redirect_to |
|
33 | + redirect_to action: 'index' |
|
38 | end |
|
34 | end |
|
39 |
|
35 | ||
|
40 | def reply |
|
36 | def reply |
|
41 | - user = User.find(session[:user_id]) |
|
37 | + @r_message = Message.new(message_params) |
|
42 | - @message = Message.new(params[:r_message]) |
|
38 | + @r_message.receiver = @message.sender |
|
43 | - @message.sender = user |
|
39 | + @r_message.sender = @current_user |
|
44 | if @message.body == '' or !@message.save |
|
40 | if @message.body == '' or !@message.save |
|
45 | flash[:notice] = 'An error occurred' |
|
41 | flash[:notice] = 'An error occurred' |
|
46 | redirect_to :action => 'show', :id => @message.replying_message_id |
|
42 | redirect_to :action => 'show', :id => @message.replying_message_id |
|
47 | else |
|
43 | else |
|
48 | flash[:notice] = 'Message replied' |
|
44 | flash[:notice] = 'Message replied' |
|
49 |
- |
|
45 | + @message.replied = true |
|
50 | - rep_msg.replied = true |
|
46 | + @message.replying_message = @r_message |
|
51 |
- |
|
47 | + @message.save |
|
52 | redirect_to :action => 'console' |
|
48 | redirect_to :action => 'console' |
|
53 | end |
|
49 | end |
|
54 | end |
|
50 | end |
|
55 |
|
51 | ||
|
56 | def hide |
|
52 | def hide |
|
57 | message = Message.find(params[:id]) |
|
53 | message = Message.find(params[:id]) |
|
58 | message.replied = true |
|
54 | message.replied = true |
|
59 | message.save |
|
55 | message.save |
|
60 | flash[:notice] = 'Message hidden (just marked replied)' |
|
56 | flash[:notice] = 'Message hidden (just marked replied)' |
|
61 | redirect_to :action => 'console' |
|
57 | redirect_to :action => 'console' |
|
62 | end |
|
58 | end |
|
63 |
|
59 | ||
|
64 | protected |
|
60 | protected |
|
65 | - def build_replying_message_hierarchy(user) |
|
61 | + def build_replying_message_hierarchy(user) |
|
66 | - @all_messages = {} |
|
62 | + @all_messages = {} |
|
67 |
|
63 | ||
|
68 |
|
64 | ||
|
69 | - # manually build replies hierarchy (to improve efficiency) |
|
65 | + # manually build replies hierarchy (to improve efficiency) |
|
70 | - [@messages, @replied_messages].each do |collection| |
|
66 | + [@messages, @replied_messages].each do |collection| |
|
71 | - collection.each do |m| |
|
67 | + collection.each do |m| |
|
72 | - @all_messages[m.id] = {:msg => m, :replies => []} |
|
68 | + @all_messages[m.id] = {:msg => m, :replies => []} |
|
|
69 | + end | ||
|
|
70 | + end | ||
|
|
71 | + | ||
|
|
72 | + @all_messages.each do |m| | ||
|
|
73 | + rep_id = m.replying_message_id | ||
|
|
74 | + if @all_messages[rep_id]!=nil | ||
|
|
75 | + @all_messages[rep_id][:replies] << m | ||
|
|
76 | + end | ||
|
73 | end |
|
77 | end |
|
74 | end |
|
78 | end |
|
75 |
|
79 | ||
|
76 | - @all_messages.each do |m| |
|
80 | + def set_message |
|
77 | - rep_id = m.replying_message_id |
|
81 | + @message = Message.find(params[:id]) |
|
78 | - if @all_messages[rep_id]!=nil |
|
||
|
79 | - @all_messages[rep_id][:replies] << m |
|
||
|
80 | - end |
|
||
|
81 | end |
|
82 | end |
|
82 | - end |
|
83 | + |
|
|
84 | + def message_params | ||
|
|
85 | + params.require(:message).permit(:body) | ||
|
|
86 | + end | ||
|
83 |
|
87 | ||
|
84 | end |
|
88 | end |
@@ -1,13 +1,12 | |||||
|
1 | - = user_title_bar(@user) |
|
||
|
2 |
|
|
1 | |
|
3 | %h1 Console: active messages |
|
2 | %h1 Console: active messages |
|
4 |
|
3 | ||
|
5 | = link_to '[all messages]', :action => 'list_all' |
|
4 | = link_to '[all messages]', :action => 'list_all' |
|
6 |
|
5 | ||
|
7 | %table |
|
6 | %table |
|
8 | %tr |
|
7 | %tr |
|
9 | %th From |
|
8 | %th From |
|
10 | %th When |
|
9 | %th When |
|
11 | %th Message |
|
10 | %th Message |
|
12 | %th |
|
11 | %th |
|
13 | = render :partial => "short_message", :collection => @messages |
|
12 | = render :partial => "short_message", :collection => @messages |
@@ -1,13 +1,11 | |||||
|
1 | - = user_title_bar(@user) |
|
||
|
2 | - |
|
||
|
3 |
|
|
1 | %h1 Console: all messages |
|
4 |
|
2 | ||
|
5 | = link_to '[active messages]', :action => 'list_all' |
|
3 | = link_to '[active messages]', :action => 'list_all' |
|
6 |
|
4 | ||
|
7 | %table |
|
5 | %table |
|
8 | %tr |
|
6 | %tr |
|
9 | %th From |
|
7 | %th From |
|
10 | %th When |
|
8 | %th When |
|
11 | %th Message |
|
9 | %th Message |
|
12 | %th |
|
10 | %th |
|
13 | = render :partial => "short_message", :collection => @messages |
|
11 | = render :partial => "short_message", :collection => @messages |
@@ -1,20 +1,20 | |||||
|
1 | %h3 Message |
|
1 | %h3 Message |
|
2 |
|
2 | ||
|
3 | .message |
|
3 | .message |
|
4 | .stat |
|
4 | .stat |
|
5 | = "#{@message.sender.full_name} at #{@message.created_at}" |
|
5 | = "#{@message.sender.full_name} at #{@message.created_at}" |
|
6 | .body= simple_format(@message.body) |
|
6 | .body= simple_format(@message.body) |
|
7 |
|
7 | ||
|
8 | %h3 Your reply: |
|
8 | %h3 Your reply: |
|
9 |
- = form_for ' |
|
9 | + = form_for 'message', url: reply_message_path(@message) do |f| |
|
10 | = f.text_area :body, :rows => 5, :cols => 100 |
|
10 | = f.text_area :body, :rows => 5, :cols => 100 |
|
11 | - = f.hidden_field :receiver_id, {:value => @message.sender_id } |
|
11 | + -#= f.hidden_field :receiver_id, {:value => @message.sender_id } |
|
12 | - = f.hidden_field :replying_message_id, {:value => @message.id } |
|
12 | + -#= f.hidden_field :replying_message_id, {:value => @message.id } |
|
13 | = submit_tag "Post" |
|
13 | = submit_tag "Post" |
|
14 |
|
14 | ||
|
15 | %p |
|
15 | %p |
|
16 | If you do not want to reply, but want to hide this message from |
|
16 | If you do not want to reply, but want to hide this message from |
|
17 | console, you can |
|
17 | console, you can |
|
18 | = link_to "[hide]", :action => 'hide', :id => @message.id |
|
18 | = link_to "[hide]", :action => 'hide', :id => @message.id |
|
19 | this message. (This message will be marked as replied.) |
|
19 | this message. (This message will be marked as replied.) |
|
20 |
|
20 |
@@ -1,194 +1,199 | |||||
|
1 | Rails.application.routes.draw do |
|
1 | Rails.application.routes.draw do |
|
2 | resources :tags |
|
2 | resources :tags |
|
3 | get "sources/direct_edit" |
|
3 | get "sources/direct_edit" |
|
4 |
|
4 | ||
|
5 | root :to => 'main#login' |
|
5 | root :to => 'main#login' |
|
6 |
|
6 | ||
|
7 | #logins |
|
7 | #logins |
|
8 | match 'login/login', to: 'login#login', via: [:get,:post] |
|
8 | match 'login/login', to: 'login#login', via: [:get,:post] |
|
9 |
|
9 | ||
|
10 | resources :contests |
|
10 | resources :contests |
|
11 | resources :sites |
|
11 | resources :sites |
|
12 | resources :test |
|
12 | resources :test |
|
13 |
|
13 | ||
|
14 | resources :messages do |
|
14 | resources :messages do |
|
|
15 | + member do | ||
|
|
16 | + get 'hide' | ||
|
|
17 | + post 'reply' | ||
|
|
18 | + end | ||
|
15 | collection do |
|
19 | collection do |
|
16 | get 'console' |
|
20 | get 'console' |
|
|
21 | + get 'list_all' | ||
|
17 | end |
|
22 | end |
|
18 | end |
|
23 | end |
|
19 |
|
24 | ||
|
20 | resources :announcements do |
|
25 | resources :announcements do |
|
21 | member do |
|
26 | member do |
|
22 | get 'toggle','toggle_front' |
|
27 | get 'toggle','toggle_front' |
|
23 | end |
|
28 | end |
|
24 | end |
|
29 | end |
|
25 |
|
30 | ||
|
26 | resources :problems do |
|
31 | resources :problems do |
|
27 | member do |
|
32 | member do |
|
28 | get 'toggle' |
|
33 | get 'toggle' |
|
29 | get 'toggle_test' |
|
34 | get 'toggle_test' |
|
30 | get 'toggle_view_testcase' |
|
35 | get 'toggle_view_testcase' |
|
31 | get 'stat' |
|
36 | get 'stat' |
|
32 | end |
|
37 | end |
|
33 | collection do |
|
38 | collection do |
|
34 | get 'turn_all_off' |
|
39 | get 'turn_all_off' |
|
35 | get 'turn_all_on' |
|
40 | get 'turn_all_on' |
|
36 | get 'import' |
|
41 | get 'import' |
|
37 | get 'manage' |
|
42 | get 'manage' |
|
38 | get 'quick_create' |
|
43 | get 'quick_create' |
|
39 | post 'do_manage' |
|
44 | post 'do_manage' |
|
40 | post 'do_import' |
|
45 | post 'do_import' |
|
41 | end |
|
46 | end |
|
42 | end |
|
47 | end |
|
43 |
|
48 | ||
|
44 | resources :groups do |
|
49 | resources :groups do |
|
45 | member do |
|
50 | member do |
|
46 | post 'add_user', to: 'groups#add_user', as: 'add_user' |
|
51 | post 'add_user', to: 'groups#add_user', as: 'add_user' |
|
47 | delete 'remove_user/:user_id', to: 'groups#remove_user', as: 'remove_user' |
|
52 | delete 'remove_user/:user_id', to: 'groups#remove_user', as: 'remove_user' |
|
48 | delete 'remove_all_user', to: 'groups#remove_all_user', as: 'remove_all_user' |
|
53 | delete 'remove_all_user', to: 'groups#remove_all_user', as: 'remove_all_user' |
|
49 | post 'add_problem', to: 'groups#add_problem', as: 'add_problem' |
|
54 | post 'add_problem', to: 'groups#add_problem', as: 'add_problem' |
|
50 | delete 'remove_problem/:problem_id', to: 'groups#remove_problem', as: 'remove_problem' |
|
55 | delete 'remove_problem/:problem_id', to: 'groups#remove_problem', as: 'remove_problem' |
|
51 | delete 'remove_all_problem', to: 'groups#remove_all_problem', as: 'remove_all_problem' |
|
56 | delete 'remove_all_problem', to: 'groups#remove_all_problem', as: 'remove_all_problem' |
|
52 | end |
|
57 | end |
|
53 | collection do |
|
58 | collection do |
|
54 |
|
59 | ||
|
55 | end |
|
60 | end |
|
56 | end |
|
61 | end |
|
57 |
|
62 | ||
|
58 | resources :testcases, only: [] do |
|
63 | resources :testcases, only: [] do |
|
59 | member do |
|
64 | member do |
|
60 | get 'download_input' |
|
65 | get 'download_input' |
|
61 | get 'download_sol' |
|
66 | get 'download_sol' |
|
62 | end |
|
67 | end |
|
63 | collection do |
|
68 | collection do |
|
64 | get 'show_problem/:problem_id(/:test_num)' => 'testcases#show_problem', as: 'show_problem' |
|
69 | get 'show_problem/:problem_id(/:test_num)' => 'testcases#show_problem', as: 'show_problem' |
|
65 | end |
|
70 | end |
|
66 | end |
|
71 | end |
|
67 |
|
72 | ||
|
68 | resources :grader_configuration, controller: 'configurations' do |
|
73 | resources :grader_configuration, controller: 'configurations' do |
|
69 | collection do |
|
74 | collection do |
|
70 | get 'set_exam_right(/:value)', action: 'set_exam_right', as: 'set_exam_right' |
|
75 | get 'set_exam_right(/:value)', action: 'set_exam_right', as: 'set_exam_right' |
|
71 | end |
|
76 | end |
|
72 | end |
|
77 | end |
|
73 |
|
78 | ||
|
74 | resources :users do |
|
79 | resources :users do |
|
75 | member do |
|
80 | member do |
|
76 | get 'toggle_activate', 'toggle_enable' |
|
81 | get 'toggle_activate', 'toggle_enable' |
|
77 | get 'stat' |
|
82 | get 'stat' |
|
78 | end |
|
83 | end |
|
79 | collection do |
|
84 | collection do |
|
80 | get 'profile' |
|
85 | get 'profile' |
|
81 | post 'chg_passwd' |
|
86 | post 'chg_passwd' |
|
82 | end |
|
87 | end |
|
83 | end |
|
88 | end |
|
84 |
|
89 | ||
|
85 | resources :submissions do |
|
90 | resources :submissions do |
|
86 | member do |
|
91 | member do |
|
87 | get 'download' |
|
92 | get 'download' |
|
88 | get 'compiler_msg' |
|
93 | get 'compiler_msg' |
|
89 | get 'rejudge' |
|
94 | get 'rejudge' |
|
90 | get 'source' |
|
95 | get 'source' |
|
91 | end |
|
96 | end |
|
92 | collection do |
|
97 | collection do |
|
93 | get 'prob/:problem_id', to: 'submissions#index', as: 'problem' |
|
98 | get 'prob/:problem_id', to: 'submissions#index', as: 'problem' |
|
94 | get 'direct_edit_problem/:problem_id(/:user_id)', to: 'submissions#direct_edit_problem', as: 'direct_edit_problem' |
|
99 | get 'direct_edit_problem/:problem_id(/:user_id)', to: 'submissions#direct_edit_problem', as: 'direct_edit_problem' |
|
95 | get 'get_latest_submission_status/:uid/:pid', to: 'submissions#get_latest_submission_status', as: 'get_latest_submission_status' |
|
100 | get 'get_latest_submission_status/:uid/:pid', to: 'submissions#get_latest_submission_status', as: 'get_latest_submission_status' |
|
96 | end |
|
101 | end |
|
97 | end |
|
102 | end |
|
98 |
|
103 | ||
|
99 |
|
104 | ||
|
100 | #user admin |
|
105 | #user admin |
|
101 | resources :user_admin do |
|
106 | resources :user_admin do |
|
102 | collection do |
|
107 | collection do |
|
103 | match 'bulk_manage', via: [:get, :post] |
|
108 | match 'bulk_manage', via: [:get, :post] |
|
104 | get 'bulk_mail' |
|
109 | get 'bulk_mail' |
|
105 | get 'user_stat' |
|
110 | get 'user_stat' |
|
106 | get 'import' |
|
111 | get 'import' |
|
107 | get 'new_list' |
|
112 | get 'new_list' |
|
108 | get 'admin' |
|
113 | get 'admin' |
|
109 | get 'active' |
|
114 | get 'active' |
|
110 | get 'mass_mailing' |
|
115 | get 'mass_mailing' |
|
111 | get 'revoke_admin' |
|
116 | get 'revoke_admin' |
|
112 | post 'grant_admin' |
|
117 | post 'grant_admin' |
|
113 | match 'create_from_list', via: [:get, :post] |
|
118 | match 'create_from_list', via: [:get, :post] |
|
114 | match 'random_all_passwords', via: [:get, :post] |
|
119 | match 'random_all_passwords', via: [:get, :post] |
|
115 | end |
|
120 | end |
|
116 | member do |
|
121 | member do |
|
117 | get 'clear_last_ip' |
|
122 | get 'clear_last_ip' |
|
118 | end |
|
123 | end |
|
119 | end |
|
124 | end |
|
120 |
|
125 | ||
|
121 | resources :contest_management, only: [:index] do |
|
126 | resources :contest_management, only: [:index] do |
|
122 | collection do |
|
127 | collection do |
|
123 | get 'user_stat' |
|
128 | get 'user_stat' |
|
124 | get 'clear_stat' |
|
129 | get 'clear_stat' |
|
125 | get 'clear_all_stat' |
|
130 | get 'clear_all_stat' |
|
126 | get 'change_contest_mode' |
|
131 | get 'change_contest_mode' |
|
127 | end |
|
132 | end |
|
128 | end |
|
133 | end |
|
129 |
|
134 | ||
|
130 | #get 'user_admin', to: 'user_admin#index' |
|
135 | #get 'user_admin', to: 'user_admin#index' |
|
131 | #get 'user_admin/bulk_manage', to: 'user_admin#bulk_manage', as: 'bulk_manage_user_admin' |
|
136 | #get 'user_admin/bulk_manage', to: 'user_admin#bulk_manage', as: 'bulk_manage_user_admin' |
|
132 | #post 'user_admin', to: 'user_admin#create' |
|
137 | #post 'user_admin', to: 'user_admin#create' |
|
133 | #delete 'user_admin/:id', to: 'user_admin#destroy', as: 'user_admin_destroy' |
|
138 | #delete 'user_admin/:id', to: 'user_admin#destroy', as: 'user_admin_destroy' |
|
134 |
|
139 | ||
|
135 | #singular resource |
|
140 | #singular resource |
|
136 | #---- BEWARE ---- singular resource maps to plural controller by default, we can override by provide controller name directly |
|
141 | #---- BEWARE ---- singular resource maps to plural controller by default, we can override by provide controller name directly |
|
137 | #report |
|
142 | #report |
|
138 | resource :report, only: [], controller: 'report' do |
|
143 | resource :report, only: [], controller: 'report' do |
|
139 | get 'login' |
|
144 | get 'login' |
|
140 | get 'multiple_login' |
|
145 | get 'multiple_login' |
|
141 | get 'problem_hof(/:id)', action: 'problem_hof', as: 'problem_hof' |
|
146 | get 'problem_hof(/:id)', action: 'problem_hof', as: 'problem_hof' |
|
142 | get 'current_score(/:group_id)', action: 'current_score', as: 'current_score' |
|
147 | get 'current_score(/:group_id)', action: 'current_score', as: 'current_score' |
|
143 | get 'max_score' |
|
148 | get 'max_score' |
|
144 | post 'show_max_score' |
|
149 | post 'show_max_score' |
|
145 | end |
|
150 | end |
|
146 | #get 'report/current_score', to: 'report#current_score', as: 'report_current_score' |
|
151 | #get 'report/current_score', to: 'report#current_score', as: 'report_current_score' |
|
147 | #get 'report/problem_hof(/:id)', to: 'report#problem_hof', as: 'report_problem_hof' |
|
152 | #get 'report/problem_hof(/:id)', to: 'report#problem_hof', as: 'report_problem_hof' |
|
148 | #get "report/login" |
|
153 | #get "report/login" |
|
149 | #get 'report/max_score', to: 'report#max_score', as: 'report_max_score' |
|
154 | #get 'report/max_score', to: 'report#max_score', as: 'report_max_score' |
|
150 | #post 'report/show_max_score', to: 'report#show_max_score', as: 'report_show_max_score' |
|
155 | #post 'report/show_max_score', to: 'report#show_max_score', as: 'report_show_max_score' |
|
151 |
|
156 | ||
|
152 | resource :main, only: [], controller: 'main' do |
|
157 | resource :main, only: [], controller: 'main' do |
|
153 | get 'login' |
|
158 | get 'login' |
|
154 | get 'logout' |
|
159 | get 'logout' |
|
155 | get 'list' |
|
160 | get 'list' |
|
156 | get 'submission(/:id)', action: 'submission', as: 'main_submission' |
|
161 | get 'submission(/:id)', action: 'submission', as: 'main_submission' |
|
157 | get 'announcements' |
|
162 | get 'announcements' |
|
158 | get 'help' |
|
163 | get 'help' |
|
159 | post 'submit' |
|
164 | post 'submit' |
|
160 | end |
|
165 | end |
|
161 | #main |
|
166 | #main |
|
162 | #get "main/list" |
|
167 | #get "main/list" |
|
163 | #get 'main/submission(/:id)', to: 'main#submission', as: 'main_submission' |
|
168 | #get 'main/submission(/:id)', to: 'main#submission', as: 'main_submission' |
|
164 | #post 'main/submit', to: 'main#submit' |
|
169 | #post 'main/submit', to: 'main#submit' |
|
165 | #get 'main/announcements', to: 'main#announcements' |
|
170 | #get 'main/announcements', to: 'main#announcements' |
|
166 |
|
171 | ||
|
167 |
|
172 | ||
|
168 | # |
|
173 | # |
|
169 | get 'tasks/view/:file.:ext' => 'tasks#view' |
|
174 | get 'tasks/view/:file.:ext' => 'tasks#view' |
|
170 | get 'tasks/download/:id/:file.:ext' => 'tasks#download' |
|
175 | get 'tasks/download/:id/:file.:ext' => 'tasks#download' |
|
171 | get 'heartbeat/:id/edit' => 'heartbeat#edit' |
|
176 | get 'heartbeat/:id/edit' => 'heartbeat#edit' |
|
172 |
|
177 | ||
|
173 | #grader |
|
178 | #grader |
|
174 | get 'graders/list', to: 'graders#list', as: 'grader_list' |
|
179 | get 'graders/list', to: 'graders#list', as: 'grader_list' |
|
175 | namespace :graders do |
|
180 | namespace :graders do |
|
176 | get 'task/:id/:type', action: 'task', as: 'task' |
|
181 | get 'task/:id/:type', action: 'task', as: 'task' |
|
177 | get 'view/:id/:type', action: 'view', as: 'view' |
|
182 | get 'view/:id/:type', action: 'view', as: 'view' |
|
178 | get 'clear/:id', action: 'clear', as: 'clear' |
|
183 | get 'clear/:id', action: 'clear', as: 'clear' |
|
179 | get 'stop' |
|
184 | get 'stop' |
|
180 | get 'stop_all' |
|
185 | get 'stop_all' |
|
181 | get 'clear_all' |
|
186 | get 'clear_all' |
|
182 | get 'clear_terminated' |
|
187 | get 'clear_terminated' |
|
183 | get 'start_grading' |
|
188 | get 'start_grading' |
|
184 | get 'start_exam' |
|
189 | get 'start_exam' |
|
185 |
|
190 | ||
|
186 | end |
|
191 | end |
|
187 |
|
192 | ||
|
188 |
|
193 | ||
|
189 | # See how all your routes lay out with "rake routes" |
|
194 | # See how all your routes lay out with "rake routes" |
|
190 |
|
195 | ||
|
191 | # This is a legacy wild controller route that's not recommended for RESTful applications. |
|
196 | # This is a legacy wild controller route that's not recommended for RESTful applications. |
|
192 | # Note: This route will make all actions in every controller accessible via GET requests. |
|
197 | # Note: This route will make all actions in every controller accessible via GET requests. |
|
193 | # match ':controller(/:action(/:id))(.:format)', via: [:get, :post] |
|
198 | # match ':controller(/:action(/:id))(.:format)', via: [:get, :post] |
|
194 | end |
|
199 | end |
deleted file |
You need to be logged in to leave comments.
Login now