Welcome to the LimeSurvey Community Forum

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

Search Results (Searched for: html)

  • tpartner
  • tpartner's Avatar
26 Apr 2013 12:46
Replied by tpartner on topic Changing column width of array text
That's because you have a JavaScript error - imagetick_lime.js is called before jQuery.

In startpage.pstpl, change this:
Code:
  <script type="text/javascript" src="{TEMPLATEURL}imagetick_lime.js"></script>  
  {TEMPLATEJS}

To this:
Code:
  {TEMPLATEJS}
  <script type="text/javascript" src="{TEMPLATEURL}imagetick_lime.js"></script>
  • mheiselberg
  • mheiselberg's Avatar
21 Apr 2013 15:28 - 21 Apr 2013 15:29
Hey guys and girls,

I have made a small survey for my bachelor project. As I want as many answers as possible, I want people to share my survey on twitter and facebook after they've completed the survey themselves.

I found a small tutorial on how to make simple links for this. However, when I click the "share on facebook"-link the link description says the following: "Error We are sorry but you don't have permissions to do this. Please contact "my name" ( "my email" ) for further assistance." Here is a screenshot of it.

I think it is still possible for people to post the link on facebook, but that description is very unfortunate and might keep people from sharing or clicking the link.

So, is there a way to change it?

Here is the specific facebook-related code in the end message.
Code:
<strong>Facebook</strong> <a href="http://www.facebook.com/sharer.php?u=http://goo.gl/6AYn4" target="_blank">Share this questionaire on Facebook</a></p>

I have no idea how to change this. I've filled in the description and URL description under "Edit Text Elements".

I'm using Limesurvey Version 2.00+ Build 130406.

Best regards
Martin
  • marcic
  • marcic's Avatar
17 Apr 2013 11:41 - 17 Apr 2013 11:43
Replied by marcic on topic Saving GPS coordinates
Sorry, apparently the lss file was not attached. Here it is again.



What I was trying to do was to implement one of these solutions:

macmost.com/iphone-gps-location-with-javascript.html

merged.ca/iphone/html5-geolocation
  • tpartner
  • tpartner's Avatar
15 Apr 2013 18:28
Replied by tpartner on topic Array question with answers in dropdown boxes
Try removing the script from the question source and place it at the end of template.js

Remove the opening script tag:
Code:
<script charset="utf-8" type="text/javascript">
And the closing script tag:
Code:
</script>
  • tpartner
  • tpartner's Avatar
05 Apr 2013 18:10 - 29 Jul 2013 12:30
As it happens, I have integrated jPlayer into LimeSurvey.

Create a new "audio" directory in your template directory and upload your audio files there. (these can be placed elsewhere but the code below would need to be modified)

Download the jPlayer plugin and add these to your template:
- Jplayer.swf
- jquery.jplayer.min.js
- The "skin" folder

Add this to startpage.pstpl after {TEMPLATEJS}
Code:
  <!-- jPlayer files -->
  <link href="{TEMPLATEURL}skin/blue.monday/jplayer.blue.monday.css" rel="stylesheet" type="text/css" />
  <script type="text/javascript" src="{TEMPLATEURL}jquery.jplayer.min.js"></script>

