From: Chris S. <san...@us...> - 2005-10-11 17:35:36
|
Update of /cvsroot/stack/stack-1-0/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26708/scripts Modified Files: stackAuthor.php stackDatabase.php stackFrontend.php stackQuestion.php stackQuiz.php stackUser.php Log Message: Index: stackDatabase.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackDatabase.php,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** stackDatabase.php 20 Sep 2005 16:32:24 -0000 1.51 --- stackDatabase.php 11 Oct 2005 17:35:38 -0000 1.52 *************** *** 961,965 **** function stack_db_attempt_get($questionID,$seed,$user,&$errors) { ! $question_attempts = NULL; // Gets the $questionID, with $seed, for $user // Returns the $question_attempts array of $this_attempts. --- 961,965 ---- function stack_db_attempt_get($questionID,$seed,$user,&$errors) { ! $question_attempts = NULL; // Gets the $questionID, with $seed, for $user // Returns the $question_attempts array of $this_attempts. Index: stackAuthor.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackAuthor.php,v retrieving revision 1.45 retrieving revision 1.46 diff -C2 -d -r1.45 -r1.46 *** stackAuthor.php 11 Oct 2005 09:57:44 -0000 1.45 --- stackAuthor.php 11 Oct 2005 17:35:38 -0000 1.46 *************** *** 1244,1248 **** //Check that within current field there is no type tag, otherwise skip $err = ''; ! $keyname = 'stackQuiz_'.$key; echo "<tr><td><b>".get_string($keyname,'stack','')."</b></td>\n"; if ('subjectID' == $key) { --- 1244,1248 ---- //Check that within current field there is no type tag, otherwise skip $err = ''; ! $keyname = 'stackSubject_'.$key; echo "<tr><td><b>".get_string($keyname,'stack','')."</b></td>\n"; if ('subjectID' == $key) { Index: stackQuestion.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackQuestion.php,v retrieving revision 1.41 retrieving revision 1.42 diff -C2 -d -r1.41 -r1.42 *** stackQuestion.php 11 Oct 2005 09:57:44 -0000 1.41 --- stackQuestion.php 11 Oct 2005 17:35:38 -0000 1.42 *************** *** 1509,1513 **** // Construct this attempt - $this_attempt['RawAns'] =$RawAns; $this_attempt['RawMark'] = 0; $this_attempt['Penalty'] = 0; --- 1509,1512 ---- *************** *** 1518,1526 **** if ('' != trim($RawAns) ) { - $err = validate_casstring($RawAns,'s'); // parse the student's raw answer - if ('' != $err) { - $errors['RawAns']= $err; - } - // Check for forbidden words $forbidden = stack_options_forbidden($options); --- 1517,1520 ---- *************** *** 1540,1543 **** --- 1534,1548 ---- } } + + // Validate the casstring, which might be changed as a result of this. + $err = validate_casstring($RawAns,'s'); // parse the student's raw answer + show_array($err); + if ('' != $err) { + $errors['RawAns']= $err; + } + + // Stars may have been inserted here in validate_casstring. + $this_attempt['RawAns'] = $RawAns; + } else { *************** *** 1704,1708 **** $ta = $all_locs_Inst[$tan]['value']; - //echo "$sa,$ta,{$answertest[$prn]},{$answertestopt[$prn]}"; $this_PRattempt = stack_apply_answertest($sa,$ta,$answertest[$prn],$answertestopt[$prn],$options,$errors); //show_array($this_PRattempt); --- 1709,1712 ---- *************** *** 2237,2241 **** $options = stack_options_set($question,$quiz_options); $questionInst = stack_question_inst($question,$seed,$options,$errors); ! $qAtts = stack_db_attempt_get($questionID,$seed,$user,$errors); if (is_array($qAtts)) { $questionInst['questionAttempts']=$qAtts; --- 2241,2246 ---- $options = stack_options_set($question,$quiz_options); $questionInst = stack_question_inst($question,$seed,$options,$errors); ! $qseed = $questionInst['questionSeedInst']; ! $qAtts = stack_db_attempt_get($questionID,$qseed,$user,$errors); if (is_array($qAtts)) { $questionInst['questionAttempts']=$qAtts; Index: stackQuiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackQuiz.php,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** stackQuiz.php 11 Oct 2005 09:57:44 -0000 1.16 --- stackQuiz.php 11 Oct 2005 17:35:38 -0000 1.17 *************** *** 243,247 **** $quiz_res = ''; ! echo "<h1>Quiz results: {$quiz['quizName']}</h1>"; // Print a summary of the context of this quiz. --- 243,248 ---- $quiz_res = ''; ! $a = $quiz['quizName']; ! echo '<h1>'.get_string('FE_quiz_results','stack',$a).'</h1>'; // Print a summary of the context of this quiz. *************** *** 257,261 **** } if (NULL == $quiz_questions) { ! echo 'There are no questions in this quiz! Please contact your administrator.'; return NULL; } --- 258,262 ---- } if (NULL == $quiz_questions) { ! echo get_string('FE_quiz_no_questions','stack',''); return NULL; } *************** *** 281,285 **** $qn = $options['QuVal']; echo ' <th>'.$qn."</th>\n"; ! $qtot = $qtot + $qn; } // end foreach echo " <th>$qtot</th>\n</tr>\n"; --- 282,286 ---- $qn = $options['QuVal']; echo ' <th>'.$qn."</th>\n"; ! $qtot += $qn; } // end foreach echo " <th>$qtot</th>\n</tr>\n"; *************** *** 319,326 **** echo " <td align='center'>".$mark."</td>\n"; } // end foreach ! $percent = round(100*$tot/$qtot,2); ! echo " <td align='center'>".$tot."</td>\n"; ! echo " <td align='center'>".$percent."</td>\n"; ! echo "</tr>\n"; } --- 320,327 ---- echo " <td align='center'>".$mark."</td>\n"; } // end foreach ! $percent = round(100*$tot/$qtot,2); ! echo " <td align='center'>".$tot."</td>\n"; ! echo " <td align='center'>".$percent."</td>\n"; ! echo "</tr>\n"; } *************** *** 331,335 **** echo "\n</table>\n"; } else { ! echo "<p>You have no users in your database.</p>"; } --- 332,336 ---- echo "\n</table>\n"; } else { ! echo '<p>'.get_string('FE_user_nousers','stack','').'</p>'; } *************** *** 401,407 **** $var = round(pow($var,0.5),4); ! echo "Number of attempts: $noatt. mean: $average, variance: $var"; } else { ! echo "Number of attempts: 0"; } --- 402,409 ---- $var = round(pow($var,0.5),4); ! $a = array(0 => $noatt, 1 => $average, 2=> $var); ! echo get_string('FE_analysis_qu_stats','stack',$a); } else { ! echo get_string('FE_analysis_qu_noatt','stack',''); } *************** *** 412,416 **** } else { ! echo "<p>There are no attempts at any questions in this quiz.</p>"; } --- 414,418 ---- } else { ! echo '<p>'.get_string('FE_analysis_qu_noatts','stack','').'</p>'; } Index: stackUser.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackUser.php,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** stackUser.php 11 Oct 2005 09:57:44 -0000 1.18 --- stackUser.php 11 Oct 2005 17:35:38 -0000 1.19 *************** *** 370,378 **** if(is_array($stack_users)) { ! echo "<tr><td>User ID</td>\n"; echo "<td><select name=\"userID\">\n"; - echo "userID"; - if ($anyUser) { $spec_users=array('(any)','>0'); --- 370,376 ---- if(is_array($stack_users)) { ! echo "<tr><td>".get_string('USR_StudentID','stack','')."</td>\n"; echo "<td><select name=\"userID\">\n"; if ($anyUser) { $spec_users=array('(any)','>0'); Index: stackFrontend.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/stackFrontend.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** stackFrontend.php 11 Oct 2005 09:57:44 -0000 1.4 --- stackFrontend.php 11 Oct 2005 17:35:38 -0000 1.5 *************** *** 250,254 **** } else { ! echo "<p>You have no quizzes available to try.</p>"; echo "<p>\n<form name='quizform' action='$PostTo' method='POST'> <input type='hidden' name='quizid' value='-1' /> --- 250,254 ---- } else { ! echo '<p>'.get_string('FE_quiz_none','stack','').'</p>'; echo "<p>\n<form name='quizform' action='$PostTo' method='POST'> <input type='hidden' name='quizid' value='-1' /> *************** *** 294,298 **** } else { ! echo "<p>You have no subjects available to try.</p>"; echo "<p>\n<form name='subjectform' action='$PostTo' method='POST'> <input type='hidden' name='subjectid' value='-1' /> --- 294,298 ---- } else { ! echo '<p>'.get_string('FE_subject_none','stack','').'</p>'; echo "<p>\n<form name='subjectform' action='$PostTo' method='POST'> <input type='hidden' name='subjectid' value='-1' /> *************** *** 313,317 **** echo '<h1>'.get_string('FE_notadmin','stack').'</h1>'; echo '<p>'.get_string('FE_needadmin','stack',$user['username']).'</p>'; ! echo "<p>Please login <a href='index.php?action=login'>here</a></p>"; include('html/pagefoot.php'); die(); --- 313,317 ---- echo '<h1>'.get_string('FE_notadmin','stack').'</h1>'; echo '<p>'.get_string('FE_needadmin','stack',$user['username']).'</p>'; ! echo '<p>'.get_string('FE_loginhere','stack',$user['username']).'</p>'; include('html/pagefoot.php'); die(); |