要建立一个检测模式静态内容 [英] To build an examination pattern static content

查看:110
本文介绍了要建立一个检测模式静态内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想bulid一个Android应用程序进行检查。假设有两个科目,每个包含每20个问题。那么如何来实施落实这些问题和答案/最好的方法?我想重新使用的活动,是用的strings.xml是preferred的方式吗?怎么样?所有的事情都是静态的内容,都在只有客户端。
  感谢名单提前。

I want to bulid an android application to conduct a examination. Suppose there are two subjects, and each contains 20 questions each. So how to implement / best way to implement these questions and answers? I want to reuse the Activity and is the way of using Strings.xml is preferred? how? All the things are Static content, all at client side only. Thanx in advance.

- 主季

推荐答案

您可以在里面arrays.xml 2定义阵列(问题和解答)。例子如下: http://developer.android.com/resources /samples/ApiDemos/res/values​​/arrays.html
如果你想重用现有的活动,那么你的应用将是同一个活动的不同对象的序列(可以称之为QuestionActivity),并且可以调用新用户时preSS下一步。通过这种方式,你应该把问题的数量,里面显示的意图,所以活动就知道要显示的内容。
用户可以preSS后退按钮,他的回答可能会丢失。所以,还当用户选择了一些答案,你应该记住问题的答案。

You can define 2 arrays (questions and answers) inside your arrays.xml. Example is here: http://developer.android.com/resources/samples/ApiDemos/res/values/arrays.html If you want to reuse existing activity, then your application will be a sequence of different objects of the same activity (lets call it QuestionActivity), and you can call new one when user press Next. In this way you should put the number of question to display inside intent, so the activity will know what to display. User can press Back button and his answers can be lost. So also you should memorize answers to questions when user chooses some answer.

这篇关于要建立一个检测模式静态内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