Description:
redact user name on view submission
Commit status:
[Not Reviewed]
References:
merge algo
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r848:057622a7b534 - - 3 files changed: 24 inserted, 18 deleted

@@ -2,29 +2,31
2 = "-"
2 = "-"
3 - else
3 - else
4 %strong= "Submission ID:"
4 %strong= "Submission ID:"
5 = submission.id
5 = submission.id
6 %br
6 %br
7 - unless submission.graded_at
7 - unless submission.graded_at
8 %strong= t 'main.submitted_at:'
8 %strong= t 'main.submitted_at:'
9 = format_full_time_ago(submission.submitted_at.localtime)
9 = format_full_time_ago(submission.submitted_at.localtime)
10 - else
10 - else
11 %strong= t 'main.graded_at:'
11 %strong= t 'main.graded_at:'
12 = format_full_time_ago(submission.graded_at.localtime)
12 = format_full_time_ago(submission.graded_at.localtime)
13 %br
13 %br
14 - if GraderConfiguration['ui.show_score']
14 - if GraderConfiguration['ui.show_score']
15 %strong=t 'main.score'
15 %strong=t 'main.score'
16 = "#{(submission.points*100/submission.problem.full_score).to_i} "
16 = "#{(submission.points*100/submission.problem.full_score).to_i} "
17 = " ["
17 = " ["
18 %tt
18 %tt
19 = submission.grader_comment
19 = submission.grader_comment
20 = "]"
20 = "]"
21 %br
21 %br
22 %strong View:
22 %strong View:
23 - if GraderConfiguration.show_grading_result
23 - if GraderConfiguration.show_grading_result
24 = link_to '[detailed result]', :action => 'result', :id => submission.id
24 = link_to '[detailed result]', :action => 'result', :id => submission.id
25 - if submission.graded_at
25 - if submission.graded_at
26 - %button.btn.btn-info.btn-xs{type: 'button', data: {toggle: 'modal', target: '#compiler'}}
26 + = link_to "#{t 'main.cmp_msg'}", compiler_msg_submission_path(submission), {popup: true,remote: true,class: 'btn btn-xs btn-info'}
27 - =t 'main.cmp_msg'
27 + -#
28 + %button.btn.btn-info.btn-xs{type: 'button', data: {toggle: 'modal', target: '#compiler'}}
29 + =t 'main.cmp_msg'
28 = link_to "#{t 'main.src_link'}", download_submission_path(submission.id), class: 'btn btn-xs btn-info'
30 = link_to "#{t 'main.src_link'}", download_submission_path(submission.id), class: 'btn btn-xs btn-info'
29 = link_to "#{t 'main.submissions_link'}", problem_submissions_path(problem_id), class: 'btn btn-xs btn-info'
31 = link_to "#{t 'main.submissions_link'}", problem_submissions_path(problem_id), class: 'btn btn-xs btn-info'
30
32
@@ -27,60 +27,61
27 .form-group
27 .form-group
28 = label_tag 'Language:'
28 = label_tag 'Language:'
29 = select_tag 'language_id', options_from_collection_for_select(Language.all, 'id', 'pretty_name', @lang_id || @current_user.default_language || Language.find_by_pretty_name("Python").id || Language.first.id), class: 'form-control select', style: "width: 100px"
29 = select_tag 'language_id', options_from_collection_for_select(Language.all, 'id', 'pretty_name', @lang_id || @current_user.default_language || Language.find_by_pretty_name("Python").id || Language.first.id), class: 'form-control select', style: "width: 100px"
30 .form-group
30 .form-group
31 .input-group
31 .input-group
32 %span.input-group-btn
32 %span.input-group-btn
33 %span.btn.btn-default.btn-file
33 %span.btn.btn-default.btn-file
34 Browse
34 Browse
35 = file_field_tag 'load_file'
35 = file_field_tag 'load_file'
36 = text_field_tag '' , nil, {readonly: true, class: 'form-control'}
36 = text_field_tag '' , nil, {readonly: true, class: 'form-control'}
37 .form-group
37 .form-group
38 = submit_tag 'Submit', class: 'btn btn-success', id: 'live_submit',
38 = submit_tag 'Submit', class: 'btn btn-success', id: 'live_submit',
39 data: {confirm: "Submitting this source code for task #{@problem.long_name}?"}
39 data: {confirm: "Submitting this source code for task #{@problem.long_name}?"}
40 - # latest submission status
40 - # latest submission status
41 .panel{class: (@submission && @submission.graded_at) ? "panel-info" : "panel-warning"}
41 .panel{class: (@submission && @submission.graded_at) ? "panel-info" : "panel-warning"}
42 .panel-heading
42 .panel-heading
43 Latest Submission Status
43 Latest Submission Status
44 = link_to "Refresh",get_latest_submission_status_submissions_path(@submission.user,@problem), class: "btn btn-default btn-sm", remote: true if @submission
44 = link_to "Refresh",get_latest_submission_status_submissions_path(@submission.user,@problem), class: "btn btn-default btn-sm", remote: true if @submission
45 .panel-body
45 .panel-body
46 %div#latest_status
46 %div#latest_status
47 - if @submission
47 - if @submission
48 = render :partial => 'submission_short',
48 = render :partial => 'submission_short',
49 :locals => {submission: @submission, problem_name: @problem.name, problem_id: @problem.id }
49 :locals => {submission: @submission, problem_name: @problem.name, problem_id: @problem.id }
50
50
51 - - if @submission
51 + .modal.fade#compiler{tabindex: -1,role: 'dialog'}
52 - .modal.fade#compiler{tabindex: -1,role: 'dialog'}
52 + .modal-dialog.modal-lg{role:'document'}
53 - .modal-dialog.modal-lg{role:'document'}
53 + .modal-content
54 - .modal-content
54 + .modal-header
55 - .modal-header
55 + %button.close{type: 'button', data: {dismissed: :modal}, aria: {label: 'close'}}
56 - %button.close{type: 'button', data: {dismissed: :modal}, aria: {label: 'close'}}
56 + %span{aria: {hidden: 'true'}, data: {dismiss: 'modal'}} ×
57 - %span{aria: {hidden: 'true'}, data: {dismiss: 'modal'}} ×
57 + %h4 Compiler message
58 - %h4 Compiler message
58 + .modal-body
59 - .modal-body
59 + %pre#compiler_msg
60 - %pre#compiler_msg= @submission.compiler_message
60 + - if @submission
61 - .modal-footer
61 + = @submission.compiler_message
62 - %button.btn.btn-default{type: 'button', data: {dismiss: 'modal'}} Close
62 + .modal-footer
63 + %button.btn.btn-default{type: 'button', data: {dismiss: 'modal'}} Close
63
64
64 :javascript
65 :javascript
65 $(document).ready(function() {
66 $(document).ready(function() {
66 e = ace.edit("editor")
67 e = ace.edit("editor")
67 e.setValue($("#text_sourcecode").val());
68 e.setValue($("#text_sourcecode").val());
68 e.gotoLine(1);
69 e.gotoLine(1);
69 $("#language_id").trigger('change');
70 $("#language_id").trigger('change');
70
71
71 $("#load_file").on('change',function(evt) {
72 $("#load_file").on('change',function(evt) {
72 var file = evt.target.files[0];
73 var file = evt.target.files[0];
73 var reader = new FileReader();
74 var reader = new FileReader();
74 reader.onload = function(theFile) {
75 reader.onload = function(theFile) {
75 var e = ace.edit("editor")
76 var e = ace.edit("editor")
76 e.setValue(theFile.target.result);
77 e.setValue(theFile.target.result);
77 e.gotoLine(1);
78 e.gotoLine(1);
78 };
79 };
79 reader.readAsText(file)
80 reader.readAsText(file)
80 });
81 });
81
82
82 //brython();
83 //brython();
83 });
84 });
84
85
85
86
86
87
@@ -9,53 +9,56
9
9
10
10
11 .containter
11 .containter
12 .row
12 .row
13 .col-md-7
13 .col-md-7
14 %h2 Source Code
14 %h2 Source Code
15 .col-md-5
15 .col-md-5
16 %h2 Stat
16 %h2 Stat
17 .row
17 .row
18 .col-md-7
18 .col-md-7
19 %div#editor{ style: "font-size: 14px; height: 400px; border-radius:5px;" }
19 %div#editor{ style: "font-size: 14px; height: 400px; border-radius:5px;" }
20 :javascript
20 :javascript
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 @current_user.admin? ||@current_user == @submission.user
34 - = link_to "#{@submission.user.login}", stat_user_path(@submission.user)
34 + - if @submission.user
35 - = @submission.user.full_name
35 + = link_to "#{@submission.user.login}", stat_user_path(@submission.user)
36 + = @submission.user.full_name
37 + - else
38 + = "(n/a)"
36 - else
39 - else
37 - = "(n/a)"
40 + = '-- REDACTED --'
38 %tr
41 %tr
39 %td.text-right
42 %td.text-right
40 %strong Task
43 %strong Task
41 %td
44 %td
42 - if @submission.problem!=nil
45 - if @submission.problem!=nil
43 = link_to "[#{@submission.problem.name}]", stat_problem_path(@submission.problem)
46 = link_to "[#{@submission.problem.name}]", stat_problem_path(@submission.problem)
44 = @submission.problem.full_name
47 = @submission.problem.full_name
45 = link_to_description_if_any "[download] <span class='glyphicon glyphicon-file'></span>".html_safe, @submission.problem
48 = link_to_description_if_any "[download] <span class='glyphicon glyphicon-file'></span>".html_safe, @submission.problem
46 - else
49 - else
47 = "(n/a)"
50 = "(n/a)"
48 %tr
51 %tr
49 %td.text-right
52 %td.text-right
50 %strong Tries
53 %strong Tries
51 %td= @submission.number
54 %td= @submission.number
52 %tr
55 %tr
53 %td.text-right
56 %td.text-right
54 %strong Language
57 %strong Language
55 %td= @submission.language.pretty_name
58 %td= @submission.language.pretty_name
56 %tr
59 %tr
57 %td.text-right
60 %td.text-right
58 %strong Submitted
61 %strong Submitted
59 %td #{time_ago_in_words(@submission.submitted_at)} ago (at #{@submission.submitted_at.to_formatted_s(:long)})
62 %td #{time_ago_in_words(@submission.submitted_at)} ago (at #{@submission.submitted_at.to_formatted_s(:long)})
60 %tr
63 %tr
61 %td.text-right
64 %td.text-right
You need to be logged in to leave comments. Login now