stickck
08-24-2005, 08:20 PM
I finally got back and i'm trying to get these done before i have to leave again. what i want to do is keep the questions and answers in either a table or txt file and have them import into the quiz (depending on which quiz the user chooses) here is what i have for a smaller quiz (most of the tests are 100 to 150 questions each) 31 tests to build yet! i searched the forums here and i didnt find anything that really explained how. i seen a few samples that tigger put out (thanks Tigger for the certificate you built. i changed it around so that at the end of the quiz it added the score results and user name to it.) want to see what i built, email me and i'll send you a copy.
question_list = {};
question_list [1] ="In a lockout, an energy-isolating device is locked in the safe or off position.\n\nA - True.\nB - False.";
question_list [2] ="In a tagout, the energy-isolating device is placed in the safe position and a written warning is attached to it.\n\nA - True.\nB - False.";
question_list [3] ="Lockout/tagout should be used whenever you are performing service or maintenance around any machine where you could be injured by unexpected start-up or release of stored energy.\n\nA - True.\nB - False.";
question_list [4] ="Applying locks or tags in the right places de-energizes the equipment.\n\nA - True.\nB - False.";
question_list [5] ="Turning off the power switch removes all energy from powered equipment.\n\nA - True.\nB - False.";
question_list [6] ="Before lockout/tagout is applied, all workers in the affected area must be notified.\n\nA - True.\nB - False.";
question_list [7] ="Before you turn off equipment in order to lock or tag it out, you must know the type of energy it uses, the hazards of that energy and how to control the energy.\n\nA - True.\nB - False.";
question_list [8] ="After equipment has been isolated from its power source, it is still necessary to control any energy stored in the system.\n\nA - True.\nB - False.";
question_list [9] ="Before removing lockout/tagout devices, you must make sure the danger area is clear of tools and workers.\n\nA - True.\nB - False.";
question_list [10] ="If a worker is not present to remove his own lock, any co-worker can remove it as long as he first makes sure it is safe.\n\nA - True.\nB - False.";
-- This is a list of corresponding correct answers
answer_list = {"A","A","A","B","B","A","A","A","A","B"}
whole_list = {"In a lockout, an energy-isolating device is locked in the safe or off position.\n\nA - True","In a tagout, the energy-isolating device is placed in the safe position and a written warning is attached to it.\n\nA - True","Lockout/tagout should be used whenever you are performing service or maintenance around any machine where you could be injured by unexpected start-up or release of stored energy.\n\nA - True","Applying locks or tags in the right places de-energizes the equipment.\n\nB - False","Turning off the power switch removes all energy from powered equipment.\n\nB - False","Before lockout/tagout is applied, all workers in the affected area must be notified.\n\nA - True","Before you turn off equipment in order to lock or tag it out, you must know the type of energy it uses, the hazards of that energy and how to control the energy.\n\nA - True","After equipment has been isolated from its power source, it is still necessary to control any energy stored in the system.\n\nA - True","Before removing lockout/tagout devices, you must make sure the danger area is clear of tools and workers.\n\nA - True","If a worker is not present to remove his own lock, any co-worker can remove it as long as he first makes sure it is safe.\n\nB - Fasle",};
this is the basic quiz template, i just addes several things like the wrong_list that tell the user the correct answer when they answer wrong. i did have keystokes but if they answered wrong, they could hit the correct answer key and it would change thier score and mark it correct. i couldn't figure out the fix for that so i took it out. so my question is how can i put the questions / answers listed above in a txt file and have it imported into the quiz? also, will i have to format the questions just like those above when i do the TXT file or can i just have the questions and answers like normal with out the \n\n double space stuff.
I'm not that good at scripting. i know just enough to get myself in trouble! :)
thanks for any help you can give!!!!!
SSgt Chris Koehnle
U.S. Air Force
question_list = {};
question_list [1] ="In a lockout, an energy-isolating device is locked in the safe or off position.\n\nA - True.\nB - False.";
question_list [2] ="In a tagout, the energy-isolating device is placed in the safe position and a written warning is attached to it.\n\nA - True.\nB - False.";
question_list [3] ="Lockout/tagout should be used whenever you are performing service or maintenance around any machine where you could be injured by unexpected start-up or release of stored energy.\n\nA - True.\nB - False.";
question_list [4] ="Applying locks or tags in the right places de-energizes the equipment.\n\nA - True.\nB - False.";
question_list [5] ="Turning off the power switch removes all energy from powered equipment.\n\nA - True.\nB - False.";
question_list [6] ="Before lockout/tagout is applied, all workers in the affected area must be notified.\n\nA - True.\nB - False.";
question_list [7] ="Before you turn off equipment in order to lock or tag it out, you must know the type of energy it uses, the hazards of that energy and how to control the energy.\n\nA - True.\nB - False.";
question_list [8] ="After equipment has been isolated from its power source, it is still necessary to control any energy stored in the system.\n\nA - True.\nB - False.";
question_list [9] ="Before removing lockout/tagout devices, you must make sure the danger area is clear of tools and workers.\n\nA - True.\nB - False.";
question_list [10] ="If a worker is not present to remove his own lock, any co-worker can remove it as long as he first makes sure it is safe.\n\nA - True.\nB - False.";
-- This is a list of corresponding correct answers
answer_list = {"A","A","A","B","B","A","A","A","A","B"}
whole_list = {"In a lockout, an energy-isolating device is locked in the safe or off position.\n\nA - True","In a tagout, the energy-isolating device is placed in the safe position and a written warning is attached to it.\n\nA - True","Lockout/tagout should be used whenever you are performing service or maintenance around any machine where you could be injured by unexpected start-up or release of stored energy.\n\nA - True","Applying locks or tags in the right places de-energizes the equipment.\n\nB - False","Turning off the power switch removes all energy from powered equipment.\n\nB - False","Before lockout/tagout is applied, all workers in the affected area must be notified.\n\nA - True","Before you turn off equipment in order to lock or tag it out, you must know the type of energy it uses, the hazards of that energy and how to control the energy.\n\nA - True","After equipment has been isolated from its power source, it is still necessary to control any energy stored in the system.\n\nA - True","Before removing lockout/tagout devices, you must make sure the danger area is clear of tools and workers.\n\nA - True","If a worker is not present to remove his own lock, any co-worker can remove it as long as he first makes sure it is safe.\n\nB - Fasle",};
this is the basic quiz template, i just addes several things like the wrong_list that tell the user the correct answer when they answer wrong. i did have keystokes but if they answered wrong, they could hit the correct answer key and it would change thier score and mark it correct. i couldn't figure out the fix for that so i took it out. so my question is how can i put the questions / answers listed above in a txt file and have it imported into the quiz? also, will i have to format the questions just like those above when i do the TXT file or can i just have the questions and answers like normal with out the \n\n double space stuff.
I'm not that good at scripting. i know just enough to get myself in trouble! :)
thanks for any help you can give!!!!!
SSgt Chris Koehnle
U.S. Air Force