Package upperbound.learningtools.funes

Examples of upperbound.learningtools.funes.MultipleChoiceExam


    examProcess = new MultipleChoiceExamProcess("Pedro Duke",
        createMultipleChoiceExam());
  }

  private MultipleChoiceExam createMultipleChoiceExam() {
    MultipleChoiceExam exam = new MultipleChoiceExam(
        "Test exam",
        new SimpleMultipleChoiceExamRules(),
        createMultipleChoiceExamQuestions());
    return exam;
  }
View Full Code Here


    rules = new SimpleMultipleChoiceExamRules();
    questions = new ArrayList<MultipleChoiceQuestion>();
  }

  public void testCreation() throws Exception {
    MultipleChoiceExam exam = new MultipleChoiceExam("Exam title", rules, questions);
   
    assertEquals(exam.getTitle(), "Exam title");
    assertEquals(exam.getRules(), rules);
    assertEquals(exam.getQuestions(), questions);
  }
View Full Code Here

  public MultipleChoiceExamDOMBasedBuilder(Document document) {
    this.document = document;
  }

  public MultipleChoiceExam buildExam() {
    return new MultipleChoiceExam(getExamTitle(), new SimpleMultipleChoiceExamRules(), getQuestions());
  }
View Full Code Here

  private static final int EXPECTED_NUMBER_OF_QUESTIONS = 2;

  /* tests */
  public void testReadExamWithDefaultRules() throws Exception {
    MultipleChoiceExamXmlParser parser = new MultipleChoiceExamXmlParser();
    MultipleChoiceExam exam = parser.parse(getInputStreamForExamWithDefaultRules());

    assertEquals(exam.getTitle(), EXPECTED_TITLE);
    assertEquals(exam.numberOfQuestions(), EXPECTED_NUMBER_OF_QUESTIONS);
    assertEquals(exam.getRules().getClass(), SimpleMultipleChoiceExamRules.class);
    assertEquals(((SimpleMultipleChoiceExamRules) exam.getRules()).getPercentageOfCorrectAnswersToPass(),
        SimpleMultipleChoiceExamRules.DEFAULT_PERCENTAGE_OF_CORRECT_ANSWERS_TO_PASS);

    int questionNumber = 1;
    for (MultipleChoiceQuestion question : exam) {
      assertEquals("Topic "+ questionNumber, question.getTopic());
      assertEquals("question " + questionNumber, question.getQuestion());
      assertEquals(3, question.getAnswerOptions().size());
      assertEquals("A", question.getAnswerOptions().get(0));
      assertEquals("B", question.getAnswerOptions().get(1));
      assertEquals("C", question.getAnswerOptions().get(2));
      assertEquals(1, question.getCorrectAnswers().size());
      assertEquals("Explanation " + questionNumber, question.getExplanation());
      questionNumber++;
    }

    assertTrue(exam.getQuestions().get(0).getCorrectAnswers().contains("A"));
    assertTrue(exam.getQuestions().get(1).getCorrectAnswers().contains("C"));
  }
View Full Code Here

TOP

Related Classes of upperbound.learningtools.funes.MultipleChoiceExam

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.