Description:
add submission view loggin
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r529:32578781bde7 - - 3 files changed: 8 inserted, 2 deleted
@@ -0,0 +1,5 | |||
|
1 | + class AddLastIpToUser < ActiveRecord::Migration | |
|
2 | + def change | |
|
3 | + add_column :users, :last_ip, :string | |
|
4 | + end | |
|
5 | + end |
@@ -77,25 +77,25 | |||
|
77 | 77 | lexer = case @submission.language.name |
|
78 | 78 | when "c" then Rouge::Lexers::C.new |
|
79 | 79 | when "cpp" then Rouge::Lexers::Cpp.new |
|
80 | 80 | when "pas" then Rouge::Lexers::Pas.new |
|
81 | 81 | when "ruby" then Rouge::Lexers::Ruby.new |
|
82 | 82 | when "python" then Rouge::Lexers::Python.new |
|
83 | 83 | when "java" then Rouge::Lexers::Java.new |
|
84 | 84 | when "php" then Rouge::Lexers::PHP.new |
|
85 | 85 | end |
|
86 | 86 | @formatted_code = formatter.format(lexer.lex(@submission.source)) |
|
87 | 87 | @css_style = Rouge::Themes::ThankfulEyes.render(scope: '.highlight') |
|
88 | 88 | |
|
89 |
- Submission |
|
|
89 | + SubmissionViewLogs.create(user_id: session[:user_id],submission_id: @submission.id) | |
|
90 | 90 | |
|
91 | 91 | end |
|
92 | 92 | |
|
93 | 93 | # various grader controls |
|
94 | 94 | |
|
95 | 95 | def stop |
|
96 | 96 | grader_proc = GraderProcess.find(params[:id]) |
|
97 | 97 | GraderScript.stop_grader(grader_proc.pid) |
|
98 | 98 | flash[:notice] = 'Grader stopped. It may not disappear now, but it should disappear shortly.' |
|
99 | 99 | redirect_to :action => 'list' |
|
100 | 100 | end |
|
101 | 101 |
@@ -2,25 +2,25 | |||
|
2 | 2 | # This file is auto-generated from the current state of the database. Instead |
|
3 | 3 | # of editing this file, please use the migrations feature of Active Record to |
|
4 | 4 | # incrementally modify your database, and then regenerate this schema definition. |
|
5 | 5 | # |
|
6 | 6 | # Note that this schema.rb definition is the authoritative source for your |
|
7 | 7 | # database schema. If you need to create the application database on another |
|
8 | 8 | # system, you should be using db:schema:load, not running all the migrations |
|
9 | 9 | # from scratch. The latter is a flawed and unsustainable approach (the more migrations |
|
10 | 10 | # you'll amass, the slower it'll run and the greater likelihood for issues). |
|
11 | 11 | # |
|
12 | 12 | # It's strongly recommended to check this file into your version control system. |
|
13 | 13 | |
|
14 |
- ActiveRecord::Schema.define(:version => 20150827131 |
|
|
14 | + ActiveRecord::Schema.define(:version => 20150827133841) do | |
|
15 | 15 | |
|
16 | 16 | create_table "announcements", :force => true do |t| |
|
17 | 17 | t.string "author" |
|
18 | 18 | t.text "body", :limit => 16777215 |
|
19 | 19 | t.boolean "published" |
|
20 | 20 | t.datetime "created_at", :null => false |
|
21 | 21 | t.datetime "updated_at", :null => false |
|
22 | 22 | t.boolean "frontpage", :default => false |
|
23 | 23 | t.boolean "contest_only", :default => false |
|
24 | 24 | t.string "title" |
|
25 | 25 | t.string "notes" |
|
26 | 26 | end |
@@ -240,17 +240,18 | |||
|
240 | 240 | t.string "hashed_password" |
|
241 | 241 | t.string "salt", :limit => 5 |
|
242 | 242 | t.string "alias" |
|
243 | 243 | t.string "email" |
|
244 | 244 | t.integer "site_id" |
|
245 | 245 | t.integer "country_id" |
|
246 | 246 | t.boolean "activated", :default => false |
|
247 | 247 | t.datetime "created_at" |
|
248 | 248 | t.datetime "updated_at" |
|
249 | 249 | t.string "section" |
|
250 | 250 | t.boolean "enabled", :default => true |
|
251 | 251 | t.string "remark" |
|
252 | + t.string "last_ip" | |
|
252 | 253 | end |
|
253 | 254 | |
|
254 | 255 | add_index "users", ["login"], :name => "index_users_on_login", :unique => true |
|
255 | 256 | |
|
256 | 257 | end |
You need to be logged in to leave comments.
Login now