Welcome to the LimeSurvey Community Forum

Ask the community, share ideas, and connect with other LimeSurvey users!

How to add multiple Surveys from one domain and autoplay for audiofiles

  • BusyBonsai
  • BusyBonsai's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 7 months ago #172164 by BusyBonsai
Dear all,

we are using the free version of Offlinesurvey and hosting Limesurvey ourselves at version 2.73. We want to run the surveys both online and offline. Now we struggle at adding multiple surveys to the app.
After one survey has been added successfully, when adding a second survey from that domain, an error message appears saying that a survey with either the same survey-ID, URL or Survey name already has been added. Which is not true as the given arguments are:
Survey nameSurvey IDSurvey URL
name x599345 survey.wzb.eu/index.php/599345?lang=pl
name y866824 survey.wzb.eu/index.php/866824?lang=pl
name z828948 survey.wzb.eu/index.php/828948?lang=pl

On the website we can't find any information on a limitation like this for the free version, just the max. 10 locked surveys, which we wouldn't reach anyway. Is it just not working or do we miss anything?

Help is much appreciated!

Best regards
The topic has been locked.
  • BusyBonsai
  • BusyBonsai's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 7 months ago #172165 by BusyBonsai
Guess I cannot change the Threads name. Forget about the second part, the autoplay for audiofiles. (I'll explain why below)
So in two of these three surveys we use audiofiles that read out loud the question texts when the pages are loaded. Doing the surveys on the offline app, the audiofiles are implemented but the autoplay-setting doesnt work. However, it just came to my mind that on the app the survey is presented group by group, so it would play several audiofiles at the same time, which would not help.
The topic has been locked.
More
5 years 7 months ago #172180 by aaskoura
Hi,
about the error, this has nothing to do with free or pro. Mainly survey name duplication is what causes this error... please send your survey details to support email support [at] offlinesurveys.com and they will come back with exact issue..

About playing audio when a group is shown in OfflineSurveys... this is doable.. OfflineSurvey fire an event "render" when showing a group or a question, you can handle it the same way as in www.offlinesurveys.com/ufaqs/how-to-impl...er-in-offlinesurveys it should work fine
The topic has been locked.
  • BusyBonsai
  • BusyBonsai's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 7 months ago #172200 by BusyBonsai
Dear aaskoura

thanks for you reply. I guess survey name, survey ID and survey URL are all relevant "survey details"? I'll write to the support then!
The topic has been locked.
  • BusyBonsai
  • BusyBonsai's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 7 months ago #172309 by BusyBonsai
Hello again,

so meanwhile I've managed to understand and use your code specified in www.offlinesurveys.com/ufaqs/how-to-impl...er-in-offlinesurveys .
Btw on notice - the code in the 'download as sample LimeSurvey Question' is missing the '$('#question' + {QID}).hide();'-line. I am not sure whether it's supposed to.

So for some reason I can't make the timer work; whether its 90000 or 2000 milliseconds the audio would play immediately when the page is loaded (which doesn't concern me that much, since I want to simulate autoplay anyways).
So running the survey online on a windows computer, the audio is being played. However when I now try to update/synchronize the survey to the offline app, it gives me Error15: "Caching of survey details aborted due to Javascript-mistakes in the survey." (as I'd translate from German to English). When I simply comment out the code I can synchronize, deleting the comment tags gives the error again. Can you help me here? I attached the Code as a .txt-file if needed.

File Attachment:

File Name: audioplay.txt
File Size:1 KB


Help will be much appreciated!
Attachments:
The topic has been locked.
More
5 years 6 months ago #173226 by aaskoura
Code:
<script type="text/javascript" charset="utf-8">
    $(document).ready(function() {
        var questionObj = $('#question' + {QID});
        try {
            questionObj.on('kill', function(event) {
                questionObj.find("audio").get(0).pause();
            });
        } catch (ex) {
            questionObj.bind('kill', function(event) {
                questionObj.find("audio").get(0).pause();
            });
        }
    });
</script>

add this snippet to a qiven question with audio and it will pause it if you pressed next on OfflineSurveys
The topic has been locked.
More
5 years 6 months ago #173227 by aaskoura
Code:
<script type="text/javascript" charset="utf-8">
    $(document).ready(function() {
        var questionObj = $('#question' + {QID});
        try {
            questionObj.on('render', function(event) {
                questionObj.find("audio").get(0).play();
            });
        } catch (ex) {
            questionObj.bind('render', function(event) {
                questionObj.find("audio").get(0).play();
            });
        }
    });
</script>
This one to autoplay a question once displayed on OfflineSurveys (you need to have one audio per group or use QuestionByQuestion navigation on OfflineSurveys, otherwise it is one bloody orchestra :) )
The topic has been locked.
  • BusyBonsai
  • BusyBonsai's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 6 months ago #173458 by BusyBonsai
Dear aaskoura

thanks again for your help. We found out that the problem seems to be on the device, not the app, since it does not autoplay the audiofile even when using the browser on the tablet (I've only tried the online version on a computer before, not on the tablet).

If you don't have any tipps from here, I will accept this as a dead end.

Kind regards
Adam
The topic has been locked.
  • BusyBonsai
  • BusyBonsai's Avatar Topic Author
  • Offline
  • Junior Member
  • Junior Member
More
5 years 6 months ago #173468 by BusyBonsai
Edit: The autoplay DOES work in the online version, on the browser, on the tablet. I have been mistaken. Sorry for the confusion.

So for some reason the code still doesnt fire off the audiofiles. Enabling the control panel and pressing the play button manually does play them however.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose