You are on page 1of 12

<HTML> <HEAD> <META http-equiv="content-type" content="text/html; charset=utf-8"> <script language ="javascript" src="jquery.js"></script> <script language ="javascript" src="grid.

js"></script> <script src="cms.js" type="text/javascript"></script> <title>Quizzes and Surveys</title> </HEAD> <link href="style/index.css" type="text/css" rel="stylesheet" /> <link href="style/grid.css" type="text/css" rel="stylesheet" /> <BODY bgcolor="#97A3AF" > <script language="javascript"> window.onscroll = function() { MoveLoadingMessage("loadingDiv"); } jQuery.ajaxSetup({ beforeSend: function() { $('#loadingDiv').show() }, complete: function(){ $('#loadingDiv').hide() }, success: function() {} }); </script> <table style="display:none" id="loadingDiv" style="position: absolute; left: 10px; top: 10px"> <tr> <td> <table> <tr> <td bgcolor="red"> <font color="white" size="3"><b>&nbsp;Please wait ...&nbsp;</b></font> </td> </tr> </table> </td> </tr> </table> <script language="javascript">

MoveLoadingMessage("loadingDiv"); </script> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="middle"> <td> <img src="style/i/logo.gif" /> </td> <td> </td> <td valign="middle"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr valign="middle"> <td width="150px" valign="middle"> <img src="style/i/bg_3.gif" /> </td> <td> </td> </tr> </table> </td> </tr> <tr> <td class="c_menu_td" valign="top" style="width:170px"> <br> <table> <tr> <td > <a class="menu_child_name" href='index.php?module=cats'>Categories</a> </td> </tr> <tr> <td > <a class="menu_child_name" href='index.php?module=quizzes'>Quizzes</a> </td> </tr> <tr> <td > <a class="menu_child_name" href='index.php?module=add_edit_quiz'>New Quiz</a> </td> </tr> <tr> <td > <a class="menu_child_name" href='index.php?module=local_users'>Local users</a> </td> </tr> <tr>

<td > <a class="menu_child_name" href='index.php?module=add_edit_user'>New user</a> </td> </tr> <tr> <td > <a class="menu_child_name" href='index.php?module=assignments'>Assignments</a> </td> </tr> <tr> <td > <a class="menu_child_name" href='index.php?module=add_assignment'>New Assignment</a> </td> </tr> </table> </td> <td width="15px"></td> <td align="center" valign="top" bgcolor="#F4F5F7" > <table width="95%" cellpadding="0" cellspacing="0" border="0" > <tr> <td align="right"> <a href="logout.php" border="1"><img border=0 src="style/i/logout.gif" /></a>&nbsp;&nbsp;&nbsp; </td> </tr> <tr> <td valign="top" bgcolor="#F4F5F7"> <table width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="main_table_desc_text"> <font color="black"> Add/Edit question </font> </td> </tr> <tr> <td><br><hr><br></td> </tr> </table> </td> </tr> <tr height="550px"> <td valign="top"> <script language="JavaScript" type="text/javascript" src="rte/html2xhtml.js"></script> <script language="JavaScript" type="text/javascript" src="rte/richtext.js"></script>

<script language="JavaScript" type="text/javascript" src="lib/validations.js"></script>

<form id="form1" method="post" onsubmit="return submitForm();"> <table class="desc_text" style="width:850px"> <tr> <td valign="top"> Question : </td> <td> <textarea name="txtQstsEd" rows="8" cols="60">&lt;p&gt; Who is in photo ?&lt;/p&gt; &lt;p&gt; &lt;img alt=&quot;&quot; src=&quot;editor_images/1.jpg&quot; style=&quot;width: 200px; height: 200px&quot; /&gt;&lt;/p&gt;</textarea> <script type="text/javascript">//<![CDATA[ window.CKEDITOR_BASEPATH='ckeditor/'; //]]></script> <script type="text/javascript" src="ckeditor/ckeditor.js?t=B8DJ5M3"></script> <script type="text/javascript">//<![CDATA[ CKEDITOR.replace('txtQstsEd'); //]]></script> </td> </tr> <tr> <td> Point: </td> <td> <input style="width:100px" type="text" id="txtPoint" value="10" name="txtPoint"> </td> </tr> <tr> <td valign="top"> Header text : </td> <td> <textarea style="width:100%;height:70px" id="txtHeader" name="txtHeader">First question is linked to image .</textarea> </td> </tr> <tr> <td valign="top">

