Update of /cvsroot/stack/stack-1-0
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8318
Added Files:
mei.php
Log Message:
--- NEW FILE: mei.php ---
<?php
/**
*
* Welcome to STACK. A system for teaching and assessment using a
* computer algebra kernel.
* <br>
* This file is licensed under the GPL License.
* <br>
* Copyright (c) 2005, Christopher James Sangwin
*
* @author Chris Sangwin C.J...@bh...
*
* @package Stack
*/
session_start();
require_once('stackConfig.php');
require_once('stackLib.php');
/**
* To use this script, add a variable $choosequiz_store
* 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 are the subjectID numbers you wish to release.
*
* You also need to add a variable $choosequiz_auth to stackConf.php
* This is used by VISTA to authorise the page.
*/
$user = stack_user_guest();
if (array_key_exists('username',$_GET)) {
$username = strtolower($_GET['username']);
$userID = strtolower($_GET['userID']);
$user = stack_user_login_vista($username,$userID);
$_SESSION['user'] = $user;
}
if (array_key_exists('subjectID',$_GET)) {
// Check this is permitted.
if (isset($MEI_subjects)) {
if (FALSE !== array_search($_GET['subjectID'],$MEI_subjects)) {
$subjectID = $_GET['subjectID'];
} else {
echo "This subject is not available through this page.";
die();
}
} else {
echo "The administrator of this STACK server has not released any subjects.";
die();
}
$subject = stack_db_subject_get($subjectID,FALSE);
$_SESSION['subject'] = $subject;
} else if (array_key_exists('subject',$_SESSION)) {
$subject = $_SESSION['subject'];
$subjectID = $subject['subjectID'];
} else {
echo "You need to supply details of a STACK subjectID number.";
die();
}
echo "<table width='100%'>\n<tr>\n <td align='left'><h1>STACK quizzes</h1></td>\n";
echo " <td align='right'><img src='pics/logo.png' alt='STACK logo' /></td>\n</tr>\n</table>";
echo $subject['subjectHTMLHead'];
$quiz_store = stack_db_subject_quiz_list_student($subjectID);
stack_quiz_student_select($subjectID,$quiz_store, $user, FALSE, "choosequiz.php");
echo $subject['subjectHTMLFoot'];
|