Problems with HTML5 standalone (psychology experiment)

Bringing your stacks to the web

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

MarBor
Posts: 15
Joined: Fri Sep 18, 2020 2:56 pm

Problems with HTML5 standalone (psychology experiment)

Post by MarBor » Tue Sep 29, 2020 12:33 pm

Hello everyone,

I appreciate the help that is provided here a lot and now I need to ask some questions I haven't found in this forum so far.
I am completely new to LiveCode and have only little prior experience with coding (basic MATLAB and R; however, almost no HTML or JavaScript). I will love to also contribute to this forum with answers as soon as a gain in experience allows me to do so.

Due to the Corona situation studies have to be conducted online for now (and some more time I guess).
Since my original experiment code was written in MATLAB with Psychtoolbox, which doesn't allow for an online solution, I had to recode it in another software, that would run online.
I chose Livecode, because it is quite straightforward - especially when it's about more interactive types of experiments - and because of the prospect of taking the app online.

I am so far quite happy with the results of my work, but I face some problems with actually running the HTML5 standalone in the browser, and I hope you can help me with these:
I use LiveCode Community 9 . 6 . 1 (rc 2) under Windows 10 and with Mozilla Firefox as browser.

- presentation style -
The app looks much different (plain ugly :D) as html standalone (I can link screenshots, if someone grants me the rights).
Is there a remedy for that? Can you change some setting in LiveCode (maybe in some standalone settings)? Or can some style defining code be added in the little HTML file (maybe some CSS)?

- participant information and behaviour -
I know that in LiveCode you can get system information about platform, processor, machine, version and so on, but in the HTML version this doesn't work (for example, provides "HTML5" as platform and "js" as processor). This isn't so important to me (although the system the app is running on would be interesting to know for me).
Is there a way of getting browser and screen/window related information?
I need to make sure, that the 1024*768 experiment stack is always seen entirely in original size.
Can you get the browser, the app is running on?
And: Is it possible to check, whether the window/tab with the app is active (in the foreground)?
The last thing is important, because I need to know, whether the participants pay enough attention to the experiment and don't get distracted or try to find solution help on the web.

- save txt file with participant's behavioural data -
The standalone lies on a web server that I can upload data to via SFTP protocoll.
I need to save data (how many problems were solved, how much time was needed, etc) from the app in a txt or csv file.
I've figured out that when I run the HTML standalone in the browser the app shows the following path: "[dot]/this[dot]program"
I can also save my file to something like "[dot]/output[dot]txt" ...
But how do I get it to some repository that I can access?

Sorry for this long post and the many questions that reveal my lack of knowledge about HTML, JavaScript and internet processes :?

I hope someone feels like helping me with some of these issues. It's very important that I get this experiment to work soon :oops:

Cheers,

Martin

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Problems with HTML5 standalone (psychology experiment)

Post by richmond62 » Tue Sep 29, 2020 7:49 pm

(I can link screenshots, if someone grants me the rights)
You'll be granted rights after you have written 7 postings.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Problems with HTML5 standalone (psychology experiment)

Post by richmond62 » Tue Sep 29, 2020 7:51 pm

(plain ugly :D)
That is because the HTML project has stalled and is only "half-cooked": I suggest you start barracking the LiveCode
people directly about that as there isn't much that the end-users can manage until they sort things out.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Problems with HTML5 standalone (psychology experiment)

Post by richmond62 » Tue Sep 29, 2020 7:52 pm

I need to make sure, that the 1024*768 experiment stack is always seen entirely in original size.
I would be extremely surprised if anyone is using a monitor with a smaller resolution nowadays.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Problems with HTML5 standalone (psychology experiment)

Post by richmond62 » Tue Sep 29, 2020 7:57 pm

Can you get the browser, the app is running on?
I am not sure why you decided to put a comma in the middle of that question!

I have a feeling (Richard, Klaus, Jacque ???) that to do that you'll have to pimp
the javascript in your HTML standalone:

