Welcome to the LimeSurvey Community Forum

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

Record responses as audio

  • tpartner
  • tpartner's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
12 years 2 months ago - 12 years 2 months ago #71993 by tpartner
Replied by tpartner on topic Record responses as audio
In the source of the question, add a click event handler for the Next/Submit buttons:
Code:
<script type="text/javascript" charset="utf-8">
 
 
  $(document).ready(function() {
 
    // Interrupt next/submit function 
    $('#movenextbtn, #movesubmitbtn').click(function(){
 
      var url = 'path/to/audio/file.wav';
 
      // Request the file
      var request = new XMLHttpRequest();
      request.open('HEAD', url, false);
      request.send();
 
      // Act on the request results
      if(request.status!=404 == false) {
        // File doesn't exist
        alert ('File does not exist!');
        return false
      }
      else {
        // File exists
        return true
      }
    });
  });
 
</script>

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 12 years 2 months ago by tpartner.
The following user(s) said Thank You: audiolime
The topic has been locked.
  • audiolime
  • audiolime's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
12 years 1 month ago #73643 by audiolime
Replied by audiolime on topic Record responses as audio
wow, that's great! I just came back to this issue after working on other parts on the project, and it works beautifully! Thank you very much for the code.

I tried to adapt it to check for a file name that includes {SAVEDID} and {QID} (I am using 1.92 now), but somehow that code never generates the "File does not exist"- error.
I substituted the line:
Code:
var url = 'path/to/audio/file.wav';

with this line:
Code:
var url = 'scripts/voice/v1_s' + {SAVEDID} + '_q' +  {QID} '.wav';
The topic has been locked.
  • Mazi
  • Mazi's Avatar
  • Offline
  • Official LimeSurvey Partner
  • Official LimeSurvey Partner
More
12 years 1 month ago #73769 by Mazi
Replied by Mazi on topic Record responses as audio

audiolime wrote: wow, that's great! I just came back to this issue after working on other parts on the project, and it works beautifully! Thank you very much for the code.

You're welcome :-)

If our hints have been helpful and you enjoy limesurvey please consider a donation to the team .
We do all this in our free time and you don't have to pay a penny for this software.

Without your help we can't keep this project alive.

Best regards/Beste Grüße,
Dr. Marcel Minke
Need Help? We offer professional Limesurvey support: survey-consulting.com
Contact: marcel.minke(at)survey-consulting.com
The topic has been locked.
More
11 years 2 months ago - 11 years 2 months ago #91328 by Tgrskng
Replied by Tgrskng on topic Aw: Re: Record responses as audio
Hello everyone,

I would like to use the Nanogong app in Limesurvey as well, however by just using the information posted in this thread and on the following website I cannot successfully use
the app: bugs.limesurvey.org/view.php?id=5663

Could someone help me out with some basic steps?

First of all do I need anything else besides Limesurvey and the nanogong app in order to make it work?
I downloaded nanogong.jar, but where do I get the receiver.php from?
Should I just copy the html text (attachment) into a Limesurvey question box or how exactly can I integrate the app into Limesurvey?
How can I save the audio recordings?
I am sorry to ask such basic questions but with the descriptions posted so far I don't know how to make it work.

I would appreciate your help a lot.
Last edit: 11 years 2 months ago by Tgrskng.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose