Commit 6bc7324eb2fcaef99b8a87ebbb097746eafd7e60
1 parent
90bb583f
Exists in
master
and in
1 other branch
only use active choices when using catchup algo
Showing
1 changed file
with
2 additions
and
2 deletions
Show diff stats
app/models/question.rb
@@ -123,8 +123,8 @@ class Question < ActiveRecord::Base | @@ -123,8 +123,8 @@ class Question < ActiveRecord::Base | ||
123 | # This will not run once all prompts have been generated, | 123 | # This will not run once all prompts have been generated, |
124 | # but it prevents us from having to pregenerate all possible prompts | 124 | # but it prevents us from having to pregenerate all possible prompts |
125 | if weights.size < choices.size ** 2 - choices.size | 125 | if weights.size < choices.size ** 2 - choices.size |
126 | - choices.each do |l| | ||
127 | - choices.each do |r| | 126 | + choices.active.each do |l| |
127 | + choices.active.each do |r| | ||
128 | if l.id == r.id | 128 | if l.id == r.id |
129 | next | 129 | next |
130 | end | 130 | end |