https://jsfiddle.net/oscarj24/DJ349/

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Problems with HTML5 standalone (psychology experiment)

Post by richmond62 » Tue Sep 29, 2020 8:00 pm

I use LiveCode Community 9 . 6 . 1 (rc 2)
Chuck it out and download the stable version. 8)

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Problems with HTML5 standalone (psychology experiment)

Post by richmond62 » Tue Sep 29, 2020 8:47 pm

The last thing is important, because I need to know, whether the participants pay enough attention to the experiment and don't get distracted or try to find solution help on the web.
I think I would solve that by installing timers: after all, to read a question and then go browsing on the web to find the answer will always take longer than a direct reply.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Problems with HTML5 standalone (psychology experiment)

Post by richmond62 » Tue Sep 29, 2020 8:56 pm

But how do I get it to some repository that I can access?
Well a DropBox account of a Google Drive?

MarBor
Posts: 15
Joined: Fri Sep 18, 2020 2:56 pm

Re: Problems with HTML5 standalone (psychology experiment)

Post by MarBor » Wed Sep 30, 2020 12:12 pm

Hello richmond62,

thank you very much for putting the effort of answering all my questions!
richmond62 wrote:
Tue Sep 29, 2020 7:51 pm
(plain ugly :D)
That is because the HTML project has stalled and is only "half-cooked": I suggest you start barracking the LiveCode
people directly about that as there isn't much that the end-users can manage until they sort things out.
This is a bit of a bummer, since I probably can't expect this to be fixed until I want to launch the study.

richmond62 wrote:
Tue Sep 29, 2020 7:52 pm
I need to make sure, that the 1024*768 experiment stack is always seen entirely in original size.
I would be extremely surprised if anyone is using a monitor with a smaller resolution nowadays.
I totally agree - that's why I picked this stack size. Still, psychology researchers love controlling as much as possible :lol:

richmond62 wrote:
Tue Sep 29, 2020 7:57 pm
Can you get the browser, the app is running on?
I am not sure why you decided to put a comma in the middle of that question!
Bad German habits, I guess ... :oops:
When writing in English, I still sometimes put commas the way I would in German.
But I am a bit surprised that it is even considered worth mentioning ... :)

richmond62 wrote:
Tue Sep 29, 2020 8:00 pm
I use LiveCode Community 9 . 6 . 1 (rc 2)
Chuck it out and download the stable version. 8)
Thanks for the advice - done!

richmond62 wrote:
Tue Sep 29, 2020 8:47 pm
The last thing is important, because I need to know, whether the participants pay enough attention to the experiment and don't get distracted or try to find solution help on the web.
I think I would solve that by installing timers: after all, to read a question and then go browsing on the web to find the answer will always take longer than a direct reply.
Good point - I do use timers, since the task is quite complex and there is a time limit of two minutes (or the trial ends as soon as the participant has detected the target node in the network problem). The participants probably can't find help for solving those problems, anyway. But I would just like to know whether they are constantly working on or, at least, paying attention to the task. Again, behavioural researchers love controlling as much as they can.

richmond62 wrote:
Tue Sep 29, 2020 8:56 pm
But how do I get it to some repository that I can access?
Well a DropBox account of a Google Drive?
I am not sure whether I expressed what I am looking for so well.
The experiment app generates a txt file that is supposed to be saved somewhere automatically so that no action of the participant or study conductor is required.
If this has been clear all along, the point is that I wouldn't know how to upload the file from my HTML5 standalone to DropBox or Google Drive, I'm afraid.
[Update: I now got some webspace that is running PHP and some database system from the university. Could this be of help? Unfortunately, this is also anything but trivial for me ... :? ]


Thanks again for all the help - I really appreciate it!

Best,

Martin

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7210
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Problems with HTML5 standalone (psychology experiment)

Post by jacque » Wed Sep 30, 2020 5:38 pm

