📄 answerhistorydata.java
字号:
/* * SchoolEJB - CyberDemia's library of EJBs for educational related services. * Copyright (C) 2003 CyberDemia Research and Services * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * * See the COPYING file located in the top-level-directory of * the archive of this library for complete text of license. */package com.cyberdemia.school;import java.io.Serializable;import java.util.Date;/** * AnswerHistoryData is a data transfer object to transfer AnswerHistoryRecordBean data to clients. * * @author Alexander Yap */public class AnswerHistoryData implements Serializable{ /** * Creates an instance of AnswerHistoryData. * @param testId Test ID * @param questionId Question ID * @param userId User ID * @param questionIndex Index of the question within the test. * @param questionScore Question score * @param userAnswer User's answer index * @param correctAnswer Question's correct answer index * @param correct Whether the user's answer was correct * @param timestamp Timestamp when the user answered the question. */ public AnswerHistoryData( String testId, String questionId, String userId, int questionIndex, int questionScore, int userAnswer, int correctAnswer, boolean correct, Date timestamp ) { m_testId = testId; m_questionId = questionId; m_userId = userId; m_questionIndex = questionIndex; m_questionScore = questionScore; m_userAnswer = userAnswer; m_correctAnswer = correctAnswer; m_correct = correct; m_timestamp = timestamp; } /** * Gets the test ID. * @return Test ID */ public String getTestId() { return m_testId; } /** * Gets the question ID. * @return Question ID */ public String getQuestionId() { return m_questionId; } /** * Gets the user ID. * @return User ID */ public String getUserId() { return m_userId; } /** * Gets the index of the question within the test. * @return Index of the question. */ public int getQuestionIndex() { return m_questionIndex; } /** * Gets the score of the question. This is the score awarded to the * user if the user's answer is correct. * @return Question score. */ public int getQuestionScore() { return m_questionScore; } /** * Gets the user's answer index. * @return User's answer index. */ public int getUserAnswer() { return m_userAnswer; } /** * Gets the correct answer index. * @return Correct answer index. */ public int getCorrectAnswer() { return m_correctAnswer; } /** * Checks whether the user's answer was correct. * @return true if user's answer was correct, otherwise false. */ public boolean isCorrect() { return m_correct; } /** * Gets the timestamp when the user answered the question. * @return Timestamp when the user answered the question. */ public Date getTimestamp() { return m_timestamp; } private String m_testId = null; private String m_questionId = null; private String m_userId = null; private int m_questionIndex = -1; private int m_questionScore = -1; private int m_userAnswer = -1; private int m_correctAnswer = -1; private boolean m_correct = false; private Date m_timestamp = null; }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -