Ignore:
Timestamp:
01/17/12 18:17:51 (13 years ago)
Author:
fpvanagthoven
Message:
  • Faal met perongeluk de database committen-_- Maar is weer deleted, zou nu weer moeten werken.
  • QuestionEditor? werkt nu grotendeels, paar kleine afwerkingsfoutjes (en data die nog niet in de DB passen)
  • selectQuestion scherm gemaakt, is nog niet zo multifunctioneel als je zou hopen. Ideaal gezien zou dit ipv een statische PHP pagina, een JS driven widget worden die je bijvoorbeeld kan gebruiken voor "Add existing question" in de surveyEditor.
  • Zelfde voor selectApplication.php en selectSurvey.php.
  • objectSelectionWidget class maken voor dit doeleind? (Na demo!)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/branches/jos-branch/questionEditor.php

    r208 r237  
    11<?php
    22require 'classes/master.php'; //should be at top of every page
     3
     4if (!isset($_SESSION['userUid'])) {
     5    redirect("index.php");
     6}
     7
     8if (!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
    315?>
    416
    5 <!--
    6 To change this template, choose Tools | Templates
    7 and open the template in the editor.
    8 -->
    917<!DOCTYPE html>
    1018<html>
    1119    <head>
    1220        <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>
    1424        <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'); ?>
    1653    </head>
    1754    <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">
    2364                    </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="" />
    4867                    </div>
    4968                </div>
Note: See TracChangeset for help on using the changeset viewer.