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

📄 question.java

📁 纯JAVA代码的考试系统
💻 JAVA
字号:
/**
 * Question.java
 * 本代码为教育目的而编写,但遵循产品代码规范。
 * 任何人任何时候都可以使用此代码,但需说明引用的代码来源于
 * www.fangsoft.org。
 * 欢迎任何建议。
 * 访问我们:
 * 		电子邮件:fangsoft.com@gmail.com
 * 		网站:   www.fangsoft.org
 * =====================================
 * This code is for software education,but it follows production code quality.
 * Anyone can use this code anywhere, but you should comment the code is from
 * www.fangsoft.org.
 * Any suggestion from you is appreciated. 
 * Visit us by
 *       email:    fangsoft.com@gmail.com
 *       websiste: www.fangsoft.org
 */
package org.fangsoft.testcenter.model;

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

/**
 * @author fangsoft 2007-2-7
 * 
 */
public class Question {
	private String type;
	private String name;
	private String answer;
	private int score;
	private List<ChoiceItem> choiceItem;
	private int id;

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Question() {
		this.choiceItem = new ArrayList<ChoiceItem>();
	}

	public void addChoiceItem(ChoiceItem item) {
		// choiceItem[count++]=item;
		this.choiceItem.add(item);
	}

	public ChoiceItem getChoiceItem(int index) {
		// return choiceItem[index];
		return this.choiceItem.get(index);
	}

	public String getAnswer() {
		return answer;
	}

	public void setAnswer(String answer) {
		this.answer = answer;
	}

	public List<ChoiceItem> getChoiceItem() {
		return choiceItem;
	}

	public void setChoiceItem(List<ChoiceItem> choiceItem) {
		this.choiceItem = choiceItem;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getScore() {
		return score;
	}

	public void setScore(int score) {
		this.score = score;
	}

	public void assignLabel(String[] label) {
		int count = 0;
		//StringBuffer rightAnswer = new StringBuffer();
		if (this.choiceItem != null) {
			for (ChoiceItem item : this.getChoiceItem()) {
				item.setLabel(label[count++]);
				/*if (item.isCorrect())
					rightAnswer.append(label[count - 1]);*/
			}
		}
		//this.setAnswer(rightAnswer.toString());
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}
}

⌨️ 快捷键说明

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