Comments (4)
Try replacing
<img id="distractor-image" src="{ $this.files[this.parameters.distractor] } /">
with either
<img id="distractor-image" src="{ $this.files[this.parameters.distractor] }" />
or even simply
<img id="distractor-image" src="{ $this.files[this.parameters.distractor] }">
(personally I prefer including the explicit "/>" to close the element, but that is a style issue).
from lab.js.
Thanks @mcfarla9, I have tried this both ways and I am still receiving the same issue:
Perhaps I am not defining the parameter properly? I have done this in the loop section where the main stimuli is defined:
from lab.js.
At this stage I would set aside the main project and work through some small demos in order to figure out how things work, then import what I learned into the main project.
In particular, here I would set aside all the scripting. I would make a demo that does nothing but present a sequence of stimulus images (using a Loop component) in a fixed order (I always save randomizaiton for the last step in development, it greatly simplifies the testing!). Then I would add a distractor image. Etc.
Anyway, I did some fussing around myself, and it looks like the following should work in your Content:
<img id="distractor-image" src=${this.files[this.parameters.distractor]} />
You have to pay attention to where each $, {}, and [] should go.
from lab.js.
Oh, since you used this.files in your Content, I assumed that you were storing the distractor files directly within the stimulus component. But from your screen shot it looks like you are storing your distractor files out in the static area. That changes everything. In that case you would reduce that line in your Content to simply
<img id="distractor-image" src=${this.parameters.distractor} />
Or if in your Loop you would rather put just the distractor file names without "static/" at the front of each one, you could add the "static/" string in the Content thus
<img id="distractor-image" src="static/${this.parameters.distractor}" />
from lab.js.
Related Issues (20)
- Forced-choice task videos
- Next page when video ends
- Specify exact time for selected elements / Automatic (form) input save while 'timeout' in effect
- Countdown timer HOT 1
- N-back-task Data HOT 1
- Exporting audiovisual cognitive task
- "Delete all files" button
- node-lsl is not installable on M1 macs
- while loops
- Keep the session of the experiment and restore it on reload HOT 1
- Study stuck in loading in the preview mode in lab.js HOT 3
- help please HOT 3
- between-subject design? HOT 2
- How to store a javascript object into lab.js's data HOT 1
- Help with making blocks of trials within dot probe task
- Help me with dialogues
- The last component of the study sometimes does not want to finish and save the data HOT 2
- Adding audio files HOT 1
- postMessage fails because functions cannot be cloned HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lab.js.