Permalink
Browse files

Merge branch 'master' of github.com:rposborne/phd_checker

  • Loading branch information...
2 parents 1c792da + 8cdeaa5 commit a9196ecf7ade146eec0038cd9d3d3d354d013935 @jaminben jaminben committed Mar 31, 2011
Showing with 8 additions and 5 deletions.
  1. +2 −2 app/controllers/a_controller.rb
  2. +4 −2 app/controllers/b_controller.rb
  3. +2 −1 app/controllers/e_controller.rb
@@ -2,8 +2,8 @@ class AController < EssayBaseController
def score_card
@user = User.find(params[:participant_id])
@responses = @user.responses
-
- @payment = 30
+ completed_essay = @user.responses.collect {|x| x.essay }.uniq.count
+ @payment = 3*completed_essay
render :file => "essays/score_card"
end
end
@@ -2,8 +2,10 @@ class BController < EssayBaseController
def score_card
@user = User.find(params[:participant_id])
@responses = @user.responses
-
- @payment = 30
+ completed_essay = @user.responses.collect {|x| x.essay }.uniq.count
+ @payment = 3*completed_essay
+ #set the quota here
+ @responses.count > 1 ? @payment += 1 : @payment
render :file => "essays/score_card"
end
end
@@ -3,7 +3,8 @@ def score_card
@user = User.find(params[:participant_id])
@responses = @user.responses
- @payment = 30
+ completed_essay = @user.responses.collect {|x| x.essay }.uniq.count
+ @payment = 3*completed_essay
render :file => "essays/score_card"
end
end

0 comments on commit a9196ec

Please sign in to comment.