📄 showquestionview.java
字号:
package org.fangsoft.testcenter.view.console;
import static org.fangsoft.util.Console.output;
import static org.fangsoft.util.Console.prompt;
import java.util.ArrayList;
import java.util.List;
import org.fangsoft.testcenter.model.ChoiceItem;
import org.fangsoft.testcenter.model.Question;
import org.fangsoft.testcenter.model.Test;
import org.fangsoft.testcenter.view.View;
public class ShowQuestionView extends ConsoleView implements View {
// private Test test=null;
private Test test=null;
private String answer=null;
private int index=0;
@Override
public void displayView() {
// TODO Auto-generated method stub
//System.out.println(this.index);
Question q=test.getQuestion(this.index);
q.assignLabel(ChoiceItem.LABEL);
this.answer=prompt(this.index + 1, q);
/*int count=0;
for (Question q : test.getQuestion()) {
q.assignLabel(ChoiceItem.LABEL);
answer.add(prompt(count + 1, q));
count++;
}
long end = System.currentTimeMillis();
output("考试结束,现在时间是:%1$tT%n",end);*/
}
public String getAnswer() {
return answer;
}
public void setAnswer(String answer) {
this.answer = answer;
}
public Test getTest() {
return test;
}
public void setTest(Test test) {
// TODO Auto-generated method stub
this.test = test;
}
public int getIndex() {
return index;
}
public void setIndex(int index) {
this.index = index;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -