Description:
added level to problems, randoms problem from each level
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r255:b7ca2d765156 - - 9 files changed: 87 inserted, 7 deleted

@@ -0,0 +1,9
1 + class AddLevelToProblems < ActiveRecord::Migration
2 + def self.up
3 + add_column :problems, :level, :integer, :default => 0
4 + end
5 +
6 + def self.down
7 + remove_column :problems, :level, :integer
8 + end
9 + end
@@ -1,13 +1,37
1 class CodejomController < ApplicationController
1 class CodejomController < ApplicationController
2
2
3 before_filter :admin_authorization
3 before_filter :admin_authorization
4 - before_filter :authenticate
5
4
6 def index
5 def index
7 @user = User.find(session[:user_id])
6 @user = User.find(session[:user_id])
8 @problems = Problem.find(:all)
7 @problems = Problem.find(:all)
9 - @available_problems = @problems.find_all {|p| not p.available }
8 + @levels = @problems.collect {|p| p.level}.uniq.sort
9 + @available_problems = {}
10 + @levels.each do |level|
11 + @available_problems[level] = []
12 + end
13 + @problems.find_all {|p| not p.available }.each do |problem|
14 + @available_problems[problem.level] << problem
15 + end
10 @activated_problems = @problems.find_all {|p| p.available }
16 @activated_problems = @problems.find_all {|p| p.available }
11 end
17 end
12
18
19 + def random_problem
20 + level = params[:id].to_i
21 +
22 + problems = Problem.unavailable.level(level).all
23 + puts problems
24 + if problems.length!=0
25 + if problems.length != 1
26 + problem = problems[rand(problems.length)]
27 + else
28 + problem = problems[0]
29 + end
30 + problem.available = true
31 + problem.save
32 + end
33 +
34 + redirect_to :action => 'index'
35 + end
36 +
13 end
37 end
@@ -1,200 +1,203
1 class ProblemsController < ApplicationController
1 class ProblemsController < ApplicationController
2
2
3 before_filter :authenticate, :authorization
3 before_filter :authenticate, :authorization
4
4
5 in_place_edit_for :problem, :name
5 in_place_edit_for :problem, :name
6 in_place_edit_for :problem, :full_name
6 in_place_edit_for :problem, :full_name
7 in_place_edit_for :problem, :full_score
7 in_place_edit_for :problem, :full_score
8
8
9 + # for codejom
10 + in_place_edit_for :problem, :level
11 +
9 def index
12 def index
10 list
13 list
11 render :action => 'list'
14 render :action => 'list'
12 end
15 end
13
16
14 # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
17 # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
15 verify :method => :post, :only => [ :destroy,
18 verify :method => :post, :only => [ :destroy,
16 :create, :quick_create,
19 :create, :quick_create,
17 :do_manage,
20 :do_manage,
18 :do_import,
21 :do_import,
19 :update ],
22 :update ],
20 :redirect_to => { :action => :list }
23 :redirect_to => { :action => :list }
21
24
22 def list
25 def list
23 @problems = Problem.find(:all, :order => 'date_added DESC')
26 @problems = Problem.find(:all, :order => 'date_added DESC')
24 end
27 end
25
28
26 def show
29 def show
27 @problem = Problem.find(params[:id])
30 @problem = Problem.find(params[:id])
28 end
31 end
29
32
30 def new
33 def new
31 @problem = Problem.new
34 @problem = Problem.new
32 @description = nil
35 @description = nil
33 end
36 end
34
37
35 def create
38 def create
36 @problem = Problem.new(params[:problem])
39 @problem = Problem.new(params[:problem])
37 @description = Description.new(params[:description])
40 @description = Description.new(params[:description])
38 if @description.body!=''
41 if @description.body!=''
39 if !@description.save
42 if !@description.save
40 render :action => new and return
43 render :action => new and return
41 end
44 end
42 else
45 else
43 @description = nil
46 @description = nil
44 end
47 end
45 @problem.description = @description
48 @problem.description = @description
46 if @problem.save
49 if @problem.save
47 flash[:notice] = 'Problem was successfully created.'
50 flash[:notice] = 'Problem was successfully created.'
48 redirect_to :action => 'list'
51 redirect_to :action => 'list'
49 else
52 else
50 render :action => 'new'
53 render :action => 'new'
51 end
54 end
52 end
55 end
53
56
54 def quick_create
57 def quick_create
55 @problem = Problem.new(params[:problem])
58 @problem = Problem.new(params[:problem])
56 @problem.full_name = @problem.name if @problem.full_name == ''
59 @problem.full_name = @problem.name if @problem.full_name == ''
57 @problem.full_score = 100
60 @problem.full_score = 100
58 @problem.available = false
61 @problem.available = false
59 @problem.test_allowed = true
62 @problem.test_allowed = true
60 @problem.output_only = false
63 @problem.output_only = false
61 @problem.date_added = Time.new
64 @problem.date_added = Time.new
62 if @problem.save
65 if @problem.save
63 flash[:notice] = 'Problem was successfully created.'
66 flash[:notice] = 'Problem was successfully created.'
64 redirect_to :action => 'list'
67 redirect_to :action => 'list'
65 else
68 else
66 flash[:notice] = 'Error saving problem'
69 flash[:notice] = 'Error saving problem'
67 redirect_to :action => 'list'
70 redirect_to :action => 'list'
68 end
71 end
69 end
72 end
70
73
71 def edit
74 def edit
72 @problem = Problem.find(params[:id])
75 @problem = Problem.find(params[:id])
73 @description = @problem.description
76 @description = @problem.description
74 end
77 end
75
78
76 def update
79 def update
77 @problem = Problem.find(params[:id])
80 @problem = Problem.find(params[:id])
78 @description = @problem.description
81 @description = @problem.description
79 if @description == nil and params[:description][:body]!=''
82 if @description == nil and params[:description][:body]!=''
80 @description = Description.new(params[:description])
83 @description = Description.new(params[:description])
81 if !@description.save
84 if !@description.save
82 flash[:notice] = 'Error saving description'
85 flash[:notice] = 'Error saving description'
83 render :action => 'edit' and return
86 render :action => 'edit' and return
84 end
87 end
85 @problem.description = @description
88 @problem.description = @description
86 elsif @description!=nil
89 elsif @description!=nil
87 if !@description.update_attributes(params[:description])
90 if !@description.update_attributes(params[:description])
88 flash[:notice] = 'Error saving description'
91 flash[:notice] = 'Error saving description'
89 render :action => 'edit' and return
92 render :action => 'edit' and return
90 end
93 end
91 end
94 end
92 if @problem.update_attributes(params[:problem])
95 if @problem.update_attributes(params[:problem])
93 flash[:notice] = 'Problem was successfully updated.'
96 flash[:notice] = 'Problem was successfully updated.'
94 redirect_to :action => 'show', :id => @problem
97 redirect_to :action => 'show', :id => @problem
95 else
98 else
96 render :action => 'edit'
99 render :action => 'edit'
97 end
100 end
98 end
101 end
99
102
100 def destroy
103 def destroy
101 Problem.find(params[:id]).destroy
104 Problem.find(params[:id]).destroy
102 redirect_to :action => 'list'
105 redirect_to :action => 'list'
103 end
106 end
104
107
105 def toggle
108 def toggle
106 @problem = Problem.find(params[:id])
109 @problem = Problem.find(params[:id])
107 @problem.available = !(@problem.available)
110 @problem.available = !(@problem.available)
108 @problem.save
111 @problem.save
109 end
112 end
110
113
111 def turn_all_off
114 def turn_all_off
112 Problem.find(:all,
115 Problem.find(:all,
113 :conditions => "available = 1").each do |problem|
116 :conditions => "available = 1").each do |problem|
114 problem.available = false
117 problem.available = false
115 problem.save
118 problem.save
116 end
119 end
117 redirect_to :action => 'list'
120 redirect_to :action => 'list'
118 end
121 end
119
122
120 def turn_all_on
123 def turn_all_on
121 Problem.find(:all,
124 Problem.find(:all,
122 :conditions => "available = 0").each do |problem|
125 :conditions => "available = 0").each do |problem|
123 problem.available = true
126 problem.available = true
124 problem.save
127 problem.save
125 end
128 end
126 redirect_to :action => 'list'
129 redirect_to :action => 'list'
127 end
130 end
128
131
129 def stat
132 def stat
130 @problem = Problem.find(params[:id])
133 @problem = Problem.find(params[:id])
131 if !@problem.available
134 if !@problem.available
132 redirect_to :controller => 'main', :action => 'list'
135 redirect_to :controller => 'main', :action => 'list'
133 else
136 else
134 @submissions = Submission.find_all_last_by_problem(params[:id])
137 @submissions = Submission.find_all_last_by_problem(params[:id])
135 end
138 end
136 end
139 end
137
140
138 def manage
141 def manage
139 @problems = Problem.find(:all, :order => 'date_added DESC')
142 @problems = Problem.find(:all, :order => 'date_added DESC')
140 end
143 end
141
144
142 def do_manage
145 def do_manage
143 if params.has_key? 'change_date_added'
146 if params.has_key? 'change_date_added'
144 change_date_added
147 change_date_added
145 end
148 end
146 redirect_to :action => 'manage'
149 redirect_to :action => 'manage'
147 end
150 end
148
151
149 def import
152 def import
150 @allow_test_pair_import = allow_test_pair_import?
153 @allow_test_pair_import = allow_test_pair_import?
151 end
154 end
152
155
153 def do_import
156 def do_import
154 old_problem = Problem.find_by_name(params[:name])
157 old_problem = Problem.find_by_name(params[:name])
155 if !allow_test_pair_import? and params.has_key? :import_to_db
158 if !allow_test_pair_import? and params.has_key? :import_to_db
156 params.delete :import_to_db
159 params.delete :import_to_db
157 end
160 end
158 @problem, import_log = Problem.create_from_import_form_params(params,
161 @problem, import_log = Problem.create_from_import_form_params(params,
159 old_problem)
162 old_problem)
160
163
161 if @problem.errors.length != 0
164 if @problem.errors.length != 0
162 render :action => 'import' and return
165 render :action => 'import' and return
163 end
166 end
164
167
165 if old_problem!=nil
168 if old_problem!=nil
166 flash[:notice] = "The test data has been replaced for problem #{@problem.name}"
169 flash[:notice] = "The test data has been replaced for problem #{@problem.name}"
167 end
170 end
168 @log = import_log
171 @log = import_log
169 end
172 end
170
173
171 ##################################
174 ##################################
172 protected
175 protected
173
176
174 def allow_test_pair_import?
177 def allow_test_pair_import?
175 if defined? ALLOW_TEST_PAIR_IMPORT
178 if defined? ALLOW_TEST_PAIR_IMPORT
176 return ALLOW_TEST_PAIR_IMPORT
179 return ALLOW_TEST_PAIR_IMPORT
177 else
180 else
178 return false
181 return false
179 end
182 end
180 end
183 end
181
184
182 def change_date_added
185 def change_date_added
183 problems = get_problems_from_params
186 problems = get_problems_from_params
184 year = params[:date_added][:year].to_i
187 year = params[:date_added][:year].to_i
185 month = params[:date_added][:month].to_i
188 month = params[:date_added][:month].to_i
186 day = params[:date_added][:day].to_i
189 day = params[:date_added][:day].to_i
187 date = Date.new(year,month,day)
190 date = Date.new(year,month,day)
188 problems.each do |p|
191 problems.each do |p|
189 p.date_added = date
192 p.date_added = date
190 p.save
193 p.save
191 end
194 end
192 end
195 end
193
196
194 def get_problems_from_params
197 def get_problems_from_params
195 problems = []
198 problems = []
196 params.keys.each do |k|
199 params.keys.each do |k|
197 if k.index('prob-')==0
200 if k.index('prob-')==0
198 name, id = k.split('-')
201 name, id = k.split('-')
199 problems << Problem.find(id)
202 problems << Problem.find(id)
200 end
203 end
@@ -1,125 +1,132
1 class Problem < ActiveRecord::Base
1 class Problem < ActiveRecord::Base
2
2
3 belongs_to :description
3 belongs_to :description
4 has_many :test_pairs, :dependent => :delete_all
4 has_many :test_pairs, :dependent => :delete_all
5
5
6 + named_scope :level, lambda { |level|
7 + { :conditions => { :level => level }}
8 + }
9 +
10 + named_scope :unavailable, { :conditions => { :available => false }}
11 +
12 +
6 validates_presence_of :name
13 validates_presence_of :name
7 validates_format_of :name, :with => /^\w+$/
14 validates_format_of :name, :with => /^\w+$/
8 validates_presence_of :full_name
15 validates_presence_of :full_name
9
16
10 DEFAULT_TIME_LIMIT = 1
17 DEFAULT_TIME_LIMIT = 1
11 DEFAULT_MEMORY_LIMIT = 32
18 DEFAULT_MEMORY_LIMIT = 32
12
19
13 def test_pair_count
20 def test_pair_count
14 @test_pair_count ||= test_pairs.size
21 @test_pair_count ||= test_pairs.size
15 end
22 end
16
23
17 def uses_random_test_pair?
24 def uses_random_test_pair?
18 test_pair_count != 0
25 test_pair_count != 0
19 end
26 end
20
27
21 def random_test_pair(forbidden_numbers=nil)
28 def random_test_pair(forbidden_numbers=nil)
22 if forbidden_numbers.length < test_pair_count
29 if forbidden_numbers.length < test_pair_count
23 begin
30 begin
24 test_num = 1 + rand(test_pair_count)
31 test_num = 1 + rand(test_pair_count)
25 end while forbidden_numbers!=nil and forbidden_numbers.include? test_num
32 end while forbidden_numbers!=nil and forbidden_numbers.include? test_num
26 else
33 else
27 test_num = 1 + rand(test_pair_count)
34 test_num = 1 + rand(test_pair_count)
28 end
35 end
29 test_pairs.find_by_number test_num
36 test_pairs.find_by_number test_num
30 end
37 end
31
38
32 def self.find_available_problems
39 def self.find_available_problems
33 find(:all, :conditions => {:available => true}, :order => "date_added DESC")
40 find(:all, :conditions => {:available => true}, :order => "date_added DESC")
34 end
41 end
35
42
36 # TODO: may try to optimize this using cache
43 # TODO: may try to optimize this using cache
37 def self.available_problem_count
44 def self.available_problem_count
38 return Problem.find_available_problems.length
45 return Problem.find_available_problems.length
39 end
46 end
40
47
41 def self.create_from_import_form_params(params, old_problem=nil)
48 def self.create_from_import_form_params(params, old_problem=nil)
42 problem = old_problem || Problem.new
49 problem = old_problem || Problem.new
43 import_params = Problem.extract_params_and_check(params, problem)
50 import_params = Problem.extract_params_and_check(params, problem)
44
51
45 if not problem.valid?
52 if not problem.valid?
46 return problem, 'Error importing'
53 return problem, 'Error importing'
47 end
54 end
48
55
49 problem.full_score = 100
56 problem.full_score = 100
50 problem.date_added = Time.new
57 problem.date_added = Time.new
51 problem.test_allowed = true
58 problem.test_allowed = true
52 problem.output_only = false
59 problem.output_only = false
53 problem.available = false
60 problem.available = false
54
61
55 if not problem.save
62 if not problem.save
56 return problem, 'Error importing'
63 return problem, 'Error importing'
57 end
64 end
58
65
59 import_to_db = params.has_key? :import_to_db
66 import_to_db = params.has_key? :import_to_db
60
67
61 importer = TestdataImporter.new(problem)
68 importer = TestdataImporter.new(problem)
62
69
63 if not importer.import_from_file(import_params[:file],
70 if not importer.import_from_file(import_params[:file],
64 import_params[:time_limit],
71 import_params[:time_limit],
65 import_params[:memory_limit],
72 import_params[:memory_limit],
66 import_to_db)
73 import_to_db)
67 problem.errors.add_to_base('Import error.')
74 problem.errors.add_to_base('Import error.')
68 end
75 end
69
76
70 return problem, importer.log_msg
77 return problem, importer.log_msg
71 end
78 end
72
79
73 protected
80 protected
74
81
75 def self.to_i_or_default(st, default)
82 def self.to_i_or_default(st, default)
76 if st!=''
83 if st!=''
77 st.to_i
84 st.to_i
78 else
85 else
79 default
86 default
80 end
87 end
81 end
88 end
82
89
83 def self.extract_params_and_check(params, problem)
90 def self.extract_params_and_check(params, problem)
84 time_limit = Problem.to_i_or_default(params[:time_limit],
91 time_limit = Problem.to_i_or_default(params[:time_limit],
85 DEFAULT_TIME_LIMIT)
92 DEFAULT_TIME_LIMIT)
86 memory_limit = Problem.to_i_or_default(params[:memory_limit],
93 memory_limit = Problem.to_i_or_default(params[:memory_limit],
87 DEFAULT_MEMORY_LIMIT)
94 DEFAULT_MEMORY_LIMIT)
88
95
89 if time_limit==0 and time_limit_s!='0'
96 if time_limit==0 and time_limit_s!='0'
90 problem.errors.add_to_base('Time limit format errors.')
97 problem.errors.add_to_base('Time limit format errors.')
91 elsif time_limit<=0 or time_limit >60
98 elsif time_limit<=0 or time_limit >60
92 problem.errors.add_to_base('Time limit out of range.')
99 problem.errors.add_to_base('Time limit out of range.')
93 end
100 end
94
101
95 if memory_limit==0 and memory_limit_s!='0'
102 if memory_limit==0 and memory_limit_s!='0'
96 problem.errors.add_to_base('Memory limit format errors.')
103 problem.errors.add_to_base('Memory limit format errors.')
97 elsif memory_limit<=0 or memory_limit >512
104 elsif memory_limit<=0 or memory_limit >512
98 problem.errors.add_to_base('Memory limit out of range.')
105 problem.errors.add_to_base('Memory limit out of range.')
99 end
106 end
100
107
101 if params[:file]==nil or params[:file]==''
108 if params[:file]==nil or params[:file]==''
102 problem.errors.add_to_base('No testdata file.')
109 problem.errors.add_to_base('No testdata file.')
103 end
110 end
104
111
105 file = params[:file]
112 file = params[:file]
106
113
107 if problem.errors.length!=0
114 if problem.errors.length!=0
108 return problem
115 return problem
109 end
116 end
110
117
111 problem.name = params[:name]
118 problem.name = params[:name]
112 if params[:full_name]!=''
119 if params[:full_name]!=''
113 problem.full_name = params[:full_name]
120 problem.full_name = params[:full_name]
114 else
121 else
115 problem.full_name = params[:name]
122 problem.full_name = params[:name]
116 end
123 end
117
124
118 return {
125 return {
119 :time_limit => time_limit,
126 :time_limit => time_limit,
120 :memory_limit => memory_limit,
127 :memory_limit => memory_limit,
121 :file => file
128 :file => file
122 }
129 }
123 end
130 end
124
131
125 end
132 end
@@ -1,11 +1,23
1 %h1 Code Jom Control Panel
1 %h1 Code Jom Control Panel
2
2
3 - %h2= "Available problems (#{@available_problems.length})"
3 + %h2 Available problems
4 - %ul
4 + %table{:class => "codejom-problems"}
5 - - @available_problems.each do |problem|
5 + %tr
6 - %li= problem.name
6 + - @levels.each do |level|
7 + %th= "Level #{level} (#{@available_problems[level].length})"
8 + %tr
9 + - @levels.each do |level|
10 + %td
11 + - @available_problems[level].each do |problem|
12 + = problem.name
13 + %br/
14 + %tr
15 + - @levels.each do |level|
16 + %td{:class => 'random-button'}
17 + - form_tag :action => 'random_problem', :id => level do
18 + = submit_tag 'Random'
7
19
8 %h2= "Activated problems (#{@activated_problems.length})"
20 %h2= "Activated problems (#{@activated_problems.length})"
9 - @activated_problems.each do |problem|
21 - @activated_problems.each do |problem|
10 = problem.name
22 = problem.name
11
23
@@ -1,58 +1,60
1 <% content_for :head do %>
1 <% content_for :head do %>
2 <%= stylesheet_link_tag 'problems' %>
2 <%= stylesheet_link_tag 'problems' %>
3 <%= javascript_include_tag :defaults %>
3 <%= javascript_include_tag :defaults %>
4 <% end %>
4 <% end %>
5
5
6 <h1>Listing problems</h1>
6 <h1>Listing problems</h1>
7
7
8 <p>
8 <p>
9 <%= link_to '[New problem]', :action => 'new' %>
9 <%= link_to '[New problem]', :action => 'new' %>
10 <%= link_to '[Manage problems]', :action => 'manage' %>
10 <%= link_to '[Manage problems]', :action => 'manage' %>
11 <%= link_to '[Import problems]', :action => 'import' %>
11 <%= link_to '[Import problems]', :action => 'import' %>
12 <%= link_to '[Turn off all problems]', :action => 'turn_all_off' %>
12 <%= link_to '[Turn off all problems]', :action => 'turn_all_off' %>
13 <%= link_to '[Turn on all problems]', :action => 'turn_all_on' %>
13 <%= link_to '[Turn on all problems]', :action => 'turn_all_on' %>
14 </p>
14 </p>
15
15
16 <div class="submitbox">
16 <div class="submitbox">
17 <% form_tag :action => 'quick_create' do %>
17 <% form_tag :action => 'quick_create' do %>
18 <b>Quick New:</b>
18 <b>Quick New:</b>
19 <label for="problem_name">Name</label>
19 <label for="problem_name">Name</label>
20 <%= text_field 'problem', 'name' %> |
20 <%= text_field 'problem', 'name' %> |
21 <label for="problem_full_name">Full name</label>
21 <label for="problem_full_name">Full name</label>
22 <%= text_field 'problem', 'full_name' %>
22 <%= text_field 'problem', 'full_name' %>
23 <%= submit_tag "Create" %>
23 <%= submit_tag "Create" %>
24 <% end %>
24 <% end %>
25 </div>
25 </div>
26
26
27 <table>
27 <table>
28 <tr>
28 <tr>
29 <th>Name</th>
29 <th>Name</th>
30 <th>Full name</th>
30 <th>Full name</th>
31 + <th>Level</th>
31 <th>Full score</th>
32 <th>Full score</th>
32 <th>Date added</th>
33 <th>Date added</th>
33 <th>Avail?</th>
34 <th>Avail?</th>
34 <th>Test?</th>
35 <th>Test?</th>
35 </tr>
36 </tr>
36
37
37 <% for problem in @problems %>
38 <% for problem in @problems %>
38 <tr id="prob-<%= problem.id %>" name="prob-<%= problem.id %>" class="<%= (problem.available) ? "available" : "not-available" %>">
39 <tr id="prob-<%= problem.id %>" name="prob-<%= problem.id %>" class="<%= (problem.available) ? "available" : "not-available" %>">
39 <% @problem=problem %>
40 <% @problem=problem %>
40 <td><%= in_place_editor_field :problem, :name, {}, :rows=>1 %></td>
41 <td><%= in_place_editor_field :problem, :name, {}, :rows=>1 %></td>
41 <td><%= in_place_editor_field :problem, :full_name, {}, :rows=>1 %></td>
42 <td><%= in_place_editor_field :problem, :full_name, {}, :rows=>1 %></td>
43 + <td><%= in_place_editor_field :problem, :level, {}, :rows=>1 %></td>
42 <td><%= in_place_editor_field :problem, :full_score, {}, :rows=>1 %></td>
44 <td><%= in_place_editor_field :problem, :full_score, {}, :rows=>1 %></td>
43 <td><%= problem.date_added %></td>
45 <td><%= problem.date_added %></td>
44 <td id="prob-<%= problem.id %>-avail"><%= problem.available %></td>
46 <td id="prob-<%= problem.id %>-avail"><%= problem.available %></td>
45 <td><%= problem.test_allowed %></td>
47 <td><%= problem.test_allowed %></td>
46
48
47 <td><%= link_to_remote '[Toggle]', :url => {:action => 'toggle', :id => problem.id } %></td>
49 <td><%= link_to_remote '[Toggle]', :url => {:action => 'toggle', :id => problem.id } %></td>
48 <td><%= link_to '[Stat]', :action => 'stat', :id => problem.id %></td>
50 <td><%= link_to '[Stat]', :action => 'stat', :id => problem.id %></td>
49 <td><%= link_to '[Show]', :action => 'show', :id => problem %></td>
51 <td><%= link_to '[Show]', :action => 'show', :id => problem %></td>
50 <td><%= link_to '[Edit]', :action => 'edit', :id => problem %></td>
52 <td><%= link_to '[Edit]', :action => 'edit', :id => problem %></td>
51 <td><%= link_to '[Destroy]', { :action => 'destroy', :id => problem }, :confirm => 'Are you sure?', :method => :post %></td>
53 <td><%= link_to '[Destroy]', { :action => 'destroy', :id => problem }, :confirm => 'Are you sure?', :method => :post %></td>
52 </tr>
54 </tr>
53 <% end %>
55 <% end %>
54 </table>
56 </table>
55
57
56 <br />
58 <br />
57
59
58 <%= link_to '[New problem]', :action => 'new' %>
60 <%= link_to '[New problem]', :action => 'new' %>
@@ -1,248 +1,249
1 # This file is auto-generated from the current state of the database. Instead of editing this file,
1 # This file is auto-generated from the current state of the database. Instead of editing this file,
2 # please use the migrations feature of Active Record to incrementally modify your database, and
2 # please use the migrations feature of Active Record to incrementally modify your database, and
3 # then regenerate this schema definition.
3 # then regenerate this schema definition.
4 #
4 #
5 # Note that this schema.rb definition is the authoritative source for your database schema. If you need
5 # Note that this schema.rb definition is the authoritative source for your database schema. If you need
6 # to create the application database on another system, you should be using db:schema:load, not running
6 # to create the application database on another system, you should be using db:schema:load, not running
7 # all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
7 # all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations
8 # you'll amass, the slower it'll run and the greater likelihood for issues).
8 # you'll amass, the slower it'll run and the greater likelihood for issues).
9 #
9 #
10 # It's strongly recommended to check this file into your version control system.
10 # It's strongly recommended to check this file into your version control system.
11
11
12 - ActiveRecord::Schema.define(:version => 20100129041917) do
12 + ActiveRecord::Schema.define(:version => 20100209145331) do
13
13
14 create_table "announcements", :force => true do |t|
14 create_table "announcements", :force => true do |t|
15 t.string "author"
15 t.string "author"
16 t.text "body"
16 t.text "body"
17 t.boolean "published"
17 t.boolean "published"
18 t.datetime "created_at"
18 t.datetime "created_at"
19 t.datetime "updated_at"
19 t.datetime "updated_at"
20 t.boolean "frontpage", :default => false
20 t.boolean "frontpage", :default => false
21 t.boolean "contest_only", :default => false
21 t.boolean "contest_only", :default => false
22 t.string "title"
22 t.string "title"
23 end
23 end
24
24
25 create_table "codejom_statuses", :force => true do |t|
25 create_table "codejom_statuses", :force => true do |t|
26 t.integer "user_id"
26 t.integer "user_id"
27 t.boolean "alive"
27 t.boolean "alive"
28 t.integer "num_problems_passed"
28 t.integer "num_problems_passed"
29 t.datetime "created_at"
29 t.datetime "created_at"
30 t.datetime "updated_at"
30 t.datetime "updated_at"
31 end
31 end
32
32
33 create_table "configurations", :force => true do |t|
33 create_table "configurations", :force => true do |t|
34 t.string "key"
34 t.string "key"
35 t.string "value_type"
35 t.string "value_type"
36 t.string "value"
36 t.string "value"
37 t.datetime "created_at"
37 t.datetime "created_at"
38 t.datetime "updated_at"
38 t.datetime "updated_at"
39 t.text "description"
39 t.text "description"
40 end
40 end
41
41
42 create_table "countries", :force => true do |t|
42 create_table "countries", :force => true do |t|
43 t.string "name"
43 t.string "name"
44 t.datetime "created_at"
44 t.datetime "created_at"
45 t.datetime "updated_at"
45 t.datetime "updated_at"
46 end
46 end
47
47
48 create_table "descriptions", :force => true do |t|
48 create_table "descriptions", :force => true do |t|
49 t.text "body"
49 t.text "body"
50 t.boolean "markdowned"
50 t.boolean "markdowned"
51 t.datetime "created_at"
51 t.datetime "created_at"
52 t.datetime "updated_at"
52 t.datetime "updated_at"
53 end
53 end
54
54
55 create_table "grader_processes", :force => true do |t|
55 create_table "grader_processes", :force => true do |t|
56 t.string "host", :limit => 20
56 t.string "host", :limit => 20
57 t.integer "pid"
57 t.integer "pid"
58 t.string "mode"
58 t.string "mode"
59 t.boolean "active"
59 t.boolean "active"
60 t.datetime "created_at"
60 t.datetime "created_at"
61 t.datetime "updated_at"
61 t.datetime "updated_at"
62 t.integer "task_id"
62 t.integer "task_id"
63 t.string "task_type"
63 t.string "task_type"
64 t.boolean "terminated"
64 t.boolean "terminated"
65 end
65 end
66
66
67 add_index "grader_processes", ["host", "pid"], :name => "index_grader_processes_on_ip_and_pid"
67 add_index "grader_processes", ["host", "pid"], :name => "index_grader_processes_on_ip_and_pid"
68
68
69 create_table "languages", :force => true do |t|
69 create_table "languages", :force => true do |t|
70 t.string "name", :limit => 10
70 t.string "name", :limit => 10
71 t.string "pretty_name"
71 t.string "pretty_name"
72 t.string "ext", :limit => 10
72 t.string "ext", :limit => 10
73 t.string "common_ext"
73 t.string "common_ext"
74 end
74 end
75
75
76 create_table "messages", :force => true do |t|
76 create_table "messages", :force => true do |t|
77 t.integer "sender_id"
77 t.integer "sender_id"
78 t.integer "receiver_id"
78 t.integer "receiver_id"
79 t.integer "replying_message_id"
79 t.integer "replying_message_id"
80 t.text "body"
80 t.text "body"
81 t.boolean "replied"
81 t.boolean "replied"
82 t.datetime "created_at"
82 t.datetime "created_at"
83 t.datetime "updated_at"
83 t.datetime "updated_at"
84 end
84 end
85
85
86 create_table "problems", :force => true do |t|
86 create_table "problems", :force => true do |t|
87 t.string "name", :limit => 30
87 t.string "name", :limit => 30
88 t.string "full_name"
88 t.string "full_name"
89 t.integer "full_score"
89 t.integer "full_score"
90 t.date "date_added"
90 t.date "date_added"
91 t.boolean "available"
91 t.boolean "available"
92 t.string "url"
92 t.string "url"
93 t.integer "description_id"
93 t.integer "description_id"
94 t.boolean "test_allowed"
94 t.boolean "test_allowed"
95 t.boolean "output_only"
95 t.boolean "output_only"
96 + t.integer "level", :default => 0
96 end
97 end
97
98
98 create_table "rights", :force => true do |t|
99 create_table "rights", :force => true do |t|
99 t.string "name"
100 t.string "name"
100 t.string "controller"
101 t.string "controller"
101 t.string "action"
102 t.string "action"
102 end
103 end
103
104
104 create_table "rights_roles", :id => false, :force => true do |t|
105 create_table "rights_roles", :id => false, :force => true do |t|
105 t.integer "right_id"
106 t.integer "right_id"
106 t.integer "role_id"
107 t.integer "role_id"
107 end
108 end
108
109
109 add_index "rights_roles", ["role_id"], :name => "index_rights_roles_on_role_id"
110 add_index "rights_roles", ["role_id"], :name => "index_rights_roles_on_role_id"
110
111
111 create_table "roles", :force => true do |t|
112 create_table "roles", :force => true do |t|
112 t.string "name"
113 t.string "name"
113 end
114 end
114
115
115 create_table "roles_users", :id => false, :force => true do |t|
116 create_table "roles_users", :id => false, :force => true do |t|
116 t.integer "role_id"
117 t.integer "role_id"
117 t.integer "user_id"
118 t.integer "user_id"
118 end
119 end
119
120
120 add_index "roles_users", ["user_id"], :name => "index_roles_users_on_user_id"
121 add_index "roles_users", ["user_id"], :name => "index_roles_users_on_user_id"
121
122
122 create_table "sessions", :force => true do |t|
123 create_table "sessions", :force => true do |t|
123 t.string "session_id"
124 t.string "session_id"
124 t.text "data"
125 t.text "data"
125 t.datetime "updated_at"
126 t.datetime "updated_at"
126 end
127 end
127
128
128 add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
129 add_index "sessions", ["session_id"], :name => "index_sessions_on_session_id"
129 add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"
130 add_index "sessions", ["updated_at"], :name => "index_sessions_on_updated_at"
130
131
131 create_table "sites", :force => true do |t|
132 create_table "sites", :force => true do |t|
132 t.string "name"
133 t.string "name"
133 t.boolean "started"
134 t.boolean "started"
134 t.datetime "start_time"
135 t.datetime "start_time"
135 t.datetime "created_at"
136 t.datetime "created_at"
136 t.datetime "updated_at"
137 t.datetime "updated_at"
137 t.integer "country_id"
138 t.integer "country_id"
138 t.string "password"
139 t.string "password"
139 end
140 end
140
141
141 create_table "submission_statuses", :force => true do |t|
142 create_table "submission_statuses", :force => true do |t|
142 t.integer "user_id"
143 t.integer "user_id"
143 t.integer "problem_id"
144 t.integer "problem_id"
144 t.boolean "passed"
145 t.boolean "passed"
145 t.integer "submission_count"
146 t.integer "submission_count"
146 t.datetime "created_at"
147 t.datetime "created_at"
147 t.datetime "updated_at"
148 t.datetime "updated_at"
148 end
149 end
149
150
150 create_table "submissions", :force => true do |t|
151 create_table "submissions", :force => true do |t|
151 t.integer "user_id"
152 t.integer "user_id"
152 t.integer "problem_id"
153 t.integer "problem_id"
153 t.integer "language_id"
154 t.integer "language_id"
154 t.text "source"
155 t.text "source"
155 t.binary "binary"
156 t.binary "binary"
156 t.datetime "submitted_at"
157 t.datetime "submitted_at"
157 t.datetime "compiled_at"
158 t.datetime "compiled_at"
158 t.text "compiler_message"
159 t.text "compiler_message"
159 t.datetime "graded_at"
160 t.datetime "graded_at"
160 t.integer "points"
161 t.integer "points"
161 t.text "grader_comment"
162 t.text "grader_comment"
162 t.integer "number"
163 t.integer "number"
163 t.string "source_filename"
164 t.string "source_filename"
164 end
165 end
165
166
166 add_index "submissions", ["user_id", "problem_id", "number"], :name => "index_submissions_on_user_id_and_problem_id_and_number", :unique => true
167 add_index "submissions", ["user_id", "problem_id", "number"], :name => "index_submissions_on_user_id_and_problem_id_and_number", :unique => true
167 add_index "submissions", ["user_id", "problem_id"], :name => "index_submissions_on_user_id_and_problem_id"
168 add_index "submissions", ["user_id", "problem_id"], :name => "index_submissions_on_user_id_and_problem_id"
168
169
169 create_table "tasks", :force => true do |t|
170 create_table "tasks", :force => true do |t|
170 t.integer "submission_id"
171 t.integer "submission_id"
171 t.datetime "created_at"
172 t.datetime "created_at"
172 t.integer "status"
173 t.integer "status"
173 t.datetime "updated_at"
174 t.datetime "updated_at"
174 end
175 end
175
176
176 create_table "test_pair_assignments", :force => true do |t|
177 create_table "test_pair_assignments", :force => true do |t|
177 t.integer "user_id"
178 t.integer "user_id"
178 t.integer "problem_id"
179 t.integer "problem_id"
179 t.integer "test_pair_id"
180 t.integer "test_pair_id"
180 t.integer "test_pair_number"
181 t.integer "test_pair_number"
181 t.integer "request_number"
182 t.integer "request_number"
182 t.datetime "created_at"
183 t.datetime "created_at"
183 t.datetime "updated_at"
184 t.datetime "updated_at"
184 t.boolean "submitted"
185 t.boolean "submitted"
185 end
186 end
186
187
187 create_table "test_pairs", :force => true do |t|
188 create_table "test_pairs", :force => true do |t|
188 t.integer "problem_id"
189 t.integer "problem_id"
189 t.text "input", :limit => 16777215
190 t.text "input", :limit => 16777215
190 t.text "solution", :limit => 16777215
191 t.text "solution", :limit => 16777215
191 t.datetime "created_at"
192 t.datetime "created_at"
192 t.datetime "updated_at"
193 t.datetime "updated_at"
193 t.integer "number"
194 t.integer "number"
194 end
195 end
195
196
196 create_table "test_requests", :force => true do |t|
197 create_table "test_requests", :force => true do |t|
197 t.integer "user_id"
198 t.integer "user_id"
198 t.integer "problem_id"
199 t.integer "problem_id"
199 t.integer "submission_id"
200 t.integer "submission_id"
200 t.string "input_file_name"
201 t.string "input_file_name"
201 t.string "output_file_name"
202 t.string "output_file_name"
202 t.string "running_stat"
203 t.string "running_stat"
203 t.integer "status"
204 t.integer "status"
204 t.datetime "updated_at"
205 t.datetime "updated_at"
205 t.datetime "submitted_at"
206 t.datetime "submitted_at"
206 t.datetime "compiled_at"
207 t.datetime "compiled_at"
207 t.text "compiler_message"
208 t.text "compiler_message"
208 t.datetime "graded_at"
209 t.datetime "graded_at"
209 t.string "grader_comment"
210 t.string "grader_comment"
210 t.datetime "created_at"
211 t.datetime "created_at"
211 t.float "running_time"
212 t.float "running_time"
212 t.string "exit_status"
213 t.string "exit_status"
213 t.integer "memory_usage"
214 t.integer "memory_usage"
214 end
215 end
215
216
216 add_index "test_requests", ["user_id", "problem_id"], :name => "index_test_requests_on_user_id_and_problem_id"
217 add_index "test_requests", ["user_id", "problem_id"], :name => "index_test_requests_on_user_id_and_problem_id"
217
218
218 create_table "user_contest_stats", :force => true do |t|
219 create_table "user_contest_stats", :force => true do |t|
219 t.integer "user_id"
220 t.integer "user_id"
220 t.datetime "started_at"
221 t.datetime "started_at"
221 t.datetime "created_at"
222 t.datetime "created_at"
222 t.datetime "updated_at"
223 t.datetime "updated_at"
223 end
224 end
224
225
225 create_table "users", :force => true do |t|
226 create_table "users", :force => true do |t|
226 t.string "login", :limit => 50
227 t.string "login", :limit => 50
227 t.string "full_name"
228 t.string "full_name"
228 t.string "hashed_password"
229 t.string "hashed_password"
229 t.string "salt", :limit => 5
230 t.string "salt", :limit => 5
230 t.string "alias"
231 t.string "alias"
231 t.string "email"
232 t.string "email"
232 t.integer "site_id"
233 t.integer "site_id"
233 t.integer "country_id"
234 t.integer "country_id"
234 t.boolean "activated", :default => false
235 t.boolean "activated", :default => false
235 t.datetime "created_at"
236 t.datetime "created_at"
236 t.datetime "updated_at"
237 t.datetime "updated_at"
237 t.string "member1_full_name"
238 t.string "member1_full_name"
238 t.string "member2_full_name"
239 t.string "member2_full_name"
239 t.string "member3_full_name"
240 t.string "member3_full_name"
240 t.boolean "high_school"
241 t.boolean "high_school"
241 t.string "member1_school_name"
242 t.string "member1_school_name"
242 t.string "member2_school_name"
243 t.string "member2_school_name"
243 t.string "member3_school_name"
244 t.string "member3_school_name"
244 end
245 end
245
246
246 add_index "users", ["login"], :name => "index_users_on_login", :unique => true
247 add_index "users", ["login"], :name => "index_users_on_login", :unique => true
247
248
248 end
249 end
@@ -88,192 +88,202
88 padding: 5px;
88 padding: 5px;
89 margin: 10px 0px;
89 margin: 10px 0px;
90 color: black;
90 color: black;
91 font-size: 13px; }
91 font-size: 13px; }
92
92
93 .errorExplanation {
93 .errorExplanation {
94 border: 1px dotted gray;
94 border: 1px dotted gray;
95 color: #bb2222;
95 color: #bb2222;
96 padding: 5px 15px 5px 15px;
96 padding: 5px 15px 5px 15px;
97 margin-bottom: 5px;
97 margin-bottom: 5px;
98 background-color: white;
98 background-color: white;
99 font-weight: normal; }
99 font-weight: normal; }
100 .errorExplanation h2 {
100 .errorExplanation h2 {
101 color: #cc1111;
101 color: #cc1111;
102 font-weight: bold; }
102 font-weight: bold; }
103
103
104 table.uinfo {
104 table.uinfo {
105 border-collapse: collapse;
105 border-collapse: collapse;
106 border: 1px solid black;
106 border: 1px solid black;
107 font-size: 13px; }
107 font-size: 13px; }
108
108
109 td.uinfo {
109 td.uinfo {
110 vertical-align: top;
110 vertical-align: top;
111 border: 1px solid black;
111 border: 1px solid black;
112 padding: 5px; }
112 padding: 5px; }
113
113
114 th.uinfo {
114 th.uinfo {
115 background: lightgreen;
115 background: lightgreen;
116 vertical-align: top;
116 vertical-align: top;
117 text-align: right;
117 text-align: right;
118 border: 1px solid black;
118 border: 1px solid black;
119 padding: 5px; }
119 padding: 5px; }
120
120
121 .compilermsgbody {
121 .compilermsgbody {
122 font-family: monospace; }
122 font-family: monospace; }
123
123
124 .task-menu {
124 .task-menu {
125 text-align: center;
125 text-align: center;
126 font-size: 13px;
126 font-size: 13px;
127 line-height: 1.75em;
127 line-height: 1.75em;
128 font-weight: bold;
128 font-weight: bold;
129 border-top: 1px dashed gray;
129 border-top: 1px dashed gray;
130 border-bottom: 1px dashed gray;
130 border-bottom: 1px dashed gray;
131 margin-top: 2px;
131 margin-top: 2px;
132 margin-bottom: 4px; }
132 margin-bottom: 4px; }
133
133
134 table.taskdesc {
134 table.taskdesc {
135 border: 2px solid #dddddd;
135 border: 2px solid #dddddd;
136 border-collapse: collapse;
136 border-collapse: collapse;
137 margin: 10px auto;
137 margin: 10px auto;
138 width: 90%;
138 width: 90%;
139 font-size: 13px; }
139 font-size: 13px; }
140 table.taskdesc p {
140 table.taskdesc p {
141 font-size: 13px; }
141 font-size: 13px; }
142 table.taskdesc tr.name {
142 table.taskdesc tr.name {
143 border: 2px solid #dddddd;
143 border: 2px solid #dddddd;
144 background: #dddddd;
144 background: #dddddd;
145 color: #333333;
145 color: #333333;
146 font-weight: bold;
146 font-weight: bold;
147 font-size: 14px;
147 font-size: 14px;
148 line-height: 1.5em;
148 line-height: 1.5em;
149 text-align: center; }
149 text-align: center; }
150 table.taskdesc td.desc-odd {
150 table.taskdesc td.desc-odd {
151 padding: 5px;
151 padding: 5px;
152 padding-left: 20px;
152 padding-left: 20px;
153 background: #fefeee; }
153 background: #fefeee; }
154 table.taskdesc td.desc-even {
154 table.taskdesc td.desc-even {
155 padding: 5px;
155 padding: 5px;
156 padding-left: 20px;
156 padding-left: 20px;
157 background: #feeefe; }
157 background: #feeefe; }
158
158
159 .announcementbox {
159 .announcementbox {
160 margin: 10px 0px;
160 margin: 10px 0px;
161 background: #bbddee;
161 background: #bbddee;
162 padding: 1px; }
162 padding: 1px; }
163 .announcementbox span.title {
163 .announcementbox span.title {
164 font-weight: bold;
164 font-weight: bold;
165 color: #224455;
165 color: #224455;
166 padding-left: 10px;
166 padding-left: 10px;
167 line-height: 1.6em; }
167 line-height: 1.6em; }
168 .announcementbox .announcement {
168 .announcementbox .announcement {
169 margin: 2px;
169 margin: 2px;
170 background: white;
170 background: white;
171 padding: 1px;
171 padding: 1px;
172 padding-left: 10px;
172 padding-left: 10px;
173 padding-right: 10px;
173 padding-right: 10px;
174 padding-top: 5px;
174 padding-top: 5px;
175 padding-bottom: 5px; }
175 padding-bottom: 5px; }
176 .announcementbox .announcement p {
176 .announcementbox .announcement p {
177 font-size: 12px;
177 font-size: 12px;
178 margin: 2px; }
178 margin: 2px; }
179
179
180 .pub-info {
180 .pub-info {
181 text-align: right;
181 text-align: right;
182 font-style: italic;
182 font-style: italic;
183 font-size: 9px; }
183 font-size: 9px; }
184 .pub-info p {
184 .pub-info p {
185 text-align: right;
185 text-align: right;
186 font-style: italic;
186 font-style: italic;
187 font-size: 9px; }
187 font-size: 9px; }
188
188
189 .announcement .toggles {
189 .announcement .toggles {
190 font-weight: normal;
190 font-weight: normal;
191 float: right;
191 float: right;
192 font-size: 80%; }
192 font-size: 80%; }
193 .announcement .announcement-title {
193 .announcement .announcement-title {
194 font-weight: bold; }
194 font-weight: bold; }
195
195
196 .message {
196 .message {
197 margin: 10px 0 0; }
197 margin: 10px 0 0; }
198 .message .message {
198 .message .message {
199 margin: 0 0 0 30px; }
199 margin: 0 0 0 30px; }
200 .message .message .stat {
200 .message .message .stat {
201 font-size: 10px;
201 font-size: 10px;
202 line-height: 1.75em;
202 line-height: 1.75em;
203 padding: 0 5px;
203 padding: 0 5px;
204 color: #444444;
204 color: #444444;
205 background: #bbbbbb;
205 background: #bbbbbb;
206 font-weight: bold; }
206 font-weight: bold; }
207 .message .body {
207 .message .body {
208 border: 2px solid #dddddd;
208 border: 2px solid #dddddd;
209 background: #fff8f8;
209 background: #fff8f8;
210 padding-left: 5px; }
210 padding-left: 5px; }
211 .message .reply-body {
211 .message .reply-body {
212 border: 2px solid #bbbbbb;
212 border: 2px solid #bbbbbb;
213 background: #fffff8;
213 background: #fffff8;
214 padding-left: 5px; }
214 padding-left: 5px; }
215 .message .stat {
215 .message .stat {
216 font-size: 10px;
216 font-size: 10px;
217 line-height: 1.75em;
217 line-height: 1.75em;
218 padding: 0 5px;
218 padding: 0 5px;
219 color: #333333;
219 color: #333333;
220 background: #dddddd;
220 background: #dddddd;
221 font-weight: bold; }
221 font-weight: bold; }
222
222
223 .contest-title {
223 .contest-title {
224 color: white;
224 color: white;
225 text-align: center;
225 text-align: center;
226 line-height: 2em; }
226 line-height: 2em; }
227
227
228 .registration-desc {
228 .registration-desc {
229 border: 1px dotted gray;
229 border: 1px dotted gray;
230 background: #f5f5f5;
230 background: #f5f5f5;
231 padding: 5px;
231 padding: 5px;
232 margin: 10px 0;
232 margin: 10px 0;
233 font-size: 12px;
233 font-size: 12px;
234 line-height: 1.5em; }
234 line-height: 1.5em; }
235
235
236 .test-desc {
236 .test-desc {
237 border: 1px dotted gray;
237 border: 1px dotted gray;
238 background: #f5f5f5;
238 background: #f5f5f5;
239 padding: 5px;
239 padding: 5px;
240 margin: 10px 0;
240 margin: 10px 0;
241 font-size: 12px;
241 font-size: 12px;
242 line-height: 1.5em; }
242 line-height: 1.5em; }
243
243
244 .problem-list {
244 .problem-list {
245 width: 200px;
245 width: 200px;
246 float: left; }
246 float: left; }
247
247
248 .problem-bar {
248 .problem-bar {
249 margin-top: 5px;
249 margin-top: 5px;
250 padding: 5px;
250 padding: 5px;
251 background: #e0e0e0; }
251 background: #e0e0e0; }
252 .problem-bar span.problem-title {
252 .problem-bar span.problem-title {
253 font-weight: bold;
253 font-weight: bold;
254 font-size: 110%; }
254 font-size: 110%; }
255
255
256 .problem-content {
256 .problem-content {
257 float: left;
257 float: left;
258 margin-left: 10px;
258 margin-left: 10px;
259 width: 700px; }
259 width: 700px; }
260
260
261 .problem-panel {
261 .problem-panel {
262 border: 1px black solid;
262 border: 1px black solid;
263 padding: 5px; }
263 padding: 5px; }
264 .problem-panel .problem-form {
264 .problem-panel .problem-form {
265 border: 1px dotted #99aaee;
265 border: 1px dotted #99aaee;
266 background: #eeeeff; }
266 background: #eeeeff; }
267
267
268 .notice-bar {
268 .notice-bar {
269 margin-top: 3px;
269 margin-top: 3px;
270 margin-bottom: 3px;
270 margin-bottom: 3px;
271 text-align: center; }
271 text-align: center; }
272 .notice-bar span.notice {
272 .notice-bar span.notice {
273 color: white;
273 color: white;
274 font-weight: bold;
274 font-weight: bold;
275 background: #000070;
275 background: #000070;
276 padding: 3px 20px 3px 20px;
276 padding: 3px 20px 3px 20px;
277 -moz-border-radius: 2px;
277 -moz-border-radius: 2px;
278 -webkit-border-radius: 5px;
278 -webkit-border-radius: 5px;
279 border-radius: 5px; }
279 border-radius: 5px; }
280 +
281 + table.codejom-problems th {
282 + background: #000070;
283 + color: white; }
284 + table.codejom-problems td {
285 + width: 200px;
286 + vertical-align: top;
287 + text-align: center; }
288 + table.codejom-problems td.random-button {
289 + background: lightgrey; }
@@ -135,192 +135,204
135
135
136 th.uinfo
136 th.uinfo
137 background: lightgreen
137 background: lightgreen
138 vertical-align: top
138 vertical-align: top
139 text-align: right
139 text-align: right
140 border: 1px solid black
140 border: 1px solid black
141 padding: 5px
141 padding: 5px
142
142
143
143
144 .compilermsgbody
144 .compilermsgbody
145 font-family: monospace
145 font-family: monospace
146
146
147 .task-menu
147 .task-menu
148 text-align: center
148 text-align: center
149 font-size: 13px
149 font-size: 13px
150 line-height: 1.75em
150 line-height: 1.75em
151 font-weight: bold
151 font-weight: bold
152 border-top: 1px dashed gray
152 border-top: 1px dashed gray
153 border-bottom: 1px dashed gray
153 border-bottom: 1px dashed gray
154 margin-top: 2px
154 margin-top: 2px
155 margin-bottom: 4px
155 margin-bottom: 4px
156
156
157
157
158 table.taskdesc
158 table.taskdesc
159 border: 2px solid #dddddd
159 border: 2px solid #dddddd
160 border-collapse: collapse
160 border-collapse: collapse
161 margin: 10px auto
161 margin: 10px auto
162 width: 90%
162 width: 90%
163 font-size: 13px
163 font-size: 13px
164
164
165 p
165 p
166 font-size: 13px
166 font-size: 13px
167
167
168 tr.name
168 tr.name
169 border: 2px solid #dddddd
169 border: 2px solid #dddddd
170 background: #dddddd
170 background: #dddddd
171 color: #333333
171 color: #333333
172 font-weight: bold
172 font-weight: bold
173 font-size: 14px
173 font-size: 14px
174 line-height: 1.5em
174 line-height: 1.5em
175 text-align: center
175 text-align: center
176
176
177 td
177 td
178 &.desc-odd
178 &.desc-odd
179 padding: 5px
179 padding: 5px
180 padding-left: 20px
180 padding-left: 20px
181 background: #fefeee
181 background: #fefeee
182
182
183 &.desc-even
183 &.desc-even
184 padding: 5px
184 padding: 5px
185 padding-left: 20px
185 padding-left: 20px
186 background: #feeefe
186 background: #feeefe
187
187
188
188
189 .announcementbox
189 .announcementbox
190 margin: 10px 0px
190 margin: 10px 0px
191 background: #bbddee
191 background: #bbddee
192 padding: 1px
192 padding: 1px
193
193
194 span.title
194 span.title
195 font-weight: bold
195 font-weight: bold
196 color: #224455
196 color: #224455
197 padding-left: 10px
197 padding-left: 10px
198 line-height: 1.6em
198 line-height: 1.6em
199
199
200 .announcement
200 .announcement
201 margin: 2px
201 margin: 2px
202 background: white
202 background: white
203 padding: 1px
203 padding: 1px
204 padding-left: 10px
204 padding-left: 10px
205 padding-right: 10px
205 padding-right: 10px
206 padding-top: 5px
206 padding-top: 5px
207 padding-bottom: 5px
207 padding-bottom: 5px
208
208
209 p
209 p
210 font-size: 12px
210 font-size: 12px
211 margin: 2px
211 margin: 2px
212
212
213
213
214 .pub-info
214 .pub-info
215 text-align: right
215 text-align: right
216 font-style: italic
216 font-style: italic
217 font-size: 9px
217 font-size: 9px
218
218
219 p
219 p
220 text-align: right
220 text-align: right
221 font-style: italic
221 font-style: italic
222 font-size: 9px
222 font-size: 9px
223
223
224
224
225 .announcement
225 .announcement
226 .toggles
226 .toggles
227 font-weight: normal
227 font-weight: normal
228 float: right
228 float: right
229 font-size: 80%
229 font-size: 80%
230
230
231 .announcement-title
231 .announcement-title
232 font-weight: bold
232 font-weight: bold
233
233
234
234
235 .message
235 .message
236 margin: 10px 0 0
236 margin: 10px 0 0
237
237
238 .message
238 .message
239 margin: 0 0 0 30px
239 margin: 0 0 0 30px
240
240
241 .stat
241 .stat
242 font-size: 10px
242 font-size: 10px
243 line-height: 1.75em
243 line-height: 1.75em
244 padding: 0 5px
244 padding: 0 5px
245 color: #444444
245 color: #444444
246 background: #bbbbbb
246 background: #bbbbbb
247 font-weight: bold
247 font-weight: bold
248
248
249 .body
249 .body
250 border: 2px solid #dddddd
250 border: 2px solid #dddddd
251 background: #fff8f8
251 background: #fff8f8
252 padding-left: 5px
252 padding-left: 5px
253
253
254 .reply-body
254 .reply-body
255 border: 2px solid #bbbbbb
255 border: 2px solid #bbbbbb
256 background: #fffff8
256 background: #fffff8
257 padding-left: 5px
257 padding-left: 5px
258
258
259 .stat
259 .stat
260 font-size: 10px
260 font-size: 10px
261 line-height: 1.75em
261 line-height: 1.75em
262 padding: 0 5px
262 padding: 0 5px
263 color: #333333
263 color: #333333
264 background: #dddddd
264 background: #dddddd
265 font-weight: bold
265 font-weight: bold
266
266
267 .contest-title
267 .contest-title
268 color: white
268 color: white
269 text-align: center
269 text-align: center
270 line-height: 2em
270 line-height: 2em
271
271
272 .registration-desc
272 .registration-desc
273 border: 1px dotted gray
273 border: 1px dotted gray
274 background: #f5f5f5
274 background: #f5f5f5
275 padding: 5px
275 padding: 5px
276 margin: 10px 0
276 margin: 10px 0
277 font-size: 12px
277 font-size: 12px
278 line-height: 1.5em
278 line-height: 1.5em
279
279
280 .test-desc
280 .test-desc
281 border: 1px dotted gray
281 border: 1px dotted gray
282 background: #f5f5f5
282 background: #f5f5f5
283 padding: 5px
283 padding: 5px
284 margin: 10px 0
284 margin: 10px 0
285 font-size: 12px
285 font-size: 12px
286 line-height: 1.5em
286 line-height: 1.5em
287
287
288 .problem-list
288 .problem-list
289 width: 200px
289 width: 200px
290 float: left
290 float: left
291
291
292 .problem-bar
292 .problem-bar
293 margin-top: 5px
293 margin-top: 5px
294 padding: 5px
294 padding: 5px
295 background: #e0e0e0
295 background: #e0e0e0
296
296
297 span.problem-title
297 span.problem-title
298 font-weight: bold
298 font-weight: bold
299 font-size: 110%
299 font-size: 110%
300
300
301 .problem-content
301 .problem-content
302 float: left
302 float: left
303 margin-left: 10px
303 margin-left: 10px
304 width: 700px
304 width: 700px
305
305
306 .problem-panel
306 .problem-panel
307 border: 1px black solid
307 border: 1px black solid
308 padding: 5px
308 padding: 5px
309
309
310 .problem-form
310 .problem-form
311 border: 1px dotted #99aaee
311 border: 1px dotted #99aaee
312 background: #eeeeff
312 background: #eeeeff
313
313
314 .notice-bar
314 .notice-bar
315 margin-top: 3px
315 margin-top: 3px
316 margin-bottom: 3px
316 margin-bottom: 3px
317 text-align: center
317 text-align: center
318
318
319 span.notice
319 span.notice
320 color: white
320 color: white
321 font-weight: bold
321 font-weight: bold
322 background: #000070
322 background: #000070
323 padding: 3px 20px 3px 20px
323 padding: 3px 20px 3px 20px
324 -moz-border-radius: 2px
324 -moz-border-radius: 2px
325 -webkit-border-radius: 5px
325 -webkit-border-radius: 5px
326 border-radius: 5px
326 border-radius: 5px
327 +
328 + table.codejom-problems
329 + th
330 + background: #000070
331 + color: white
332 + td
333 + width: 200px
334 + vertical-align: top
335 + text-align: center
336 +
337 + &.random-button
338 + background: lightgrey No newline at end of file
You need to be logged in to leave comments. Login now