Commit 32d574d65a93119e7b0b7d4645bf9028287357aa

Authored by Dhruv Kapadia
1 parent cc084f19

Making catchup algorithm non hard coded

app/controllers/prompts_controller.rb
... ... @@ -70,8 +70,8 @@ class PromptsController < InheritedResources::Base
70 70 #@prompt.choices.each(&:compute_score!)
71 71 respond_to do |format|
72 72 if successful
73   - catchup_marketplace_ids = [120, 117, 1, 116]
74   - if catchup_marketplace_ids.include?(@question.id)
  73 + #catchup_marketplace_ids = [120, 117, 1, 116]
  74 + if @question.uses_catchup?
75 75 logger.info("Question #{@question.id} is using catchup algorithm!")
76 76 next_prompt = @question.catchup_choose_prompt
77 77 else
... ...
db/migrate/20100420130849_add_catchup_bool_to_questions.rb 0 → 100644
... ... @@ -0,0 +1,9 @@
  1 +class AddCatchupBoolToQuestions < ActiveRecord::Migration
  2 + def self.up
  3 + add_column :questions, :uses_catchup, :boolean, :default => false
  4 + end
  5 +
  6 + def self.down
  7 + remove_column :questions, :uses_catchup
  8 + end
  9 +end
... ...