Footer text : </td> <td> <textarea style="width:100%;height:70px" id="txtFooter" name="txtFooter">Please, click Next button if you don't know answer</textarea> </td> </tr> <tr> <td> Select template : </td> <td> <select id="drpTemplate" name="drpTemplate" style="width:100%" onchange="ChangeTemplate()"> <option value=-1>Not selected</option><option value="0">Multi answer (checkbox)</option><option selected value="1">One answer (radio button)</option><option value="3">Free text (textarea)</option><option value="4">Multi text (numbers only)</option> </select> </td> </tr> </table> <table style="width:850px"> <tr style="display:none" id="trMulti"> <td align="center"> <table class="desc_text" id="tblMulti" > <tr> <td>Header text (can be empty):</td> <td><input type="text" value="" name="txtMultiGroupName" id="txtMultiGrpName"></td> </tr> <tr> <td colspan="2"><hr></td> </tr> <tr> <td>Answer Variants </td> <td class="desc_text">Correct answer </td> </tr> <tr> <td> <input type="text" id="txtChoise1" value="Bill Gates" name="txtMulti1"></td> <td><input type="checkbox" id="chkMulti1" name="chkMulti1" ></td> </tr> <tr>

<td> <input type="text" id="txtChoise1" value="Michael Dell" name="txtMulti2"></td> <td><input type="checkbox" id="chkMulti2" name="chkMulti2" ></td> </tr> <tr> <td> <input type="text" id="txtChoise1" value="Steve Jobs" name="txtMulti3"></td> <td><input type="checkbox" id="chkMulti3" name="chkMulti3" ></td> </tr> <tr> <td> <input type="text" id="txtChoise1" value="Bruce Lee" name="txtMulti4"></td> <td><input type="checkbox" id="chkMulti4" name="chkMulti4" ></td> </tr> </table> <table width="170px"> <tr> <td align="center"><input style="width:25px" type="button" value=" + " onclick="addRow('tblMulti','txtMulti')" /> <input style="width:25px" type="button" value=" - " onclick="deleteRow('tblMulti')" /> </td> </tr> </table> </td> </tr> <tr style="display:none" id="trOne" > <td align="center"> <table id="tblOne" class="desc_text" > <tr> <td>Header text (can be empty):</td> <td><input type="text" value="" name="txtOneGroupName"></td> </tr> <tr> <td colspan="2"><hr></td> </tr> <tr> <td>Answer Variants </td> <td class="desc_text">Correct answer </td> </tr> <tr>

<td> <input type="text" id="txtChoise1" name="txtOne1" value="Bill Gates"></td> <td><input type="radio" name="rdOne" value="1"></td> </tr> <tr> <td> <input type="text" id="txtChoise2" name="txtOne2" value="Michael Dell"></td> <td><input type="radio" name="rdOne" value="2"></td> </tr> <tr> <td> <input type="text" id="txtChoise3" name="txtOne3" value="Steve Jobs"></td> <td><input type="radio" name="rdOne" value="3"></td> </tr> <tr> <td> <input type="text" id="txtChoise4" name="txtOne4" value="Bruce Lee"></td> <td><input type="radio" name="rdOne" value="4"></td> </tr> </table> <table width="170px"> <tr> <td align="center"><input style="width:25px" type="button" value=" + " onclick="addRow('tblOne','txtOne')" /> <input style="width:25px" type="button" value=" - " onclick="deleteRow('tblOne')" /> </td> </tr> </table> </td> </tr> <tr style="display:none" id="trArea"> <td align="center"> <table id="tblArea" class="desc_text"> <tr> <td valign="top" align="right"> Header text (can be empty): </td> <td> <input style="width:300px" type="text" value="" name="txtAreaGroupName"></td> </tr> <tr> <td valign="top" align="right">

Enter correct answer (can be empty): </td> <td> <textarea style="width:300px;height:100px" name="txtArea1"></textarea> <td> </tr> </table> </td> </tr> <tr style="display:none" id="trMultiText"> <td align="center"> <table id="tblMultiText" class="desc_text"> <tr> <td>Header text (can be empty):</td> <td><input type="text" value="" name="txtMultiTextGroupName"></td> </tr> <tr> <td colspan="2"><hr></td> </tr> <tr> <td>Answer Variants </td> <td class="desc_text">Correct answer </td> </tr> <tr> <td> <input type="text" id="txtChoise1" name="txtMultiText1" value="Bill Gates"></td> <td><input type="text" id="txtText1" name="txtMultiCrctAnswer1" value=""></td> </tr> <tr> <td> <input type="text" id="txtChoise2" name="txtMultiText2" value="Michael Dell"></td> <td><input type="text" id="txtText2" name="txtMultiCrctAnswer2" value=""></td> </tr> <tr> <td> <input type="text" id="txtChoise3" name="txtMultiText3" value="Steve Jobs"></td> <td><input type="text" id="txtText3" name="txtMultiCrctAnswer3" value=""></td> </tr> <tr>

