aboutsummaryrefslogtreecommitdiff
blob: ceb8dc989500e1704d5c4eae471d656a546e2149 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
<def tag="detailed" polymorphic>You should define detailed tag if you want to use it</def>

<def tag="detailed" for="Question">
  <h2><name/></h2>
  <if test="&can_edit?">
    (Edit: question
      <a action="edit">information</a>,
      <a:content action="edit">content</a>)<br/>
  </if>
  <unless test="&this.approved">Not approved.</unless>
  <view:content/>
</def>

<def tag="detailed" for="Answer">
  <h2 param="title">
    Answer of <name:owner/> for question "<name:question/>"
    <a href="&edit_answer_path(this)" if="&can_edit?">(Edit)</a>
  </h2>

  <div param="question">
    <h5>Question:</h5>
    <view:question.content/>
  </div>

  <div param="answer">
    <h5>Answer:</h5>
    <if:approved>Approved</if>
    <else>Not approved</else>

    <view:content/>
  </div>

  <with:question.reference_answer param="reference-answer">
    <card if="&can_view?">
      <header:>
        <h5>Reference answer:</h5>
      </header:>
      <body:>
        <view:content/>
      </body:>
    </card>
  </with>
</def>

<def tag="detailed" for="MultipleChoiceAnswer">
  <detailed for-type="Answer">
    <answer:>
      <h5>Answer:</h5>
      <view:options/>
    </answer:>
  </detailed>
</def>

<def tag="detailed" for="EmailAnswer">
  <h2>
    Answer of
      <with:owner><name/></with>
    for question
    "<with:question><name/></with>
    <a action="edit" if="&can_edit?">(Edit)</a>
  </h2>
  <h5>Question:</h5>
  <with:question><view:content/></with>

  <h5>Answer:</h5>
  <if:correct>
    You sent proper email.
  </if>
  <else>
    Email you sent didn't match requirements.
  </else>
</def>