Indigo Rose Software

Professional Software Development Tools

 
Page 1 of 3 1 2 3 LastLast
Results 1 to 15 of 32
  1. #1
    Join Date
    Feb 2004
    Location
    Cowfields of Germany
    Posts
    617

    Huh? Another Quiz Question!!

    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

  2. #2
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    A couple suggestions are these

    First with the format of the file, you could build the tables as you have them above in a text file(actually a .lua file) and then use the LUA function dofile(filename) to instantiate the tables for your quiz. This is nice because you could then easily change out the quiz you want to use with the engine.

    Or you could have one question and answer set per line and use the TextFile.ReadToTable. to create your table, very similar to the above. I would have all the formatting in the text string when you read it to a table or at least to a String.Replace to add the correct syntax so it is readeable in the quiz tool.

    HTH
    Tigg
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  3. #3
    Join Date
    Feb 2004
    Location
    Cowfields of Germany
    Posts
    617
    i think i might try your first suggestion. so i should just put the questions and answers in the correct format into a txt file and change the extention to .lua? the dofile(filename) function--do i need the luacom plugin for that?

    once it populates the table with the file info, let say they want to go back and do a different test. do i need to clear the table first of will it copy over the old info with the new info?

    thanks for the help with this. i'm working on adding in the MSAGENT and have him tell the user the correct answer when they answer wrong.

    i still cant attach the program. i get an error when i try. oh well.


    Thanks again for your help.
    Chris

  4. #4
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    No LuaCOM is not required. dofile() is a lua function that works in AMS, see www.lua.org for more details. It loads and runs the lua code from an ASCII file.

    Once you use dofile the table is now loaded, the person can now take the test. If they want to go back and take another, then they can dofile on another file to load that one too. And what is really cool is you can use the Luacompile program that is on the board somewhere to convert the text file to a binary file and your questions are now more secure.

    Tigg
    TJ-Tigger
    "A common mistake that people make when trying to design something completely foolproof was to underestimate the ingenuity of complete fools."
    "Draco dormiens nunquam titillandus."
    Map of IR Forum Users - IR Project CodeViewer - Online Help - TiggTV - QuizEngine

  5. #5
    Join Date
    Feb 2004
    Location
    Cowfields of Germany
    Posts
    617
    oh! i've been looking at www.LUA.org and i've been trying to understand it. does AMS support all of the LUA functions?
    thanks for the help with this. i like that much better. right now i have all the tests in word docs (we used to print them off and hand them out), but im going to import them into Excel and put in the codes that way (much quicker that way unless you know of a simpler way) and save it as a txt file.

    thanks again

    chris

  6. #6
    Join Date
    Feb 2004
    Location
    Cowfields of Germany
    Posts
    617
    this is a little off the subject but anyways. MSAGENT. i got everything to work but how can i speed up the Speak command. i would like to speed up how fast it types the word in the speech bubble (whatever that call that thing)

    MyAgent.Characters("Merlin"):Speak ("Welcome "..strName.."!")

    MyAgent.Characters("Merlin"):Speak ("Incorrect. The correct answer is "..whole_list[question_index].."!")


  7. #7
    Join Date
    Dec 2003
    Location
    Location! Location!
    Posts
    6,137
    FWIW, I.R.'s AMS 5 documentation (read: help) does cover the dofile and require built-ins.

    http://www.indigorose.com/webhelp/am..._Functions.htm

    Intrigued

  8. #8
    Join Date
    Feb 2004
    Location
    Cowfields of Germany
    Posts
    617
    Thanks Tigger & Intrigued! It works perfect!!! i'll upload the APZ from home. i think our LAN system is blocking the upload here. The way i was doing it, i would of used up about 200 meg. now it should only be about 6 meg!

    THANK YOU!!!!!!

    screenshot for you.

    chris

  9. #9
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Snazzy looking project!

  10. #10
    Join Date
    Feb 2004
    Location
    Cowfields of Germany
    Posts
    617
    Thanks Corey

    you helped me out with this project when i started it back april 2004. been in the middle east most of last year. now i can get back on it. Thanks for the help with it. i know i'll be asking for more help with it in the near future.


    Thanks again

    chris

  11. #11
    Join Date
    Oct 2005
    Posts
    2
    i want this project stickck
    tanx alot

  12. #12
    Join Date
    Feb 2004
    Location
    Cowfields of Germany
    Posts
    617
    i got off it again. i'll eventually get it completed. there are several errors in it right now. i changed the way it get the questions and i havent worked out the new bugs. i used to keep the questions and answers in the global list, but now i use LUA files and import them during runtime. its much better. now the user can create thier own tests and they're automaticly imported into the test program. (i havent added that in yet.) i'm just going to use a list box that populates with the LUA files a folder.

    i cant get the site to let me upload from work. ill try from home to get it to work. send me a private message with your email and i can email you the file. i have 2 different ones. one that links all the test together (5 Meg) and the other only opens one test (1 Meg).

    chris

  13. #13
    Join Date
    Feb 2004
    Location
    Cowfields of Germany
    Posts
    617
    i still cant get it to upload. i can email it to you if you want. i fixed a few of the errors real quick. just send me a private message unless you dont mind your email address in a post....

    let me know

    chris

  14. #14
    Join Date
    Feb 2004
    Location
    Cowfields of Germany
    Posts
    617
    all the errors are fixed now. when i created the APZ file, I didnt notice that it deleted the gif files for the certificate. easy fix!

  15. #15
    Join Date
    Feb 2004
    Location
    Cowfields of Germany
    Posts
    617
    more help please! i've searched the forum for this and i've tried several different ways but i still cant get it to work right. i want to write sting to a text file and it does, but i want it to add some info like user and score and date. here is what i have right now.

    Print Button OnClick
    TextFile.WriteFromString("AutoPlay\\Docs\\Results. txt", '..strName', true);

    Page Preload
    strName = Dialog.Input("Vehicle Maintenance Test Module", "Please Enter your Name", "Your Name Here!!!", MB_ICONQUESTION);

    but when it rights to the text file it only writes ..strName not the actual name tha was input. and suggestions?

    thanks

    chris

Page 1 of 3 1 2 3 LastLast

Similar Threads

  1. Quiz Template and images question
    By sue in forum AutoPlay Media Studio 5.0
    Replies: 10
    Last Post: 02-27-2006, 04:16 AM
  2. Share my Quiz System
    By handsomer100 in forum AutoPlay Media Studio 5.0
    Replies: 4
    Last Post: 10-03-2005, 03:29 AM
  3. Quiz results
    By mindstitchdr in forum AutoPlay Media Studio 5.0
    Replies: 5
    Last Post: 03-08-2005, 11:28 AM
  4. Need Assistance with Random Question Quiz
    By marc3515 in forum AutoPlay Media Studio 4.0
    Replies: 5
    Last Post: 02-16-2003, 06:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts