Permalink
Browse files

Removed WarmupQuizMaster, since it's no longer needed

  • Loading branch information...
1 parent ef959c7 commit d1f92c9be24d4392ec6b42574b9c09ce036e5e2b @jhannes committed May 5, 2012
Showing with 1 addition and 57 deletions.
  1. +1 −57 lib/extreme_startup/quiz_master.rb
@@ -3,63 +3,6 @@
require 'logger'
module ExtremeStartup
- class WarmupQuizMaster
- class WarmupQuestion < Question
- def initialize(player)
- @player = player
- end
-
- def correct_answer
- @player.name
- end
-
- def as_text
- "what is your name"
- end
- end
-
- def initialize(player, scoreboard, question_factory)
- @player = player
- @scoreboard = scoreboard
- end
-
- def start
- got_the_hang_of_it = false
-
- while true
- question = WarmupQuestion.new(@player)
- url = @player.url + '?q=' + URI.escape(question.to_s)
- puts "GET:" + url
-
- begin
- response = HTTParty.get(url)
-
- puts "question was " + question.to_s
- puts "player #{@player.name} said #{response}"
-
- if (question.answered_correctly?(response)) then
- puts "player #{@player.name} was correct"
-
- if !got_the_hang_of_it
- @scoreboard.increment_score_for(@player, question.points)
- @player.log_result(question.id, "correct", question.points)
- got_the_hang_of_it = true
- else
- @player.log_result(question.id, "correct again", 0)
- end
-
- else
- puts "player #{@player.name} was wrong"
- @player.log_result(question.id, "wrong", 0)
- end
- rescue => exception
- puts "player #{@player.name} was down - try again later #{exception}"
- @player.log_result(question.id, "no_response", 0)
- end
- sleep 5
- end
- end
- end
class QuizMaster
@@ -87,4 +30,5 @@ def start
end
end
end
+
end

0 comments on commit d1f92c9

Please sign in to comment.