コード例 #1
0
                    $bonus = 0.5;
                    $num_50++;
                } elseif (strstr($email_sent, 'undef')) {
                    $num_undef++;
                } else {
                    $num_err++;
                }
                $raw_total_bonus += $bonus;
                if (!$dry) {
                    $a = $mturk->grantBonus($wids[$i], $aids[$i], $bonus, $bonusstr);
                }
            }
            $num_accepted++;
        } else {
            if (!$dry) {
                $res = $mturk->rejectHIT($aids[$i], "You did not finish the task acceptably.");
            }
            $num_rejected++;
        }
    }
    print "Assignments: Approved {$num_accepted}, rejected {$num_rejected}\n";
    print "Bonuses: \$0.50 = {$num_50}, \$0.01 = {$num_01}, undef = {$num_undef}, err = {$num_err}\n";
    $total_bonus = $raw_total_bonus * 1.1;
    print "Total bonus: {$total_bonus} ({$raw_total_bonus} + 10%)\n";
    $total_expense = $total_bonus + $num_accepted * 0.55;
    print "Total expense: {$total_expense} (bonus + {$num_accepted}*0.55)\n";
} else {
    print "Approving assignments is OFF.\n";
}
//Record affected mturk_ids
sort($wids);