function displayPuzzleInfo($uid, $pid, $puzzleInfo) { $title = nl2br2($puzzleInfo['title']); if ($title == NULL) { $title = '(untitled)'; } $summary = nl2br2($puzzleInfo['summary']); if ($summary == NULL) { $summary = '(no summary)'; } $description = nl2br2($puzzleInfo['description']); if ($description == NULL) { $description = '(no description)'; } $codename = getCodename($pid); ?> <h2><?php echo "{$codename} (puzzle #{$pid}): {$title}"; ?> </h2> <p><strong><?php echo "Round: {$puzzleround}"; ?> </strong></p> <p><table><?php displayAnswers($uid, $pid); ?> </table></p> <div class='hideFromTest puzzledesc'> <?php echo $summary; ?> </div> <div class='hideFromTest puzzledesc'> <?php echo $description; ?> </div> <?php }
foot(); exit(1); } if (isset($_POST['newAnswer'])) { $result = submitAnswersForm(strtoupper($_POST['newAnswer']), $_POST['round']); if ($result == FALSE) { echo '<div class="errormsg">Error in submitting new answer</div>'; } } if (isset($_POST['newRound'])) { $result = submitNewRound($_POST['newRound'], strtoupper($_POST['roundAnswer'])); if ($result == FALSE) { echo '<div class="errormsg">Error in submitting new round</div>'; } } displayAnswers($uid); // End HTML foot(); //------------------------------------------------------------------------ function displayAnswers($uid) { $rounds = getRounds(); if (!$rounds) { ?> <span class="emptylist">No rounds to list</span> <?php } foreach ($rounds as $round) { $answers = getAnswersForRound($round['rid']); ?> <table class="boxed">