From: Chris S. <san...@us...> - 2005-09-15 08:50:53
|
Update of /cvsroot/stack/stack-1-0 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3806 Modified Files: choosequiz.php quiz.php Log Message: Index: choosequiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/choosequiz.php,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** choosequiz.php 7 Sep 2005 14:28:58 -0000 1.2 --- choosequiz.php 15 Sep 2005 08:50:41 -0000 1.3 *************** *** 21,24 **** --- 21,27 ---- * to stackConfig.php which is an array of the subjectID numbers * of subjects you wish to be available through this page. + * + * eg $choosequiz_store = array('1','2'); + * where 1 & 2 aare the subjectID numbers you wish to release. */ Index: quiz.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/quiz.php,v retrieving revision 1.39 retrieving revision 1.40 diff -C2 -d -r1.39 -r1.40 *** quiz.php 12 Sep 2005 08:07:47 -0000 1.39 --- quiz.php 15 Sep 2005 08:50:41 -0000 1.40 *************** *** 19,34 **** include($stack_root.'/frontend_general/process_input.php'); - ///////////////////////////////////////////////////////////// - // (1) For a quiz, the admin user should behave like a guest. - // We don't want lots of admin user quizzes to be stored. - // The user is not stored in the session, so it lasts only - // for this script. - ///////////////////////////////////////////////////////////// - - if ($user['id'] <= 0 or !$user['loggedin']) { - include_once($stack_root."/scripts/stackUser.php"); - $user = stack_user_guest(); - } - ////////////////////////////////////////////////////////// // (2) Assign default values to quiz specific variables. --- 19,22 ---- *************** *** 134,139 **** $quizid = $_POST['quizid']; ! // Check the $quizid is in the $subject ! if (!stack_db_subject_quiz_contained($subjectID,$quizid)) { echo "The quizID number is not linked to the subjectID numbers supplied."; die(); --- 122,127 ---- $quizid = $_POST['quizid']; ! // Check the $quizid is in the $subject, or we are the admin user. ! if (!stack_db_subject_quiz_contained($subjectID,$quizid) AND ( -1 != $user['id'] OR !$user['loggedin'] )) { echo "The quizID number is not linked to the subjectID numbers supplied."; die(); *************** *** 170,175 **** $subject_options = array(); ! if (array_key_exists('subjectOptions',$subject)){ ! $subject_options = $subject['subjectOptions']; } --- 158,165 ---- $subject_options = array(); ! if (is_array($subject)) { ! if (array_key_exists('subjectOptions',$subject)){ ! $subject_options = $subject['subjectOptions']; ! } } *************** *** 191,194 **** --- 181,198 ---- } + + ///////////////////////////////////////////////////////////// + // (1) For a quiz, the admin user should behave like a guest. + // We don't want lots of admin user quizzes to be stored. + // The user is not stored in the session, so it lasts only + // for this script. + ///////////////////////////////////////////////////////////// + + if ($user['id'] <= 0 or !$user['loggedin']) { + include_once($stack_root."/scripts/stackUser.php"); + $user = stack_user_guest(); + } + + // This is used by the remote calling functions. if ('review' == $action) { $student_user = $_POST['userid']; |