Examples of Question


Examples of org.webcamp.questionary.dto.Question

  @Override
  public Score evaluate(Questionary questionary, List<List<AnswerIndex>> answers) {
    int correctlyAnsweredQuestions = 0;
    for (int i = 0; i < questionary.getQuestions().size(); i++) {
      Question q = questionary.getQuestions().get(i);
      // calculate number of correct answers
      int correctAnswers = 0;
      for (Answer a : q.getAnswers()) {
        if (a.isCorrect()) {
          correctAnswers++;
        }
      }
      int userCorrectAnswers = 0;
      List<AnswerIndex> userAnswers = answers.get(i);
      for (AnswerIndex ai : userAnswers) {
        if (q.getAnswers().get(ai.getIndex()).isCorrect()) {
          userCorrectAnswers++;
        }
      }
      if (userCorrectAnswers == userAnswers.size() && userCorrectAnswers == correctAnswers) {
        correctlyAnsweredQuestions++;
View Full Code Here

Examples of se.inera.ifv.casebox.core.entity.Question

    @PersistenceContext
    EntityManager entityManager;

    @Test
    public void testPersist() throws Exception {
        Question question = new Question("bepa", "Some serializable object");
        questionRepository.persist(question);

        entityManager.flush();
        entityManager.clear();
View Full Code Here

Examples of uk.ac.osswatch.simal.ssmm.model.Question

   * @param infoQuestions2 the questions to ask
   */
  private static void askAll(QuestionSet infoQuestions2) {
    Iterator<Question> itr = infoQuestions2.values().iterator();
    while (itr.hasNext()) {
      Question question = itr.next();
      ask(question);
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.