question.java

来自「远程电子考试系统」· Java 代码 · 共 66 行

JAVA
66
字号
package fangsoft.testcenter.model;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

public class Question implements java.io.Serializable {

	private List choices;

	private String text;

	// private int counter;

	public Question() {
		super();
		text = "";
		choices = new ArrayList();
		// TODO Auto-generated constructor stub
	}

	public void addChoice(Choice aChoice) {
		// choices[counter]=aChoice;
		choices.add(aChoice);
	}

	public Choice getChoice(int index) {
		// return choices[index];
		if (index >= 0 && index < choices.size())
			return (Choice) choices.get(index);
		return null;
	}

	public int getCount() {
		return choices.size();
	}
	
	/*
	 * protected void finalize() throws Throwable { System.out.println("Finalize
	 * called on " + this); super.finalize(); }
	 */
	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public List getChoices() {
		return choices;
	}

	public void setChoices(List newchoices) {
		this.choices = newchoices;
	}
	public void resetAllPicks() {
		Iterator it = choices.iterator();
		while (it.hasNext()) {
			Choice choice = (Choice) it.next();
			choice.setPicked(false);
		}
	}
	
}

⌨️ 快捷键说明

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