// Redirect to the login page, if not logged in $uid = isLoggedIn(); // Check for puzzle id if (!isset($_GET['pid'])) { head("", "Error"); echo "Puzzle ID not found. Please try again."; foot(); exit(1); } $pid = $_GET['pid']; // Start HTML head("", "Puzzle {$pid}: Testsolving"); // Check permissions if (!isTestingAdmin($uid)) { if (!isTesterOnPuzzle($uid, $pid) && !isFormerTesterOnPuzzle($uid, $pid)) { if (!canTestPuzzle($uid, $pid)) { echo "You do not have permission to test this puzzle."; foot(); exit(1); } else { addPuzzleToTestQueue($uid, $pid); } } } $title = getTitle($pid); if ($title == NULL) { $title = '(untitled)'; } echo "<h2>Puzzle {$pid} — {$title}</h2>"; echo "<strong class='impt'>IMPORTANT:</strong> <b>Please leave feedback! We\n need it!</b><br><br> When you are done, PLEASE leave feedback indicating\n that you do not intend to return, <b>even if the rest is blank</b>. This\n removes you as a tester on this puzzle, so we can track who's still\n working.\n"; echo "<br><br>\n";
function getAvailablePuzzlesToTestForUser($uid) { $puzzles = getPuzzlesInTesting(); $available = array(); echo "\n<br>\n"; foreach ($puzzles as $pid) { if (canTestPuzzle($uid, $pid) && !isInTargetedTestsolving($pid) && !isTesterOnPuzzle($uid, $pid) && !isFormerTesterOnPuzzle($uid, $pid) && canUseMoreTesters($pid)) { $available[] = $pid; } } return $available; }
if (!addToTestAdminQueue($uid, $pid)) { $_SESSION['failedToAdd'] = TRUE; } header("Location: " . URL . "/testadmin.php"); exit(0); } if (isset($_POST['getTestId'])) { $pid = $_POST['pid']; if (!validPuzzleId($pid)) { utilsError("Invalid puzzle ID."); } if (isTestingAdmin($uid)) { header("Location: " . URL . "/test.php?pid=" . $pid); exit(0); } if (canTestPuzzle($uid, $pid, TRUE) && !isTesterOnPuzzle($uid, $pid)) { addPuzzleToTestQueue($uid, $pid); header("Location: " . URL . "/test.php?pid=" . $pid); } else { if (isTesterOnPuzzle($uid, $pid)) { header("Location: " . URL . "/test.php?pid=" . $pid); } else { if (!isset($_SESSION['testError'])) { $_SESSION['testError'] = "Could not add Puzzle {$pid} to your queue"; } header("Location: " . URL . "/testsolving.php"); } } exit(0); } if (isset($_POST['getPuzz'])) {