<strong class="impt">IMPORTANT:</strong> <b>Clicking a puzzle below will mark you as a testsolver. Please click judiciously and file a testsolving report!</b> <br> <?php $availPuzzles = getAvailablePuzzlesToTestForUser($uid); if ($availPuzzles != NULL) { // Sort descending, by MINUS priority, then reverse. // Trust me on this. // // (We want to sort by priority descending, then by puzzle ID // ascending. This is the easiest way to (sort of mostly) // accomplish that. "Mostly" because PHP's asort is not // stable, so this method of using a secondary sort key doesn't // quite work.) foreach ($availPuzzles as $pid) { $sort[$pid] = -getPuzzleTestPriority($pid); } asort($sort); $availPuzzles = array_keys($sort); $availPuzzles = array_reverse($availPuzzles); } displayQueue($uid, $availPuzzles, "notes summary numtesters", TRUE); ?> <br/> <br/> <hr/> <br/> <?php } if (USING_TESTSOLVE_TEAMS == 'TRUE') { $myteam = getUserTestTeamID($uid);
function getPuzzleToTest($uid) { $puzzles = getAvailablePuzzlesToTestForUser($uid); if (!$puzzles) { return FALSE; } $sort = array(); foreach ($puzzles as $pid) { $num = getPuzzleTestPriority($pid); // Lower numbers are HIGHER priorities $sort[$pid] = $num; } asort($sort); return key($sort); }