1 <?xml version="1.0" encoding="iso-8859-1"?> 2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN" 3 "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd"> 4 <html xmlns="http://www.w3.org/1999/xhtml" 5 xmlns:template="http://www.boddie.org.uk/ns/xmltools/template"> 6 <head> 7 <title>Questionnaire Editor</title> 8 <link xmlns:xlink="http://www.w3.org/1999/xlink" href="styles/styles.css" 9 rel="stylesheet" type="text/css" /> 10 </head> 11 12 <body template:element="questionnaire"> 13 <h1>Questionnaire Editor</h1> 14 15 <p>Enter questions and possible responses below.</p> 16 17 <form method="POST" action=""> 18 19 <div class="questionnaire"> 20 21 <table class="questionnaire"> 22 <tbody template:element="question"> 23 <tr> 24 <th class="question">Question</th> 25 <td class="question"> 26 <textarea cols="40" rows="4" template:attribute-area="question-text,insert" 27 name="...">Question</textarea> 28 </td> 29 <td class="question-options"> 30 <input type="submit" value="Remove question" name="..." template:selector-field="remove-question" /> 31 </td> 32 </tr> 33 <tr> 34 <th class="response">Response</th> 35 <td class="response"> 36 <input type="radio" template:attribute-button="text-response,none,checked" 37 name="..." value="..." /> No text answer<br /> 38 <input type="radio" template:attribute-button="text-response,before,checked" 39 name="..." value="..." /> Text before<br /> 40 </td> 41 <td></td> 42 </tr> 43 <tr> 44 <td class="response"></td> 45 <td class="response"> 46 <input type="checkbox" template:attribute-button="choice-response,multiple,checked" 47 name="..." value="choice" /> Allow multiple choices... 48 </td> 49 <td class="response"> 50 <input type="submit" value="Add choice" name="..." template:selector-field="add-choice,choice" /> 51 </td> 52 </tr> 53 <tr template:element="choice"> 54 <td class="response"></td> 55 <td class="choice"> 56 <input type="text" size="40" template:attribute-field="response-choice" 57 name="..." value="..." /> 58 </td> 59 <td class="choice-options"> 60 <input type="submit" value="Remove choice" name="..." template:selector-field="remove-choice" /> 61 </td> 62 </tr> 63 <tr> 64 <td class="response"></td> 65 <td class="response"> 66 <input type="radio" template:attribute-button="text-response,after,checked" 67 name="..." value="..." /> Text after 68 </td> 69 <td></td> 70 </tr> 71 </tbody> 72 </table> 73 74 <p> 75 <input type="submit" value="Add question" name="add-question" /> to make 76 the questionnaire longer. 77 </p> 78 79 <p> 80 <input type="submit" value="Finish" name="finish" /> when all the questions 81 and responses are ready. 82 </p> 83 84 </div> 85 86 <!-- Repeat the questionnaire in preview mode. --> 87 88 <div class="preview"> 89 90 <table class="preview"> 91 <tbody template:element="question"> 92 <tr> 93 <th class="question">Question</th> 94 <td class="question"> 95 <span template:value="@question-text">Question</span> 96 </td> 97 </tr> 98 <tr> 99 <th class="response">Response</th> 100 <td class="response"> 101 <p template:if="@text-response = 'before'" class="text-before"> 102 <input type="text" size="40" template:attribute-field="response-text" 103 name="..." value="..." /> 104 </p> 105 <p template:element="choice" class="choice" xml:space="preserve"> 106 <input type="{template:choice(../@choice-response = 'multiple', 'checkbox', 'radio')}" 107 template:attribute-button="selected,true,checked" name="..." value="..." /> 108 <span template:value="@response-choice">Choice</span> 109 </p> 110 <p template:if="@text-response = 'after'" class="text-after"> 111 <input type="text" size="40" template:attribute-field="response-text" 112 name="..." value="..." /> 113 </p> 114 </td> 115 </tr> 116 </tbody> 117 </table> 118 119 </div> 120 121 </form> 122 123 </body> 124 </html>