Description:
fix show submission where problem is nil
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r646:43781dd1b0bd - - 1 file changed: 1 inserted, 1 deleted

@@ -21,92 +21,92
21 e = ace.edit("editor")
21 e = ace.edit("editor")
22 e.setOptions({ maxLines: Infinity })
22 e.setOptions({ maxLines: Infinity })
23 e.setValue($("#data").text())
23 e.setValue($("#data").text())
24 e.gotoLine(1)
24 e.gotoLine(1)
25 e.getSession().setMode("#{get_ace_mode(@submission.language)}")
25 e.getSession().setMode("#{get_ace_mode(@submission.language)}")
26 e.setReadOnly(true)
26 e.setReadOnly(true)
27 .col-md-5
27 .col-md-5
28 %table.table.table-striped
28 %table.table.table-striped
29 %tr
29 %tr
30 %td.text-right
30 %td.text-right
31 %strong User
31 %strong User
32 %td
32 %td
33 - if @submission.user
33 - if @submission.user
34 = link_to "#{@submission.user.login}", stat_user_path(@submission.user)
34 = link_to "#{@submission.user.login}", stat_user_path(@submission.user)
35 = @submission.user.full_name
35 = @submission.user.full_name
36 - else
36 - else
37 = "(n/a)"
37 = "(n/a)"
38 %tr
38 %tr
39 %td.text-right
39 %td.text-right
40 %strong Task
40 %strong Task
41 %td
41 %td
42 - if @submission.problem!=nil
42 - if @submission.problem!=nil
43 = link_to "[#{@submission.problem.name}]", stat_problem_path(@submission.problem)
43 = link_to "[#{@submission.problem.name}]", stat_problem_path(@submission.problem)
44 = @submission.problem.full_name
44 = @submission.problem.full_name
45 - else
45 - else
46 = "(n/a)"
46 = "(n/a)"
47 %tr
47 %tr
48 %td.text-right
48 %td.text-right
49 %strong Tries
49 %strong Tries
50 %td= @submission.number
50 %td= @submission.number
51 %tr
51 %tr
52 %td.text-right
52 %td.text-right
53 %strong Language
53 %strong Language
54 %td= @submission.language.pretty_name
54 %td= @submission.language.pretty_name
55 %tr
55 %tr
56 %td.text-right
56 %td.text-right
57 %strong Submitted
57 %strong Submitted
58 %td #{time_ago_in_words(@submission.submitted_at)} ago (at #{@submission.submitted_at.to_formatted_s(:long)})
58 %td #{time_ago_in_words(@submission.submitted_at)} ago (at #{@submission.submitted_at.to_formatted_s(:long)})
59 %tr
59 %tr
60 %td.text-right
60 %td.text-right
61 %strong Graded
61 %strong Graded
62 - if @submission.graded_at
62 - if @submission.graded_at
63 %td #{time_ago_in_words(@submission.graded_at)} ago (at #{@submission.graded_at.to_formatted_s(:long)})
63 %td #{time_ago_in_words(@submission.graded_at)} ago (at #{@submission.graded_at.to_formatted_s(:long)})
64 - else
64 - else
65 %td -
65 %td -
66 %tr
66 %tr
67 %td.text-right
67 %td.text-right
68 %strong Points
68 %strong Points
69 - %td #{@submission.points}/#{@submission.problem.full_score}
69 + %td #{@submission.points}/#{@submission.try(:problem).try(:full_score)}
70 %tr
70 %tr
71 %td.text-right
71 %td.text-right
72 %strong Comment
72 %strong Comment
73 %td #{@submission.grader_comment}
73 %td #{@submission.grader_comment}
74 %tr
74 %tr
75 %td.text-right
75 %td.text-right
76 %strong Runtime (s)
76 %strong Runtime (s)
77 %td #{@submission.max_runtime}
77 %td #{@submission.max_runtime}
78 %tr
78 %tr
79 %td.text-right
79 %td.text-right
80 %strong Memory (kb)
80 %strong Memory (kb)
81 %td #{@submission.peak_memory}
81 %td #{@submission.peak_memory}
82 %tr
82 %tr
83 %td.text-right
83 %td.text-right
84 %strong Compiler result
84 %strong Compiler result
85 %td
85 %td
86 %button.btn.btn-info.btn-xs{type: 'button', data: {toggle: 'modal', target: '#compiler'}}
86 %button.btn.btn-info.btn-xs{type: 'button', data: {toggle: 'modal', target: '#compiler'}}
87 view
87 view
88 - if session[:admin]
88 - if session[:admin]
89 %tr
89 %tr
90 %td.text-right
90 %td.text-right
91 %strong IP
91 %strong IP
92 %td #{@submission.ip_address}
92 %td #{@submission.ip_address}
93 %tr
93 %tr
94 %td.text-right
94 %td.text-right
95 %strong Grading Task Status
95 %strong Grading Task Status
96 %td
96 %td
97 = @task.status_str if @task
97 = @task.status_str if @task
98 - if session[:admin]
98 - if session[:admin]
99 = link_to "rejudge", rejudge_submission_path, data: {remote: true}, class: 'btn btn-info btn-xs'
99 = link_to "rejudge", rejudge_submission_path, data: {remote: true}, class: 'btn btn-info btn-xs'
100
100
101
101
102 .modal.fade#compiler{tabindex: -1,role: 'dialog'}
102 .modal.fade#compiler{tabindex: -1,role: 'dialog'}
103 .modal-dialog.modal-lg{role:'document'}
103 .modal-dialog.modal-lg{role:'document'}
104 .modal-content
104 .modal-content
105 .modal-header
105 .modal-header
106 %button.close{type: 'button', data: {dismissed: :modal}, aria: {label: 'close'}}
106 %button.close{type: 'button', data: {dismissed: :modal}, aria: {label: 'close'}}
107 %span{aria: {hidden: 'true'}, data: {dismiss: 'modal'}} ×
107 %span{aria: {hidden: 'true'}, data: {dismiss: 'modal'}} ×
108 %h4 Compiler message
108 %h4 Compiler message
109 .modal-body
109 .modal-body
110 %pre#compiler_msg= @submission.compiler_message
110 %pre#compiler_msg= @submission.compiler_message
111 .modal-footer
111 .modal-footer
112 %button.btn.btn-default{type: 'button', data: {dismiss: 'modal'}} Close
112 %button.btn.btn-default{type: 'button', data: {dismiss: 'modal'}} Close
You need to be logged in to leave comments. Login now