package com.qxueyou.scc.exercise.service.impl.node;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import com.qxueyou.scc.exercise.model.ExerciseItemOption;
|
import com.qxueyou.scc.exercise.service.impl.Node;
|
import com.qxueyou.scc.exercise.service.impl.parser.OptionParser;
|
|
public class Option extends Node {
|
|
public Option(){
|
setName("OPTION");
|
setCheck(Boolean.FALSE);
|
setParser(new OptionParser());
|
}
|
|
@Override
|
public boolean isComplete() {
|
|
if(StringUtils.isEmpty(getNo())){
|
return false;
|
}
|
|
if(StringUtils.isEmpty(getContent())){
|
return false;
|
}
|
|
return true;
|
}
|
|
public void setNo(String no){
|
setAttribute("NO",no);
|
}
|
|
public void setContent(String content){
|
setAttribute("CONTENT",content);
|
}
|
|
public void setCheck(Boolean check){
|
setAttribute("CHECK",check);
|
}
|
|
public String getNo(){
|
return (String) getAttribute("NO");
|
}
|
|
public String getContent(){
|
return (String) getAttribute("CONTENT");
|
}
|
|
public Boolean getCheck(){
|
return (Boolean) getAttribute("CHECK");
|
}
|
|
public ExerciseItemOption convertExerciseItemOption() {
|
|
ExerciseItemOption opt = new ExerciseItemOption();
|
|
opt.setContent(getContent());
|
opt.setOptionOrder(getNo());
|
opt.setChecked(getCheck());
|
|
return opt;
|
}
|
|
}
|