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:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
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 | 39 | redirect_to :action => 'list' |
|
40 | 40 | end |
|
41 | 41 | |
|
42 |
- def |
|
|
42 | + def source | |
|
43 | 43 | submission = Submission.find(params[:id]) |
|
44 | 44 | if submission.user_id == session[:user_id] |
|
45 | 45 | fname = submission.problem.name + '.' + submission.language.ext |
@@ -52,6 +52,16 | |||
|
52 | 52 | end |
|
53 | 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 | 65 | def submission |
|
56 | 66 | @user = User.find(session[:user_id]) |
|
57 | 67 | @problems = Problem.find_available_problems |
@@ -11,6 +11,8 | |||
|
11 | 11 | </td> |
|
12 | 12 | <td> |
|
13 | 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 | 17 | </td> |
|
16 | 18 | </tr> |
@@ -9,5 +9,9 | |||
|
9 | 9 | = "Graded at #{format_short_time(submission.graded_at)}, " |
|
10 | 10 | = "score: #{submission.points} " |
|
11 | 11 | = " [" + submission.grader_comment + "]" |
|
12 | + = " | " | |
|
13 | + = link_to('[msg]', {:action => 'compiler_msg', :id => submission.id}, {:popup => true}) | |
|
12 | 14 | = " | " |
|
13 |
- = link_to('[source]',{:action => ' |
|
|
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