Sfoglia il codice sorgente

1.添加获取mmse试题库UI跳转

王鹏鹏 2 anni fa
parent
commit
819ed66754

+ 24 - 9
mmse/src/main/java/com/yingyangfly/mmse/fragment/CountFragment.kt

@@ -1,7 +1,6 @@
 package com.yingyangfly.mmse.fragment
 
 import android.os.Bundle
-import android.util.Log
 import androidx.core.os.bundleOf
 import androidx.navigation.Navigation
 import androidx.recyclerview.widget.GridLayoutManager
@@ -51,6 +50,22 @@ class CountFragment : BaseFragment<FragmentCountBinding>() {
             rvInput.layoutManager = GridLayoutManager(mContext, 3)
             rvInput.adapter = adapter
             adapter.setData(numberList)
+            adapter.onNumClickListener = { bean: String, type: String ->
+                when (type) {
+                    "0" -> {
+
+
+                    }
+                    "1" -> {
+
+
+                    }
+                    "2" -> {
+
+
+                    }
+                }
+            }
         }
     }
 
@@ -68,14 +83,14 @@ class CountFragment : BaseFragment<FragmentCountBinding>() {
             }
 
             btnNext.setOnSingleClickListener {
-//                if (judge()) {
-                val bundle = bundleOf("questionId" to 22)
-                val controller = Navigation.findNavController(it)
-                controller.navigate(
-                    R.id.action_countFragment_to_recognitionImageFragment,
-                    bundle
-                )
-//                }
+                if (judge()) {
+                    val bundle = bundleOf("questionId" to 22)
+                    val controller = Navigation.findNavController(it)
+                    controller.navigate(
+                        R.id.action_countFragment_to_recognitionImageFragment,
+                        bundle
+                    )
+                }
             }
         }
     }

+ 2 - 4
mmse/src/main/java/com/yingyangfly/mmse/fragment/MultipleChoiceFragment.kt

@@ -2,17 +2,14 @@ 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
 
 /**
@@ -168,9 +165,10 @@ class MultipleChoiceFragment : BaseFragment<FragmentMultipleChoiceBinding>() {
                 questionsBeans?.forEach {
                     if (TextUtils.equals("0", it.correct)) {
                         it.score = "0"
+                    } else {
+                        it.score = it.reviewScore
                     }
                 }
-                Log.e("wpp", JSON.toJSONString(questionsBeans))
             }
         }
     }