summaryrefslogtreecommitdiff
path: root/src/main/java/com/p4square/grow/model/QuadQuestion.java
blob: a7b4179efebb480f976c59b0f5f07b2af804e2b6 (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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
/*
 * Copyright 2013 Jesse Morgan
 */

package com.p4square.grow.model;

/**
 * Two-dimensional Question.
 *
 * @author Jesse Morgan <jesse@jesterpm.net>
 */
public class QuadQuestion extends Question {
    private static final ScoringEngine ENGINE = new QuadScoringEngine();

    private String mTop;
    private String mRight;
    private String mBottom;
    private String mLeft;

    /**
     * @return the top label.
     */
    public String getTop() {
        return mTop;
    }

    /**
     * Set the top label.
     * @param s The new top label.
     */
    public void setTop(String s) {
        mTop = s;
    }

    /**
     * @return the right label.
     */
    public String getRight() {
        return mRight;
    }

    /**
     * Set the right label.
     * @param s The new right label.
     */
    public void setRight(String s) {
        mRight = s;
    }

    /**
     * @return the bottom label.
     */
    public String getBottom() {
        return mBottom;
    }

    /**
     * Set the bottom label.
     * @param s The new bottom label.
     */
    public void setBottom(String s) {
        mBottom = s;
    }

    /**
     * @return the left label.
     */
    public String getLeft() {
        return mLeft;
    }

    /**
     * Set the left label.
     * @param s The new left label.
     */
    public void setLeft(String s) {
        mLeft = s;
    }

    @Override
    public boolean scoreAnswer(Score score, RecordedAnswer answer) {
        return ENGINE.scoreAnswer(score, this, answer);
    }

    @Override
    public QuestionType getType() {
        return QuestionType.QUAD;
    }
}