Location: PHPKode > projects > Nukequiz > html/modules/Nukequiz/admin/NQAAddQuestion.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_ADMINADDQUESTION;
include ("header.php");
nqmenuheader();
$imagesdir = $nq_config['images_directory'];
OpenTable();
$points ='1';
echo "<br><center><font class='title'>"._NQ_ADDQUES."</font>&nbsp;:&nbsp;$title&nbsp;&nbsp;[&nbsp;$quizdir&nbsp;]</center><br>"
."<form method='post' action='".$admin_file.".php'>"
."<input type='hidden' name='file' value='admin'>"
."<input type='hidden' name='op' value='nqsavenewquestion'>"
."<input type='hidden' name='qid' value='$qid'>"
."<br><center><table border='0' cellpadding='2' cellspacing='2'>"
."<tr><td>".quizhelp_img(_NQ_HELPQUESTION)."</td><td align='left'>"._NQ_QUES."</td><td align='left'>"
."<textarea wrap='virtual' name='question' cols='60' rows='4'>$question</textarea></td>"
."<tr><td>".quizhelp_img(_NQ_HELPOPTION)."</td><td align='left'>"._NQ_OPTION."&nbsp;1</td>"
."<td align='left'><textarea wrap='virtual' name='sol1' cols='60' rows='4'>$sol1</textarea></td>"
."<tr><td>".quizhelp_img(_NQ_HELPOPTION)."</td><td align='left'>"._NQ_OPTION."&nbsp;2</td>"
."<td align='left'><textarea wrap='virtual' name='sol2' cols='60' rows='4'>$sol2</textarea></td>"
."<tr><td>".quizhelp_img(_NQ_HELPOPTION)."</td><td align='left'>"._NQ_OPTION."&nbsp;3</td>"
."<td align='left'><textarea wrap='virtual' name='sol3' cols='60' rows='4'>$sol3</textarea></td>"
."<tr><td>".quizhelp_img(_NQ_HELPOPTION)."</td><td align='left'>"._NQ_OPTION."&nbsp;4</td>"
."<td align='left'><textarea wrap='virtual' name='sol4' cols='60' rows='4'>$sol4</textarea></td>"
."<tr><td>".quizhelp_img(_NQ_HELPQUESTYPE)."</td>"
."<td align='left'>"._NQ_QUESTIONTYPE."</td>"
."<td><table width='100%' cellpadding='2' cellspacing='2' border='0'><tr>"
."<td align='center'>"._NQ_MULCHOICEQ."</td><td align='center'>"._NQ_MULANSQ."</td><td align='center'>"._NQ_OPENQ."</td></tr><tr>"
."<td align='center'><input type='checkbox'  name='ismcq' $ismcq></td><td align='center'>"
."<input type='checkbox'  name='ismultiple' $ismultiple></td>"
."<td align='center'><input type='checkbox' name='isoe' $isoe></td>"
."</tr></table></td>"
."</tr><td>".quizhelp_img(_NQ_HELPCORRECTANS)."</td><td align='left'>"._NQ_CANSWER."</td>"
."<td align='left'><input type='text' name='answer' value='$answer' size='8'></td></tr>"
."</tr><td>".quizhelp_img(_NQ_HELPEXPLAIN)."</td><td align='left'>"._NQ_EXPLAINED."</td><td align='left'>"
."<textarea wrap='virtual' cols='60' rows='4' name='qexplain'>"._NQ_QEXPLAIN."</textarea></td></tr>"
."<tr><td>".quizhelp_img(_NQ_HELPPOINTSVALUE)."</td><td align='left'>"._NQ_POINTSVALUE."</td>"
."<td align='left'><input type='text' name='points' value='$points' size='4'></td></tr>"
."<tr><td>".quizhelp_img(_NQ_HELPIMAGE)."</td><td align='left'>"._NQ_QUESTIONFILE."</td><td align='left'>"
."<select name='image' value='$image' onchange=\"this.form.submit()\">";
$resulta = $db->sql_query("SELECT dir FROM ".$prefix."_nquiz_quiz WHERE qid='$qid'");
list($qdir) = $db->sql_fetchrow($resulta);
$dir_name="modules/$module_name/$imagesdir/$qdir";
$handle=opendir($dir_name);
$count=0;
while (($file = readdir($handle))!==false) {	
if (substr($file,-4) == ".jpg" || substr($file,-4) == ".jpeg" || substr($file,-4) == ".png" || substr($file,-4) == ".gif" || substr($file,-4) == ".mid" || substr($file,-4) == ".mp3" || substr($file,-4) == ".wav"){
$clist .= "$file ";
	}
}
closedir($handle); 
echo "<option name='image' value=\"$clist[i]\" selected>"._NQ_SELECTIMAGE."</option>";
echo "<option name='image' value=\""._NQ_NONE."\">"._NQ_NONE."";
$clist = explode(" ", $clist);
sort($clist);
for ($i=1; $i < sizeof($clist); $i++) {
if($clist[$i]!="") {
echo "<option name='image' value=\"$clist[$i]\">$clist[$i]";
   }
}
echo "</select><br></td></tr>";
echo "<tr><td>".quizhelp_img(_NQ_HELPPREVIEWIMAGES)."</td>";
nqdisplayimagewin();
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></td>";
echo "</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