Description:
fixed new submission error showing nil compiler message
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r772:72eb3ebb9aef - - 1 file changed: 3 inserted, 1 deleted

@@ -38,49 +38,51
38 data: {confirm: "Submitting this source code for task #{@problem.long_name}?"}
38 data: {confirm: "Submitting this source code for task #{@problem.long_name}?"}
39 - # latest submission status
39 - # latest submission status
40 .panel{class: (@submission && @submission.graded_at) ? "panel-info" : "panel-warning"}
40 .panel{class: (@submission && @submission.graded_at) ? "panel-info" : "panel-warning"}
41 .panel-heading
41 .panel-heading
42 Latest Submission Status
42 Latest Submission Status
43 = link_to "Refresh",get_latest_submission_status_submissions_path(@submission.user,@problem), class: "btn btn-default btn-sm", remote: true if @submission
43 = link_to "Refresh",get_latest_submission_status_submissions_path(@submission.user,@problem), class: "btn btn-default btn-sm", remote: true if @submission
44 .panel-body
44 .panel-body
45 %div#latest_status
45 %div#latest_status
46 - if @submission
46 - if @submission
47 = render :partial => 'submission_short',
47 = render :partial => 'submission_short',
48 :locals => {submission: @submission, problem_name: @problem.name, problem_id: @problem.id }
48 :locals => {submission: @submission, problem_name: @problem.name, problem_id: @problem.id }
49 .row
49 .row
50 .col-md-12
50 .col-md-12
51 %h2 Console
51 %h2 Console
52 %textarea#console{style: 'height: 100%; width: 100%;background-color:#000;color:#fff;font-family: consolas, monaco, "Droid Sans Mono";',rows: 20}
52 %textarea#console{style: 'height: 100%; width: 100%;background-color:#000;color:#fff;font-family: consolas, monaco, "Droid Sans Mono";',rows: 20}
53
53
54 .modal.fade#compiler{tabindex: -1,role: 'dialog'}
54 .modal.fade#compiler{tabindex: -1,role: 'dialog'}
55 .modal-dialog.modal-lg{role:'document'}
55 .modal-dialog.modal-lg{role:'document'}
56 .modal-content
56 .modal-content
57 .modal-header
57 .modal-header
58 %button.close{type: 'button', data: {dismissed: :modal}, aria: {label: 'close'}}
58 %button.close{type: 'button', data: {dismissed: :modal}, aria: {label: 'close'}}
59 %span{aria: {hidden: 'true'}, data: {dismiss: 'modal'}} ×
59 %span{aria: {hidden: 'true'}, data: {dismiss: 'modal'}} ×
60 %h4 Compiler message
60 %h4 Compiler message
61 .modal-body
61 .modal-body
62 - %pre#compiler_msg= @submission.compiler_message
62 + %pre#compiler_msg
63 + - if @submission
64 + = @submission.compiler_message
63 .modal-footer
65 .modal-footer
64 %button.btn.btn-default{type: 'button', data: {dismiss: 'modal'}} Close
66 %button.btn.btn-default{type: 'button', data: {dismiss: 'modal'}} Close
65
67
66 :javascript
68 :javascript
67 $(document).ready(function() {
69 $(document).ready(function() {
68 e = ace.edit("editor")
70 e = ace.edit("editor")
69 e.setValue($("#text_sourcecode").val());
71 e.setValue($("#text_sourcecode").val());
70 e.gotoLine(1);
72 e.gotoLine(1);
71 $("#language_id").trigger('change');
73 $("#language_id").trigger('change');
72
74
73 $("#load_file").on('change',function(evt) {
75 $("#load_file").on('change',function(evt) {
74 var file = evt.target.files[0];
76 var file = evt.target.files[0];
75 var reader = new FileReader();
77 var reader = new FileReader();
76 reader.onload = function(theFile) {
78 reader.onload = function(theFile) {
77 var e = ace.edit("editor")
79 var e = ace.edit("editor")
78 e.setValue(theFile.target.result);
80 e.setValue(theFile.target.result);
79 e.gotoLine(1);
81 e.gotoLine(1);
80 };
82 };
81 reader.readAsText(file)
83 reader.readAsText(file)
82 });
84 });
83
85
84 //brython();
86 //brython();
85 });
87 });
86
88
You need to be logged in to leave comments. Login now