Description:
[web] added compiler message and submission links to main/list git-svn-id: http://theory.cpe.ku.ac.th/grader/web/trunk@147 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r70:d6fd1806794c - - 4 files changed: 25 inserted, 3 deleted

@@ -0,0 +1,6
1 + %h2= "Compiler message for submission \##{@submission.number}, task: #{@submission.problem.name}"
2 + %p
3 + - if @submission.compiler_message.chomp == ''
4 + no message
5 + - else
6 + = simple_format(@submission.compiler_message)
@@ -39,7 +39,7
39 redirect_to :action => 'list'
39 redirect_to :action => 'list'
40 end
40 end
41
41
42 - def get_source
42 + def source
43 submission = Submission.find(params[:id])
43 submission = Submission.find(params[:id])
44 if submission.user_id == session[:user_id]
44 if submission.user_id == session[:user_id]
45 fname = submission.problem.name + '.' + submission.language.ext
45 fname = submission.problem.name + '.' + submission.language.ext
@@ -52,6 +52,16
52 end
52 end
53 end
53 end
54
54
55 + def compiler_msg
56 + @submission = Submission.find(params[:id])
57 + if @submission.user_id == session[:user_id]
58 + render :action => 'compiler_msg', :layout => 'empty'
59 + else
60 + flash[:notice] = 'Error viewing source'
61 + redirect_to :action => 'list'
62 + end
63 + end
64 +
55 def submission
65 def submission
56 @user = User.find(session[:user_id])
66 @user = User.find(session[:user_id])
57 @problems = Problem.find_available_problems
67 @problems = Problem.find_available_problems
@@ -11,6 +11,8
11 </td>
11 </td>
12 <td>
12 <td>
13 <%= render :partial => 'submission_short',
13 <%= render :partial => 'submission_short',
14 - :locals => { :submission => @prob_submissions[problem_counter][:submission]} %>
14 + :locals => {
15 + :submission => @prob_submissions[problem_counter][:submission],
16 + :problem_name => problem.name }%>
15 </td>
17 </td>
16 </tr>
18 </tr>
@@ -10,4 +10,8
10 = "score: #{submission.points} "
10 = "score: #{submission.points} "
11 = " [" + submission.grader_comment + "]"
11 = " [" + submission.grader_comment + "]"
12 = " | "
12 = " | "
13 - = link_to('[source]',{:action => 'get_source', :id => submission.id})
13 + = link_to('[msg]', {:action => 'compiler_msg', :id => submission.id}, {:popup => true})
14 + = " | "
15 + = link_to('[source]',{:action => 'source', :id => submission.id})
16 + = " | "
17 + = link_to '[submissions]', :action => 'submission', :id => problem_name
You need to be logged in to leave comments. Login now