GithubHelp home page GithubHelp logo

psychojs's People

Contributors

apitiot avatar dvbridges avatar earcanal avatar jonathanoroberts avatar lightest avatar nabaruns avatar peircej avatar pn2200 avatar rebeccahirst avatar sijiazhao avatar teparsons avatar tpronk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

psychojs's Issues

Unhandled Promise Rejection - Pixi Issue [Safari]

Hey,

Not sure exactly where this issue should go as it's related to a JS error in the online version related to Pixi (so apologies if this should go the JS repo instead - please delete/close if in wrong place or if not relevant as it's from a separate library). Other than my movie playing issues, I've noticed another non fatal issue in the console while attempting to play movies with the part of the library responsible for the video base texture with Safari.

This is on the latest non technical preview build of Safari - have not checked other browsers but not seen this as an error anywhere else.

I don't think this is due to Pixi, I believe it's Safari (so again, not much of a fix possible I think but I wouldn't know how to get around it personally).

Error given in Console below:

[Error] Unhandled Promise Rejection: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. (anonymous function) rejectPromise play _onCanPlay (pixi-4.8.1.min.js:16:13796) (anonymous function) e (pixi-4.8.1.min.js:16:12750) fromVideo (pixi-4.8.1.min.js:16:14212) fromVideo (pixi-4.8.1.min.js:16:5535) _updateIfNeeded (visual-3.0.5.js:346) setAutoDraw (core-3.0.5.js:1310) trialRoutineEachFrame (Movie_Mp4.js:133) _runNextTasks (util-3.0.5.js:1051) _runNextTasks (util-3.0.5.js:1044) update (util-3.0.5.js:1011)

https://developer.mozilla.org/en-US/docs/Web/API/HTMLMediaElement/play (I'm using their explanation about the following because it's more succinct then what I can describe - this applies to using play but I believe it's a related error here):

"NotAllowedError
The user agent (browser) or operating system doesn't allow playback of media in the current context or situation. This may happen, for example, if the browser requires the user to explicitly start media playback by clicking a "play" button."

Basically, I know that Chrome and Safari and other major browsers were moving towards blocking auto-playing elements to stop people front-loading data heavy clips, especially on mobile that auto-play and sap your data allowance (or in fact, slow things down to a crawl or if you hide an iframe and just play an annoying ad constantly in the background on less then reputable sites) and to require an explicit user action before allowing anything to play. However, I've not run into this on desktop and I'm not entirely sure what the client side can do for this.

For the record, this is in the same experiment as my mp4 video test issues which I've mentioned on Discourse but here is the link for the experiment: https://pavlovia.org/run/Makataui/video-test/html/

Screenshot of video error included below with console showing:
Screen Shot 2019-03-14 at 10 32 15

Ferenc

PsychoJS versions

Github isn't up to date with pavlovia version of psychojs:

  • no changes pushed to github since 3.0.8 (now 3.1.1)
  • no changes pulled from github e.g. commit fb8115c

We also need to add version 3.1.2 release version to pavlovia/lib

Option to go fullscreen

We want to be able to force the browser into a fullscreen view, in the way that internet video players can go fullscreen. This should be an option for Window

Pop out of Full Screen

The builder generated script stays in full screen display mode after quitPsychoJS requiring the user to exit full screen mode manually. I can see the advantage of this, but by default it should return the user to their normal display settings which are likely not full screen.

This could be done by fixing the builder translation to either add "document.exitFullscreen();" to quitPsychoJS, or to modify quitPsychoJS to take a boolean parameter to return full screen.

questions about psychojs

Hey, cool project. I have two questions:

  1. what license does your package use? I see in the LICENSE it says BSD but the files themselves mention GPL-3
  2. I was wondering what your motivation is for using php instead of nodejs

I am currently working on combining two projects (openexp and expfactory that would work to support deploying experiments in an electron app or web page powered by different backends such as jspsych or perhaps soon psychojs.

Data save should support database (MongoDB)

I think this should be an option rather than requirement - the current system of csv files being pushed to git is going to be nice for some people, but only if they do a good job of keeping personal that can be fully removed.
Given the idea of pavlovia having a data-submission API the activate step should have some way of setting what format the data will be?

Adding Form class

We've started on the Form class in PsychoPy, supporting a spreadsheet of questions as an input and laying them out, with various answer options (slider, choices, free text).

The PsychoPy implementation is rendered by us manually using the Slider class and text stimuli (free text will need textbox2 to be completed) but potentially for the JS version it could be done with other controls and integrated with GL canvas?

Adding TextBox

A text engine that supports text entry (TextStim only allows display) and provides a border and background color.
This probably needs TextBox2 to be completed on the Python side but otherwise we could just agree the params/attributes and code simultaneously

Is there a limit to the size of movie that can be played?

Warning: Unpleasant content in one of the video files

A user wants to play movies from Pavlovia. They upload ok, but the experiment freezes when you click "Ok" to begin, and then the Pavlovia dashboard also freezes.

project deleted

If there is a preferred file type (e.g., not .wmv) or file size limit, perhaps we can put this as a warning, or document it.

Empty trials being added to trial handler

Two examples of empty trials being added to the trial handler, probably related to the condition files formatting.

Example 1
https://pavlovia.org/run/dvbridges/dpbe_l2/html/
Example 2
https://pavlovia.org/run/FrankBartel/epp3-keyboard/html/

Slightly different example with what may be errors in filenaming - filenames starting with numbers do not work - perhaps we can warn users in PsychoPy as well
https://pavlovia.org/run/jvcasillas/dpbe_l2/html/

To fix this issue, users are currently required to:

  • Create a new conditions file
  • Copy only the cells with information from the old conditions file, to the new conditions file
  • Avoid copying whole columns, as this will also copy the empty formatted cells.
  • Save new conditions file, and delete the old, error-causing conditions file.

Pavlovia: payments and tokens

By the summer we need to be able to receive payments, assign to users and consume them with participants (and this needs to be working flawlessly!)

TextStim.pos is 200?

I write a little demo to test the TextStim and failed. The code :

      // wait until document is ready:
      $(document).ready(function() {{
        psychoJS.frameCount=0;
        win= new psychoJS.visual.Window({color:'green', size:(300,300)});
        psychoJS.init(win);
        s=new psychoJS.Scheduler();
        t = new psychoJS.visual.TextStim({text:'hello wold', 'win':win,pos:(100,200), color: 'red'})
        t2=new PIXI.Text('hello world 2');
        task=function(){
            t.draw();
            // t.pixiRep.position={x:1,y:2}
            
            win._container.addChild(t2);
            console.log(win._container.children.length)
            // win._renderer.render(win._container);
            return

            console.log(psychoJS.frameCount);
            if( psychoJS.frameCount<500)return psychoJS.FLIP_REPEAT;
        }
        s.add(task);
        s.start(win);
        // s.run()
    }})</script>

No error but the t did not show while t2 is right.
And in the console , t._pos is 200 . Why? I missed anything?

Need to implement a callOnFlip() func/schedule for better RT precision

Response times should be measured from when the stimulus actually appears, not when it is requested. To do that we need to reset the RT clock when screen flip occurs. Most general way to do that (in keeping with psychopy) is with a Window.callOnFlip() function. Operates a bit like the scheduler calls: first arg is the function, and further args to be passed to the function if needed.

We need code to detect the win flip and run the list of function calls then. That's the tricky bit, but seems possible using opengl trick with a flush() call. I think I sent a link on how to do that in an email a few months ago, but can't now find the details again. I'll go back to google and re-link here

TrialHandler does not support nReps or random/sequential method

As far as I can see we can't currently run more than one cycle of a set of conditions.

The code to select TrialHandler.thisTrial is commented out at

/* TODO
#fetch the trial info
if self.method in ['random','sequential','fullRandom']:
self.thisIndex = self.sequenceIndices[self.thisTrialN][self.thisRepN]
self.thisTrial = self.trialList[self.thisIndex]
self.data.add('ran',1)
self.data.add('order',self.thisN)
if self.autoLog:
logging.exp('New trial (rep=%i, index=%i): %s' %(self.thisRepN, self.thisTrialN, self.thisTrial), obj=self.thisTrial)
*/

In the test examples we've indexed into the conditions file entries directly (i.e. not using the TrialHandler to do this)

Removed resources are still present and downloaded

Problem: I added a bunch of images to the wrong directory manually in html/resources. I then moved them and git rm'd them, so that they're now not in the current git tree. However, they are still being listed and found by resource loader and downloaded at the start of the task each time, which is doubling startup time for some already embarrassingly large images.

I suspect the pavlovia server is downloading a zip of the task and unzipping it to overwrite things instead of checking out a repo, and that the resource list is just built by listing the directory? I'm sure there's a way to reset this (maybe even a new fork of the repo), but it seems like something that would be helpful to fix.

Also, a feature request would be to not display the name of each resource in the loading dialogue but only show the progress, as the names of stimuli or other resources can sometimes have meaning that you wouldn't want a participant to see. If that sounds reasonable I'll add it as another issue.

Pavlovia 'activate' link needs more options and better visuals

  • A user might want to prevent further data collection. So we need to be able to deactivate.
  • The current representation doesn't exactly leap out to a novice that it's controlling participant recruitment. In the original discussions we had the label was about recruiting or not and we'd talked about setting how that recruitment
  • When the user chooses to activate/recruit we should be providing them with options of how the data will be saved (SQL or flat CSV etc) and how recruitment will work (do we need to generate a set of participant IDs and send emails?)

two bugs that happen when you want to dynamically set the position and size of a rectangle shape (and possibly other shapes) from a csv

Hello!
I found two bugs that occur when i want to dynamically set the position and/or size of a rectangle (shape stimulus). These bugs only happen in the online javascript version and not when i run the experiment locally in python

The first bug happens when the component is being initialized in the beginning of the experiment. PsychoJS is trying to set the position and size attributes with the variable, instead of giving them a placeholder value for the time being, which results in a reference error because the variable hasnt yet been pulled from the csv file.

The second bug is specifically related to the rectangle subclass (maybe some other shapes will have it as well). It happens when the size attribute is being dynamically adjusted at the beginning of the routine. PsychoJS is trying to use the setSize setter method, but it doesnt work because the rectangle has specific setWidth and setHeight methods, which have to be used instead.

This is my first time reporting bugs like this so i hope i provided enough info for you to fix the issue, i just thought since i spent my day trying to make my experiment work there might as well be some use from it for you guys as well :)

continueRoutine support

Is it true that continueRoutine doesn't work in PsychoJS? I've been trying to write a conditional loop like in psychopy using continueRoutine but it doesn't work. Just knowing that it doesn't work now is helpful. A fix is even better.

Add .editorconfig file to PsychoJS repository

Lets add a .editorconfig file to the PsychoJS repository so we have consistent indentation for the HTML and JS files, see EditorConfig. Currently, the indentation in JS and HTML looks wrong because of GitHubs default settings (I think is 8 spaces for an indent?). Setting a .editorconfig file allows us to define what indentation params should be used for specific file types. Below is all that is required...

# top-most EditorConfig file
root = true

# Don't use tabs for indentation.
[*]
indent_style = space
# (Please don't specify an indent_size here; that has too many unintended consequences.)

# Python files
[*.{py}]
indent_style = tab
indent_size = 4

# HTML+CSS/JS  files
[*.{html,css,js}]
indent_style = tab
indent_size = 2

QUEST and staircase files

Hi,
I was looking through the files and cannot see any functions involving staircasing or QUEST thresholding. These are in psychopy and I was wondering if they were going to be in psychojs. Thanks.

Ability to pass variables to the experiment (e.g. skipping dialog box)

e.g. in the GET attributes

If the participant name or condition is passed in the GET attributes then we don't need to collect that in the dialog box.

If all attributes are passed then maybe we don't need the dialog box at all? Maybe we should keep it anyway though and just present the OK button (ie. don't present attributes that aren't needed but still have the dialog so that people get ready to start and resources load)

Infinite duration for Sound component not infinite

Leaving the sound duration empty in the Sound component gives a sound component parameter of secs: -1 e.g.,

sound = new Sound({
    win: psychoJS.window,
    value: 'A',
    secs: -1,
    });

In PsychoPy, secs: -1 should give an infinite duration tone, but online only a brief sound is played.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.