|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Is this possible in XSL?
I would not bother pre-computing combinations of answers - the list of possible combinations will be enormous. Why not do it in XML? In-line the answers with the questions ... <questions> <question id="1"> <text>This is a question</text> <option opt="A">This is response A</option> <option opt="B">This is response B</option> <option opt="C">This is response C</option> <correct_answer>A</correct_answer> </question> <question id="2"> <text>This is another question</text> <option opt="A">This is response A</option> <option opt="B">This is response B</option> <option opt="C">This is response C</option> <correct_answer>A</correct_answer> <correct_answer>C</correct_answer> </question> </questions> Option i) Serve the questions, with options (but not correct_answers) to the user. You might indicate the number of answers required - depends on your rubric. On your server, compare the options selected with the correct options. Option ii) Serve the full file as is to the end users, and let the browser check the responses (use Java/JavaScript/other language). Depending on your environment, you may need to review the simplicity of the models above, and the chances of people perusing your files (security). From: Mark Nahabedian [mailto:naha@xxxxxxxxxx] Sent: Tuesday, October 02, 2001 12:48 PM To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Subject: Is this possible in XSL? Uslu, Cihan Y (MED) writes: > Hi; > Is it possible to get all the answers' item-ids in a way that covers > all the possible correct answer combination. > For example I have this multiple choice question in XML and the correct > answers are "A" "B" and "H". > What I want to output is to get all the possible correct answer > combination like this: > "ABH | AHB | BAH | BHA | HAB | HBA" > > How can I do this in XSL? How would you do it in another language? Are the "item-id" attributes always a single character in length? Is there some maximum number of <answer> elements for all <question>s? I.e. can the script assume that no <question> will ever have more than 5 <answer>s? If so, you can precompute all possible permutations and just use the elements of the precomputed permutation as indexes into the <answer> elements for a given <question>. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








