From: Chris S. <san...@us...> - 2005-08-19 22:13:24
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19854 Modified Files: Tag: development_xmlrqp quiz.php Log Message: Index: quiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/quiz.php,v retrieving revision 1.25.2.4 retrieving revision 1.25.2.5 diff -C2 -d -r1.25.2.4 -r1.25.2.5 *** quiz.php 16 Aug 2005 16:04:08 -0000 1.25.2.4 --- quiz.php 19 Aug 2005 22:13:14 -0000 1.25.2.5 *************** *** 70,73 **** --- 70,75 ---- // action = solutions Mark the response to *every question* then show the solutions // This prevents further attempts + // action = review Review a student's quiz, as the teacher. + // If there is a quiz stored in the $_SESSION, we should use this. *************** *** 106,110 **** // (4.3) construct the $quiz ! if ('continue_quiz' == $action or 'new_quiz_version' == $action) { // Clear any existing quiz and quizInst from the $_SESSION session_unregister('quizInst'); --- 108,112 ---- // (4.3) construct the $quiz ! if ('continue_quiz' == $action or 'new_quiz_version' == $action or 'review' == $action) { // Clear any existing quiz and quizInst from the $_SESSION session_unregister('quizInst'); *************** *** 153,159 **** } } // (4.5) Reconstruct $quizInst from previous data ! if ('continue_quiz' == $action) { $userinfo = stack_db_quiz_quizattempt_getlast($quizid,$user['id']); --- 155,166 ---- } } + + if ('review' == $action) { + $student_user = $_POST['userid']; + $user = stack_db_user_get_ID($student_user); + } // (4.5) Reconstruct $quizInst from previous data ! if ('continue_quiz' == $action or 'review' == $action) { $userinfo = stack_db_quiz_quizattempt_getlast($quizid,$user['id']); *************** *** 498,501 **** --- 505,511 ---- $title = get_string('TrySTACKQuiz','stack','').": {$user['firstname']} {$user['lastname']} ({$user['username']})"; + if ('review' == $action) { + $title = get_string('ReviewSTACKQuiz','stack','').": {$user['firstname']} {$user['lastname']} ({$user['username']})"; + } // TODO : The second argument needs to be 'MathML' when required *************** *** 584,588 **** } else { //unfocus ! if ('solutions' != $action) { echo "<a href=\"javascript:takeaction('focus',$key);\">".get_string('Focus','stack','')."</a> "; } --- 594,598 ---- } else { //unfocus ! if ('solutions' != $action and 'review' != $action) { echo "<a href=\"javascript:takeaction('focus',$key);\">".get_string('Focus','stack','')."</a> "; } *************** *** 597,601 **** } ! if ('solutions' != $action) { echo" <a href=\"javascript:takeaction('validate',0);\">".get_string('Validate','stack','')."</a>  <a href=\"javascript:takeaction('mark_question',$key);\">".get_string('MarkThisQ','stack','')."</a>  "; --- 607,611 ---- } ! if ('solutions' != $action and 'review' != $action) { echo" <a href=\"javascript:takeaction('validate',0);\">".get_string('Validate','stack','')."</a>  <a href=\"javascript:takeaction('mark_question',$key);\">".get_string('MarkThisQ','stack','')."</a>  "; *************** *** 620,624 **** } ! if ('solutions' != $action and TRUE != $duedate_passed) { $RA = $this_attempt['RawAns']; echo stack_question_inst_try_formfrag($RA,"RawAns[$key]"); --- 630,634 ---- } ! if ('solutions' != $action and TRUE != $duedate_passed and 'review' != $action) { $RA = $this_attempt['RawAns']; echo stack_question_inst_try_formfrag($RA,"RawAns[$key]"); *************** *** 629,632 **** --- 639,651 ---- stack_question_inst_show_sol($qInst,$errors); } + + // Show a review table. + if ('review' == $action) { + echo "<p><table bgcolor='#CCCCCC' width='100%' cellpadding='2'><tr><td>"; + stack_question_inst_show_attempts($qInst,$errors); + echo "</td></tr><tr><td><b>".get_string('QTestQuestionNote','stack','')."</b> ".nsf($qInst,'questionNoteInst'); + echo "</td></tr></table></p>"; + stack_question_inst_show_sol($qInst,$errors); + } } // End of feedback & errors *************** *** 666,670 **** echo "<table>\n"; ! if ('solutions' != $action) { if ($focus) { --- 685,689 ---- echo "<table>\n"; ! if ('solutions' != $action and 'review' != $action) { if ($focus) { *************** *** 683,687 **** } ! if ('Practice' == $quizmode) { echo " <tr><td><a href=\"javascript:takeaction('solutions',0);\">".get_string('Solutions','stack','')."</a></td> <td>".get_string('SolutionsExplain','stack','')."</td></tr>\n --- 702,706 ---- } ! if ('Practice' == $quizmode and 'review' != $action) { echo " <tr><td><a href=\"javascript:takeaction('solutions',0);\">".get_string('Solutions','stack','')."</a></td> <td>".get_string('SolutionsExplain','stack','')."</td></tr>\n *************** *** 691,697 **** } ! echo "<tr><td nowrap='nowrap'><a href=\"index.php?action=choose_quiz\">".get_string('ChooseQuiz','stack','')."</a></td> ! <td>".get_string('ClickHereTryQuiz','stack','')."</td></tr>\n ! <tr><td><a href='index.php?action=choose_quiz'>".get_string('Home','stack','')."</a></td> <td>".get_string('STACKHomePage','stack','')."</td></tr>\n"; echo "</table>"; --- 710,714 ---- } ! echo "<tr><td><a href='index.php?action=choose_quiz'>".get_string('Home','stack','')."</a></td> <td>".get_string('STACKHomePage','stack','')."</td></tr>\n"; echo "</table>"; |