1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/examples/Common/QuestionPlayer/Resources/player_template.xhtml Fri Nov 21 01:42:17 2008 +0100
1.3 @@ -0,0 +1,100 @@
1.4 +<?xml version="1.0" encoding="iso-8859-1"?>
1.5 +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML Basic 1.0//EN"
1.6 + "http://www.w3.org/TR/xhtml-basic/xhtml-basic10.dtd">
1.7 +<html xmlns="http://www.w3.org/1999/xhtml"
1.8 + xmlns:template="http://www.boddie.org.uk/ns/xmltools/template">
1.9 +<head>
1.10 + <title>Questionnaire</title>
1.11 + <link xmlns:xlink="http://www.w3.org/1999/xlink" href="styles/styles.css"
1.12 + rel="stylesheet" type="text/css" />
1.13 +</head>
1.14 +
1.15 +<body template:element="questionnaire">
1.16 +<h1>Questionnaire</h1>
1.17 +
1.18 +<form method="POST" action="">
1.19 +
1.20 +<div class="questionnaire">
1.21 +
1.22 + <div class="shadow">
1.23 +
1.24 + <table class="questionnaire">
1.25 + <tbody template:element="question" template:init="no">
1.26 + <tr>
1.27 + <th class="question">Question #<span template:value="count(preceding-sibling::question) + 1">n</span></th>
1.28 + <td class="question">
1.29 + <span template:value="@question-text">Question</span>
1.30 +
1.31 + <!-- Hidden state. -->
1.32 +
1.33 + <input template:attribute-field="question-text" type="hidden" name="..." value="..." />
1.34 + <input template:attribute-field="choice-response" type="hidden" name="..." value="..." />
1.35 + </td>
1.36 + </tr>
1.37 + <tr>
1.38 + <th class="response">Response</th>
1.39 + <td class="response">
1.40 + <div template:element="choice" template:init="no">
1.41 +
1.42 + <!-- Show a radio or checkbox if appropriate. -->
1.43 +
1.44 + <p xml:space="preserve">
1.45 +
1.46 + <span template:if="not(response-type/@value = 'text')">
1.47 +
1.48 + <!-- Show checkboxes. -->
1.49 +
1.50 + <input template:if="../@choice-response = 'multiple'"
1.51 + type="checkbox"
1.52 + name="{template:other-list-attributes('selected', 'value', ..)}" value="{@response-choice}"
1.53 + template:expr="count(../selected[@value = current()/@response-choice]) > 0" template:expr-attr="checked" />
1.54 +
1.55 + <!-- Show radio boxes. -->
1.56 +
1.57 + <input template:if="not(../@choice-response = 'multiple')"
1.58 + type="radio"
1.59 + name="{template:other-attributes('selected', ..)}" value="{@response-choice}"
1.60 + template:expr="../@selected = @response-choice" template:expr-attr="checked" />
1.61 +
1.62 + </span>
1.63 +
1.64 + <span template:value="@response-choice">Choice</span>
1.65 + </p>
1.66 +
1.67 + <!-- Show a text box if appropriate. -->
1.68 +
1.69 + <p template:if="response-type/@value and not(response-type/@value = 'choice')">
1.70 + <input template:attribute-field="response-text" type="text" size="40" name="..." value="..." />
1.71 + </p>
1.72 +
1.73 + <!-- Hidden state. -->
1.74 +
1.75 + <input template:element="response-type" template:attribute-field="value" type="hidden" name="..." value="..." />
1.76 + <input template:attribute-field="response-choice" type="hidden" name="..." value="..." />
1.77 + </div>
1.78 + </td>
1.79 + </tr>
1.80 + </tbody>
1.81 + </table>
1.82 +
1.83 + </div>
1.84 +
1.85 +</div>
1.86 +
1.87 +<div class="operations">
1.88 +
1.89 + <p>
1.90 + <input type="submit" value="Update" name="update" /> to refresh the form.
1.91 + </p>
1.92 +
1.93 + <p>
1.94 + <input type="submit" value="Finish" name="finish" /> when you are happy with
1.95 + your responses.
1.96 + </p>
1.97 +
1.98 +</div>
1.99 +
1.100 +</form>
1.101 +
1.102 +</body>
1.103 +</html>