From: Juliette W. <jv...@us...> - 2005-06-16 11:58:46
|
Update of /cvsroot/stack/stack-1-0/frontend_general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16820/frontend_general Modified Files: Tag: frontend_dev front_end_display.php Log Message: Moved select quiz html into separate file Index: front_end_display.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/frontend_general/Attic/front_end_display.php,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** front_end_display.php 16 Jun 2005 11:44:45 -0000 1.1.2.1 --- front_end_display.php 16 Jun 2005 11:58:30 -0000 1.1.2.2 *************** *** 74,77 **** --- 74,123 ---- echo '<h1>Thank you</h1><p>Thank you for using STACK.'; } + + function stack_select_quiz_screen($quiz_store, $user) { + global $stack_root; + require_once("{$stack_root}/html/quizjava.html"); + echo "<h1>Please choose a quiz to try</h1>"; + global $stackQuiz; + if (is_array($quiz_store)) { + + + echo "<p>\n<form name='quizform' action='quiz.php' method='POST'> + <input type='hidden' name='quizID' value='-1'> + <input type='hidden' name='action' value='continue_quiz'>"; + + echo "\n<table cellpadding='2'>\n"; + echo "\n<tr><th>{$stackQuiz['quizName']['descript']}</th><th>{$stackQuiz['quizDescription']['descript']}</th><th>Last mark (%)</th></tr>"; + foreach ($quiz_store as $qs => $quiz) { + $qname = $quiz['quizName']; + $qID = $quiz['quizID']; + $mark = '-'; + if (is_array($user)) { + if (array_key_exists('id',$user)) { + $userinfo = stack_db_quiz_quizattempt_getlast($qID,$user['id']); + if (is_array($userinfo)) { + if (NULL != $userinfo['mark']) { + $mark = round(100*$userinfo['mark']/$userinfo['maxmark'],2); + } + } + } + } + echo "<tr><td><a href=\"javascript:takeaction('continue_quiz','$qID');\">{$qname}</a></td>\n"; + echo "<td>".$quiz['quizDescription']."</td><td align='center'>$mark</td></tr>\n"; + } + echo "\n</table>\n</form>\n</p>"; + } else { + echo "<p>You have no quizzes available to try.</p>"; + } + } + + function stack_login_error_screen($error) { + echo "There was an error with the login or registration"; + echo $error; + } + + function stack_welcome_screen($user) { + echo "<h1>Welcome</h1> <p>Welcome to STACK, {$user['firstname']} {$user['lastname']}.</p>"; + } ?> |