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

📄 item.java

📁 支持GUI和持久对象的联机测试系统
💻 JAVA
字号:
/*
 * Item.java
 * 
 * MSE06B班张智力的实验报告
 * 
 * 2006年12月8日
 */

package olts.item;

/**
 * Item类,各种题型题目的抽象类
 */
public abstract class Item {

    /**
     * content属性,试题的题目
     */
    public String content;
    
    /**
     * standAnswer属性,试题的标准答案
     */
    public String standAnswer;
    
    /**
     * difficulty属性,试题的难度
     */
    public int difficulty;
    
    /**
     * score属性,试题的满分分数
     */
    public int score;
    
    /**
     * time属性,试题的预计答题时间
     */
    public int time;
    
    /**
     * subject属性,试题的科目分类
     */
    public String subject;
    
    /**
     * Item构造函数
     * @param content 题目
     * @param standAnswer 标准答案
     * @param difficulty 难度
     * @param score 满分分数
     * @param time 预计答题时间
     * @param subject 科目分类
     */
    public Item(String content, String standAnswer, int difficulty, int score, int time, String subject){
        this.content = content;
        this.standAnswer = standAnswer;
        this.difficulty = difficulty;
        this.score = score;
        this.time = time;
        this.subject = subject;
    }
    
    /**
     * isCorrect方法,判断用户答案是否正确 
     * @param answer 用户输入的答案
     * @return 若用户输入的答案与标准答案一致,返回true,否则返回false
     */
    public boolean isCorrect(String answer){
        return this.standAnswer.equals(answer);
    }
    
    /**
     * getScore方法,返回该试题的满分分数
     * @return
     */
    public int getScore(){
    	return this.score;
    }
    
}

⌨️ 快捷键说明

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