package Ġch . ral ena . quiz app . activity Ċ Ċ import Ġandroid . view . LayoutInflater Ċ import Ġandroid . widget . Button Ċ import Ġandroid . widget . RadioButton Ċ import Ġandroid . widget . Radio Group Ċ import Ġandroid . widget . TextView Ċ import Ġch . ral ena . quiz app . R Ċ import Ġch . ral ena . quiz app . objects . Constants Ċ import Ġch . ral ena . quiz app . objects . Quiz Ċ import Ġch . ral ena . quiz app . view . Base View Mvc Ċ Ċ class ĠQu iz Activity View ( Ċĉ ĉ layout Inflater : ĠLayoutInflater Ċ ) Ġ: ĠBase View Mvc < Quiz Activity View . Listener >( Ċĉ ĉ layout Inflater , Ċĉ ĉ R . layout . activity _ quiz Ċ ) Ġ{ Ċ ĉ interface ĠListener Ġ{ Ċĉ ĉ fun ĠonSubmit Button Click ( checked RadioButton : ĠRadio Button ?) Ċ ĉ } ĊĊ ĉ private Ġval Ġquestions Left TextView : ĠTextView Ġ= ĠfindViewById ( R . id . questions Left TextView ) Ċ ĉ private Ġval Ġtotal Questions TextView : ĠTextView Ġ= ĠfindViewById ( R . id . total Questions TextView ) Ċ ĉ private Ġval Ġcorrect TextView : ĠTextView Ġ= ĠfindViewById ( R . id . correct TextView ) Ċ ĉ private Ġval Ġequation TextView : ĠTextView Ġ= ĠfindViewById ( R . id . equation TextView ) Ċ ĉ private Ġval Ġsubmit Button : ĠButton Ġ= ĠfindViewById ( R . id . check Answer Button ) Ċ ĉ private Ġval Ġanswers Group : ĠRadio Group Ġ= ĠfindViewById ( R . id . answers Group ) ĊĊ ĉ init Ġ{ Ċĉ ĉ submit Button . setOnClickListener Ġ{ Ċĉĉ ĉ for Ġ( listener Ġin Ġlisteners ) Ġ{ Ċĉĉĉ ĉ val Ġradio Button : ĠRadio Button Ġ= ĠfindViewById ( answers Group . checked RadioButton Id ) Ċĉĉĉ ĉ listener . on Submit Button Click ( radioButton ) Ċĉĉ ĉ } Ċĉ ĉ } Ċ ĉ } ĊĊ ĉ fun Ġupdate Quiz Questions ( quiz : ĠQu iz ) Ġ{ Ċĉ ĉ for Ġ( i Ġin Ġ 0 Ġuntil Ġanswers Group . child Count ) Ġ{ Ċĉĉ ĉ val Ġbutton Ġ= Ġanswers Group . getChild At ( i ) Ġas ĠRadio Button Ċĉĉ ĉ button . text Ġ= Ġ"${ quiz . question . get Answer ( i )}" Ċĉĉ ĉ button . tag Ġ= Ġi Ċĉ ĉ } ĊĊĊĉ ĉ val Ġquestion Ġ= Ġquiz . question Ċĉ ĉ equation TextView . text Ġ= Ġquestion . text ĊĊĉ ĉ val Ġquestions Left Ġ= ĠConstants . MAX _ TR IES Ġ- Ġquiz . total T ries Ċĉ ĉ questions Left TextView . text Ġ= Ġ"${ questions Left }" Ċĉ ĉ total Questions TextView . text Ġ= Ġ"${ quiz . total T ries }" Ċĉ ĉ correct TextView . text Ġ= Ġ"${ quiz . correct T ries }" Ċ ĉ } ĊĊ ĉ fun Ġclear Checked Buttons () Ġ{ Ċĉ ĉ answers Group . clear Check () Ċ ĉ } Ċ }