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

📄 testform.java

📁 老外的在线考试
💻 JAVA
字号:
/* * CyberTester - J2EE Web application for creating, delivering and managing tests/exams/surveys.  * Copyright (C) 2004 CyberDemia Research and Services Pty Ltd * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program 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 General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program (see the file COPYING); 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 program for complete text of license. */package com.cyberdemia.cybertester.admin.test;import javax.servlet.http.HttpServletRequest;import org.apache.struts.action.*;import com.cyberdemia.cybertester.admin.*;import com.cyberdemia.cybertester.CyberTesterUtils;import com.cyberdemia.school.*;/** *  * TestForm is a Struts ActionForm to send, receive and validate values from the  * test editor form. *   * @version $Revision: 1.2 $ at $Date: 2004/03/15 09:54:02 $ by $Author: alexycyap $ * @author Alexander Yap */public final class TestForm extends ActionForm{	public Integer getId()	{		return m_id;	}	public void setId(Integer id)	{		m_id = id;	}		public String getName()	{		return m_name;	}		public void setName(String name)	{		m_name = name;	}		public String getMode()	{		return m_mode;	}		public void setMode(String mode)	{		m_mode = mode;	}		public void setOwnerHierId(String id)	{		m_ownerHierId = id;	}		public String getOwnerHierId()	{		return m_ownerHierId;	}		public void setPassPercentage(String pass)	{		m_passPercentage = pass;	}		public String getPassPercentage()	{		return m_passPercentage;	}		public boolean isNew()	{		return AdminConstants.EDITOR_NEW_MODE.equalsIgnoreCase(m_mode);	}		public boolean isMultiQuestionsMode()	{		return m_multiQuestionsMode;	}		public void setMultiQuestionsMode(boolean multi)	{		m_multiQuestionsMode = multi;	}		public int getTimeLimitSeconds()	{		return m_timeLimitSecs;	}		public void setTimeLimitSeconds(int secs)	{		m_timeLimitSecs = secs;	}		public boolean isSuppressQuestionFeedback()	{		return m_suppressQuesFeedback;	}		public void setSuppressQuestionFeedback(boolean suppress)	{		m_suppressQuesFeedback = suppress;	}		public boolean isSuppressTestEndFeedback()	{		return m_suppressTestEndFeedback;	}		public void setSuppressTestEndFeedback(boolean suppress)	{		m_suppressTestEndFeedback = suppress;	}		/**	* Reset all properties to their default values.	*	* @param mapping The mapping used to select this instance	* @param request The servlet request we are processing	*/	public void reset(ActionMapping mapping, HttpServletRequest request) 	{		m_id = DEFAULT_ID;		m_name=null;		m_ownerHierId = null;		m_passPercentage=String.valueOf(TestBean.PASSING_PERCENTAGE);		m_mode = AdminConstants.EDITOR_NEW_MODE;		m_multiQuestionsMode=false;		m_suppressQuesFeedback=false;		m_suppressTestEndFeedback=false;		m_timeLimitSecs = 0;	}		public ActionErrors validate(ActionMapping mapping, HttpServletRequest request) 	{		ActionErrors errors = new ActionErrors();		if ((m_id==null)&&(!AdminConstants.EDITOR_NEW_MODE.equals(m_mode)))		{			errors.add("id", new ActionError("error.test.id.missing"));		}				CyberTesterUtils.validateRequiredFormEnteredParam("Name", m_name, errors);		CyberTesterUtils.validateRequiredFormSelectedParam("Owner Hierarchy ID", m_ownerHierId, errors);		CyberTesterUtils.validateRequiredFormNumericParamInRange("Passing percentage", m_passPercentage, 0.0, 99.0, errors);		if (m_timeLimitSecs<0)		{			errors.add("Time limit", new ActionError("error.form.negativeIntegerParam","Time limit",String.valueOf(m_timeLimitSecs)));		}		return errors;	}		private String m_name=null; 	private String m_ownerHierId = null;	private Integer m_id = DEFAULT_ID;	private String m_passPercentage=String.valueOf(TestBean.PASSING_PERCENTAGE);	private String m_mode=AdminConstants.EDITOR_NEW_MODE;	private boolean m_multiQuestionsMode=false;	private boolean m_suppressQuesFeedback=false;	private boolean m_suppressTestEndFeedback=false;	private int m_timeLimitSecs = 0;    private static final Integer DEFAULT_ID = new Integer(0);}

⌨️ 快捷键说明

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