|
|
@@ -2,14 +2,17 @@ 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.alibaba.fastjson.JSON
|
|
|
import com.yingyang.mmse.R
|
|
|
import com.yingyang.mmse.databinding.FragmentMultipleChoiceBinding
|
|
|
import com.yingyangfly.baselib.base.BaseFragment
|
|
|
import com.yingyangfly.baselib.db.QuestionsBean
|
|
|
import com.yingyangfly.baselib.ext.setOnSingleClickListener
|
|
|
import com.yingyangfly.baselib.ext.toast
|
|
|
+import com.yingyangfly.baselib.utils.GsonUtil
|
|
|
import com.yingyangfly.mmse.adapter.ChoiceAdapter
|
|
|
|
|
|
/**
|
|
|
@@ -159,6 +162,16 @@ class MultipleChoiceFragment : BaseFragment<FragmentMultipleChoiceBinding>() {
|
|
|
* 提交测试
|
|
|
*/
|
|
|
private fun submit() {
|
|
|
-
|
|
|
+ if (dao != null) {
|
|
|
+ val questionsBeans = dao?.getAllQuestions()
|
|
|
+ if (questionsBeans.isNullOrEmpty().not()) {
|
|
|
+ questionsBeans?.forEach {
|
|
|
+ if (TextUtils.equals("0", it.correct)) {
|
|
|
+ it.score = "0"
|
|
|
+ }
|
|
|
+ }
|
|
|
+ Log.e("wpp", JSON.toJSONString(questionsBeans))
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|