<td> <input type="text" id="txtChoise4" name="txtMultiText4" value="Bruce Lee"></td> <td><input type="text" id="txtText4" name="txtMultiCrctAnswer4" value=""></td> </tr> </table> <table width="320px"> <tr> <td align="center"><input style="width:25px" type="button" value=" + " onclick="addRow('tblMultiText','txtMultiText')" /> <input style="width:25px" type="button" value=" - " onclick="deleteRow('tblMultiText')" /> </td> </tr> </table> <table style="display:none"> <tr> <td><input type="checkbox" id="chkAllowNumbers" name="chkAllowNumbers" /><label id="lbl1" for="chkAllowNumbers">Allow users to enter only numbers</label></td> </tr><tr> <td><input type="checkbox" id="chkDontCalc" name="chkDontCalc" /><label id="lbl1" for="chkDontCalc">Do not calculate results of this question</label></td> </tr> </table> </td> </tr>

</table> <br> <hr /> <br> <table style="width:850px"> <tr> <td align="center"> <input type="submit" id="btnSave" name="btnSave" value="Save" style="width:150px"> <input type="button" id="btnCancel" name="btnCancel" value="Cancel" style="width:150px" onclick="javascript:window.location.href='?module=questions'"> </td> </tr> </table> <script type="text/javascript"> CKEDITOR.config.width ='740px'; </script>

<SCRIPT language="javascript"> ChangeTemplate(); //var c_multi = 4; var counters = new Array(); var answer_count = 4; counters["tblMulti"] = answer_count; counters["tblOne"] = answer_count; counters["tblArea"] = answer_count; counters["tblMultiText"] = answer_count; function addRow(tableID, textboxID ) { counters[tableID]++; var table = document.getElementById(tableID); var rowCount = table.rows.length; var row = table.insertRow(rowCount); var colCount = table.rows[0].cells.length; for(var i=0; i<colCount; i++) { var newcell = row.insertCell(i); newcell.innerHTML = table.rows[3].cells[i].innerHTML.replace(new RegExp("1",'g'),counters[tableID]); //alert(newcell.childNodes); switch(newcell.childNodes[0].type) { case "text": newcell.childNodes[0].value = ""; var txtname=newcell.childNodes[0].name; var newname=txtname.substr(0,txtname.length-1)+counters[tableID]; newcell.childNodes[0].id=newname; newcell.childNodes[0].name=newname; break; case "checkbox": newcell.childNodes[0].checked = false; newcell.childNodes[0].id="chkMulti"+counters[tableID]; newcell.childNodes[0].name="chkMulti"+counters[tableID]; break; case "select-one":

newcell.childNodes[0].selectedIndex = 0; newcell.childNodes[0].value=counters[tableID]; break; } } } function deleteRow(tableID) { var table = document.getElementById(tableID); var rowCount = table.rows.length; if(rowCount==4) { alert('Cannot delete last choise'); return; } table.deleteRow(rowCount-1); counters[tableID]--; } function ChangeTemplate() { DisableAllTemplates(); var val = document.getElementById('drpTemplate').options[document.getElementById('drpTemplate').selec tedIndex].value; if(val ==0) { document.getElementById('trMulti').style.display=""; } else if(val==1) { document.getElementById('trOne').style.display=""; } else if(val==3) { document.getElementById('trArea').style.display=""; } else if(val==4) { document.getElementById('trMultiText').style.display=""; } }

function DisableAllTemplates() { document.getElementById('trMulti').style.display="none"; document.getElementById('trOne').style.display="none"; document.getElementById('trArea').style.display="none"; document.getElementById('trMultiText').style.display="none"; } </SCRIPT> </form> </td> </tr> </table> </td> </tr> </table> <table style="width:100%" style="display:none"> <tr> <td bgcolor="white"> <table style="width:100%" cellpadding="0" cellspacing="0"> </table> </td> </tr> </table> </BODY> </HTML>

You might also like