夏普中的多项选择 [英] multiple choice in c sharp

查看:72
本文介绍了夏普中的多项选择的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用c#在xml文件中设计所有问题和问题答案的多项选择.请帮助我.感谢期待

how can i design a multiple choice such all the questions and the answers to the questions in an xml file,using c#.please help me out.thanks in anticipation

推荐答案

a)您确实知道导师阅读了这些内容,看看谁不能做作业?
b)我们不做作业.
c)阅读 [
a) You do realize that tutors read these to see who can''t do their assignments?
b) we don''t do homework.
c) read this[^].


我们无法在此处提供您的代码.您仍然可以在Google上查看是否可以找到类似的示例

但是这是伪代码,仔细阅读一下,您会找到背后的所有线索
1.将xml加载到XmlDocument. (命名空间System.XML)
2.解析XML并获得IList或数组字符串中的答案
3.对收集对象进行while循环
4.获取每个答案
5.动态创建一个单选按钮,并将其命名为radio_ [counter],例如radio_1,radio_2.当用户检查收音机时,最后一个数字将用于标识答案.
6.在收音机旁边,在标签中显示答案.
7.页脚处将有一个按钮.单击该按钮将使用forms.control
在单选按钮集合上循环. 8.获取选中的单选按钮,解析单选按钮的名称并获取最后一个数字.
9.将号码发送到数据库以获取答案.如果匹配,请说正确答案",否则请说错误答案".

自己尝试.
祝你好运.

欢呼
We can not give you the code here. You can still google to see if you can find similar example

But here is the pseudo code, go through it, you will find all the clues behind
1. Load the xml to XmlDocument. (namespace System.XML)
2. Parse the XML and get the answers in a IList or array string
3. Do a while loop on the collection object
4. Get each answer
5. Create a radio button dynamically and name it as radio_[counter] like radio_1, radio_2. This last number will be used to identify the answer when user checks a radio.
6. beside the radio, display the answer in a label.
7. There will be a button at the footer. Clicking the button will make a loop on radiobutton collection using forms.control
8. Get the checked radio button, parse the name of the radio button and get the last number.
9. Send the number to the database to get the answer. If matches, say "Right Answer", if no "Wrong Answer".

Try it yourself.
Best of luck.

cheers


根据您对xml的评论,我尝试将xml发布到评论中.
某种程度上,xml不被视为有效文本(可能是出于安全原因).

因此,这是带有问题,答案和正确标志的示例xml.

As per your comments on xml, I tried to post the xml in comment.
Somehow the xml is not considered as valid text (probably due to security).

So, here is the sample xml with question, answer and correct flag.

<samplepaper>
<question id="1" description="What is the capital city of India?">
<answer id="1" description="Mumbai" flag="0" />
<answer id="2" description="Kolkata" flag="0" />
<answer id="3" description="New Delhi" flag="1" />
<answer id="4" description="Chennai" flag="0" />
</question>
<question id="1" description="XML can be parse using?">
<answer id="1" description="xmlparse" flag="0" />
<answer id="2" description="XmlDoc" flag="0" />
<answer id="3" description="XMLGrabber" flag="0" />
<answer id="4" description="XMLDocument" flag="1" />
</question>
</samplepaper>



标记= 1是正确答案
标志= 0是错误答案

欢呼



Flag=1 is correct answer
Flag=0 is incorrect answer

cheers


这篇关于夏普中的多项选择的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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