Skip to content

Commit

Permalink
Add "jump to assessment ID" option to admin utils
Browse files Browse the repository at this point in the history
  • Loading branch information
drlippman committed Dec 28, 2017
1 parent 21f929b commit 569459b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions util/utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@
if (isset($_POST['action']) && $_POST['action']=='jumptoitem') {
if (!empty($_POST['cid'])) {
header('Location: ' . $GLOBALS['basesiteurl'] . "/course/course.php?cid=".Sanitize::courseId($_POST['cid']));
} else if (!empty($_POST['aid'])) {
$stm = $DBH->prepare("SELECT courseid FROM imas_assessments WHERE id=?");
$stm->execute(array($_POST['aid']));
$destcid = $stm->fetchColumn(0);
header('Location: ' . $GLOBALS['basesiteurl'] . "/course/addassessment.php?cid=".Sanitize::onlyInt($destcid)."&id=".Sanitize::onlyInt($_POST['aid']));
} else if (!empty($_POST['pqid'])) {
header('Location: ' . $GLOBALS['basesiteurl'] . "/course/testquestion.php?qsetid=".Sanitize::onlyInt($_POST['pqid']));
} else if (!empty($_POST['eqid'])) {
Expand All @@ -84,6 +89,7 @@
echo '<input type=hidden name=action value="jumptoitem" />';
echo '<p>Jump to:<br/>';
echo 'Course ID: <input type="text" size="8" name="cid"/><br/>';
echo 'Assessment ID: <input type="text" size="8" name="aid"/><br/>';
echo 'Preview Question ID: <input type="text" size="8" name="pqid"/><br/>';
echo 'Edit Question ID: <input type="text" size="8" name="eqid"/><br/>';
echo '<input type="submit" value="Go"/>';
Expand Down

0 comments on commit 569459b

Please sign in to comment.