Add this code to your template.js file:
Code:
$(document).ready(function(){
 
  if($('.audioSource').length > 0) {
 
    // Define some vars
    var surveyRoot = location.pathname.split('index.php')[0];
    var templateName = $('head link[href*="template.css"]').attr('href').replace(/\/template.css/, '').split('/templates/')[1];
    var fieldNames = $('input#fieldnames').attr('value');
    var tmp = fieldNames.split('X');
    var sID = tmp[0];
    var gID = tmp[1];
 
    // Add some classes
    $('.audioSource').closest('div.question-wrapper').addClass('audioQuestion');
 
    // Loop through all player source inclusions
    $('.audioSource').each(function(i) {
 
      // The source filename
      var audioSource = $(this).text().replace(/[\s\n\t]/g,'');
 
      //Insert a wrapper for the player object
      $(this).after('<div id="player'+i+'" class="playerWrapper" />');
 
      // Insert the player user interface
      var parentClass = '';
      if($(this).closest('tr[id^="javatbd"]').length > 0) {
        parentClass = 'subQuestion';
      }
      else if($(this).closest('div.question-wrapper').length > 0) {
        parentClass = 'question';
      }
      else {
        parentClass = 'groupDescription';
      }
      var playerController = '<div id="jp_container_'+i+'" class="jp-audio '+parentClass+'"> \
                  <div class="jp-type-single"> \
                    <div class="jp-gui jp-gui_'+i+' jp-interface"> \
                      <ul class="jp-controls"> \
                        <li><a href="javascript:;" class="jp-play jp-play_'+i+'" tabindex="1">play</a></li> \
                        <li><a href="javascript:;" class="jp-pause jp-pause_'+i+'" tabindex="1">pause</a></li> \
                        <li><a href="javascript:;" class="jp-stop jp-stop_'+i+'" tabindex="1">stop</a></li> \
                        <li><a href="javascript:;" class="jp-mute jp-mute_'+i+'" tabindex="1" title="mute">mute</a></li> \
                        <li><a href="javascript:;" class="jp-unmute jp-unmute_'+i+'" tabindex="1" title="unmute">unmute</a></li> \
                        <li><a href="javascript:;" class="jp-volume-max jp-volume-max_'+i+'" tabindex="1" title="max volume">max volume</a></li> \
                      </ul> \
                      <div class="jp-progress"> \
                        <div class="jp-seek-bar jp-seek-bar_'+i+'"> \
                          <div class="jp-play-bar jp-play-bar_'+i+'"></div> \
                        </div> \
                      </div> \
                      <div class="jp-volume-bar jp-volume-bar_'+i+'"> \
                        <div class="jp-volume-bar-value jp-volume-bar-value_'+i+'"></div> \
                      </div> \
                      <div class="jp-time-holder"> \
                        <div class="jp-current-time jp-current-time_'+i+'"></div> \
                        <div class="jp-duration jp-duration_'+i+'"></div> \
                        <ul class="jp-toggles"> \
                          <li><a href="javascript:;"class="jp-repeat jp-repeat_'+i+'" tabindex="1" title="repeat">Repeat</a></li> \
                          <li><a href="javascript:;"class="jp-repeat-off jp-repeat-off_'+i+'" tabindex="1" title="repeat off">Repeat off</a></li> \
                        </ul> \
                      </div> \
                    </div> \
                  </div> \
                </div>'
 
      if(parentClass == 'question' || parentClass == 'subQuestion') {
        $(this).parent().prepend(playerController);
      }
      else {
        $(this).parent().append(playerController);
      }
 
       // Construct the player object
       $('#player'+i).jPlayer( {
        swfPath: surveyRoot+'upload/templates/'+templateName,
        solution: 'html, flash',
        supplied: 'mp3',
        preload: 'metadata',
        volume: 0.1,
        muted: false,
        backgroundColor: '#000000',
        cssSelectorAncestor: '#jp_container_'+i+'',
        cssSelector: {
          play: '.jp-play_'+i+'',
          pause: '.jp-pause_'+i+'',
          stop: '.jp-stop_'+i+'',
          seekBar: '.jp-seek-bar_'+i+'',
          playBar: '.jp-play-bar_'+i+'',
          mute: '.jp-mute_'+i+'',
          unmute: '.jp-unmute_'+i+'',
          volumeBar: '.jp-volume-bar_'+i+'',
          volumeBarValue: '.jp-volume-bar-value_'+i+'',
          volumeMax: '.jp-volume-max_'+i+'',
          currentTime: '.jp-current-time_'+i+'',
          duration: '.jp-duration_'+i+'',
          repeat: '.jp-repeat_'+i+'',
          repeatOff: '.jp-repeat-off_'+i+'',
          gui: '.jp-gui_'+i+''
        },
        ready: function () {
          $(this).jPlayer("setMedia", {
            mp3: surveyRoot+'upload/templates/'+templateName+'/audio/'+audioSource
          });
        },
        play: function () {
          // Pause all other players
          $(this).jPlayer('pauseOthers');
        },
        errorAlerts: false,
        warningAlerts: false
 
      });
 
    });
 
  }
});

