0
QCM的結構將存儲像設計XML到OOP方式
qcm.xml -->master node
groups.xml -> list of groups
group.xml -> group node
questions.xml -> list of questions
question.xml -> question node
anwsers.xml -> list of answers.
anwser.xml -> answer node
而對於每一個的QCM, GROUP, QUESTION, ANSWER
將包括:
content.xml
variant.xml
property.xml
Firts我可以說element
是最小的一部分:
ELEMENT
+content
+property
+dataListRef
XML內容:
1.1) groups.xml (list of groups::groupListRef)
<groups>
<group id="123"></group>
<group id="345"></group>
<group id="567"></group>
</groups>
1.1.1) group.xml (group element)
<group>
<content id="123"></content>
<property id="123"></property>
<questionListRef id="123"></questionListRef>
</group>
1.1.1.1) questions.xml (list of questions::questionListRef)
<questions id="123">
<question id="123"></question>
<question id="345"></question>
<question id="567"></question>
</questions>
1.1.1.1.1)question.xml (question element)
<question id="123">
<content id="123"></content>
<property id="123"></property> .
<answerListRef id="123"></answerListRef>
<question>
1.1.1.1.1.1) answers.xml (list of answers belong to question::answerListRef)
<answers id="123">
<answer id="123"></answer>
<answer id="345"></answer>
<answer id="567"></answer>
<answers>
1.1.1.1.1.1.1) ...
1) content.xml
<content id="123">
<variant id="123"></variant>
<content>
a.1)variant.xml
<variant id="123">
<text></text>
<image></image>
<table></table>
<file></file>
</variant>
2) property.xml
<property id="123">
<segment></segment>
<context></context>
</property>
我的方式(我不擅長在空中接力):
<?php
interface element {
public content //obj of content
public property //obj of property
public listRef //array of obj [123,321,253]
}
class content{
//some property
//some property
}
class propery{
//some property
//some property
}
class listRef {
//some property
//some property
}
class group implements element{
//some property
//some property
}
class question implements element{
//some property
//some property
}
class answer implements element{
//some property
//some property
}
?>
任何人可以提供一些指導原則來設計這種情況下,到面向對象的方法呢?
感謝
是的,請看看我的更新卡洛斯羅伯斯。謝謝 – kn3l