<commit_before><!DOCTYPE html>
<html>

<head>

  <script src="../jspsych.js"></script>
  <script src="../plugins/jspsych-single-stim.js"></script>
  <script src="../plugins/jspsych-single-audio.js"></script>
  <link rel="stylesheet" href="../css/jspsych.css"></link>
  <style>
    img {
      width: 300px;
    }
  </style>
</head>

<body>
  <div id="jspsych-target"></div>
</body>
<script>

  var timeline_variables = [
    { v1: 'sound/sound.mp3', v2: 'Person A' },
    { v1: 'sound/hammer.mp3', v2: 'Person B' }
  ];

  var node = {
    timeline_variables: timeline_variables,
    timeline: [
      {
        type: 'single-stim',
        choices: ['none'], // Y or N
        stimulus: "<p style='text-align:center; font-size:80px;'>+</p>",
        timing_response: 500,
        is_html: true
      },
      {
        type: 'single-audio',
        choices: [89, 78], // Y or N
        stimulus: function() { return jsPsych.timelineVariable('v1'); },
        prompt: function() { return '<p class="center-content">Have you seen '+jsPsych.timelineVariable('v2')+ ' before? Y or N.</p>' }
      }
    ],
    randomize_order: true,
    repetitions: 2
  }

  jsPsych.init({
    timeline: [node],
    preload_audio: ['sound/sound.mp3','sound/hammer.mp3'],
    on_finish: function() {
      jsPsych.data.displayData();
    },
    default_iti: 250
  });
<commit_msg>fix timeline variables example<commit_after><!DOCTYPE html>
<html>

<head>

  <script src="../jspsych.js"></script>
  <script src="../plugins/jspsych-single-stim.js"></script>
  <script src="../plugins/jspsych-single-audio.js"></script>
  <link rel="stylesheet" href="../css/jspsych.css"></link>
  <style>
    img {
      width: 300px;
    }
  </style>
</head>

<body>
</body>
<script>

  var timeline_variables = [
    { v1: 'img/happy_face_1.jpg', v2: 'Ann' },
    { v1: 'img/happy_face_2.jpg', v2: 'Jackson' },
    { v1: 'img/happy_face_3.jpg', v2: 'Riley' }
  ];

  var node = {
    timeline_variables: timeline_variables,
    timeline: [
      {
        type: 'single-stim',
        choices: ['none'], // Y or N
        stimulus: "<p style='text-align:center; font-size:80px;'>+</p>",
        timing_response: 500,
        is_html: true
      },
      {
        type: 'single-stim',
        choices: [89, 78], // Y or N
        stimulus: jsPsych.timelineVariable('v1'),
        prompt: function() { return '<p class="center-content">Have you seen '+jsPsych.timelineVariable('v2', true)+ ' before? Y or N.</p>' }
      }
    ],
    randomize_order: true,
    repetitions: 2
  }

  jsPsych.init({
    timeline: [node],
    preload_images: ['img/happy_face_1.jpg', 'img/happy_face_2.jpg', 'img/happy_face_3.jpg'],
    on_finish: function() {
      jsPsych.data.displayData();
    },
    default_iti: 250
  });

{'fraction_non_alphanumeric': 0.18975468975468976, 'fraction_numerical': 0.020202020202020204, 'mean_word_length': 2.653491436100132, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 47, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1534289', 'n_tokens_mistral': 1062, 'n_tokens_neox': 983, 'n_words': 192}