⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 localtest.java

📁 老外的在线考试
💻 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 javax.ejb.*;import java.util.*;/** *  * LocalTest is the local interface to a TestBean  * that models a test consisting of one or more questions. *  * @author Alexander Yap */public interface LocalTest extends EJBLocalObject{	/**	 * Default passing percentage.	 */	public double PASSING_PERCENTAGE=50.0;	/**	 * Gets the unique ID of this test.	 * @return Unique ID	 */	public String getId();	/**	* Gets the name intended for display in user interface.	* @return Name of this test.	*/	public String getName();		/**	* Sets the name intended for display in user interface.	* @param nm Name of this test.	*/	public void setName(String nm);		/**	* Gets a String that encodes the hierarchy node that this test belongs to.	* Each hierarchy node has its own unique "hierarchy identifier" String.	* @return The hierarchy identifier of the owner hierarchy node of this test.	*/	public String getOwnerHierarchyId();	/**	* Sets a String that encodes the hierarchy node that this test belongs to.	* Each hierarchy node has its own unique "hierarchy identifier" String.	* @param hierId The hierarchy identifier of the owner hierarchy node of this test.	*/	public void setOwnerHierarchyId( String hierId);	/**	* Gets the owner hierarchy node that this test belongs to.	* @return Owner hierarchy node of this test.	*/	public IHierarchy getOwner();		/**	 * Gets the score threshold in percentage for passing this test. 	 * @return Passing percentage, between 0 and 100.	 */	public double getPassPercentage();	/**	 * Sets the score threshold in percentage for passing this test. 	 * @param pass Passing percentage, between 0 and 100.	 */	public void setPassPercentage(double pass);	/**	* Gets List of questions (LocalQuestion interfaces) associated with this test.	* The number of questions returned is specified by <i>count</i> if 	* there are enough questions, otherwise its all the available questions.	* The current implementation simply returns the first <i>count</i>	* questions.	*	* @param count  Desired number of questions to return.	* @return List of LocalQuestion interfaces.	*/	public List getQuestions(int count);		/**	* Sets the allocated time limit (in seconds) for this test.	* @param limit  Time limit in seconds, or 0 (or negative) for no time limit.	*/	public void setTimeLimitSeconds(int limit);	/**	* Gets the allocated time limit (in seconds) for this test.	* @return  Time limit in seconds, or 0 (or negative) for no time limit.	*/	public int getTimeLimitSeconds();	/**	 * Sets the timestamp in milliseconds when this test was last modified.	 * @param lastModified Timestamp when this test was last modified.	 */	public void setLastModifiedMillis(long lastModified);	/**	 * Gets the timestamp in milliseconds when this test was last modified.	 * @return Timestamp when this test was last modified.	 */		public long getLastModifiedMillis();		/**	 * Checks if this test should display all its questions simultaneously	 * in a single page or one question at a time.	 * @return true if all questions should be displayed in a single page, false if only one question at a time.	 */	public boolean isMultiQuestionsMode();		/**	 * Sets if this test should display all its questions simultaneously	 * in a single page or one question at a time.	 * @param mode true if all questions should be displayed in a single page, false if only one question at a time.	 */	public void setMultiQuestionsMode(boolean mode);		/**	 * Checks whether to suppress the feedback (whether the user answered the	 * question correctly) after each question is answered. If this 	 * feedback is suppressed, the user should immediately go to the next	 * question without knowing if the answer was correct.	 * This setting only applies if MultiQuestionsMode is disabled.	 * @return true to suppress the feedback, false to show the feedback after each question.	 * @see #isMultiQuestionsMode()	 */	public boolean isSuppressQuestionFeedback();		/**	 * Sets whether to suppress the feedback (whether the user answered the	 * question correctly) after each question is answered. If this 	 * feedback is suppressed, the user should immediately go to the next	 * question without knowing if the answer was correct.	 * This setting only applies if MultiQuestionsMode is disabled.	 * @param suppress true to suppress the feedback, false to show the feedback after each question.	 * @see #isMultiQuestionsMode()	 */	public void setSuppressQuestionFeedback(boolean suppress);		/**	 * Checks whether to suppress the feedback (which questions were answered correctly	 * or wrongly) at the completion of a test. 	 * The client should also hide the test results in any review or historical	 * displays when this is enabled. 	 * @return true to suppress the feedback, false to show the feedback at the completion of a test.	 */	public boolean isSuppressTestEndFeedback();		/**	 * Sets whether to suppress the feedback (which questions were answered correctly	 * or wrongly) at the end of a test. 	 * @param suppress true to suppress the feedback, false to show the feedback at the end of a test.	 */	public void setSuppressTestEndFeedback(boolean suppress);		/**	 * Checks if this test is active. An active test	 * may be editted and used.	 * An inactive test may be considered to be logically removed	 * from the system, but is kept in the database to maintain 	 * consistency in reporting and historical logging.	 * @return true if this test is active, false if inactive.	 */	public boolean isActive();		/**	 * Actives this test, so that it may be editted and used.	 * This method may perform some checks first to ensure that this test	 * can be safely activated.	 * @return true if this test is activated, false if it is not (either a problem or it is already active) 	 */	public boolean activate();	/**	 * Deactives this test, after which it may be considered to be logically removed	 * from the system.	 * This method may perform some checks first to ensure that this test	 * can be safely deactivated.	 * @return true if this test is deactivated, false if it is not (either a problem or it is already inactive) 	 */	public boolean deactivate();	/**	* Adds question to this test.	* @param ques Question to add.	*/	public void addQuestion( LocalQuestion ques );		/**	* Removes question from this test.	* @param ques Question to remove.	*/	public void removeQuestion( LocalQuestion ques );		/**	* Removes all questions from this test.	*/	public void removeAllQuestions();		/**	 * Checks if this test has questions.	 * @return true if this test has questions, otherwise false.	 */	public boolean hasQuestions();}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -