Sfoglia il codice sorgente

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

王鹏鹏 2 anni fa
parent
commit
94c36c0cfb

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

@@ -103,7 +103,7 @@ class MultipleChoiceFragment : BaseFragment<FragmentMultipleChoiceBinding>() {
             if (secondQuestion != null) {
                 choiceItemList.add(secondQuestion)
             }
-            val thirdQuestionId = questionId + 1
+            val thirdQuestionId = questionId + 2
             val thirdQuestion = dao?.getQuestion(thirdQuestionId)
             if (thirdQuestion != null) {
                 choiceItemList.add(thirdQuestion)
@@ -119,19 +119,19 @@ class MultipleChoiceFragment : BaseFragment<FragmentMultipleChoiceBinding>() {
         if (dao != null) {
             val firstquestion = dao?.getQuestion(questionId)
             if (firstquestion != null && firstquestion.inputString.isNullOrEmpty()) {
-                "请判断是否正确".toast()
+                "请判断第一道题目答案是否正确".toast()
                 return false
             }
             val secondQuestionnId = questionId + 1
             val secondQuestion = dao?.getQuestion(secondQuestionnId)
             if (secondQuestion != null && secondQuestion.inputString.isNullOrEmpty()) {
-                "请判断是否正确".toast()
+                "请判断第二道题目答案是否正确".toast()
                 return false
             }
-            val thirdQuestionId = questionId + 1
+            val thirdQuestionId = questionId + 2
             val thirdQuestion = dao?.getQuestion(thirdQuestionId)
             if (thirdQuestion != null && thirdQuestion.inputString.isNullOrEmpty()) {
-                "请判断是否正确".toast()
+                "请判断第三道题目答案是否正确".toast()
                 return false
             }
         }

+ 14 - 14
mmse/src/main/java/com/yingyangfly/mmse/fragment/SoundRecordFragment.kt

@@ -26,7 +26,7 @@ class SoundRecordFragment : BaseFragment<FragmentSoundRecordBinding>() {
     private var playVoice: PlayVoice? = null
 
     override fun onCreate(savedInstanceState: Bundle?) {
-        questionId = arguments?.getInt("questionId") ?: 4
+        questionId = arguments?.getInt("questionId") ?: 11
         super.onCreate(savedInstanceState)
     }
 
@@ -77,19 +77,19 @@ class SoundRecordFragment : BaseFragment<FragmentSoundRecordBinding>() {
      */
     private fun loadData() {
         if (dao != null) {
-            if (questionId == 11) {
-                val firstquestion = dao?.getQuestion(questionId)
-                if (firstquestion != null) {
-                    firstWord = firstquestion.reviewItem
-                }
-                val secondQuestion = dao?.getQuestion(12)
-                if (secondQuestion != null) {
-                    secondWord = secondQuestion.reviewItem
-                }
-                val thirdQuestion = dao?.getQuestion(13)
-                if (thirdQuestion != null) {
-                    thirdWord = thirdQuestion.reviewItem
-                }
+            val firstquestion = dao?.getQuestion(questionId)
+            if (firstquestion != null) {
+                firstWord = firstquestion.reviewItem
+            }
+            val secondQuestionnId = questionId + 1
+            val secondQuestion = dao?.getQuestion(secondQuestionnId)
+            if (secondQuestion != null) {
+                secondWord = secondQuestion.reviewItem
+            }
+            val thirdQuestionId = questionId + 2
+            val thirdQuestion = dao?.getQuestion(thirdQuestionId)
+            if (thirdQuestion != null) {
+                thirdWord = thirdQuestion.reviewItem
             }
         }
     }

+ 0 - 28
mmse/src/main/res/layout/fragment_count.xml

@@ -162,34 +162,6 @@
                     app:layout_constraintTop_toBottomOf="@+id/tvResultFour"
                     tools:text="@string/previous_question" />
 
-                <androidx.appcompat.widget.AppCompatTextView
-                    android:id="@+id/tvHundredMinusSevenSix"
-                    android:layout_width="wrap_content"
-                    android:layout_height="wrap_content"
-                    android:layout_marginStart="@dimen/divider_205px"
-                    android:layout_marginTop="@dimen/divider_23px"
-                    android:text="@string/subtract_seven_more"
-                    android:textColor="@color/color_FF333333"
-                    android:textSize="@dimen/divider_34px"
-                    android:textStyle="bold"
-                    app:layout_constraintStart_toStartOf="parent"
-                    app:layout_constraintTop_toBottomOf="@+id/tvHundredMinusSevenFive" />
-
-                <androidx.appcompat.widget.AppCompatTextView
-                    android:id="@+id/tvResultSix"
-                    android:layout_width="wrap_content"
-                    android:layout_height="@dimen/divider_53px"
-                    android:layout_marginStart="@dimen/divider_20px"
-                    android:layout_marginTop="@dimen/divider_15px"
-                    android:background="@drawable/bg_calculation_results"
-                    android:gravity="center"
-                    android:textColor="@color/color_FF333333"
-                    android:textSize="@dimen/divider_34px"
-                    android:textStyle="bold"
-                    app:layout_constraintStart_toEndOf="@+id/tvHundredMinusSevenSix"
-                    app:layout_constraintTop_toBottomOf="@+id/tvResultFive"
-                    tools:text="@string/previous_question" />
-
             </androidx.constraintlayout.widget.ConstraintLayout>
 
             <LinearLayout