public function __construct(ScalarExercise $exercise, $answer)
 {
     parent::__construct();
     $this->content = $exercise->getBlueprint();
     $this->seed = $exercise->getSeed();
     $this->answer = $answer;
 }
 /**
  * @subscribe
  * @param User $user
  * @param ScalarExercise $exercise
  */
 public function onCorrectAnswer(User $user, ScalarExercise $exercise)
 {
     $blueprint = $exercise->getBlueprint();
     // TODO award after percentage on last N answers reaches X %
     if ($user->getBadges($this->getKey())->where('blueprint_id = ?', $blueprint->id)->count() !== 0) {
         // already awarded for this blueprint
         return;
     }
     $this->awardTo($user, function (Badge $badge, User $user) use($blueprint) {
         return new Bridges\ExerciseMastery($badge, $user, $blueprint);
     });
 }