richmond62 wrote:
Tue Sep 29, 2020 7:51 pm
(plain ugly :D)
That is because the HTML project has stalled and is only "half-cooked": I suggest you start barracking the LiveCode
people directly about that as there isn't much that the end-users can manage until they sort things out.
No. Any OS that isn't Mac or Windows defaults to the old Unix Motif appearance. This is true on all mobile platforms as well. We deal with that by setting specific properties on buttons and other controls to create the appearance we want. The flexibility of LC allows us to skin our apps in any number of ways.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7210
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Problems with HTML5 standalone (psychology experiment)

Post by jacque » Wed Sep 30, 2020 5:46 pm

I need to make sure, that the 1024*768 experiment stack is always seen entirely in original size.
You can get the screenrect and if it is smaller than the stack then you can set the scalefactor to allow it to fit. However this would reduce the size of the stack somewhat, though everything will be proportional.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9801
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Problems with HTML5 standalone (psychology experiment)

Post by FourthWorld » Wed Sep 30, 2020 6:04 pm

Does this app specifically need to be confined in a browser? Will it be used multiple times, or just once?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

MarBor
Posts: 15
Joined: Fri Sep 18, 2020 2:56 pm

Re: Problems with HTML5 standalone (psychology experiment)

Post by MarBor » Thu Oct 01, 2020 2:37 pm

Thanks for your helpful remarks, jacque!
jacque wrote:
Wed Sep 30, 2020 5:38 pm
richmond62 wrote:
Tue Sep 29, 2020 7:51 pm
(plain ugly :D)
That is because the HTML project has stalled and is only "half-cooked": I suggest you start barracking the LiveCode
people directly about that as there isn't much that the end-users can manage until they sort things out.
No. Any OS that isn't Mac or Windows defaults to the old Unix Motif appearance. This is true on all mobile platforms as well. We deal with that by setting specific properties on buttons and other controls to create the appearance we want. The flexibility of LC allows us to skin our apps in any number of ways.
I will now go through my stack and make sure that I set all the specific properties. Are there any global settings so that I don't need to set them for every button. Do I need to set the properties in a script for this purpose or can I also set them in the IDE?

jacque wrote:
Wed Sep 30, 2020 5:46 pm
I need to make sure, that the 1024*768 experiment stack is always seen entirely in original size.
You can get the screenrect and if it is smaller than the stack then you can set the scalefactor to allow it to fit. However this would reduce the size of the stack somewhat, though everything will be proportional.
This sounds like a good thing to do. On the other hand, I probably shouldn't take the risk of having the participants see the stack in different sizes.


Thanks again for your help!

MarBor
Posts: 15
Joined: Fri Sep 18, 2020 2:56 pm

Re: Problems with HTML5 standalone (psychology experiment)

Post by MarBor » Thu Oct 01, 2020 2:49 pm

FourthWorld wrote:
Wed Sep 30, 2020 6:04 pm
Does this app specifically need to be confined in a browser? Will it be used multiple times, or just once?
The app is a behavioural experiment that is part of a psychological study.
I need around 110 participants to do the experiment to complete my study.
Due to Corona I switched to the online solution instead of a lab experiment, so that the participants can do the experiment at home or more or less anywhere.

I think I'm pretty close now to having fixed most of the problems.
The only thing left is putting the app online while being able to store/save the data (a simple txt file) on a server. Since yesterday there is some Linux server space with Apache, PHP, Perl and MariaDB available to me.
Do you think I should switch to LiveCode Community Server then to run the stack file?
Or can I stick with the HTML5 standalone (stored on the Linux server then) and then maybe add some PHP script to make some communication between the LiveCode app and the server via JavaScript, Jquery (?) and PHP possible?

Unfortunately, I have no idea how to do this ... any kind of advice/help would be highly appreciated!

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9249
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Problems with HTML5 standalone (psychology experiment)

Post by richmond62 » Thu Oct 01, 2020 6:29 pm

Why not have the results posted in a text file to your email address?

Post Reply

Return to “HTML5”