6 Replies Latest reply on Apr 12, 2012 9:24 AM by Floor_IDGnet

    Alternative timeloop for IWP

    Floor_IDGnet

      Hi there,

      I need some help to make an timeloop suiteble for IWP, like a do-while loop for answering questions in an exam with a variable timewindow for answeringtime. The answers will be given by an button-script action. Because "script-halt" is not compatible with IWP i have already tryed:

       

      timestart (=GetTimestamp)

      loop

      exit loop if =GetTimestamp>timestart+10sec

      End loop

       

      But during this loop no answers-actions are exepted or all scriptactions will be ignored.

      A have also used 10 times a scripthalt-step for 1 sec. This worked fine when running fm-client but not in IWP.

       

      Any suggestions are welcome!

       

      Greatings, Floor

        • 1. Re: Alternative timeloop for IWP
          Stephen Huston

          Hi Floor,

           

          Your loop, as written, has not pause inside it, so it is running however many hundreds or thousands of loops it can handle in the 10 seconds with no down-time.

           

          Have you tried it without the loop, but using a timed pause of 10 seconds? (Allow User Abort so it won't attempt to lock the screen.)

           

          Warning: I haven't tried this in IWP, but your constantly-looping script would tie up FMPro processing pretty tightly as well without any pause.

           

          Be sure to check compatibilty of all script steps with Web Publishing in the script editor's filtering.

           

          Stephen Huston

          • 2. Re: Alternative timeloop for IWP
            fitch

            You don't necessarily need a loop.

             

            Set the ending time via script when the user navigates to the question (e.g., timestamp+10sec).

             

            Set a message at the top of the screen: "You have 10 seconds to respond."

             

            When the user clicks the done/submit button, the button's script could check whether the allotted time had elapsed.

            • 3. Re: Alternative timeloop for IWP
              Malcolm

              You don't necessarily need a loop.

               

               

              Set the ending time via script when the user navigates to the question (e.g., timestamp+10sec).

               

               

              Set a message at the top of the screen: "You have 10 seconds to respond."

               

               

              When the user clicks the done/submit button, the button's script could check whether the allotted time had elapsed.

               

               

              This is a much better method but it is still missing something. It's the web. You have potential for problems at every turn. You cannot presume that the page has loaded and is visible to the user within the 10 second timeframe ( yes, I know it's an example ).  Unless the timer is invoked on the client side you will be reducing the time by (processing/network/page rendering) * 2. Which means that every user has a different amount of time

               

              I think you need to use this method and improve it with javaScript at the front end. The javascript could start the timer on page load. It can keep track of time and the start and finish time can both be passed back to filemaker. That time taken to answer can be compared with the allowed time.

               

              I can see IWP in the subject line. It doesn't seem to be appropriate for this job. IWP is great for simple data entry screens but if you want to do more you'll have to do it with your wrist tied to your ankle.

               

              CWP gives you all the benefits of PHP programming on the server between FMP and the client. You can use powerful javascript libraries to improve the user experience. There are frameworks and open-source applications free to use. The PHP site assistant will produce a working website for you within minutes.

               

              Malcolm

              • 4. Re: Alternative timeloop for IWP
                Floor_IDGnet

                Hi Malcolm (and all others),

                 

                Thanks for your reply, and you are right about IWP, but i am not in to PhP and Java. So i  just wanted to give it a try in IWP.

                 

                By adding a submit-button i can tackle the problem but because this is a simulation on an official exam, and the don't use a submitbutton a realy didn't want to have one in this system.

                The timepauze like Stephan's and setting the time like fitch's suggestion was tested before the initial posting on this forum. And within fm-client if worked very nice.

                 

                So i will have to ad an submitbutton and recalc the time betwene start en finish and get of from there.

                 

                Again thank an sorry for my bad english, Dutch is my native lang.

                 

                Greatings, Floor

                • 5. Re: Alternative timeloop for IWP
                  Malcolm

                  Thanks for your reply, and you are right about IWP, but i am not in to PhP and Java. So i  just wanted to give it a try in IWP.

                   

                  Ok. Good luck. If anyone comments, just tell them, of course it could be done in PHP/javascript but that would be too easy.

                   

                  malcolm

                  • 6. Re: Alternative timeloop for IWP
                    Floor_IDGnet

                    Hi Malcolm,

                     

                    I succesfully made an alt. loop for IWP by a Javascript on timer.html page that triggers a buttonscript on the FM-layout. See this file. Works great on localhost.

                     

                    Migrating to the server I have to know the default webfolder for the Fm-Server. I thought it was /Web Publishing/IWP but this seems to be wrong. This is also the location for my own IWP-homepage.

                     

                    Soo I am looking for the equivalent for the "C:\Program Files\FileMaker\FileMaker Pro 11 Advanced\web" folder on a local machine.

                     

                    Any suggestions please!

                     

                    Floor