Add this to the end of template.css:
Code:
/******** Audio player styles (additional styles in the skin folder) ********/
 
span.group-description {
  display: inline-block;
  padding: 5px;
}
 
.audioSource,
.answeredCodes {
  display: none;
}
 
.jp-audio {
  text-align: center;
}

In the group description or question source where you want a player to appear, add something like this where "question_1.mp3" is the desired audio filename. These <div> elements will be hidden by CSS and automatically detected by JavaScript which will insert the player.
Code:
<div class="audioSource">question_1.mp3</div>


Here's a working LimeSurvey 2.0 template and survey:

File Attachment:

File Name: Demo_jPlay...tion.zip
File Size:319 KB

File Attachment:

File Name: limesurvey...7759.lss
File Size:14 KB
  • moisha
  • moisha's Avatar
03 Apr 2013 17:33 - 03 Apr 2013 17:42
Tooltips was created by moisha
I am a newbie and have 1.92 version of the survey from bluehost. Trying to create this www.personalitypage.com/high-level.html in the survey - how can i do this easily? I need to have user pick 1 or 2 choices only. I am thinking about using tooltips, but open to anything that work.
  • DenisChenu
  • DenisChenu's Avatar
21 Mar 2013 12:19 - 21 Mar 2013 12:21
Replied by DenisChenu on topic Problem whit RANK layout

nicoillo wrote: Whit default template sometimes it's ok, sometime no. :blink:

? Can you find when it work and when not ?
If you find it : please do a bug report.

nicoillo wrote: "With the last version ranking.css must be added for all template". What do you mean with this? I have to put rankin.css in my template folder and include it in the html or with {TEMPLATECSS} am I ok?

No, you have it in the survey: this is OK.

Denis
  • nicoillo
  • nicoillo's Avatar
21 Mar 2013 11:29
Replied by nicoillo on topic Problem whit RANK layout
Whit default template sometimes it's ok, sometime no. :blink:

'Arg. Not IE7, and debugging css with IE7 is a pity ....' I know...it's about 30 hours I'm trying to do it!!!

Now I try to copy ranking.css at the end...


"With the last version ranking.css must be added for all template". What do you mean with this? I have to put rankin.css in my template folder and include it in the html or with {TEMPLATECSS} am I ok?
  • FrAgFo0d
  • FrAgFo0d's Avatar
19 Mar 2013 15:28
Replied by FrAgFo0d on topic Calling API with jQuery/Javascript Version 2.0
OK So I am also checking it out in the Dutch forum.

