Mujiburrohman

Ujian Online

Jul 12th, 2020
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Kotlin 3.30 KB | None | 0 0
  1.  R.id.selanjutnyaMulaiUjianFragmentTV -> {
  2.                 progressBarHolderLoginCL.visibility = View.VISIBLE
  3.                 AMulaiUjianFragmentTV.setBackgroundResource(R.drawable.bg_btn_v3)
  4.                 BMulaiUjianFragmentTV.setBackgroundResource(R.drawable.bg_btn_v3)
  5.                 CMulaiUjianFragmentTV.setBackgroundResource(R.drawable.bg_btn_v3)
  6.                 DMulaiUjianFragmentTV.setBackgroundResource(R.drawable.bg_btn_v3)
  7.                 if ( jawaban == ""){
  8.                     progressBarHolderLoginCL.visibility = View.GONE
  9.                     Utils.INSTANCE.ToastyInfo(this.requireContext(), "Silahkan pilih jawaban dulu")
  10.  
  11.                 }else{
  12.                     hal++
  13.                     if (position == index) {
  14.                         Hawk.put("position" , position)
  15.                         Hawk.put("nilai" , nilai)
  16.                         val bundle = bundleOf("nilai" to nilai)
  17.                         findNavController().navigate(
  18.                             R.id.action_mulaiUjianFragment_to_hasilUjianFragment,
  19.                             bundle
  20.                         )
  21.                         timer.cancel()
  22.  
  23.                     } else {
  24.                         if (jawaban == currentAnswer) {
  25.                             nilai += poin
  26.                             if (position != index) {
  27.                                 position++
  28.                                 jawaban = ""
  29.                                 Hawk.put("position" , position)
  30.                                 Hawk.put("nilai" , nilai)
  31.                                 vm.getSoal(API_URL.API_KEY, kelas_id, evaluasi_id)
  32.                                 //textColor
  33.                                 AMulaiUjianFragmentTV.setTextColor(ContextCompat.getColor(this.requireContext(), R.color.greyText))
  34.                                 BMulaiUjianFragmentTV.setTextColor(ContextCompat.getColor(this.requireContext(), R.color.greyText))
  35.                                 CMulaiUjianFragmentTV.setTextColor(ContextCompat.getColor(this.requireContext(), R.color.greyText))
  36.                                 DMulaiUjianFragmentTV.setTextColor(ContextCompat.getColor(this.requireContext(), R.color.greyText))
  37.                             }
  38.                         } else {
  39.                             nilai += 0
  40.                             if (position != index) {
  41.                                 position++
  42.                                 jawaban = ""
  43.                                 Hawk.put("nilai" , nilai)
  44.                                 vm.getSoal(API_URL.API_KEY, kelas_id, evaluasi_id)
  45.                                 //textColor
  46.                                 Hawk.put("position" , position)
  47.                                 AMulaiUjianFragmentTV.setTextColor(ContextCompat.getColor(this.requireContext(), R.color.greyText))
  48.                                 BMulaiUjianFragmentTV.setTextColor(ContextCompat.getColor(this.requireContext(), R.color.greyText))
  49.                                 CMulaiUjianFragmentTV.setTextColor(ContextCompat.getColor(this.requireContext(), R.color.greyText))
  50.                                 DMulaiUjianFragmentTV.setTextColor(ContextCompat.getColor(this.requireContext(), R.color.greyText))
  51.                             }
  52.                         }
  53.  
  54.                     }
  55.                 }
  56.  
  57.             }
Add Comment
Please, Sign In to add comment