在线答题demo,具体代码是一年多前完成的,比较简单,不再贴出,请参见Github。

主要功能:

单选:点击选项直接进入下一题。
多选:选择多个选项,向右滑动进入下一题。
答题卡:点击题号重新进入答题界面。
使用技术:

主框架为ViewPager内嵌Fragment,包含试题Fragment(QuestionItemFragment
)和答题卡Fragment(ScantronItemFragment ),并使用FragmentStatePagerAdapter
进行适配。

单选题和多选题使用ListView实现,主要利用了ListView的ListView.CHOICE_MODE_SINGLE and
ListView.CHOICE_MODE_MULTIPLE属性。

为了方便试题界面和答题卡界面的自由跳转,使用了LocalBroadcast。

效果图:

 

Github地址:

https://github.com/wildcreek/MultiChoice

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-03
  • 2021-11-24
  • 2021-10-05
  • 2021-10-19
猜你喜欢
  • 2018-06-29
  • 2021-05-26
  • 2021-11-06
  • 2022-12-23
  • 2021-11-07
  • 2021-10-02
  • 2021-12-21
相关资源
相似解决方案