|
@@ -2,6 +2,7 @@ package com.yingyangfly.mmse.fragment
|
|
|
|
|
|
import android.os.Bundle
|
|
|
import android.text.TextUtils
|
|
|
+import android.util.Log
|
|
|
import androidx.core.os.bundleOf
|
|
|
import androidx.navigation.Navigation
|
|
|
import com.yingyang.mmse.R
|
|
@@ -9,6 +10,7 @@ import com.yingyang.mmse.databinding.FragmentJudgmentBinding
|
|
|
import com.yingyangfly.baselib.base.BaseFragment
|
|
|
import com.yingyangfly.baselib.db.QuestionsBean
|
|
|
import com.yingyangfly.baselib.ext.setOnSingleClickListener
|
|
|
+import com.yingyangfly.baselib.ext.toast
|
|
|
|
|
|
/**
|
|
|
* 录入单个判断
|
|
@@ -47,19 +49,32 @@ class JudgmentFragment : BaseFragment<FragmentJudgmentBinding>() {
|
|
|
}
|
|
|
}
|
|
|
btnNext.setOnSingleClickListener {
|
|
|
- if (questionId < 10) {
|
|
|
- questionId++
|
|
|
- loadData()
|
|
|
- } else {
|
|
|
+ if (question != null) {
|
|
|
+ if (question!!.inputString.isNullOrEmpty()) {
|
|
|
+ val str = "请判断受试者的回答是否正确"
|
|
|
+ str.toast()
|
|
|
+ } else {
|
|
|
+ if (questionId < 10) {
|
|
|
+ questionId++
|
|
|
+ loadData()
|
|
|
+ } else {
|
|
|
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
judgeRadio.setOnCheckedChangeListener { group, checkedId ->
|
|
|
if (checkedId == R.id.btnDeny) {
|
|
|
- question!!.inputString = "否"
|
|
|
+ if (question != null && dao != null) {
|
|
|
+ question!!.inputString = "否"
|
|
|
+ dao?.update(question!!)
|
|
|
+ }
|
|
|
} else if (checkedId == R.id.btnCorrect) {
|
|
|
- question!!.inputString = "是"
|
|
|
+ if (question != null && dao != null) {
|
|
|
+ question!!.inputString = "是"
|
|
|
+ dao?.update(question!!)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|