{# Audio question type. Renders an HTML5 from an arbitrary URL. Optionally enforces "listen to completion" before allowing the participant to continue, and (when `id` is set) logs listening telemetry to the database. Audio always uses native controls — there is no equivalent to video's `minimal_controls` because the scrubber is also the only progress indicator the participant has, and play/pause is essential. When `force_listen` is on a snap-back guard prevents seeking past the supposed playhead position. JSON fields: src (required) URL of the audio file. autoplay (optional, default false) force_listen (optional, default false) When true, btnNext is disabled until the participant listens to at least `completion_threshold` of the clip. completion_threshold (optional, default 0.98) Fraction of duration that counts as "listened". id (optional) When set, three columns are written to the questionnaire table: {id}_started — epoch seconds when the participant first pressed play (0 if never). {id}_ended — epoch seconds at last observed activity (play/timeupdate/pause). {id}_listened — accumulated forward play time (seconds), excluding seeks and background-tab playback. #} {% set fl = question.force_listen|default(false) %} {% set threshold = question.completion_threshold|default(0.98) %} {% set prior_started = question.prior_started|default(0) %} {% set prior_ended = question.prior_ended|default(0) %} {% set prior_listened = question.prior_listened|default(0) %} Your browser does not support HTML5 audio. {% if question.id %} {% endif %}