Rev 1315 | Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1314 | jmachado | 1 | package pt.estgp.estgweb.domain; |
2 | |||
3 | import pt.estgp.estgweb.utils.ConfigProperties; |
||
4 | |||
5 | import java.lang.reflect.InvocationTargetException; |
||
6 | import java.lang.reflect.Method; |
||
7 | |||
8 | /** |
||
9 | * Created by jorgemachado on 09/03/16. |
||
10 | */ |
||
11 | public class QuestionarioImpl extends Questionario |
||
12 | { |
||
13 | |||
14 | public enum 1.5.0/docs/api/org/omg/PortableServer/POAManagerPackage/State.html">State |
||
15 | { |
||
16 | CREATED, |
||
17 | ASSIGNED, // -> All tipologies prototypes created and assigned to student answers |
||
18 | PROCESSING, // -> Impossible to change or edit prototypes, possible to answer |
||
19 | CLOSED, // -> Impossible to answer |
||
20 | STATISTICS1 |
||
21 | } |
||
22 | |||
23 | public QuestionarioImpl() { |
||
24 | super(); |
||
25 | |||
26 | setState(1.5.0/docs/api/org/omg/PortableServer/POAManagerPackage/State.html">State.CREATED.name()); |
||
27 | setGroup1Title(ConfigProperties.getProperty("questionario.group1.title")); |
||
28 | setGroup2Title(ConfigProperties.getProperty("questionario.group2.title")); |
||
29 | setGroup3Title(ConfigProperties.getProperty("questionario.group3.title")); |
||
30 | setGroup4Title(ConfigProperties.getProperty("questionario.group4.title")); |
||
31 | setGroup5Title(ConfigProperties.getProperty("questionario.group5.title")); |
||
32 | |||
33 | |||
34 | for(int i = 1; i <=30;i++) |
||
35 | { |
||
36 | |||
37 | try { |
||
38 | 1.5.0/docs/api/java/lang/String.html">String group = ConfigProperties.getProperty("questionario.p" + i + ".group"); |
||
39 | 1.5.0/docs/api/java/lang/reflect/Method.html">Method m = this.getClass().getMethod("setP" + i + "Group",1.5.0/docs/api/java/lang/String.html">String.class); |
||
40 | m.invoke(this,group); |
||
41 | |||
42 | 1.5.0/docs/api/java/lang/String.html">String pergunta = ConfigProperties.getProperty("questionario.p" + i); |
||
43 | 1.5.0/docs/api/java/lang/reflect/Method.html">Method m2 = this.getClass().getMethod("setP" + i,1.5.0/docs/api/java/lang/String.html">String.class); |
||
44 | m2.invoke(this,pergunta); |
||
45 | } catch (1.5.0/docs/api/java/lang/NoSuchMethodException.html">NoSuchMethodException e) { |
||
46 | e.printStackTrace(); |
||
47 | } catch (1.5.0/docs/api/java/lang/reflect/InvocationTargetException.html">InvocationTargetException e) { |
||
48 | e.printStackTrace(); |
||
49 | } catch (1.5.0/docs/api/java/lang/IllegalAccessException.html">IllegalAccessException e) { |
||
50 | e.printStackTrace(); |
||
51 | } |
||
52 | } |
||
53 | |||
54 | } |
||
55 | |||
56 | public static void main(1.5.0/docs/api/java/lang/String.html">String[] args) |
||
57 | { |
||
58 | QuestionarioImpl q = new QuestionarioImpl(); |
||
59 | 1.5.0/docs/api/java/lang/System.html">System.out.println(q); |
||
60 | } |
||
61 | } |