From: Chris S. <san...@us...> - 2005-10-26 17:49:01
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17401/scripts Modified Files: stackQuestion.php stackQuiz.php Log Message: Index: stackQuiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackQuiz.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** stackQuiz.php 11 Oct 2005 17:35:38 -0000 1.17 --- stackQuiz.php 26 Oct 2005 17:48:50 -0000 1.18 *************** *** 179,196 **** function stack_quiz_student_select($subjectID, $quiz_store, $user, $review=FALSE, $returnurl='') { global $stack_root; ! if (!$review) { ! include($stack_root.'/html/quizchoose.html'); ! require_once("{$stack_root}/html/quizjava.html"); ! } echo '<h2>'.get_string('quiz_choose','stack').'</h2>'; - - global $stackQuiz; if (is_array($quiz_store)) { - echo "\n<table cellpadding='2'>\n"; - echo "\n<tr><th>".get_string('stackQuiz_quizName','stack','')."</th><th>".get_string('stackQuiz_quizDescription','stack','')."</th><th>".get_string('FE_quiz_lastmark','stack','')."</th><th>".get_string('stackQuiz_quizDueDate','stack','')."</th>\n</tr>\n"; --- 179,190 ---- function stack_quiz_student_select($subjectID, $quiz_store, $user, $review=FALSE, $returnurl='') { global $stack_root; + global $stackQuiz; ! $uID = $user['id']; echo '<h2>'.get_string('quiz_choose','stack').'</h2>'; if (is_array($quiz_store)) { echo "\n<table cellpadding='2'>\n"; echo "\n<tr><th>".get_string('stackQuiz_quizName','stack','')."</th><th>".get_string('stackQuiz_quizDescription','stack','')."</th><th>".get_string('FE_quiz_lastmark','stack','')."</th><th>".get_string('stackQuiz_quizDueDate','stack','')."</th>\n</tr>\n"; *************** *** 212,216 **** echo "<tr>\n"; if ($review) { - $uID = $user['id']; echo " <td><a href=\"javascript:quizreview('$uID','$qID','$subjectID');\">{$qname}</a></td>\n"; } else { --- 206,209 ---- *************** *** 224,227 **** --- 217,226 ---- } echo "\n</table>\n</p>"; + + if (!$review) { + include($stack_root.'/html/quizchoose.html'); + require_once("{$stack_root}/html/quizjava.html"); + } + } else { echo '<p>'.get_string('quiz_nonetochoose','stack').'</p>'; Index: stackQuestion.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackQuestion.php,v retrieving revision 1.46 retrieving revision 1.47 diff -C2 -d -r1.46 -r1.47 *** stackQuestion.php 25 Oct 2005 16:36:51 -0000 1.46 --- stackQuestion.php 26 Oct 2005 17:48:50 -0000 1.47 *************** *** 1037,1040 **** --- 1037,1066 ---- /** + * Validate a seed. + * + * @param $seed The potential seed. + * @return boolean + */ + function stack_question_validate_seed($seed) { + + // a seed must be only numbers three to five digits long. + if (strlen($seed)<3 or 5<strlen($seed)) { + return(FALSE); + } + + // a seed must not contain anything but digits. + if (ereg("([^0-9])",$seed)) { + return(FALSE); + } + + // $seed >= 1000 + if ($seed < 1000) { + return(FALSE); + } else { + return(TRUE); + } + + } + /** * Produce a report on why an item is invalid - used by the RQP * *************** *** 1523,1526 **** --- 1549,1553 ---- // Construct this attempt + $this_attempt['RawAns'] = ''; $this_attempt['RawMark'] = 0; $this_attempt['Penalty'] = 0; *************** *** 1528,1532 **** $this_attempt['AnswerNote'] = ''; $this_attempt['FeedBack'] = ''; - if ('' != trim($RawAns) ) { --- 1555,1558 ---- *************** *** 2032,2036 **** */ function stack_question_inst_displayq($questionInst) { ! echo '<p>'.$questionInst['questionStemInst'].'</p>'; } --- 2058,2062 ---- */ function stack_question_inst_displayq($questionInst) { ! echo "\n<p>".$questionInst['questionStemInst']."</p>\n"; } *************** *** 2060,2064 **** if (''!=$RawAns) { print_string('YourLastAns','stack',''); ! echo '<center>'.$dispAns.'</center>'; } else { echo '<font color="orange">'.get_string('YouHaveNotAns','stack','').'</font>'; --- 2086,2090 ---- if (''!=$RawAns) { print_string('YourLastAns','stack',''); ! echo "\n<center>\n".$dispAns."\n</center>\n"; } else { echo '<font color="orange">'.get_string('YouHaveNotAns','stack','').'</font>'; *************** *** 2070,2078 **** // Add generic feedback. if (1==$this_attempt['RawMark']) { ! echo $options['FeedBackGenericCorrect']; } else if (0==$this_attempt['RawMark']) { ! echo $options['FeedBackGenericIncorrect']; } else { ! echo $options['FeedBackGenericPCorrect']; } --- 2096,2104 ---- // Add generic feedback. if (1==$this_attempt['RawMark']) { ! echo "\n".$options['FeedBackGenericCorrect']; } else if (0==$this_attempt['RawMark']) { ! echo "\n".$options['FeedBackGenericIncorrect']; } else { ! echo "\n".$options['FeedBackGenericPCorrect']; } *************** *** 2080,2084 **** //Give the question specific feedback. ! echo '<br />'.$this_attempt['FeedBack']; } } else { // An invalid response --- 2106,2110 ---- //Give the question specific feedback. ! echo "\n<br />".$this_attempt['FeedBack']; } } else { // An invalid response *************** *** 2138,2146 **** } ! echo "<form name='questionInsttryform' action='$PostTo' method='POST'>\n"; echo stack_question_inst_try_formfrag($lastans,'RawAns'); ! echo "<input type='submit' name='action' value='validate' /> \n ! <input type='submit' name='action' value='mark' /> \n ! </form>\n\n\n"; // form in which questions are edited. } --- 2164,2172 ---- } ! echo "\n<form name='questionInsttryform' action='$PostTo' method='POST'>\n"; echo stack_question_inst_try_formfrag($lastans,'RawAns'); ! echo "\n<input type='submit' name='action' value='validate' />\n ! <input type='submit' name='action' value='mark' /> \n ! </form>\n"; // form in which questions are edited. } |