示例#1
0
    public function showForm($data = null)
    {
        if (!is_null($data)) {
            $this->data = $data;
        }
        $GLOBALS["headerjs"] = $this->headerJS();
        $GLOBALS["headercss"] = $this->headerCSS();
        $GLOBALS["title"] = is_null($this->data("title")) ? "Edit untitled assessment item" : "Edit assessment item \"" . htmlspecialchars($this->data("title")) . "\"";
        include "htmlheader.php";
        ?>
			<h2><?php 
        echo $GLOBALS["title"];
        ?>
</h2>
			<?php 
        $this->showmessages();
        ?>
			<form id="edititem" action="<?php 
        $action = new EditAssessmentItemAction();
        echo $action->actionURL();
        ?>
" method="post">
				<dl>
					<dt><label for="title">Title</label></dt>
					<dd><input size="64" type="text" name="title" id="title"<?php 
        if (isset($this->data["title"])) {
            ?>
 value="<?php 
            echo htmlspecialchars($this->data["title"]);
            ?>
"<?php 
        }
        ?>
></dd>

					<dt><label for="description">Description</label></dt>
					<dd><textarea rows="8" cols="64" name="description" id="description"><?php 
        if (isset($this->data["description"])) {
            echo htmlspecialchars($this->data["description"]);
        }
        ?>
</textarea></dd>

					<dt><label for="keywords">Keywords (comma-separated)</label></dt>
					<dd><textarea id="keywords" name="keywords" rows="4" cols="64"><?php 
        echo htmlspecialchars(implode(", ", $this->getKeywords()));
        ?>
</textarea></dd>

					<dt><label for="stimulus">Stimulus</label></dt>
					<dd><textarea class="qtitinymce resizable" rows="8" cols="64" name="stimulus" id="stimulus"><?php 
        if (isset($this->data["stimulus"])) {
            echo htmlspecialchars($this->data["stimulus"]);
        }
        ?>
</textarea></dd>

					<?php 
        echo $this->formHTML();
        ?>

					<dt>Actions</dt>
					<dd>
						<input type="hidden" name="qtiid" value="<?php 
        echo $this->getQTIID();
        ?>
">
						<input id="edititemsubmit" type="submit" name="edititem" value="Submit">
					</dd>
				</dl>
			</form>

		<?php 
        include "htmlfooter.php";
    }
示例#2
0
 */
/*------------------------------------------------------------------------------
(c) 2010 JISC-funded EASiHE project, University of Southampton
Licensed under the Creative Commons 'Attribution non-commercial share alike' 
licence -- see the LICENCE file for more details
------------------------------------------------------------------------------*/
if (isset($_REQUEST["itemtype"])) {
    // item type chosen
    // look for a item type class with this name
    $classname = "QTI" . ucfirst($_REQUEST["itemtype"]);
    if (!@class_exists($classname) || !is_subclass_of($classname, "QTIAssessmentItem")) {
        servererror("Item type doesn't exist or not implemented");
    }
    $ai = new $classname();
    $ai->sessionStore();
    $action = new EditAssessmentItemAction();
    redirect($action->actionURL($ai, false));
}
// choose from a list of item types
$items = item_types();
$GLOBALS["title"] = "New assessment item";
include "htmlheader.php";
?>
<h2><?php 
echo $GLOBALS["title"];
?>
</h2>
<p>The first stage is to choose an item type.</p>
<dl>
	<?php 
foreach ($items as $item) {