export default {
data: {
questions:[
{
detail:"入睡时间",
optionA:"没问题",
optionB:"轻微延迟",
optionC:"显著延迟",
optionD:"延迟严重或没有睡觉",
answers:[false,false,false,false],
answer:""
},
{
detail:"夜间苏醒",
optionA:"没问题",
optionB:"轻微影响",
optionC:"显著影响",
optionD:"严重影响或没有睡觉",
answers:[false,false,false,false],
answer:""
},
{
detail:"比期望的时间早醒",
optionA:"没问题",
optionB:"轻微提早",
optionC:"显著提早",
optionD:"严重提早或没有睡觉",
answers:[false,false,false,false],
answer:""
},
{
detail:"总睡眠时间",
optionA:"足够",
optionB:"轻微不足",
optionC:"显著不足",
optionD:"严重不足或没有睡觉",
answers:[false,false,false,false],
answer:""
},
{
detail:"总睡眠质量",
optionA:"满意",
optionB:"轻微不满",
optionC:"显著不满",
optionD:"严重不满或没有睡觉",
answers:[false,false,false,false],
answer:""
},
{
detail:"白天情绪",
optionA:"正常",
optionB:"轻微低落",
optionC:"显著低落",
optionD:"严重低落",
answers:[false,false,false,false],
answer:""
},
{
detail:"白天身体功能",
optionA:"足够",
optionB:"轻微影响",
optionC:"显著影响",
optionD:"严重影响",
answers:[false,false,false,false],
answer:""
},
{
detail:"白天思睡",
optionA:"无思睡",
optionB:"轻微思睡",
optionC:"显著思睡",
optionD:"严重思睡",
answers:[false,false,false,false],
answer:""
}
],
labelName:{
prevLabel:"前一题",
nextLabel:"后一题",
status:"normal"
}
},
onInit() {
},
selectAnswer(inputValue,e){
if(inputValue == e.value){
let val = e.value;
let index = val.substring(0,1);
let answer = val.substring(1,2);
this.questions[index].answer = answer;
this.getAnswer(answer,index);
console.info(this.questions[index].answers);
}
},
getAnswer(answer,index){
this.questions[index].answers = [false,false,false,false]
switch(answer){
case "A": this.questions[index].answers[0] = true;break;
case "B": this.questions[index].answers[1] = true;break;
case "C": this.questions[index].answers[2] = true;break;
case "D": this.questions[index].answers[3] = true;break;
}
},
switchStepper(e){
console.info("index = " + e.index);
console.info("answers = " + this.questions[e.index].answers);
},
finishEvent(){
console.info("finish"); let score = 0;
for(let i =0;i < this.questions.length;i++){
switch(this.questions[i].answer){
case "A":score += 0;break;
case "B":score += 1;break;
case "C":score += 2;break;
case "D":score += 3;break;
}
}
console.info("score = " + score);
}
}
- 1.
- 2.
- 3.
- 4.
- 5.
- 6.
- 7.
- 8.
- 9.
- 10.
- 11.
- 12.
- 13.
- 14.
- 15.
- 16.
- 17.
- 18.
- 19.
- 20.
- 21.
- 22.
- 23.
- 24.
- 25.
- 26.
- 27.
- 28.
- 29.
- 30.
- 31.
- 32.
- 33.
- 34.
- 35.
- 36.
- 37.
- 38.
- 39.
- 40.
- 41.
- 42.
- 43.
- 44.
- 45.
- 46.
- 47.
- 48.
- 49.
- 50.
- 51.
- 52.
- 53.
- 54.
- 55.
- 56.
- 57.
- 58.
- 59.
- 60.
- 61.
- 62.
- 63.
- 64.
- 65.
- 66.
- 67.
- 68.
- 69.
- 70.
- 71.
- 72.
- 73.
- 74.
- 75.
- 76.
- 77.
- 78.
- 79.
- 80.
- 81.
- 82.
- 83.
- 84.
- 85.
- 86.
- 87.
- 88.
- 89.
- 90.
- 91.
- 92.
- 93.
- 94.
- 95.
- 96.
- 97.
- 98.
- 99.
- 100.
- 101.
- 102.
- 103.
- 104.
- 105.
- 106.
- 107.
- 108.
- 109.
- 110.
- 111.
- 112.
- 113.
- 114.
- 115.
- 116.
- 117.
- 118.
- 119.
- 120.
- 121.
- 122.
- 123.
- 124.