Commit c3430b65 authored by ggeller's avatar ggeller

More work on options.

parent a8b6ff0c
This diff is collapsed.
<?php
// $Header: /cvsroot/tikiwiki/tiki/tiki-quiz_edit.php,v 1.4 2004-05-13 19:01:10 ggeller Exp $
// $Header: /cvsroot/tikiwiki/tiki/tiki-quiz_edit.php,v 1.5 2004-05-14 17:05:36 ggeller Exp $
// Copyright (c) 2002-2004, Luis Argerich, Garland Foster, Eduardo Polidor,
// George G. Geller et. al.
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
/*
Must check for any students having accessed the quiz before
allowing changes.
Status
N students have taken this quiz.
M quizzes have been machine graded
J quizzes have been graded by peer review
K quizzes have been graded by graders and teachers
(The expire date must be rigid. That is, papers will not be accepted after the expire
date, even if the quiz was started before the expire date. Otherwise, in cases where
we have "show answers after expire date", a student who has completed the quiz could
give the answers to another student during the grace period. So when the student
takes the quiz, the system must issue a warning to the student about the expire date
if the date is less the the session timeout time away.)
(Quiz results are always stored.)
*/
error_reporting(E_ALL);
// Initialization
......@@ -61,6 +82,16 @@ $cat_type = 'quiz';
$cat_objid = $_REQUEST["quizId"];
include_once ("categorize_list.php");
if (isset($_REQUEST["preview"]) || isset($_REQUEST["xmlview"])|| isset($_REQUEST["textview"])) {
echo "line: ".__LINE__."<br>";
echo "Sorry, this is only a prototype at present.<br>";
foreach ($_REQUEST as $key => $request){
echo $key." = ".$request."<br>";
}
die;
}
if (isset($_REQUEST["save"])) {
check_ticket('edit-quiz-question');
$cat_href = "tiki-quiz.php?quizId=" . $cat_objid;
......@@ -75,6 +106,19 @@ if (isset($_REQUEST["save"])) {
echo $key." = ".$request."<br>";
}
$quiz = array();
if ($_REQUEST["online"] == "online"){
$quiz["online"] = "T";
}
else {
$quiz["online"] = "F";
}
$quiz["name"] = $_REQUEST["name"];
echo '$quiz = '."<br>";
foreach ($quiz as $key => $request){
echo $key." = ".$request."<br>";
}
// Have to parse the data and bail out if there is an error.
//
// Store the new or revised information
......@@ -111,14 +155,34 @@ ask_ticket('edit-quiz-question');
$quiz['name'] = "Test Chapter 01";
$quiz['description'] = "Quiz on Chapter 01 of Tom Sawyer";
$quiz['online'] = "n";
// The default publish date to be Jan 1, of this year at midnight.
$quiz['publishDate'] = mktime(0, 0, 0, 1, 1, date("Y"));
// The default expire date to be 10 years after the default publish date
$quiz['expireDate'] = mktime(0, 0, 0, 1, 1, date("Y")+10);
$quiz['grading'] = "machine";
$quiz['showScore'] = "immediately";
$quiz['showCorrectAnswers'] = "immediately";
// GGG scaffolding -end
$optionsGrading = array();
$optionsGrading[] = "machine";
$optionsGrading[] = "peer review";
$optionsGrading[] = "teacher";
$smarty->assign('optionsGrading', $optionsGrading);
$optionsShowScore = array();
$optionsShowScore[] = "immediately";
$optionsShowScore[] = "after expire date";
$optionsShowScore[] = "never";
$smarty->assign('optionsShowScore', $optionsShowScore);
$smarty->assign_by_ref('quiz', $quiz);
// GGG scaffolding
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment