Location: PHPKode > projects > Nukequiz > html/modules/Nukequiz/admin/NQAModifyQuestion.php
<?php
/*****************************************************************/
/* Nukequiz (tm)    v 3.1.0                                		 */
/* By: Kissoftware (hide@address.com)      		     */
/* http://www.kissoftware.org.uk                           		 */
/* http://www.kissoftware.co.uk                       		     */
/* Copyright © 2003-2008 by Kissoftware         				 */
/* See Docs For Information & Credits                 			 */
/* For More information Visit Forums Or The Online Help Manual	 */
/*****************************************************************/
$pagetitle = _NQ_ADMINMODIFYQUES;
include ("header.php");
nqmenuheader();
$imagesdir = $nq_config['images_directory'];
OpenTable();
$result = $db->sql_query("SELECT * FROM ".$prefix."_nquiz_questions WHERE quesid='$quesid'");
list ($quesid, $qid, $ismcq, $ismultiple, $isoe, $question, $sol1, $sol2, $sol3, $sol4, $answer, $points, $qexplain, $quesfile, $hits) = $db->sql_fetchrow($result);
echo "<br><center><font class='title'>"._NQ_MODIFYQUES."&nbsp;:&nbsp;$quesid</font></center><br>";
$question = preg_replace("/\"/","&quot;",$question);
$sol1 = stripslashes(check_html($sol1, "nohtml"));
$sol2 = stripslashes(check_html($sol2, "nohtml"));
$sol3 = stripslashes(check_html($sol3, "nohtml"));
$sol4 = stripslashes(check_html($sol4, "nohtml"));
if (!$quesfile) ($quesfile=""._NQ_NONE."");
if ($ismcq==1) { $ismcq = "checked"; }
if ($ismultiple==1) { $ismultiple = "checked"; }
if ($isoe==1) { $isoe = "checked"; }
echo "<form method='post' action='".$admin_file.".php'>";
echo "<input type='hidden' name='op' value='nqsavemodifyquestion'>";
echo "<input type='hidden' name='qid' value='$qid'>";
echo "<input type='hidden' name='quesid' value='$quesid'>";
echo "<br><center><table width='98%' border='0' cellpadding='2' cellspacing='2'>";
echo "<tr><td>".quizhelp_img(_NQ_HELPQUESTION)."</td><td align='left'>"._NQ_QUES."</td>";
echo "<td align='left'><textarea wrap='virtual'name='question'cols='80' rows='5'>$question</textarea></td>";
echo "<tr><td>".quizhelp_img(_NQ_HELPOPTION)."</td><td align='left'>"._NQ_OPTION."1</td>";
echo "<td><textarea wrap='virtual' name='sol1' cols='80' rows='5'>$sol1</textarea></td>";
echo "<tr><td>".quizhelp_img(_NQ_HELPOPTION)."</td><td align='left'>"._NQ_OPTION."2</td>";
echo "<td align='left'><textarea wrap='virtual' name='sol2' cols='80' rows='5'>$sol2</textarea></td>";
echo "<tr><td>".quizhelp_img(_NQ_HELPOPTION)."</td><td align='left'>"._NQ_OPTION."3</td>";
echo "<td align='left'><textarea wrap='virtual' name='sol3' cols='80' rows='5'>$sol3</textarea></td>";
echo "<tr><td>".quizhelp_img(_NQ_HELPOPTION)."</td><td align='left'>"._NQ_OPTION."4</td>";
echo "<td align='left'><textarea wrap='virtual' name='sol4' cols='80' rows='5'>$sol4</textarea></td>";
echo "<tr><td>".quizhelp_img(_NQ_HELPQUESTYPE)."</td>";
echo "<td align='left'>"._NQ_QUESTIONTYPE."</td>";
echo "<td><table width='100%'cellpadding='2'cellspacing='2'border='0'><tr>";
echo "<td align='center'>"._NQ_MULCHOICEQ."</td><td align='center'>"._NQ_MULANSQ."</td>";
echo "<td align='center'>"._NQ_OPENQ."</td></tr><tr>";
echo "<td align='center'><input type='checkbox'  name='ismcq' $ismcq></td>";
echo "<td align='center'><input type='checkbox'  name='ismultiple' $ismultiple></td>";
echo "<td align='center'><input type='checkbox' name='isoe' $isoe></td>";
echo "</tr></table></td>";
echo "</tr><td>".quizhelp_img(_NQ_HELPCORRECTANS)."</td><td align='left'>"._NQ_CANSWER."</td><td align='left'>";
echo "<input type='text' name='answer' value='$answer' size='8'></td></tr>";
echo "</tr><td>".quizhelp_img(_NQ_HELPEXPLAIN)."</td><td align='left'>"._NQ_EXPLAINED."</td><td align='left'>";
echo "<textarea wrap='virtual' cols='60' rows='4' name='qexplain'>$qexplain</textarea></td></tr>";
echo "<tr><td>".quizhelp_img(_NQ_HELPPOINTSVALUE)."</td><td align='left'>"._NQ_POINTSVALUE."</td>";
echo "<td align='left'><input type='text' name='points' value='$points' size='4'></td></tr>";
echo "<tr><td>".quizhelp_img(_NQ_HELPIMAGE)."</td><td align='left'>"._NQ_IMAGE."</td>";
echo "<td align='left'><select name='quesfile' onchange=\"this.form.submit()\">";
$ftitle = str_replace(" ", "_", $title);
$dir_name="modules/$module_name/$imagesdir/$quizdir";
$handle=opendir($dir_name);
while (($file = readdir($handle))!==false) {	
if(ereg(".gif|.png|.jpg|.wav|.mp3|.mid",$file))  { $clist[] = $file; } }
closedir($handle); 
echo "<option name='quesfile' value='' >"._NQ_SELECTIMAGE."</option>";
echo "<option name='quesfile' value=\""._NQ_NONE."\">"._NQ_NONE."";
sort($clist);
for ($i=0; $i < sizeof($clist); $i++) {
if($clist[$i]!="") {
$sel = "";
echo "<option name='quesfile' value=\"$clist[$i]\">$clist[$i]</option>\n";
}
}
echo "</select></td></tr><tr><td>".quizhelp_img(_NQ_HELPPREVIEWIMAGES)."</td>";
nqdisplayimagewin();
$imagesdir = $nq_config['images_directory'];
echo "<td><a href='".$admin_file.".php?&amp;op=nqdisplayquestionfiles&amp;quizdir=$quizdir&amp;title=$title' 		Onclick=\"displayimage(this.href,'','550','500','yes');return false;\">"._NQ_VIEWFILES."</a></td>";
echo "<td><b>"._NQ_CURRENTQUESFILESELECTED."&nbsp;:&nbsp;</b>$quesfile</td></tr></table></center><br>";
echo "<center><b>"._NQ_SUBMITNOTE."</b></center></form><br>";
echo "<center>"._GOBACK."</center><br>";
CloseTable();
include ('footer.php');
?>
Return current item: Nukequiz