Changeset 237 for Dev/branches/jos-branch/questionEditor.php
- Timestamp:
- 01/17/12 18:17:51 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/jos-branch/questionEditor.php
r208 r237 1 1 <?php 2 2 require 'classes/master.php'; //should be at top of every page 3 4 if (!isset($_SESSION['userUid'])) { 5 redirect("index.php"); 6 } 7 8 if (!isset($_POST['questionUid']) || empty($_POST['questionUid'])) { 9 redirect("index.php"); 10 } else { 11 $questionUid = $_POST['questionUid']; 12 } 13 14 $questions = Question::get(array()); //Get all questions 3 15 ?> 4 16 5 <!--6 To change this template, choose Tools | Templates7 and open the template in the editor.8 -->9 17 <!DOCTYPE html> 10 18 <html> 11 19 <head> 12 20 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 13 <title></title> 21 <title>Research tool</title> 22 <script type="text/javascript" src="js/generalScripts.js"></script> 23 <script type="text/javascript" src="js/sequencerScripts.js"></script> 14 24 <script type="text/javascript" src="js/questionEditorScripts.js"></script> 15 <?php new StyleSheet("awesome"); ?> 25 <script type="text/javascript"> 26 window.onload = loadfn; 27 28 function saveAndReturn_override() { 29 // This should be the override function for the save button on the questionEditor (smallFrame). 30 // It should redirect back to the selectQuestion.php page after the standard questionEditor script saves the changes (or not). 31 alert("DUH!"); 32 window.location = "selectQuestion.php"; 33 } 34 35 function loadfn() { 36 questionEditor.init(); 37 ge("questionEditor_innerFrame").appendChild(questionEditor.element); 38 ge("btnSave").addEventListener("mouseup", saveAndReturn_override, true); 39 request = new Array({ 40 type: "Question", 41 uid: "<?php echo $questionUid ?>" 42 }); 43 44 var requestString = "args="+JSON.stringify(request); 45 newAjaxRequest(requestString, "getObject.php", function(result){ 46 questionEditor.setValues(result.responseText); 47 }, true); 48 49 } 50 </script> 51 52 <?php new Stylesheet('visualEditors'); ?> 16 53 </head> 17 54 <body> 18 <div id="wrapper"> 19 <div id="content"> 20 <div id="questionEditor"> 21 <div id="questionEditor_header"> 22 Editing: <span id="header_identifier">#QUESTION-IDENT-NO</span> 55 <div id="header"> 56 <?php new Logo(); ?> 57 </div> 58 59 <div id="content"> 60 <div id="wrapper"> 61 <div id="questionEditor_outer" class="largeFrame"> 62 <div class="largeTitle">Edit Question</div> 63 <div class="innerLargeFrame" id="questionEditor_innerFrame"> 23 64 </div> 24 <div id="questionEditor_content"> 25 <h2>Question text:</h2> 26 <div id="questionEditor_bodyText"> 27 <textarea id="questionEditor_bodyText_textArea" onKeyUp="resizeTextArea();">THIS IS THE QUESTION BODY TEXT. CLICK HERE TO EDIT!</textarea> 28 </div> 29 <div id="questionEditor_questionParams" > 30 <label for="questionIdentifierField" class="formLineBreak">Question tag:</label> <input type="text" id="questionIdentifierField" class="questionParamField" onChange="updateIdentifier();" /> 31 32 <label for="questionType" class="formLineBreak">Answer type:</label> 33 <select id="questionType" onChange="selectAnswerType();" class="questionParamField"> 34 <option value=""></option> 35 <option value="int">Integer</option> 36 <option value="scale">Scale</option> 37 <option value="choice">Multiple choice</option> 38 <option value="text">Text</option> 39 </select> 40 41 42 43 </div> 44 </div> 45 <div id="questionEditor_controls"> 46 <input type="button" id="discard" value="Discard" /> 47 <input type="button" value="Save" /> 65 <div class="controls"> 66 <input type="button" value="???" id="btnSaveQuestion" class="smallButton" onclick="" /> 48 67 </div> 49 68 </div>
Note: See TracChangeset
for help on using the changeset viewer.