Changeset 112 for Dev/trunk/classes/QuestionCreationTool.php
- Timestamp:
- 09/19/11 16:29:02 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/classes/QuestionCreationTool.php
r108 r112 244 244 categoryBox.appendChild(categoryInput); 245 245 } 246 246 247 function clearFields() 248 { 249 clearCategory(); 250 clearCode(); 251 clearTitle(); 252 clearDescription(); 253 clearType(); 254 } 255 256 function clearCategory() 257 { 258 var categoryBox = document.getElementById("categoryBox"); 259 categoryBox.innerHTML = ""; 260 261 var questionCategorySelect = document.createElement("select"); 262 questionCategorySelect.setAttribute("name", "questionCategory"); 263 questionCategorySelect.id = "questionCategorySelect"; 264 265 var newCategoryButton = document.createElement("input"); 266 newCategoryButton.setAttribute("type", "button"); 267 newCategoryButton.setAttribute("onclick", "newCategory()"); 268 newCategoryButton.setAttribute("value", "New Category"); 269 newCategoryButton.className = "surveyButton"; 270 271 categoryBox.appendChild(questionCategorySelect); 272 categoryBox.appendChild(newCategoryButton); 273 } 274 275 function clearCode() 276 { 277 var codeInput = document.getElementById("questionCode"); 278 codeInput.value = ""; 279 } 280 281 function clearTitle() 282 { 283 var titleInput = document.getElementById("questionTitle"); 284 titleInput.value =""; 285 } 286 287 function clearDescription() 288 { 289 var descriptionInput = document.getElementById("questionDescription"); 290 descriptionInput.value = ""; 291 } 292 293 function clearType() 294 { 295 var typeSelect = document.getElementById("questionTypeSelect"); 296 typeSelect.selectedIndex = 0; 297 } 298 247 299 </script> 248 300 <?php … … 273 325 <td><label for="questionCategory">Category</label></td> 274 326 <td id="categoryBox"><!-- Select should be filled with existing categories--> 275 <select name="questionCategory">327 <select id="questionCategorySelect" name="questionCategory"> 276 328 <option value='Test Category'>Test Category</option> 277 329 </select> … … 295 347 <td><label for="questionType">Type answer</label></td> 296 348 <td id="questionType"> 297 <select name="questionType" onchange="handleType(this)">349 <select id="questionTypeSelect" name="questionType" onchange="handleType(this)"> 298 350 <option value='text' selected='selected'>Text</option> 299 351 <option value='int'>Integer</option> … … 306 358 </table> 307 359 <div id="answerSpecifications"></div> 360 <input id="clearQuestionFields" type="button" onclick="clearFields()" class="surveyButton" value="Clear" /> 308 361 <input id="saveQuestion" type="submit" class="surveyButton" value="Save" /> 309 362 </form>
Note: See TracChangeset
for help on using the changeset viewer.