name of file based on input1

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • mindstitchdr
    Indigo Rose Customer
    • Dec 2004
    • 239

    name of file based on input1

    I altered the quiz template to save the results of the quiz to a text file. I need to know how to use the input1 info for the filename of the doc that is saved. any help would be great. here is what I have now.

    user = Input.GetText("Input1");
    TextFile.WriteFromString("C:\\flqr.doc", "Employee:" ..user.."\r\rQuiz Taken:".."Forklift Quiz".."\r\rNumber Correct:" ..numcorrect.."\r\rGrade:" ..percent, false);

    I want to change the flqr.doc to the input given from input1
  • TJ_Tigger
    Indigo Rose Customer
    • Sep 2002
    • 3159

    #2
    Do what you are doing with the string written to the file and concatenate the filename into the file to be saved.
    Code:
    user = Input.GetText("Input1");
    TextFile.WriteFromString("C:\\".. user ..".doc", "Employee:" ..user.."\r\rQuiz Taken:".."Forklift Quiz".."\r\rNumber Correct:" ..numcorrect.."\r\rGrade:" ..percent, false);
    --
    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

    Comment

    • mindstitchdr
      Indigo Rose Customer
      • Dec 2004
      • 239

      #3
      ouch if it was a snake it would have bitten me. Is there a way to prevent the user from simply retaking the test to get a better score. Like if they start the quiz over and complete the quiz you would now have 2 files one named "usera" and the other "userb" so I would know if they took the quiz again.
      Last edited by mindstitchdr; 04-26-2005, 10:10 AM.

      Comment

      • mindstitchdr
        Indigo Rose Customer
        • Dec 2004
        • 239

        #4
        Is there any way to do this?

        Comment

        • TJ_Tigger
          Indigo Rose Customer
          • Sep 2002
          • 3159

          #5
          Yes, I am sure there is a way to do this. It depends on how you end the quiz. Once they submit the quiz at the end, don't allow them to retake the test, disable the buttons that take you to the start of the quiz. If you want to make it so they cannot retake the quiz by exiting and restarting the app, I would then suggest that you write to the registry or a file on the system. Then when the application starts you can check the file/registry to see if they have already taken the test. If they have then disable the buttons that allow them to take the quiz.

          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

          Comment

          • mindstitchdr
            Indigo Rose Customer
            • Dec 2004
            • 239

            #6
            Sorry I'm an idiot, I figured it out. All I had to do was change "false" to "true" and I get the results I was looking for. With a File.Print it will show if the user took the test more than once. Thanks for your help.

            Comment

            Working...
            X