Search in sources :

Example 1 with ChoiceOption

use of com.cas.sim.tis.view.control.imp.exam.ChoiceOption in project TeachingInSimulation by ScOrPiOzzy.

the class ExamController method loadQuestion.

/**
 * 加载题目
 * @param index 打乱以后的序号
 * @param question
 */
private void loadQuestion() {
    // 获得答题结果对象
    LibraryAnswer libraryAnswer = answers.get(currIndex);
    // // 加载题目
    // this.question.setText(question.getTitle());
    // 根据题目类型处理
    int type = libraryAnswer.getQuestion().getType();
    switch(QuestionType.getQuestionType(type)) {
        case CHOICE:
            ChoiceOption choice = new ChoiceOption(currIndex + 1, libraryAnswer, submited);
            this.options.setContent(choice);
            this.current = choice;
            break;
        case JUDGMENT:
            JudgmentOption judgment = new JudgmentOption(currIndex + 1, libraryAnswer, submited);
            this.options.setContent(judgment);
            this.current = judgment;
            break;
        case BLANK:
            BlankOption blank = new BlankOption(currIndex + 1, libraryAnswer, submited);
            this.options.setContent(blank);
            this.current = blank;
            break;
        case SUBJECTIVE:
            SubjectiveOption subjective = new SubjectiveOption(currIndex + 1, libraryAnswer, submited);
            this.options.setContent(subjective);
            this.current = subjective;
            break;
        default:
            break;
    }
}
Also used : LibraryAnswer(com.cas.sim.tis.entity.LibraryAnswer) BlankOption(com.cas.sim.tis.view.control.imp.exam.BlankOption) SubjectiveOption(com.cas.sim.tis.view.control.imp.exam.SubjectiveOption) JudgmentOption(com.cas.sim.tis.view.control.imp.exam.JudgmentOption) ChoiceOption(com.cas.sim.tis.view.control.imp.exam.ChoiceOption)

Aggregations

LibraryAnswer (com.cas.sim.tis.entity.LibraryAnswer)1 BlankOption (com.cas.sim.tis.view.control.imp.exam.BlankOption)1 ChoiceOption (com.cas.sim.tis.view.control.imp.exam.ChoiceOption)1 JudgmentOption (com.cas.sim.tis.view.control.imp.exam.JudgmentOption)1 SubjectiveOption (com.cas.sim.tis.view.control.imp.exam.SubjectiveOption)1