Subversion Repositories bacoAlunos

Rev

Rev 1315 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

package pt.estgp.estgweb.domain;

import pt.estgp.estgweb.utils.ConfigProperties;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * Created by jorgemachado on 09/03/16.
 */

public class QuestionarioImpl extends Questionario
{

    public enum 1.5.0/docs/api/org/omg/PortableServer/POAManagerPackage/State.html">State
    {
        CREATED,
        ASSIGNED, // -> All tipologies prototypes created and assigned to student answers
        PROCESSING, // -> Impossible to change or edit prototypes, possible to answer
        CLOSED, // -> Impossible to answer
        STATISTICS1
    }

    public QuestionarioImpl() {
        super();

        setState(1.5.0/docs/api/org/omg/PortableServer/POAManagerPackage/State.html">State.CREATED.name());
        setGroup1Title(ConfigProperties.getProperty("questionario.group1.title"));
        setGroup2Title(ConfigProperties.getProperty("questionario.group2.title"));
        setGroup3Title(ConfigProperties.getProperty("questionario.group3.title"));
        setGroup4Title(ConfigProperties.getProperty("questionario.group4.title"));
        setGroup5Title(ConfigProperties.getProperty("questionario.group5.title"));


        for(int i = 1; i <=30;i++)
        {

            try {
                1.5.0/docs/api/java/lang/String.html">String group = ConfigProperties.getProperty("questionario.p" + i + ".group");
                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);
                m.invoke(this,group);

                1.5.0/docs/api/java/lang/String.html">String pergunta = ConfigProperties.getProperty("questionario.p" + i);
                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);
                m2.invoke(this,pergunta);
            } catch (1.5.0/docs/api/java/lang/NoSuchMethodException.html">NoSuchMethodException e) {
                e.printStackTrace();
            } catch (1.5.0/docs/api/java/lang/reflect/InvocationTargetException.html">InvocationTargetException e) {
                e.printStackTrace();
            } catch (1.5.0/docs/api/java/lang/IllegalAccessException.html">IllegalAccessException e) {
                e.printStackTrace();
            }
        }

    }

    public static void main(1.5.0/docs/api/java/lang/String.html">String[] args)
    {
        QuestionarioImpl q =  new QuestionarioImpl();
        1.5.0/docs/api/java/lang/System.html">System.out.println(q);
    }
}