Description:
rename submission_view_log class
don't log when admin is viewing
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r530:d41578f393ed - - 2 files changed: 3 inserted, 2 deleted
@@ -77,25 +77,26 | |||
|
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 | - SubmissionViewLogs.create(user_id: session[:user_id],submission_id: @submission.id) | |
|
89 | + user = User.find(session[:user_id]) | |
|
90 | + SubmissionViewLog.create(user_id: session[:user_id],submission_id: @submission.id) unless user.admin? | |
|
90 | 91 | |
|
91 | 92 | end |
|
92 | 93 | |
|
93 | 94 | # various grader controls |
|
94 | 95 | |
|
95 | 96 | def stop |
|
96 | 97 | grader_proc = GraderProcess.find(params[:id]) |
|
97 | 98 | GraderScript.stop_grader(grader_proc.pid) |
|
98 | 99 | flash[:notice] = 'Grader stopped. It may not disappear now, but it should disappear shortly.' |
|
99 | 100 | redirect_to :action => 'list' |
|
100 | 101 | end |
|
101 | 102 |
You need to be logged in to leave comments.
Login now