Description:
add remark and enable for user
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r476:4ff0dd0be8a1 - - 3 files changed: 11 inserted, 1 deleted
@@ -0,0 +1,6 | |||||
|
|
1 | + class AddMoreToUsers < ActiveRecord::Migration | ||
|
|
2 | + def change | ||
|
|
3 | + add_column :users, :enabled, :boolean, default: 1 | ||
|
|
4 | + add_column :users, :remark, :string | ||
|
|
5 | + end | ||
|
|
6 | + end |
@@ -1,57 +1,59 | |||||
|
1 | - content_for :header do |
|
1 | - content_for :header do |
|
2 | = javascript_include_tag 'local_jquery' |
|
2 | = javascript_include_tag 'local_jquery' |
|
3 | = stylesheet_link_tag 'tablesorter-theme.cafe' |
|
3 | = stylesheet_link_tag 'tablesorter-theme.cafe' |
|
4 |
|
4 | ||
|
5 | %script{:type=>"text/javascript"} |
|
5 | %script{:type=>"text/javascript"} |
|
6 | $(function () { |
|
6 | $(function () { |
|
7 | $('#since_datetime').datetimepicker({ showButtonPanel: true, dateFormat: "yy-mm-dd", controlType: "slider"} ); |
|
7 | $('#since_datetime').datetimepicker({ showButtonPanel: true, dateFormat: "yy-mm-dd", controlType: "slider"} ); |
|
8 | $('#until_datetime').datetimepicker({ showButtonPanel: true, dateFormat: "yy-mm-dd", controlType: "slider"} ); |
|
8 | $('#until_datetime').datetimepicker({ showButtonPanel: true, dateFormat: "yy-mm-dd", controlType: "slider"} ); |
|
9 | $('#my_table').tablesorter({widgets: ['zebra']}); |
|
9 | $('#my_table').tablesorter({widgets: ['zebra']}); |
|
10 | }); |
|
10 | }); |
|
11 |
|
11 | ||
|
12 | %h1 User grading results |
|
12 | %h1 User grading results |
|
13 | %h2= params[:action] == 'user_stat' ? "Show scores from latest submission" : "Show max scores in submission range" |
|
13 | %h2= params[:action] == 'user_stat' ? "Show scores from latest submission" : "Show max scores in submission range" |
|
14 |
|
14 | ||
|
15 |
|
15 | ||
|
16 | - if @problem and @problem.errors |
|
16 | - if @problem and @problem.errors |
|
17 | =error_messages_for 'problem' |
|
17 | =error_messages_for 'problem' |
|
18 |
|
18 | ||
|
19 | = render partial: 'submission_range' |
|
19 | = render partial: 'submission_range' |
|
20 |
|
20 | ||
|
21 | - if params[:action] == 'user_stat' |
|
21 | - if params[:action] == 'user_stat' |
|
22 | %h3 Latest score |
|
22 | %h3 Latest score |
|
23 | = link_to '[download csv with all problems]', controller: :user_admin, action: :user_stat, commit: 'download csv' |
|
23 | = link_to '[download csv with all problems]', controller: :user_admin, action: :user_stat, commit: 'download csv' |
|
24 | - else |
|
24 | - else |
|
25 | %h3 Max score |
|
25 | %h3 Max score |
|
26 | = link_to '[Show only latest submissions]', controller: :user_admin, action: :user_stat |
|
26 | = link_to '[Show only latest submissions]', controller: :user_admin, action: :user_stat |
|
27 | = link_to '[download csv with all problems]', controller: :user_admin, action: :user_stat_max, commit: 'download csv' |
|
27 | = link_to '[download csv with all problems]', controller: :user_admin, action: :user_stat_max, commit: 'download csv' |
|
28 |
|
28 | ||
|
29 | %table.tablesorter-cafe#my_table |
|
29 | %table.tablesorter-cafe#my_table |
|
30 | %thead |
|
30 | %thead |
|
31 | %tr |
|
31 | %tr |
|
32 | %th User |
|
32 | %th User |
|
33 | %th Name |
|
33 | %th Name |
|
34 | %th Activated? |
|
34 | %th Activated? |
|
35 | %th Logged in |
|
35 | %th Logged in |
|
36 | %th Contest(s) |
|
36 | %th Contest(s) |
|
|
37 | + %th Remark | ||
|
37 | - @problems.each do |p| |
|
38 | - @problems.each do |p| |
|
38 | %th= p.name |
|
39 | %th= p.name |
|
39 | %th Total |
|
40 | %th Total |
|
40 | %th Passed |
|
41 | %th Passed |
|
41 | %tbody |
|
42 | %tbody |
|
42 | - @scorearray.each do |sc| |
|
43 | - @scorearray.each do |sc| |
|
43 | %tr{class: cycle('info-even','info-odd')} |
|
44 | %tr{class: cycle('info-even','info-odd')} |
|
44 | - total,num_passed = 0,0 |
|
45 | - total,num_passed = 0,0 |
|
45 | - sc.each_index do |i| |
|
46 | - sc.each_index do |i| |
|
46 | - if i == 0 |
|
47 | - if i == 0 |
|
47 | %td= link_to sc[i].login, controller: 'users', action: 'profile', id: sc[i] |
|
48 | %td= link_to sc[i].login, controller: 'users', action: 'profile', id: sc[i] |
|
48 | %td= sc[i].full_name |
|
49 | %td= sc[i].full_name |
|
49 | %td= sc[i].activated |
|
50 | %td= sc[i].activated |
|
50 | %td= sc[i].try(:contest_stat).try(:started_at)!=nil ? 'yes' : 'no' |
|
51 | %td= sc[i].try(:contest_stat).try(:started_at)!=nil ? 'yes' : 'no' |
|
51 | %td= sc[i].contests.collect {|c| c.name}.join(', ') |
|
52 | %td= sc[i].contests.collect {|c| c.name}.join(', ') |
|
|
53 | + %td= sc[i].remark | ||
|
52 | - else |
|
54 | - else |
|
53 | %td= sc[i][0] |
|
55 | %td= sc[i][0] |
|
54 | - total += sc[i][0] |
|
56 | - total += sc[i][0] |
|
55 | - num_passed += 1 if sc[i][1] |
|
57 | - num_passed += 1 if sc[i][1] |
|
56 | %td= total |
|
58 | %td= total |
|
57 | %td= num_passed |
|
59 | %td= num_passed |
@@ -1,62 +1,62 | |||||
|
1 | # encoding: UTF-8 |
|
1 | # encoding: UTF-8 |
|
2 | # This file is auto-generated from the current state of the database. Instead |
|
2 | # This file is auto-generated from the current state of the database. Instead |
|
3 | # of editing this file, please use the migrations feature of Active Record to |
|
3 | # of editing this file, please use the migrations feature of Active Record to |
|
4 | # incrementally modify your database, and then regenerate this schema definition. |
|
4 | # incrementally modify your database, and then regenerate this schema definition. |
|
5 | # |
|
5 | # |
|
6 | # Note that this schema.rb definition is the authoritative source for your |
|
6 | # Note that this schema.rb definition is the authoritative source for your |
|
7 | # database schema. If you need to create the application database on another |
|
7 | # database schema. If you need to create the application database on another |
|
8 | # system, you should be using db:schema:load, not running all the migrations |
|
8 | # system, you should be using db:schema:load, not running all the migrations |
|
9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations |
|
9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations |
|
10 | # you'll amass, the slower it'll run and the greater likelihood for issues). |
|
10 | # you'll amass, the slower it'll run and the greater likelihood for issues). |
|
11 | # |
|
11 | # |
|
12 | # It's strongly recommended to check this file into your version control system. |
|
12 | # It's strongly recommended to check this file into your version control system. |
|
13 |
|
13 | ||
|
14 |
- ActiveRecord::Schema.define(:version => 201 |
|
14 | + ActiveRecord::Schema.define(:version => 20150203153534) do |
|
15 |
|
15 | ||
|
16 | create_table "announcements", :force => true do |t| |
|
16 | create_table "announcements", :force => true do |t| |
|
17 | t.string "author" |
|
17 | t.string "author" |
|
18 | t.text "body" |
|
18 | t.text "body" |
|
19 | t.boolean "published" |
|
19 | t.boolean "published" |
|
20 | t.datetime "created_at", :null => false |
|
20 | t.datetime "created_at", :null => false |
|
21 | t.datetime "updated_at", :null => false |
|
21 | t.datetime "updated_at", :null => false |
|
22 | t.boolean "frontpage", :default => false |
|
22 | t.boolean "frontpage", :default => false |
|
23 | t.boolean "contest_only", :default => false |
|
23 | t.boolean "contest_only", :default => false |
|
24 | t.string "title" |
|
24 | t.string "title" |
|
25 | t.string "notes" |
|
25 | t.string "notes" |
|
26 | end |
|
26 | end |
|
27 |
|
27 | ||
|
28 | create_table "contests", :force => true do |t| |
|
28 | create_table "contests", :force => true do |t| |
|
29 | t.string "title" |
|
29 | t.string "title" |
|
30 | t.boolean "enabled" |
|
30 | t.boolean "enabled" |
|
31 | t.datetime "created_at", :null => false |
|
31 | t.datetime "created_at", :null => false |
|
32 | t.datetime "updated_at", :null => false |
|
32 | t.datetime "updated_at", :null => false |
|
33 | t.string "name" |
|
33 | t.string "name" |
|
34 | end |
|
34 | end |
|
35 |
|
35 | ||
|
36 | create_table "contests_problems", :id => false, :force => true do |t| |
|
36 | create_table "contests_problems", :id => false, :force => true do |t| |
|
37 | t.integer "contest_id" |
|
37 | t.integer "contest_id" |
|
38 | t.integer "problem_id" |
|
38 | t.integer "problem_id" |
|
39 | end |
|
39 | end |
|
40 |
|
40 | ||
|
41 | create_table "contests_users", :id => false, :force => true do |t| |
|
41 | create_table "contests_users", :id => false, :force => true do |t| |
|
42 | t.integer "contest_id" |
|
42 | t.integer "contest_id" |
|
43 | t.integer "user_id" |
|
43 | t.integer "user_id" |
|
44 | end |
|
44 | end |
|
45 |
|
45 | ||
|
46 | create_table "countries", :force => true do |t| |
|
46 | create_table "countries", :force => true do |t| |
|
47 | t.string "name" |
|
47 | t.string "name" |
|
48 | t.datetime "created_at", :null => false |
|
48 | t.datetime "created_at", :null => false |
|
49 | t.datetime "updated_at", :null => false |
|
49 | t.datetime "updated_at", :null => false |
|
50 | end |
|
50 | end |
|
51 |
|
51 | ||
|
52 | create_table "descriptions", :force => true do |t| |
|
52 | create_table "descriptions", :force => true do |t| |
|
53 | t.text "body" |
|
53 | t.text "body" |
|
54 | t.boolean "markdowned" |
|
54 | t.boolean "markdowned" |
|
55 | t.datetime "created_at", :null => false |
|
55 | t.datetime "created_at", :null => false |
|
56 | t.datetime "updated_at", :null => false |
|
56 | t.datetime "updated_at", :null => false |
|
57 | end |
|
57 | end |
|
58 |
|
58 | ||
|
59 | create_table "grader_configurations", :force => true do |t| |
|
59 | create_table "grader_configurations", :force => true do |t| |
|
60 | t.string "key" |
|
60 | t.string "key" |
|
61 | t.string "value_type" |
|
61 | t.string "value_type" |
|
62 | t.string "value" |
|
62 | t.string "value" |
@@ -194,53 +194,55 | |||||
|
194 | t.text "input", :limit => 16777215 |
|
194 | t.text "input", :limit => 16777215 |
|
195 | t.text "solution", :limit => 16777215 |
|
195 | t.text "solution", :limit => 16777215 |
|
196 | t.datetime "created_at", :null => false |
|
196 | t.datetime "created_at", :null => false |
|
197 | t.datetime "updated_at", :null => false |
|
197 | t.datetime "updated_at", :null => false |
|
198 | end |
|
198 | end |
|
199 |
|
199 | ||
|
200 | create_table "test_requests", :force => true do |t| |
|
200 | create_table "test_requests", :force => true do |t| |
|
201 | t.integer "user_id" |
|
201 | t.integer "user_id" |
|
202 | t.integer "problem_id" |
|
202 | t.integer "problem_id" |
|
203 | t.integer "submission_id" |
|
203 | t.integer "submission_id" |
|
204 | t.string "input_file_name" |
|
204 | t.string "input_file_name" |
|
205 | t.string "output_file_name" |
|
205 | t.string "output_file_name" |
|
206 | t.string "running_stat" |
|
206 | t.string "running_stat" |
|
207 | t.integer "status" |
|
207 | t.integer "status" |
|
208 | t.datetime "updated_at", :null => false |
|
208 | t.datetime "updated_at", :null => false |
|
209 | t.datetime "submitted_at" |
|
209 | t.datetime "submitted_at" |
|
210 | t.datetime "compiled_at" |
|
210 | t.datetime "compiled_at" |
|
211 | t.text "compiler_message" |
|
211 | t.text "compiler_message" |
|
212 | t.datetime "graded_at" |
|
212 | t.datetime "graded_at" |
|
213 | t.string "grader_comment" |
|
213 | t.string "grader_comment" |
|
214 | t.datetime "created_at", :null => false |
|
214 | t.datetime "created_at", :null => false |
|
215 | t.float "running_time" |
|
215 | t.float "running_time" |
|
216 | t.string "exit_status" |
|
216 | t.string "exit_status" |
|
217 | t.integer "memory_usage" |
|
217 | t.integer "memory_usage" |
|
218 | end |
|
218 | end |
|
219 |
|
219 | ||
|
220 | add_index "test_requests", ["user_id", "problem_id"], :name => "index_test_requests_on_user_id_and_problem_id" |
|
220 | add_index "test_requests", ["user_id", "problem_id"], :name => "index_test_requests_on_user_id_and_problem_id" |
|
221 |
|
221 | ||
|
222 | create_table "user_contest_stats", :force => true do |t| |
|
222 | create_table "user_contest_stats", :force => true do |t| |
|
223 | t.integer "user_id" |
|
223 | t.integer "user_id" |
|
224 | t.datetime "started_at" |
|
224 | t.datetime "started_at" |
|
225 | t.datetime "created_at", :null => false |
|
225 | t.datetime "created_at", :null => false |
|
226 | t.datetime "updated_at", :null => false |
|
226 | t.datetime "updated_at", :null => false |
|
227 | t.boolean "forced_logout" |
|
227 | t.boolean "forced_logout" |
|
228 | end |
|
228 | end |
|
229 |
|
229 | ||
|
230 | create_table "users", :force => true do |t| |
|
230 | create_table "users", :force => true do |t| |
|
231 | t.string "login", :limit => 50 |
|
231 | t.string "login", :limit => 50 |
|
232 | t.string "full_name" |
|
232 | t.string "full_name" |
|
233 | t.string "hashed_password" |
|
233 | t.string "hashed_password" |
|
234 | t.string "salt", :limit => 5 |
|
234 | t.string "salt", :limit => 5 |
|
235 | t.string "alias" |
|
235 | t.string "alias" |
|
236 | t.string "email" |
|
236 | t.string "email" |
|
237 | t.integer "site_id" |
|
237 | t.integer "site_id" |
|
238 | t.integer "country_id" |
|
238 | t.integer "country_id" |
|
239 | t.boolean "activated", :default => false |
|
239 | t.boolean "activated", :default => false |
|
240 | t.datetime "created_at" |
|
240 | t.datetime "created_at" |
|
241 | t.datetime "updated_at" |
|
241 | t.datetime "updated_at" |
|
|
242 | + t.boolean "enabled", :default => true | ||
|
|
243 | + t.string "remark" | ||
|
242 | end |
|
244 | end |
|
243 |
|
245 | ||
|
244 | add_index "users", ["login"], :name => "index_users_on_login", :unique => true |
|
246 | add_index "users", ["login"], :name => "index_users_on_login", :unique => true |
|
245 |
|
247 | ||
|
246 | end |
|
248 | end |
You need to be logged in to leave comments.
Login now