Description:
[web] more info on grader queues git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@257 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r127:9f136d243b9c - - 2 files changed: 14 inserted, 0 deleted

@@ -1,39 +1,44
1 1 class GradersController < ApplicationController
2 2
3 3 before_filter :admin_authorization
4 4
5 5 verify :method => :post, :only => ['clear_all'],
6 6 :redirect_to => {:action => 'index'}
7 7
8 8 def index
9 9 redirect_to :action => 'list'
10 10 end
11 11
12 12 def list
13 13 @grader_processes = GraderProcess.find(:all,
14 14 :order => 'updated_at desc')
15 15 @stalled_processes = GraderProcess.find_stalled_process
16 +
17 + @last_task = Task.find(:first,
18 + :order => 'created_at DESC')
19 + @last_test_request = TestRequest.find(:first,
20 + :order => 'created_at DESC')
16 21 end
17 22
18 23 def clear
19 24 grader_proc = GraderProcess.find(params[:id])
20 25 grader_proc.destroy if grader_proc!=nil
21 26 redirect_to :action => 'list'
22 27 end
23 28
24 29 def clear_all
25 30 GraderProcess.find(:all).each do |p|
26 31 p.destroy
27 32 end
28 33 redirect_to :action => 'list'
29 34 end
30 35
31 36 def view
32 37 if params[:type]=='Task'
33 38 redirect_to :action => 'task', :id => params[:id]
34 39 else
35 40 redirect_to :action => 'test_request', :id => params[:id]
36 41 end
37 42 end
38 43
39 44 def test_request
@@ -1,15 +1,24
1 1 - content_for :head do
2 2 = stylesheet_link_tag 'graders'
3 3
4 4 %h2 (Under Experiments)
5 5
6 6 - form_for :clear, nil, :url => {:action => 'clear_all'} do |f|
7 7 = submit_tag 'Clear all data'
8 8
9 + Last task:
10 + = link_to "#{@last_task.id}", :action => 'view', :id => @last_task.id, :type => 'Task'
11 +
12 + %br/
13 +
14 + Last test_request:
15 + = link_to "#{@last_test_request.id}", :action => 'view', :id => @last_test_request.id, :type => 'TestRequest'
16 +
17 +
9 18 %h3 Current graders
10 19
11 20 = render :partial => 'grader_list', :locals => {:grader_list => @grader_processes}
12 21
13 22 %h3 Stalled graders
14 23
15 24 = render :partial => 'grader_list', :locals => {:grader_list => @stalled_processes}
You need to be logged in to leave comments. Login now