<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
Are both reads into the same icon?<div><br></div><div><br></div><div><br><br><div><div id="SkyDrivePlaceholder"></div>> From: Paul.Swanson@harlandfs.com<br>> To: xerte@lists.nottingham.ac.uk<br>> Date: Wed, 8 Aug 2012 14:22:28 +0000<br>> Subject: [Xerte] Re: Desktop Xerte 2.17 -- having trouble reading data from external script<br>> <br>> It has to be something in my Xerte code. I am rebuilding the file, and so far the same code parsing code is working on localhost accessing the same PHP scripts. It must be something else in the file that is causing the problem. Yesterday afternoon I re-introduced the reading of the XML file and duplicating the quiz nodes. So far so good. Now I just have another database read (the first read checks to see if the user is registered for the course, the second read will get their current information an progress if they are registered -- maybe I should combine those two), then some interface changes and the final scoring / send results to the database. I think it will work, there must have been something corrupted in the original file somewhere.<br>> <br>> Paul Swanson<br>> Internal Business Systems Analyst<br>> Internal Business Intelligence<br>> Harland Financial Solutions<br>> (800) 274-7280 Ext. 2462<br>> Paul.Swanson@harlandfs.com<br>> <br>> -----Original Message-----<br>> From: xerte-bounces@lists.nottingham.ac.uk [mailto:xerte-bounces@lists.nottingham.ac.uk] On Behalf Of Julian Tenney<br>> Sent: Wednesday, August 08, 2012 2:18 AM<br>> To: Xerte discussion list<br>> Subject: [Xerte] Re: Desktop Xerte 2.17 -- having trouble reading data from external script<br>> <br>> > I'll let you know if moving my parsing routine to a script following the interaction resolves the problem in my full application.<br>> <br>> It won't - the event fires once the data comes in, and the script in the response should be able to get at it, I don't think the problem is with your xerte code,<br>> <br>> -----Original Message-----<br>> From: xerte-bounces@lists.nottingham.ac.uk [mailto:xerte-bounces@lists.nottingham.ac.uk] On Behalf Of Paul Swanson<br>> Sent: 07 August 2012 18:29<br>> To: Xerte discussion list<br>> Subject: [Xerte] Re: Desktop Xerte 2.17 -- having trouble reading data from external script<br>> <br>> Latest update: I created a stripped down version that just takes the user's text entry email address and sends it to the PHP script, and reads the response from the onSendAndLoadVars event as rawData. It's working in my stripped down version on localhost. One difference: instead of trying to display the rawData (I haven't attempted any parsing yet) in the script attached to the event response, I'm exiting the response and then doing my textIconID.appendText(rawData) -- I'll let you know if moving my parsing routine to a script following the interaction resolves the problem in my full application.<br>> <br>> Paul Swanson<br>> Internal Business Systems Analyst<br>> Internal Business Intelligence<br>> Harland Financial Solutions<br>> (800) 274-7280 Ext. 2462<br>> Paul.Swanson@harlandfs.com<br>> <br>> -----Original Message-----<br>> From: xerte-bounces@lists.nottingham.ac.uk [mailto:xerte-bounces@lists.nottingham.ac.uk] On Behalf Of Julian Tenney<br>> Sent: Tuesday, August 07, 2012 7:56 AM<br>> To: Xerte discussion list<br>> Subject: [Xerte] Re: Desktop Xerte 2.17 -- having trouble reading data from external script<br>> <br>> It's got to be security: preview isn't subject to any security restrictions. It works there, right? So you know the xerte code is fine.<br>> <br>> Can you make a simple stripped down example that just does the sendAndLoadVars thing and share the files? If it were me I'd do that, put the rlo and the php in the same folder ona webserver and try it again, then I'd debug in the engine to see if the data is coming back, and what gets returned, any errors, etc.<br>> <br>> <br>> -----Original Message-----<br>> From: xerte-bounces@lists.nottingham.ac.uk [mailto:xerte-bounces@lists.nottingham.ac.uk] On Behalf Of Paul Swanson<br>> Sent: 07 August 2012 15:52<br>> To: Xerte discussion list<br>> Subject: [Xerte] Re: Desktop Xerte 2.17 -- having trouble reading data from external script<br>> <br>> I've tried it on our live server, and get the same 'undefined' issue.<br>> <br>> Paul Swanson<br>> Internal Business Systems Analyst<br>> Internal Business Intelligence<br>> Harland Financial Solutions<br>> (800) 274-7280 Ext. 2462<br>> Paul.Swanson@harlandfs.com<br>> <br>> <br>> -----Original Message-----<br>> From: xerte-bounces@lists.nottingham.ac.uk [mailto:xerte-bounces@lists.nottingham.ac.uk] On Behalf Of Pat Lockley<br>> Sent: Tuesday, August 07, 2012 7:49 AM<br>> To: Xerte discussion list<br>> Subject: [Xerte] Re: Desktop Xerte 2.17 -- having trouble reading data from external script<br>> <br>> try a webserver that isn't localhost?<br>> <br>> On Tue, Aug 7, 2012 at 3:46 PM, Dave Burnett <d_b_burnett@hotmail.com> wrote:<br>> ><br>> > Shouldn't be as it's using an event.<br>> ><br>> ><br>> ><br>> ><br>> >> Date: Tue, 7 Aug 2012 15:43:35 +0100<br>> >> From: patrick.lockley@googlemail.com<br>> >> To: xerte@lists.nottingham.ac.uk<br>> ><br>> >> Subject: [Xerte] Re: Desktop Xerte 2.17 -- having trouble reading data<br>> >> from external script<br>> >><br>> >> Timing issue?<br>> >><br>> >> On Tue, Aug 7, 2012 at 3:41 PM, Paul Swanson <Paul.Swanson@harlandfs.com><br>> >> wrote:<br>> >> > Same thing.<br>> >> ><br>> >> ><br>> >> ><br>> >> > Paul Swanson<br>> >> ><br>> >> > Internal Business Systems Analyst<br>> >> ><br>> >> > Internal Business Intelligence<br>> >> ><br>> >> > Harland Financial Solutions<br>> >> ><br>> >> > (800) 274-7280 Ext. 2462<br>> >> ><br>> >> > Paul.Swanson@harlandfs.com<br>> >> ><br>> >> ><br>> >> ><br>> >> > From: xerte-bounces@lists.nottingham.ac.uk<br>> >> > [mailto:xerte-bounces@lists.nottingham.ac.uk] On Behalf Of Dave Burnett<br>> >> > Sent: Monday, August 06, 2012 5:01 PM<br>> >> > To: Xerte list<br>> >> > Subject: [Xerte] Re: Desktop Xerte 2.17 -- having trouble reading data<br>> >> > from<br>> >> > external script<br>> >> ><br>> >> ><br>> >> ><br>> >> > What if it's on an actual web server?<br>> >> ><br>> >> ><br>> >> ><br>> >> ><br>> >> ><br>> >> ><br>> >> ><br>> >> > ________________________________<br>> >> ><br>> >> > From: Paul.Swanson@harlandfs.com<br>> >> > To: xerte@lists.nottingham.ac.uk<br>> >> > Date: Mon, 6 Aug 2012 22:39:53 +0000<br>> >> > Subject: [Xerte] Desktop Xerte 2.17 -- having trouble reading data from<br>> >> > external script<br>> >> ><br>> >> > I'm have a devil of a time getting a Xerte app to read the response from<br>> >> > a<br>> >> > PHP script when run through a browser. It works fine in Preview mode,<br>> >> > and I<br>> >> > know the script is getting the login information and returning a string<br>> >> > because in preview mode I receive and can display the correct response<br>> >> > with<br>> >> > info from my database. I also have the PHP database script email me the<br>> >> > same<br>> >> > string. This works beautifully in Preview mode, but when I copy my rlo<br>> >> > and<br>> >> > other published files to localhost and run it from there, Xerte prints<br>> >> > 'undefined' for the rawData property returned from a sendAndLoadVars<br>> >> > call.<br>> >> > The database script still emails me the correct response.<br>> >> ><br>> >> ><br>> >> ><br>> >> > Here's what I'm sending to my PHP authentication script (domain is<br>> >> > defined<br>> >> > in a login script, and the parent Page icon has an id of loginCheck):<br>> >> ><br>> >> > // real url<br>> >> ><br>> >> > URLString = domain + '/wbt/app/admin/authenticate.php';<br>> >> ><br>> >> ><br>> >> ><br>> >> > // pass values to external script<br>> >> ><br>> >> > loginVars = new LoadVars ();<br>> >> ><br>> >> > loginVars.action = 'authenticate';<br>> >> ><br>> >> > loginVars.login = username;<br>> >> ><br>> >> > loginVars.sku = sku;<br>> >> ><br>> >> ><br>> >> ><br>> >> > // send to login script<br>> >> ><br>> >> > loginCheck.sendAndLoadVars(URLString, loginVars);<br>> >> ><br>> >> ><br>> >> ><br>> >> > Following the above, I have an Interaction with an Event icon (eventName<br>> >> > =<br>> >> > onSendAndLoadVars, icon = loginCheck). Attached to the event is a script<br>> >> > icon with:<br>> >> ><br>> >> > // initialize btnPath -- assume not authenticated<br>> >> ><br>> >> > btnPath = 1; // 1 is the fail path<br>> >> ><br>> >> > message = ''; // initialize message<br>> >> ><br>> >> > responseMessage = ''; // initialize response message<br>> >> ><br>> >> ><br>> >> ><br>> >> > rawStuff = loginCheck.rawData;<br>> >> ><br>> >> > loginInstructions.setText(loginCheck.rawData);<br>> >> ><br>> >> ><br>> >> ><br>> >> > //rawStuff = replace(rawStuff, '<sup>®</sup>', '');<br>> >> ><br>> >> > rawInfoArray = rawStuff.split('&'); // save string pairs into an array<br>> >> ><br>> >> ><br>> >> ><br>> >> > for (i = 0; i < rawInfoArray.length; i++) { // break pairs into smaller<br>> >> > arrays and parse<br>> >> ><br>> >> ><br>> >> ><br>> >> > tempArray = rawInfoArray[i].split('='); // split on = sign<br>> >> ><br>> >> ><br>> >> ><br>> >> > switch (tempArray[0]) {<br>> >> ><br>> >> > case 'reg_id':<br>> >> ><br>> >> > sid = tempArray[1];<br>> >> ><br>> >> > btnPath = 0;<br>> >> ><br>> >> > break;<br>> >> ><br>> >> > case 'message':<br>> >> ><br>> >> > responseMessage = tempArray[1];<br>> >> ><br>> >> > break;<br>> >> ><br>> >> > }<br>> >> ><br>> >> ><br>> >> ><br>> >> > }<br>> >> ><br>> >> ><br>> >> ><br>> >> > debug('sid: ' + sid + '\nresponseMessage: ' + responseMessage);<br>> >> ><br>> >> > debug(loginCheck.rawData);<br>> >> ><br>> >> ><br>> >> ><br>> >> > // display appropriate response<br>> >> ><br>> >> > if (btnPath == 1) {<br>> >> ><br>> >> > message = '<p>Could not retrieve account from the database.</p><br<br>> >> > /><p>'<br>> >> > + responseMessage + '</p>';<br>> >> ><br>> >> > }<br>> >> ><br>> >> ><br>> >> ><br>> >> > I get all the expected debug info in Preview and login is successful.<br>> >> > Debug<br>> >> > response is:<br>> >> ><br>> >> > sid: 71<br>> >> ><br>> >> > responseMessage: User Found in Database<br/><br>> >> ><br>> >> ><br>> >> ><br>> >> > reg_id=71&message=User Found in Database<br/><br>> >> ><br>> >> ><br>> >> ><br>> >> > 0<br>> >> ><br>> >> ><br>> >> ><br>> >> > Any ideas would be appreciated.<br>> >> ><br>> >> ><br>> >> ><br>> >> > Paul Swanson<br>> >> ><br>> >> > Internal Business Systems Analyst<br>> >> ><br>> >> > Internal Business Intelligence<br>> >> ><br>> >> > Harland Financial Solutions<br>> >> ><br>> >> > (800) 274-7280 Ext. 2462<br>> >> ><br>> >> > Paul.Swanson@harlandfs.com<br>> >> ><br>> >> ><br>> >> ><br>> >> ><br>> >> > This message and any attachment are intended solely for the addressee<br>> >> > and<br>> >> > may contain confidential information. If you have received this message<br>> >> > in<br>> >> > error, please send it back to me, and immediately delete it. Please do<br>> >> > not<br>> >> > use, copy or disclose the information contained in this message or in<br>> >> > any<br>> >> > attachment. Any views or opinions expressed by the author of this email<br>> >> > do<br>> >> > not necessarily reflect the views of the University of Nottingham.<br>> >> > This message has been checked for viruses but the contents of an<br>> >> > attachment<br>> >> > may still contain software viruses which could damage your computer<br>> >> > system:<br>> >> > you are advised to perform your own checks. Email communications with<br>> >> > the<br>> >> > University of Nottingham may be monitored as permitted by UK<br>> >> > legislation.<br>> >> ><br>> >> > _______________________________________________ Xerte mailing list<br>> >> > Xerte@lists.nottingham.ac.uk<br>> >> > http://lists.nottingham.ac.uk/mailman/listinfo/xerte This message and<br>> >> > any<br>> >> > attachment are intended solely for the addressee and may contain<br>> >> > confidential information. If you have received this message in error,<br>> >> > please<br>> >> > send it back to me, and immediately delete it. Please do not use, copy<br>> >> > or<br>> >> > disclose the information contained in this message or in any attachment.<br>> >> > Any<br>> >> > views or opinions expressed by the author of this email do not<br>> >> > necessarily<br>> >> > reflect the views of the University of Nottingham. This message has been<br>> >> > checked for viruses but the contents of an attachment may still contain<br>> >> > software viruses which could damage your computer system: you are<br>> >> > advised to<br>> >> > perform your own checks. Email communications with the University of<br>> >> > Nottingham may be monitored as permitted by UK legislation.<br>> >> ><br>> >> ><br>> >> > _______________________________________________<br>> >> > Xerte mailing list<br>> >> > Xerte@lists.nottingham.ac.uk<br>> >> > http://lists.nottingham.ac.uk/mailman/listinfo/xerte<br>> >> ><br>> >> > This message and any attachment are intended solely for the addressee<br>> >> > and<br>> >> > may contain confidential information. If you have received this message<br>> >> > in<br>> >> > error, please send it back to me, and immediately delete it. Please do<br>> >> > not<br>> >> > use, copy or disclose the information contained in this message or in<br>> >> > any<br>> >> > attachment. Any views or opinions expressed by the author of this email<br>> >> > do<br>> >> > not necessarily reflect the views of the University of Nottingham.<br>> >> ><br>> >> > This message has been checked for viruses but the contents of an<br>> >> > attachment<br>> >> > may still contain software viruses which could damage your computer<br>> >> > system:<br>> >> > you are advised to perform your own checks. Email communications with<br>> >> > the<br>> >> > University of Nottingham may be monitored as permitted by UK<br>> >> > legislation.<br>> >> ><br>> >> ><br>> >><br>> >> _______________________________________________<br>> >> Xerte mailing list<br>> >> Xerte@lists.nottingham.ac.uk<br>> >> http://lists.nottingham.ac.uk/mailman/listinfo/xerte<br>> ><br>> > This message and any attachment are intended solely for the addressee and<br>> > may contain confidential information. If you have received this message in<br>> > error, please send it back to me, and immediately delete it. Please do not<br>> > use, copy or disclose the information contained in this message or in any<br>> > attachment. Any views or opinions expressed by the author of this email do<br>> > not necessarily reflect the views of the University of Nottingham.<br>> ><br>> > This message has been checked for viruses but the contents of an attachment<br>> > may still contain software viruses which could damage your computer system:<br>> > you are advised to perform your own checks. Email communications with the<br>> > University of Nottingham may be monitored as permitted by UK legislation.<br>> ><br>> ><br>> > _______________________________________________<br>> > Xerte mailing list<br>> > Xerte@lists.nottingham.ac.uk<br>> > http://lists.nottingham.ac.uk/mailman/listinfo/xerte<br>> ><br>> > This message and any attachment are intended solely for the addressee and<br>> > may contain confidential information. If you have received this message in<br>> > error, please send it back to me, and immediately delete it. Please do not<br>> > use, copy or disclose the information contained in this message or in any<br>> > attachment. Any views or opinions expressed by the author of this email do<br>> > not necessarily reflect the views of the University of Nottingham.<br>> ><br>> > This message has been checked for viruses but the contents of an attachment<br>> > may still contain software viruses which could damage your computer system:<br>> > you are advised to perform your own checks. Email communications with the<br>> > University of Nottingham may be monitored as permitted by UK legislation.<br>> ><br>> ><br>> <br>> _______________________________________________<br>> Xerte mailing list<br>> Xerte@lists.nottingham.ac.uk<br>> http://lists.nottingham.ac.uk/mailman/listinfo/xerte<br>> <br>> <br>> <br>> _______________________________________________<br>> Xerte mailing list<br>> Xerte@lists.nottingham.ac.uk<br>> http://lists.nottingham.ac.uk/mailman/listinfo/xerte<br>> <br>> _______________________________________________<br>> Xerte mailing list<br>> Xerte@lists.nottingham.ac.uk<br>> http://lists.nottingham.ac.uk/mailman/listinfo/xerte<br>> <br>> <br>> <br>> _______________________________________________<br>> Xerte mailing list<br>> Xerte@lists.nottingham.ac.uk<br>> http://lists.nottingham.ac.uk/mailman/listinfo/xerte<br>> <br>> _______________________________________________<br>> Xerte mailing list<br>> Xerte@lists.nottingham.ac.uk<br>> http://lists.nottingham.ac.uk/mailman/listinfo/xerte<br>> <br>> <br>> <br>> _______________________________________________<br>> Xerte mailing list<br>> Xerte@lists.nottingham.ac.uk<br>> http://lists.nottingham.ac.uk/mailman/listinfo/xerte<br></div></div> </div></body>
</html>