OSDN Git Service

add {p,q,r}_{min,max}
authorokimoto <okimoto@good-day.co.jp>
Thu, 18 Mar 2010 02:40:24 +0000 (11:40 +0900)
committerokimoto <okimoto@good-day.co.jp>
Thu, 18 Mar 2010 02:40:24 +0000 (11:40 +0900)
app/views/admin/problems/_quadratic_equation.html.erb
app/views/admin/problems/_quadratic_equation_edit_form.html.erb
db/seeds.rb
spec/factories/problem.rb

index 58dbf65..eb8fbc2 100644 (file)
@@ -1,3 +1,6 @@
 <table class="problem">
   <%= render :partial => "common" %>
+  <%= render :partial => "minus_min_max", :locals => { :prefix => "r_", :minus => false } %>
+  <%= render :partial => "minus_min_max", :locals => { :prefix => "p_", :minus => false } %>
+  <%= render :partial => "minus_min_max", :locals => { :prefix => "q_", :minus => false } %>
 </table>
index 8eba925..2162d82 100644 (file)
@@ -1,4 +1,6 @@
 <table class="problem">
   <%= render :partial => "common_edit_form", :locals => { :f => f } %>
-  <%# TODO 作る %>
+  <%= render :partial => "minus_min_max_edit_form", :locals => { :f => f, :prefix => "r_", :minus => false } %>
+  <%= render :partial => "minus_min_max_edit_form", :locals => { :f => f, :prefix => "p_", :minus => false } %>
+  <%= render :partial => "minus_min_max_edit_form", :locals => { :f => f, :prefix => "q_", :minus => false } %>
 </table>
index 8d67541..230906a 100644 (file)
@@ -216,8 +216,11 @@ STR
                                :amount => 2,
                                :options =>  {
                                  :answer_type => :rational,
+                                 :r_min => 1,
                                  :r_max => 20,
+                                 :p_min => 0,
                                  :p_max => 12,
+                                 :q_min => 1,
                                  :q_max => 40,
                                }.to_json)
   problem_group.save!
index 410ca50..354afff 100644 (file)
@@ -109,8 +109,11 @@ Factory.define :quadratic_equation_level_1, :parent => :problem do |m|
   m.unit{|u| u.association :quadratic_equation }
   m.options({
               :answer_type => :rational,
+              :r_min => 1,
               :r_max => 20,
+              :p_min => 0,
               :p_max => 12,
+              :q_min => 0,
               :q_max => 40,
             }.to_json)
 end