paulb@31 | 1 | <?xml version="1.0" encoding="iso-8859-1"?> |
paulb@31 | 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN" |
paulb@31 | 3 | "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd"> |
paulb@31 | 4 | <html xmlns="http://www.w3.org/1999/xhtml" |
paulb@31 | 5 | xmlns:template="http://www.boddie.org.uk/ns/xmltools/template"> |
paulb@31 | 6 | <head> |
paulb@31 | 7 | <title>Questionnaire Editor</title> |
paulb@91 | 8 | <link xmlns:xlink="http://www.w3.org/1999/xlink" href="styles/styles.css" |
paulb@31 | 9 | rel="stylesheet" type="text/css" /> |
paulb@31 | 10 | </head> |
paulb@31 | 11 | |
paulb@31 | 12 | <body template:element="questionnaire"> |
paulb@31 | 13 | <h1>Questionnaire Editor</h1> |
paulb@31 | 14 | |
paul@674 | 15 | <form method="POST" action="" enctype="multipart/form-data"> |
paulb@31 | 16 | |
paul@674 | 17 | <p> |
paul@674 | 18 | Either import a previously generated XML file: |
paul@674 | 19 | <input type="file" name="importfile" /> |
paul@674 | 20 | <input type="submit" value="Import" name="import" /> |
paul@674 | 21 | </p> |
paulb@31 | 22 | |
paul@687 | 23 | <p class="error" template:if="@error">The file could not be loaded.</p> |
paul@687 | 24 | |
paul@673 | 25 | <div class="questionnaire"> |
paul@673 | 26 | |
paul@674 | 27 | <p>Or enter questions and possible responses below.</p> |
paul@674 | 28 | |
paulb@31 | 29 | <table class="questionnaire"> |
paul@674 | 30 | <tbody template:element="question" template:init="no"> |
paulb@31 | 31 | <tr> |
paul@674 | 32 | <th class="question"> |
paul@674 | 33 | Question #<span template:value="count(preceding-sibling::question) + 1">n</span><br/> |
paul@674 | 34 | <span class="control"> |
paul@674 | 35 | <input type="submit" value="Move to..." name="..." template:selector-field="move-question" /> |
paul@674 | 36 | <select template:attribute-field="destination"> |
paul@674 | 37 | <option template:select="../question" template:value="position()" value="{position()}"></option> |
paul@674 | 38 | </select> |
paul@674 | 39 | </span> |
paul@674 | 40 | </th> |
paul@673 | 41 | <td class="question"> |
paul@673 | 42 | <textarea cols="40" rows="4" template:attribute-area="question-text,insert" |
paul@673 | 43 | name="...">Question</textarea> |
paul@673 | 44 | </td> |
paulb@31 | 45 | <td class="question-options"> |
paul@673 | 46 | <input type="submit" value="Remove question" name="..." template:selector-field="remove-question" /> |
paul@673 | 47 | </td> |
paulb@31 | 48 | </tr> |
paulb@31 | 49 | <tr> |
paulb@31 | 50 | <th class="response">Response</th> |
paul@673 | 51 | <td class="response"> |
paul@673 | 52 | <input type="checkbox" template:attribute-button="choice-response,multiple,checked" |
paul@673 | 53 | name="..." value="choice" /> Allow multiple choices... |
paul@673 | 54 | </td> |
paul@673 | 55 | <td class="response"> |
paul@673 | 56 | <input type="submit" value="Add choice" name="..." template:selector-field="add-choice,choice" /> |
paul@673 | 57 | </td> |
paulb@31 | 58 | </tr> |
paul@674 | 59 | <tr template:element="choice" template:init="no"> |
paul@674 | 60 | <td class="choice"> |
paul@674 | 61 | <select template:multiple-choice-field="response-type,value" name="..."> |
paul@674 | 62 | <option template:multiple-choice-value="response-type-enum,value,selected,text()"></option> |
paul@674 | 63 | </select> |
paul@674 | 64 | </td> |
paul@673 | 65 | <td class="choice"> |
paul@673 | 66 | <input type="text" size="40" template:attribute-field="response-choice" |
paul@673 | 67 | name="..." value="..." /> |
paul@673 | 68 | </td> |
paulb@31 | 69 | <td class="choice-options"> |
paul@673 | 70 | <input type="submit" value="Remove choice" name="..." template:selector-field="remove-choice" /> |
paul@673 | 71 | </td> |
paulb@31 | 72 | </tr> |
paulb@31 | 73 | </tbody> |
paulb@31 | 74 | </table> |
paulb@31 | 75 | |
paul@674 | 76 | </div> |
paul@674 | 77 | |
paul@674 | 78 | <!-- Repeat the questionnaire in preview mode. --> |
paul@674 | 79 | |
paul@681 | 80 | <div class="preview" template:if="question"> |
paul@674 | 81 | |
paul@674 | 82 | <p>The preview of your questionnaire is shown here:</p> |
paul@674 | 83 | |
paul@674 | 84 | <div class="shadow"> |
paul@674 | 85 | |
paul@674 | 86 | <table class="preview"> |
paul@674 | 87 | <tbody template:element="question" template:output="true" template:init="no"> |
paul@674 | 88 | <tr> |
paul@674 | 89 | <th class="question">Question #<span template:value="count(preceding-sibling::question) + 1">n</span></th> |
paul@674 | 90 | <td class="question"> |
paul@674 | 91 | <span template:value="@question-text">Question</span> |
paul@674 | 92 | </td> |
paul@674 | 93 | </tr> |
paul@674 | 94 | <tr> |
paul@674 | 95 | <th class="response">Response</th> |
paul@674 | 96 | <td class="response"> |
paul@674 | 97 | <div template:element="choice" template:init="no"> |
paul@674 | 98 | <p template:if="@response-choice != '' or not(response-type/@value = 'text')" xml:space="preserve"> |
paul@674 | 99 | <input template:if="not(response-type/@value = 'text')" |
paul@674 | 100 | type="{template:choice(../@choice-response = 'multiple', 'checkbox', 'radio')}" |
paul@674 | 101 | name="_unused" value="..." /> |
paul@674 | 102 | <span template:value="@response-choice">Choice</span> |
paul@674 | 103 | </p> |
paul@674 | 104 | <p template:if="response-type/@value and not(response-type/@value = 'choice')"> |
paul@674 | 105 | <input type="text" size="40" name="_unused" /> |
paul@674 | 106 | </p> |
paul@674 | 107 | </div> |
paul@674 | 108 | </td> |
paul@674 | 109 | </tr> |
paul@674 | 110 | </tbody> |
paul@674 | 111 | </table> |
paul@674 | 112 | |
paul@674 | 113 | </div> |
paul@674 | 114 | |
paul@674 | 115 | </div> |
paul@674 | 116 | |
paul@674 | 117 | <div class="operations"> |
paul@674 | 118 | |
paulb@31 | 119 | <p> |
paul@673 | 120 | <input type="submit" value="Add question" name="add-question" /> to make |
paul@673 | 121 | the questionnaire longer. |
paul@673 | 122 | </p> |
paulb@31 | 123 | |
paulb@31 | 124 | <p> |
paul@674 | 125 | <input type="submit" value="Update" name="update" /> to refresh the preview. |
paul@674 | 126 | </p> |
paul@674 | 127 | |
paul@674 | 128 | <p> |
paul@674 | 129 | <input type="submit" value="Export" name="export" /> to produce an XML file |
paul@674 | 130 | containing the questions and responses. |
paul@674 | 131 | </p> |
paul@674 | 132 | |
paul@674 | 133 | <p> |
paul@673 | 134 | <input type="submit" value="Finish" name="finish" /> when all the questions |
paul@673 | 135 | and responses are ready. |
paul@673 | 136 | </p> |
paul@673 | 137 | |
paul@673 | 138 | </div> |
paul@673 | 139 | |
paulb@31 | 140 | </form> |
paul@673 | 141 | |
paulb@31 | 142 | </body> |
paulb@31 | 143 | </html> |