Description:
rename submission_view_log class don't log when admin is viewing
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r530:d41578f393ed - - 2 files changed: 3 inserted, 2 deleted

@@ -77,25 +77,26
77 lexer = case @submission.language.name
77 lexer = case @submission.language.name
78 when "c" then Rouge::Lexers::C.new
78 when "c" then Rouge::Lexers::C.new
79 when "cpp" then Rouge::Lexers::Cpp.new
79 when "cpp" then Rouge::Lexers::Cpp.new
80 when "pas" then Rouge::Lexers::Pas.new
80 when "pas" then Rouge::Lexers::Pas.new
81 when "ruby" then Rouge::Lexers::Ruby.new
81 when "ruby" then Rouge::Lexers::Ruby.new
82 when "python" then Rouge::Lexers::Python.new
82 when "python" then Rouge::Lexers::Python.new
83 when "java" then Rouge::Lexers::Java.new
83 when "java" then Rouge::Lexers::Java.new
84 when "php" then Rouge::Lexers::PHP.new
84 when "php" then Rouge::Lexers::PHP.new
85 end
85 end
86 @formatted_code = formatter.format(lexer.lex(@submission.source))
86 @formatted_code = formatter.format(lexer.lex(@submission.source))
87 @css_style = Rouge::Themes::ThankfulEyes.render(scope: '.highlight')
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 end
92 end
92
93
93 # various grader controls
94 # various grader controls
94
95
95 def stop
96 def stop
96 grader_proc = GraderProcess.find(params[:id])
97 grader_proc = GraderProcess.find(params[:id])
97 GraderScript.stop_grader(grader_proc.pid)
98 GraderScript.stop_grader(grader_proc.pid)
98 flash[:notice] = 'Grader stopped. It may not disappear now, but it should disappear shortly.'
99 flash[:notice] = 'Grader stopped. It may not disappear now, but it should disappear shortly.'
99 redirect_to :action => 'list'
100 redirect_to :action => 'list'
100 end
101 end
101
102
@@ -1,3 +1,3
1 - class SubmissionViewLogs < ActiveRecord::Base
1 + class SubmissionViewLog < ActiveRecord::Base
2 attr_accessible :submission_id, :user_id
2 attr_accessible :submission_id, :user_id
3 end
3 end
You need to be logged in to leave comments. Login now