From: Chris S. <san...@us...> - 2005-07-14 07:27:12
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv976 Modified Files: analysis.php index.php question_bank.php quiz.php stackstd.php.dist Log Message: Index: stackstd.php.dist =================================================================== RCS file: /cvsroot/stack/stack-1-0/stackstd.php.dist,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** stackstd.php.dist 5 Jul 2005 16:29:24 -0000 1.18 --- stackstd.php.dist 14 Jul 2005 07:27:03 -0000 1.19 *************** *** 27,38 **** $stack_os = 'unix'; ! /* Option (2): A pool of CAS processes is started */ ! /* and these wait in the background. */ ! //$stack_os = 'unix-pool'; ! ! /* SEE the install docs for how to use these two */ ! /* options. */ ! ! // Option (3): Windows // This is unsuitable for a production server. // It is *very* insecure. --- 27,31 ---- $stack_os = 'unix'; ! // Option (2): Windows // This is unsuitable for a production server. // It is *very* insecure. *************** *** 163,176 **** /***************************************************/ - /* CAS-pool socket configuration (CAS Pool usage) */ - /***************************************************/ - $stack_socket['host'] = "localhost"; - $stack_socket['port'] = 10010; // For the main socket connection - $stack_socket['childports'] = array(10011, 10012); // for the cas socket connections - $stack_socket['queuedConnAllowed'] = 5; - $stack_socket['inputStartTag'] = "<stack>"; - $stack_socket['inputEndTag'] = "</stack>"; - - /***************************************************/ /* Load standard library files */ /***************************************************/ --- 156,159 ---- *************** *** 184,192 **** require_once("{$stack_root}/scripts/stackDatabase.php"); require_once("{$stack_root}/scripts/stackSocketSend.php"); - - require_once("{$stack_root}/scripts/CASpool/stackProcess.php"); ! // Set the default language. ! $stackOptions['Language']['default'] = $stack_defaultlang; if ('unix' == $stack_os) { --- 167,172 ---- require_once("{$stack_root}/scripts/stackDatabase.php"); require_once("{$stack_root}/scripts/stackSocketSend.php"); ! require_once("{$stack_root}/scripts/CASpool/stackProcess.php"); if ('unix' == $stack_os) { *************** *** 198,201 **** --- 178,186 ---- } + + // Set the default language. + $stackOptions['Language']['default'] = $stack_defaultlang; + + if ($stack_stand_alone) { require_once("{$stack_root}/scripts/moodlelib.php"); Index: analysis.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/analysis.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** analysis.php 8 Jul 2005 16:36:08 -0000 1.14 --- analysis.php 14 Jul 2005 07:27:03 -0000 1.15 *************** *** 237,241 **** if ($qi != $qID) { // Does the question still exist in the database? ! $qID_exists_in_DB = stack_db_confirm_question_exists($qID); if ($qID_exists_in_DB) { $qidisp = "<a href=\"javascript:EditPopup('$qID');\">$qID</a>"; --- 237,241 ---- if ($qi != $qID) { // Does the question still exist in the database? ! $qID_exists_in_DB = stack_db_question_confirm_exists($qID); if ($qID_exists_in_DB) { $qidisp = "<a href=\"javascript:EditPopup('$qID');\">$qID</a>"; *************** *** 299,303 **** $query = 'SELECT questionID, questionName, questionDescription, questionKeywords ! FROM stackQuestion ORDER BY questionKeywords, questionID '; $questions = stack_db_query($query); --- 299,303 ---- $query = 'SELECT questionID, questionName, questionDescription, questionKeywords ! FROM stackQuestion ORDER BY questionID '; $questions = stack_db_query($query); *************** *** 309,318 **** if (''==$questionID or '(none)' == $questionID ) { echo " <option value=\"(none)\" selected>(none)</option>\n"; } echo " <option value=\"ALL\" >ALL</option>\n"; for ($i = 0; $i < mysql_num_rows($questions); $i++) { $row = mysql_fetch_row($questions); ! $qn = base64_unserialize($row[1]); if ($row[0] == $questionID) { echo " <option value=\"{$row[0]}\" selected>{$row[0]}: $qn </option>\n"; --- 309,326 ---- if (''==$questionID or '(none)' == $questionID ) { echo " <option value=\"(none)\" selected>(none)</option>\n"; + } else { + echo " <option value=\"(none)\">(none)</option>\n"; } + + if ('ALL' == $questionID ) { + echo " <option value=\"ALL\" selected>ALL</option>\n"; + } else { echo " <option value=\"ALL\" >ALL</option>\n"; + } + for ($i = 0; $i < mysql_num_rows($questions); $i++) { $row = mysql_fetch_row($questions); ! $qn = $row[1]; if ($row[0] == $questionID) { echo " <option value=\"{$row[0]}\" selected>{$row[0]}: $qn </option>\n"; Index: quiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/quiz.php,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** quiz.php 20 Jun 2005 15:42:52 -0000 1.23 --- quiz.php 14 Jul 2005 07:27:03 -0000 1.24 *************** *** 133,143 **** // (4.5) Reconstruct $quizInst from previous data if ('continue_quiz' == $action) { ! // Check for the necessary informtaion incoming. ! $userinfo = stack_db_quiz_quizattempt_getlast($quizid,$user['id']); if (is_array($userinfo)) { // We have attempted the quiz before with ! $seed = $userinfo['seed']; $quiz['seed'] = $seed; --- 133,142 ---- // (4.5) Reconstruct $quizInst from previous data if ('continue_quiz' == $action) { ! $userinfo = stack_db_quiz_quizattempt_getlast($quizid,$user['id']); if (is_array($userinfo)) { // We have attempted the quiz before with ! $seed = $userinfo['seed']; $quiz['seed'] = $seed; *************** *** 153,158 **** foreach ($quiz_questions as $key => $qID) { ! $qInst = stack_question_reconstruct($qID,$seed,$user['id'],$quiz_options,$errors); ! $quizInst[]=$qInst; // Make the $RawAns array equal to the student's last answer, if --- 152,157 ---- foreach ($quiz_questions as $key => $qID) { ! $qInst = stack_question_reconstruct($qID,$seed+$key,$user['id'],$quiz_options,$errors); ! $quizInst[] = $qInst; // Make the $RawAns array equal to the student's last answer, if *************** *** 187,191 **** if ( '' == $errors["qu$key"] ) { ! $quizInst[] = stack_question_inst($question,$seed,$options,$errors["qu$key"]); } else { $question = NULL; --- 186,193 ---- if ( '' == $errors["qu$key"] ) { ! // We add an offset to the quiz $seed here to make sure each question in the quiz ! // is created with a different seed. A question may appear more than once, ! // if it is instantiated with the same seed we are in trouble. ! $quizInst[] = stack_question_inst($question,$seed+$key,$options,$errors["qu$key"]); } else { $question = NULL; Index: question_bank.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/question_bank.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** question_bank.php 20 Jun 2005 15:42:52 -0000 1.4 --- question_bank.php 14 Jul 2005 07:27:03 -0000 1.5 *************** *** 181,197 **** switch ($action) { - case 'delete': - $questionID = $_POST['questionID']; - if ($admin) { - stack_db_dropquestion($questionID); - } - $action = 'questionbank_screen'; - break; case 'save': ! stack_db_addquestion($question); $action = 'questionbank_screen'; break; case 'save_as': ! stack_db_addquestion($question,TRUE); $action = 'questionbank_screen'; break; --- 181,190 ---- switch ($action) { case 'save': ! stack_db_question_add($question); $action = 'questionbank_screen'; break; case 'save_as': ! stack_db_question_add($question,TRUE); $action = 'questionbank_screen'; break; *************** *** 211,214 **** --- 204,219 ---- switch ($action) { + case 'delete': + $questionID = $_POST['questionID']; + if ($admin) { + $quiz_list = stack_db_question_quiz_list($questionID); + if (!empty($quiz_list)) { + echo '<font color="red">Question ID '.$questionID.' has been deleted, it was used in the following quiz(zes)'; + echo stack_db_question_quiz_list_printquizname($questionID)."</font>\n"; + } + stack_db_question_drop($questionID); + } + $action = 'questionbank_screen'; + break; case 'uploaded_xml': if ($upload_successful) { Index: index.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/index.php,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** index.php 8 Jul 2005 16:56:23 -0000 1.20 --- index.php 14 Jul 2005 07:27:03 -0000 1.21 *************** *** 66,70 **** if ('welcome' == $action) { echo "<h1>Welcome</h1> <p>Welcome to STACK, {$user['firstname']} {$user['lastname']}.</p>"; ! $action = 'choose_quiz'; } --- 66,72 ---- if ('welcome' == $action) { echo "<h1>Welcome</h1> <p>Welcome to STACK, {$user['firstname']} {$user['lastname']}.</p>"; ! if ('admin' != $user['username']) { ! $action = 'choose_quiz'; ! } } |