Somehow I can send the data to the API, but there is just no response from the API.
I checked my HTML Request headers and my POST body in Firebug and get this:
Code:
Accept  */*
Accept-Encoding  gzip, deflate
Accept-Language  en-US,en;q=0.5
Content-Length  83
Content-Type  application/json; charset=UTF-8
Host  10.0.0.2
Referer  http://10.0.0.2/www/
User-Agent  Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:19.0) Gecko/20100101 Firefox/19.0
X-Requested-With  XMLHttpRequest
 
 
POST body:
{"method":"get_session_key","params":{"username":"admin","password":"test"},"id":1}

This is my Response Header:
Code:
Cache-Control  no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection  Keep-Alive
Content-Encoding  gzip
Content-Length  20
Content-Type  text/html
Date  Tue, 19 Mar 2013 15:23:41 GMT
Expires  Thu, 19 Nov 1981 08:52:00 GMT
Keep-Alive  timeout=15, max=99
Pragma  no-cache
Server  Apache/2.2.16 (Debian)
Vary  Accept-Encoding
X-Powered-By  PHP/5.3.3-7+squeeze15

I do not get any response body.
Could anybody help me out with this?
  • Mazi
  • Mazi's Avatar
29 Jan 2013 11:28 - 29 Jan 2013 11:30

fchanavat wrote: You mention a cron script for sending mails automatically.
Is this the one that can be found here:
www.limesurvey-templates.com/automatical...nvitations-p-49.html

Yes. Currently that script supports Limesurvey 1.92, but we are just testing a first version for Limesurvey 2 which should be available at the shop the next weeks.

fchanavat wrote: Does it prevent having to press on the "continue" button?

If it is run by a cronjob, then sending the emails is done automatically once the server calls the script.

fchanavat wrote: Does it work on self-hosted instances and with all ISPs?

It runs on each provider which offers cronjobs. Please note that limits such as the max number of emails / minute/hour is limited by the provider, not the script. Ask your provider to raise such limits if necessary.
It might also help to set Limesurvey to use SMTP emailing which usually has less strict limits, see "How to prevent Limesurvey email invitations or reminders being treated as spam": www.limesurvey-consulting.com/how-to-pre...ing-treated-as-spam/

fchanavat wrote: Is it compatible with ALL versions?

See above...
  • fchanavat
  • fchanavat's Avatar
25 Jan 2013 15:14
Hello

You mention a cron script for sending mails automatically.
Is this the one that can be found here:
www.limesurvey-templates.com/automatical...nvitations-p-49.html

- Does it prevent having to press on the "continue" button?
- Does it work on self-hosted instances and with all ISPs?
- Is it compatible with ALL versions?

Thanks for your help. Sending surveys to large lists is a nightmare.
  • tpartner
  • tpartner's Avatar
24 Jan 2013 21:10 - 24 Jan 2013 21:12
For this workaround to work, you need to:
1) Include the CSV file in your template directory
2) Place the jquery.csv.js file in your template directory
3) Add the following line to your startpage.pstpl AFTER the {TEMPLATEJS} tag
Code:
<script type="text/javascript" src="{TEMPLATEURL}jquery.csv.js"></script>

Your code looked fine to me but I modified it a bit to automatically detect the question IDs and the the path to the template directory.

Placing this code in the source of the first question will initiate the auto-complete function for that question, using the CSV column-1 values. When a value is selected, it will auto-populate the following 2 questions with the the CSV column-2 and column-3 values.

For different questions/surveys, all you should need to modify is the csvName variable.
Code:
<script type="text/javascript" charset="utf-8">
 
  $(document).ready(function() {
 
    // Define the CSV filename
    var csvName = 'linguas.csv';
 
    // Define some paths
    var surveyRoot = location.pathname.split('index.php')[0];
    var templateName = $('head link[href*="template.css"]').attr('href').replace(/\/template.css/, '').split('/templates/')[1];
    var templatePath = surveyRoot+'upload/templates/'+templateName+'/';
 
    // Define the questions
    var q1ID = '{QID}';  
    var q1 = $('#question'+q1ID);
    var q2 = $(q1).nextAll('.text-short:eq(0)');
    var q3 = $(q1).nextAll('.text-short:eq(1)');
 
    // Define the path to the CSV
    var url = templatePath+csvName;
 
    // Create an array to hold the CSV rows
    var namesArr = new Array();
 
    // Grab the CSV contents
    $.get(url,function(data){
 
      // Convert CSV contents to an array of arrays
      fullArray = jQuery.csv()(data);
 
      // Load the CSV rows array
      $(fullArray).each(function(i, item){
        namesArr.push(item[0]);
      });
 
      // Initialise the autocomplete plugin
      $('input.text', q1).autocomplete({
        source: namesArr,
        // Event fired when a selection is made (ui.item.value refers to the selected item)
        select: function(event, ui) { 
          // Find the column 2 and column 3 values associated with the selected column 1 value and load q2 and q3
          $(fullArray).each(function(i, item){
            if(item[0] == ui.item.value) {
              // The value from column 2 of the CSV
              $('input.text', q2).val(item[1]);
              // The value from column 3 of the CSV
              $('input.text', q3).val(item[2]);
            }
          }); 
        }
 
      });
    });
  });
</script>

Here is a working copy of your survey and the corresponding template with the CSV file and jquery.csv.js included. (import the template first so the survey uses the correct one)

File Attachment:

File Name: gabriela_csv_test.zip
File Size:74 KB


File Attachment:

File Name: autofillcvs_TP.lss
File Size:28 KB
  • dweisser
  • dweisser's Avatar
22 Jan 2013 17:43
The solution looks so simple - but for the life of me I cannot get this to work on my survey.

I have enabled javascript:
Filter HTML for XSS: No

I too have a yes/no question type:
Type: Yes/No

I have copied this code:

<script type="text/javascript" charset="utf-8">

$(document).ready(function() {

// Initially disable the Next/Submit button
$('input[type="submit"]').attr('disabled', 'disabled');

// Listeners on Yes/No radios to toggle the Next/Submit button
$('input.radio[value="Y"]').click(function(){
$('input[type="submit"]').attr('disabled', '');
});
$('input.radio[value="N"]').click(function(){
$('input[type="submit"]').attr('disabled', 'disabled');
});

});

</script>

I then updated this code to reflect my particular question number.

<script type="text/javascript" charset="utf-8">

$(document).ready(function() {

// Initially disable the Next/Submit button
$('input[type="submit"]').attr('disabled', 'disabled');

// Listeners on Yes/No radios to toggle the Next/Submit button
$('#question199 input.radio[value="Y"]').click(function(){
$('input[type="submit"]').attr('disabled', '');
});
$('#question199 input.radio[value="N"]').click(function(){
$('input[type="submit"]').attr('disabled', 'disabled');
});

});

</script>

And nothing. Any thoughts? Much appreciated.
David
  • Mazi
  • Mazi's Avatar
21 Jan 2013 22:09
Replied by Mazi on topic Importing the template

navneet123 wrote: I have downloaded the IPhone1 template from the link below
www.limesurvey.org/en/download-limesurve...vey-design-templates

That template is stone old and won't work well with the latest Limesurvey versions.

A professional Limesurvey iPhone template is available here: www.limesurvey-templates.com/limesurvey-...hone-tuned-p-41.html

As for related importing problems: Make sure your template doesn't contain additional content like "mytemplate/__MACOSX"
  • DonMartin
  • DonMartin's Avatar
10 Jan 2013 14:13
Replied by DonMartin on topic LimeSurvey piwik intergration?
This has not worked for me nor did the solutions posted previously. So I appreciate that this is probably not the correct method or indeed good practice but here is my solution.

1.Assuming Piwik is installed and setup add your Limesurvey root URL as a website to track e.g. www.somewebsite.com/limesurvey (in piwik 1.9.2 this is done by going Settings > Websites > Add new website)

2.This will generate the custom Piwik Javascript tracking code, it will look almost identical to the above posted by Denis.

3.Create a new blank html document, with nothing in it, place the Javascript code just before the </body> tag.

4.Upload the documents to your template folder.

5.Open your welcome.pstpl in the last section after (WELCOME) but before any closing </td></tr></table> tags (this will depend on your template) add a link to your blank page using an iframe.

You then need to style the iframe (not the embedded page) using CSS to make it invisible, you can either add this to your template CSS or do it inline. Below is an example:


<iframe name='iframe1' id="iframe1" src="/templates/mytemplate/blank.html" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 0px;"></iframe>

If you keep this in templates you will not need to worry when you run a LS update. If you use more than one template just replicate it there as well.

…there must be a better way but I have not found it. :blush:
Displaying 4711 - 4725 out of 4821 results.

Lime-years ahead

Online-surveys for every purse and purpose