Description:
still upgrading
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r753:9918c6e0c313 - - 6 files changed: 26 inserted, 17 deleted
@@ -66,14 +66,14 | |||||
|
66 | @problem = Problem.find(params[:id]) |
|
66 | @problem = Problem.find(params[:id]) |
|
67 | @description = @problem.description |
|
67 | @description = @problem.description |
|
68 | if @description.nil? and params[:description][:body]!='' |
|
68 | if @description.nil? and params[:description][:body]!='' |
|
69 |
- @description = Description.new( |
|
69 | + @description = Description.new(description_params) |
|
70 | if !@description.save |
|
70 | if !@description.save |
|
71 | flash[:notice] = 'Error saving description' |
|
71 | flash[:notice] = 'Error saving description' |
|
72 | render :action => 'edit' and return |
|
72 | render :action => 'edit' and return |
|
73 | end |
|
73 | end |
|
74 | @problem.description = @description |
|
74 | @problem.description = @description |
|
75 | elsif @description |
|
75 | elsif @description |
|
76 |
- if !@description.update_attributes( |
|
76 | + if !@description.update_attributes(description_params) |
|
77 | flash[:notice] = 'Error saving description' |
|
77 | flash[:notice] = 'Error saving description' |
|
78 | render :action => 'edit' and return |
|
78 | render :action => 'edit' and return |
|
79 | end |
|
79 | end |
@@ -301,4 +301,8 | |||||
|
301 | params.require(:problem).permit(:name, :full_name, :full_score, :change_date_added, :date_added, :available, :test_allowed,:output_only, :url, :description, tag_ids:[]) |
|
301 | params.require(:problem).permit(:name, :full_name, :full_score, :change_date_added, :date_added, :available, :test_allowed,:output_only, :url, :description, tag_ids:[]) |
|
302 | end |
|
302 | end |
|
303 |
|
303 | ||
|
|
304 | + def description_params | ||
|
|
305 | + params.require(:description).permit(:body, :markdown) | ||
|
|
306 | + end | ||
|
|
307 | + | ||
|
304 | end |
|
308 | end |
@@ -27,7 +27,7 | |||||
|
27 | belongs_to :site |
|
27 | belongs_to :site |
|
28 | belongs_to :country |
|
28 | belongs_to :country |
|
29 |
|
29 | ||
|
30 |
- has_and_belongs_to_many :contests, -> { order(:name) |
|
30 | + has_and_belongs_to_many :contests, -> { order(:name)} |
|
31 |
|
31 | ||
|
32 | scope :activated_users, -> {where activated: true} |
|
32 | scope :activated_users, -> {where activated: true} |
|
33 |
|
33 | ||
@@ -173,7 +173,7 | |||||
|
173 | return false if site==nil |
|
173 | return false if site==nil |
|
174 | return site.finished? |
|
174 | return site.finished? |
|
175 | elsif GraderConfiguration.indv_contest_mode? |
|
175 | elsif GraderConfiguration.indv_contest_mode? |
|
176 |
- return false if self.contest_stat |
|
176 | + return false if self.contest_stat==nil |
|
177 | return contest_time_left == 0 |
|
177 | return contest_time_left == 0 |
|
178 | else |
|
178 | else |
|
179 | return false |
|
179 | return false |
@@ -8,7 +8,8 | |||||
|
8 | - if @problem and @problem.errors |
|
8 | - if @problem and @problem.errors |
|
9 | =error_messages_for 'problem' |
|
9 | =error_messages_for 'problem' |
|
10 |
|
10 | ||
|
11 |
- = |
|
11 | + = simple_form_for :problem, url: do_import_problems_path, :multipart => true do |f| |
|
|
12 | + | ||
|
12 | .submitbox |
|
13 | .submitbox |
|
13 | %table |
|
14 | %table |
|
14 | %tr |
|
15 | %tr |
@@ -1,6 +1,6 | |||||
|
1 | %h1 Maximum score |
|
1 | %h1 Maximum score |
|
2 |
|
2 | ||
|
3 |
- = form_tag |
|
3 | + = form_tag show_max_score_report_path |
|
4 | .row |
|
4 | .row |
|
5 | .col-md-4 |
|
5 | .col-md-4 |
|
6 | .panel.panel-primary |
|
6 | .panel.panel-primary |
@@ -51,17 +51,18 | |||||
|
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 | + - if @submission |
|
55 | - .modal-dialog.modal-lg{role:'document'} |
|
55 | + .modal.fade#compiler{tabindex: -1,role: 'dialog'} |
|
56 | - .modal-content |
|
56 | + .modal-dialog.modal-lg{role:'document'} |
|
57 |
- .modal- |
|
57 | + .modal-content |
|
58 | - %button.close{type: 'button', data: {dismissed: :modal}, aria: {label: 'close'}} |
|
58 | + .modal-header |
|
59 | - %span{aria: {hidden: 'true'}, data: {dismiss: 'modal'}} × |
|
59 | + %button.close{type: 'button', data: {dismissed: :modal}, aria: {label: 'close'}} |
|
60 | - %h4 Compiler message |
|
60 | + %span{aria: {hidden: 'true'}, data: {dismiss: 'modal'}} × |
|
61 | - .modal-body |
|
61 | + %h4 Compiler message |
|
62 | - %pre#compiler_msg= @submission.compiler_message |
|
62 | + .modal-body |
|
63 | - .modal-footer |
|
63 | + %pre#compiler_msg= @submission.compiler_message |
|
64 | - %button.btn.btn-default{type: 'button', data: {dismiss: 'modal'}} Close |
|
64 | + .modal-footer |
|
|
65 | + %button.btn.btn-default{type: 'button', data: {dismiss: 'modal'}} Close | ||
|
65 |
|
66 | ||
|
66 | :javascript |
|
67 | :javascript |
|
67 | $(document).ready(function() { |
|
68 | $(document).ready(function() { |
@@ -40,6 +40,7 | |||||
|
40 | get 'manage' |
|
40 | get 'manage' |
|
41 | get 'quick_create' |
|
41 | get 'quick_create' |
|
42 | post 'do_manage' |
|
42 | post 'do_manage' |
|
|
43 | + post 'do_import' | ||
|
43 | end |
|
44 | end |
|
44 | end |
|
45 | end |
|
45 |
|
46 | ||
@@ -81,6 +82,7 | |||||
|
81 | get 'download' |
|
82 | get 'download' |
|
82 | get 'compiler_msg' |
|
83 | get 'compiler_msg' |
|
83 | get 'rejudge' |
|
84 | get 'rejudge' |
|
|
85 | + get 'source' | ||
|
84 | end |
|
86 | end |
|
85 | collection do |
|
87 | collection do |
|
86 | get 'prob/:problem_id', to: 'submissions#index', as: 'problem' |
|
88 | get 'prob/:problem_id', to: 'submissions#index', as: 'problem' |
@@ -115,6 +117,7 | |||||
|
115 | get 'user_stat' |
|
117 | get 'user_stat' |
|
116 | get 'clear_stat' |
|
118 | get 'clear_stat' |
|
117 | get 'clear_all_stat' |
|
119 | get 'clear_all_stat' |
|
|
120 | + get 'change_contest_mode' | ||
|
118 | end |
|
121 | end |
|
119 | end |
|
122 | end |
|
120 |
|
123 |
You need to be logged in to leave comments.
Login now