0 votes
ago in SoSci Survey (English) by s306607 (150 points)
edited ago by s306607

I have made the changes as suggested and here is the console view. The results are as expected but I am not sure where they are stored and how to access them. Could you please guide me with that? Thanks :)

ago by SoSci Survey (348k points)
Would you mind creating a pretest link with debug option an post it? Please make sure that the pretest link starts at the page with the video embedding.
ago by s306607 (150 points)
DId the link work?
ago by SoSci Survey (348k points)
Here's the manual how to create valid pretest links:
https://www.soscisurvey.de/help/doku.php/en:survey:pretest
ago by s306607 (150 points)
Thank you, here is the preview link with debug options: https://www.soscisurvey.de/sfv_media/?act=MSeuZzkzQABdeBPVFXy6FDFI
 the pretest one doesnt have debug option but still here if needed:
https://www.soscisurvey.de/sfv_media/?act=bQP8dzZD8LymPq1cbxwUJnDo

The stats can only be seen in console and for a split second after pressing weiter n debug shows no info.

1 Answer

0 votes
ago by SoSci Survey (348k points)

The stats can only be seen in console and for a split second after pressing weiter n debug shows no info.

Okay, that's probably part of the problem. If I am correct, your Javascript that copies the information into the internal variable, is triggered from leaving the page. That may be too late to send information.

  window.addEventListener('beforeunload', function() {
    if (currentVisibleVideoId && currentViewStart) {
      var elapsed = Date.now() - currentViewStart;
      videoStats.viewDurations[currentVisibleVideoId] = (videoStats.viewDurations[currentVisibleVideoId] || 0) + elapsed;
    }
    updateHiddenInput();
  });

Instead do it before the information is sent, by using SoSciTools.questionnaire.attachCheck for example.

  SoSciTools.questionnaire.attachCheck(function() {
    if (currentVisibleVideoId && currentViewStart) {
      var elapsed = Date.now() - currentViewStart;
      videoStats.viewDurations[currentVisibleVideoId] = (videoStats.viewDurations[currentVisibleVideoId] || 0) + elapsed;
    }
    updateHiddenInput();
    return true;
  });

Note, that the SoSciTools.questionnaire is only available after the page has loaded. So, you need a bit more code:

window.addEventListener("load", function() {
      SoSciTools.questionnaire.attachCheck(function() {
        if (currentVisibleVideoId && currentViewStart) {
          var elapsed = Date.now() - currentViewStart;
          videoStats.viewDurations[currentVisibleVideoId] = (videoStats.viewDurations[currentVisibleVideoId] || 0) + elapsed;
        }
        updateHiddenInput();
        return true;
      });
});

Willkommen im Online-Support von SoSci Survey.

Hier bekommen Sie schnelle und fundierte Antworten von anderen Projektleitern und direkt von SoSci Survey.

→ Eine Frage stellen


Welcome to the SoSci Survey online support.

Simply ask a question to quickly get answers from other professionals, and directly from SoSci Survey.

→ Ask a Question

...