01 package jspkurs.aufg.kap2;
02
03 import java.io.Serializable;
04
05 /**
06 * Class hold question, matching word and user anwser
07 * of a single test item.
08 *
09 * @author Hans Joachim Herbertz
10 * @created 09.04.2003
11 */
12 public class JavaTestItem implements Serializable {
13
14 private String question = null;
15 private Integer solution = null;
16 private Integer userSelect = null;
17 private String[] answers = null;
18 /**
19 * Constructor for JavaTestItem.
20 */
21 public JavaTestItem() {
22 super();
23 }
24
25 /**
26 * Returns the question.
27 * @return String
28 */
29 public String getQuestion() {
30 return question;
31 }
32
33 /**
34 * Sets the question.
35 * @param question The question to set
36 */
37 public void setQuestion(String question) {
38 this.question = question;
39 }
40
41 /**
42 * Returns the answers.
43 * @return String[]
44 */
45 public String[] getAnswers() {
46 return answers;
47 }
48
49 /**
50 * Returns the solution.
51 * @return Integer
52 */
53 public Integer getSolution() {
54 return solution;
55 }
56
57 /**
58 * Returns the userSelect.
59 * @return Integer
60 */
61 public Integer getUserSelect() {
62 return userSelect;
63 }
64
65 /**
66 * Sets the answers.
67 * @param answers The answers to set
68 */
69 public void setAnswers(String[] answers) {
70 this.answers = answers;
71 }
72
73 /**
74 * Sets the solution.
75 * @param solution The solution to set
76 */
77 public void setSolution(Integer solution) {
78 this.solution = solution;
79 }
80
81 /**
82 * Sets the userSelect.
83 * @param userSelect The userSelect to set
84 */
85 public void setUserSelect(Integer userSelect) {
86 this.userSelect = userSelect;
87 }
88
89 public String toString() {
90 return "Question="
91 + question.substring(0, Math.min(question.length(), 30))
92 + " soluton="
93 + solution
94 + " userSelect="
95 + userSelect;
96 }
97 }
|