question.java

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

JAVA
63
字号
package fangsoft.testcenter.model;

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

public class Question {
	private List choices;

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

	}

	/**
	 * Add a new Choice to the Question
	 * 
	 * @param aChoice
	 */
	public void addChoice(Choice aChoice) {
		choices.add(aChoice);
	}

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

	public List getChoices() {
		return choices;
	}

	public void setChoices(List newChoices) {
		choices = newChoices;
	}

	public int getCount() {
		return choices.size();
	}

	private String text;

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}
	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 + -
显示快捷键?