Skip to content
Discussion options

You must be logged in to vote

Hi @ZifengLIU143,

It's not possible to directly import a JSON file like this. Instead, you can convert the JSON file to a JS variable like this:

var demostimuli = [
   {
    "Item": "S1",
    "nameFile": "4036jiu14.mp3",
    "Sequence": 369,
    "Frame": 4,
    "Error": "T",
    "Position": 4,
    "correctResp": 9,
    "pathFile": "soundemo/4036jiu14.mp3"
  },
  {
    "Item": "S2",
    "nameFile": "5liao40935.mp3",
    "Sequence": 6093,
    "Frame": 5,
    "Error": "C",
    "Position": 1,
    "correctResp": 6,
    "pathFile": "soundemo/5liao40935.mp3"
  }
]

Then load in the JS file:

<script src="demostimuli.js" type="text/javascript"></script>

Then I think it should work.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ZifengLIU143
Comment options

Answer selected by ZifengLIU143
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2604 on April 29, 2022 14:40.