tags:

views:

45

answers:

1

Hi all,

I'm writting a web application using MVC and Linq2Sql. Theie are a set of questionaires having different versions. Each version questionaire have different rating rules for the questions in the questionaire. For example 1.0 version may let question 35~ question 100 tobe 1' but in 2.0, they are 1.5'. How can you store that rules in you application?

Thanks a lot in advance!

A: 

I'd store that sort of information in meta data within an xml file.

I'd have an xml file that stores all possible questions maybe. I'd then have another xml file that stores the exams with references to questions. In the exam xml I'd have the rules for the question.

That way you could have a question with 100's of possible rules.

XML may not be your flavour and you could just as easily store them in a database but databases are more difficult to deploy than an xml file.

griegs
Thanks! Is there any libraries or tools can automate such tasks?
Roy
Not that i'm aware of. This isn't that hard to implement. The two xml files will need to be created by you anyway and should be fairly easy. <question id='questionblue'><text>what does blue sound like</text></question> as an example. then <question id='questionblue'><rule values/></question> the code to actually ready the questions and apply rules can be made generic and should also be fairly easy to write.
griegs
The problem is that the answer to the question is not only yes or no, they may be n/a. For some statistics we include na in some version, but some time we don't.
Roy
Then the exam xml files will need to store the answers also. Most questions i supose would have standard answers that can be in the question xml file. for those that are variable, i'd put the answer in the exam xml file. the exam xml file answers would overide the question xml answers allowing for standard responses and custom response.
griegs