Zu den Aufzeichnungen: ich habe unter "Daten übertragen" den Audio-Recorder in die Umfrage eingefügt. Hier der Code:
<!-- Warning -->
<div id="%q.id%NoAudio" class="warning">
<div class="content">
Ihr Gerät und/oder Browser unterstützen derzeit keine Tonaufnahme.
</div>
</div>
<!--[if IE]>
Der Internet Explorer unterstützt diese Aufzeichnung leider nicht.
<![endif]-->
<!-- Buttons -->
<div style="margin: 2em 0 0.5em">
<button id="btnStart" type="button" tabindex="50">START</button>
<button id="btnStop" type="button" tabindex="50">STOP</button>
</div>
<div style="margin: 0.5em 0" id="audioReload">Bitte laden Sie die Seite neu (<a href="javascript:SoSciTools.reloadPage()">Neu Laden</a>) und gestatten Sie der Seite Zugriff auf Ihr Audio-Gerät.</div>
<!-- Audio recorder from
https://github.com/ai/audio-recorder-polyfill -->
<script src="../plugins/audio-recorder-polyfill/AudioRecorder.min.js"></script>
<script type="text/javascript">
<!--
"use strict";
var buttonStart = document.getElementById("btnStart");
var buttonStop = document.getElementById("btnStop");
var mediaRecorder;
var mediaChunks = [];
var mediaStatus = 0;
function startRecording(button) {
if (mediaRecorder) {
mediaRecorder.start();
buttonStart.disabled = true;
buttonStop.disabled = false;
mediaStatus = 1;
}
}
function stopRecording(button) {
if (mediaRecorder) {
mediaRecorder.stop();
// You may want to change this to allow a new try (replacing the old one)
buttonStart.disabled = false;
buttonStop.disabled = true;
}
mediaStatus = 2;
}
function onStop(audioURL) {
var recordedBlob = new Blob(mediaChunks, { 'type' : 'audio/mpeg' });
// Transfer the data
%q.id%.sendBLOB(recordedBlob);
mediaStatus = 3;
}
function onStream(stream) {
mediaRecorder = new AudioRecorder(stream);
mediaRecorder.addEventListener("stop", onStop);
mediaRecorder.addEventListener("dataavailable", function(e) {
mediaChunks.push(e.data);
});
// Enable the start button
buttonStart.disabled = false;
// Remove warning
document.getElementById("audioReload").style.display = "none";
}
function checkSubmit() {
// Aufzeichnung noch aktiv?
if ((mediaStatus == 1) || (mediaStatus == 2)) {
stopRecording();
window.setTimeout(SoSciTools.submitPage, 1000);
return false;
}
return true;
}
function init() {
buttonStart.disabled = true;
buttonStop.disabled = true;
var mediaConstraints = {
video: false,
audio: true
};
function onError(error) {
document.getElementById("%q.id%NoAudio").style.display = "";
}
if (navigator.mediaDevices) {
navigator.mediaDevices.getUserMedia(mediaConstraints).then(onStream).catch(onError);
document.getElementById("%q.id%NoAudio").style.display = "none";
} else {
onError();
}
};
SoSciTools.attachEvent(window, "load", init);
SoSciTools.attachEvent(buttonStart, "click", startRecording);
SoSciTools.attachEvent(buttonStop, "click", stopRecording);
s2.attachCheck(checkSubmit);
// -->
</script>
zu 2. Hier die Video-URLs: es gibt fünf Kategorien, in denen randomisiert (per Zufallsgenerator) Videos abgespielt werden sollen, auf denen die Teilnehmenden per Audioaufnahme reagieren sollen. Hier mal die Video-URLs auf einer Kategorie:
1 =
https://hessenbox.uni-marburg.de/dl/fiHU9bn9UHYwZJo8Di7khd/27_1_a.mp4
2 =
https://hessenbox.uni-marburg.de/dl/fiB7yiYjGFpHCEQh5WedN7/29_1_a.mp4
3 =
https://hessenbox.uni-marburg.de/dl/fiFcA1iRoDEspTKenx4Pto/30_1_c.mp4
4 =
https://hessenbox.uni-marburg.de/dl/fiAxxnAqmpbKFcZ5ck7Smc/31_1_e.mp4
5 =
https://hessenbox.uni-marburg.de/dl/fi4qc1ycwDFvSwaY1iCGwR/32_2_c.mp4
6 =
https://hessenbox.uni-marburg.de/dl/fi9CheiDGG9GPvniBfqPNm/33_1_a.mp4
7 =
https://hessenbox.uni-marburg.de/dl/fiHtvYE3M52zX1TQtMXhk2/34_1_a.mp4
Danke vorab!