Welcome to the LimeSurvey Community Forum

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

Search Results (Searched for: survey title)

  • Oterito
  • Oterito's Avatar
14 Aug 2023 16:30
I used this in a 3.28.66 version of limesurvey and it worked: In version 2.5x, there are pseudo-elements inserted for the check-boxes and you can't reliably use JavaScript to apply styles to a pseudo-element.

The simplest approach is to apply classes to the row elements and target the pseudo-elements in those rows with CSS. You should also remove the check-boxes in those rows in case someone tabs through the question.

1) Add something like this to the question source:
CODE:
<script type="text/javascript" charset="utf-8">

$(document).ready(function() {
// First Row
$('#question{QID} .question-item:eq(0)').parent().addClass('sub-header');
$('#question{QID} .question-item:eq(0)').find('input').remove();
// Sixth Row
$('#question{QID} .question-item:eq(5)').parent().addClass('sub-header');
$('#question{QID} .question-item:eq(5)').find('input').remove();
// Tenth Row
$('#question{QID} .question-item:eq(11)').parent().addClass('sub-header');
$('#question{QID} .question-item:eq(11)').find('input').remove();
});
</script>

2) Add something like this to the end of template.css:
CODE:
.multiple-opt .sub-header .question-item {
padding-left: 0;
}

.multiple-opt .sub-header .label-text {
margin-left: 0;
font-weight: bold;
}

.multiple-opt .sub-header .checkbox label::before {
display: none;
}

(I found it in this post: forums.limesurvey.org/index.php/forum/de...les-for-subquestions )

But is not working in version 5.6.31.

May be this code for this version and put condicional on the subquestion?
  • Oterito
  • Oterito's Avatar
10 Aug 2023 19:21
Please help us help you and fill where relevant:
Your LimeSurvey version: 5.6.31
Own server or LimeSurvey hosting: LimeSurvey hosting
Survey theme/template: Vanilla
==================
Hi, 

I would like to create a multiple choice with comments question where show the text boxes only for two subquestions, put other two subquestions as a subtitles (with bold letters and without checkboxes) and randomize the 1st "group" of subquestions below the first subtitle between them and the 2nd "group" of subquestions below the second subtitle between them. 

I attached the survey and a sample image explaining this. 

 

- For hide the text boxes i used a JS code from this forum i already used in other survey. It worked perfectly: 

$(document).ready(function() {
 
    // Identify this question
    var qID = {QID}; 
 
    // The sub-question codes to have no text input
    var sqCodes = [1, 2, 3, 4, 6, 7, 8, 9]; 
 
    // Loop through those sq codes and remove their text inputs
    $(sqCodes).each(function(i, code) {
      $('#question'+qID+' input[type="text"][id$="X'+qID+code+'comment"]').remove();
    });
      });

- For put two subquestions as a subtitles i tried to use this JS code from this forum but is not working:

<script type="text/javascript" charset="utf-8">    
 
  $(document).on('ready pjax:scriptcomplete',function(){
    // First Row
    $('#question{QID} .question-item:eq(0)').addClass('sub-header').find('input').remove();
      // Thirteen Row
    $('#question{QID} .question-item:eq(12)').addClass('sub-header').find('input').remove();
  });
</script>
<style type="text/css">.question-item.sub-header,
  .question-item.sub-header label {
    padding: 0;
    margin-bottom: 5;
    font-weight: bold;
  }
 
  .question-item.sub-header label::before,
  .question-item.sub-header label::after {
    display: none;
  }
</style>

- And I have no idea how to randomize differents groups of subquestions between them. 

If anyone can help me it would be great. 

Thank you in advance. 
  • sbgmedia
  • sbgmedia's Avatar
24 Jul 2023 16:43 - 24 Jul 2023 16:46
Please help us help you and fill where relevant:
Your LimeSurvey version: Version 5.3.31+220815
Own server or LimeSurvey hosting: Own server
Survey theme/template:
==================
I am trying to connect to the Limesurvey API. I have enabled it and can access it in my local test environment, however, when i upload my application online and run it, I get an error :The remote server returned an error: (403) Forbidden.Following is my code:
Code:
 Imports System.IO
Imports System.Net
Imports Newtonsoft.Json
Imports Newtonsoft.Json.Linq
Public Class _Default
    Inherits System.Web.UI.Page
 
    Public Class JsnRPCclient
        Private id As Integer = 0
        Public Property URL As String
        Public Property Method As String
        Public Property Parameters As JObject
        Public Property Response1 As JsonRPCresponse
 
        Public Sub New()
            Parameters = New JObject()
            Response1 = Nothing
        End Sub
 
        Public Sub New(ByVal URL As String)
            Me.URL = URL
            Parameters = New JObject()
            Response1 = Nothing
        End Sub
 
        Public Function Post() As String
 
            Dim jobject As JObject = New JObject()
            jobject.Add(New JProperty("jsonrpc", "2.0"))
            jobject.Add(New JProperty("id", System.Threading.Interlocked.Increment(id)))
            jobject.Add(New JProperty("method", Method))
            jobject.Add(New JProperty("params", Parameters))
            Dim PostData As String = JsonConvert.SerializeObject(jobject)
            Dim encoding As UTF8Encoding = New UTF8Encoding()
            Dim bytes As Byte() = encoding.GetBytes(PostData)
            Dim requestn As HttpWebRequest = CType(WebRequest.Create(URL), HttpWebRequest)
            requestn.Method = "POST"
            requestn.ContentType = "application/json"
            requestn.KeepAlive = True
            requestn.ContentLength = bytes.Length
            Dim writeStream As Stream = requestn.GetRequestStream()
            writeStream.Write(bytes, 0, bytes.Length)
            writeStream.Close()
            Dim response As HttpWebResponse = CType(requestn.GetResponse(), HttpWebResponse)
            Dim responseStream As Stream = response.GetResponseStream()
            Dim readStream As StreamReader = New StreamReader(responseStream, encoding.UTF8)
            Response1 = New JsonRPCresponse()
            Response1 = JsonConvert.DeserializeObject(Of JsonRPCresponse)(readStream.ReadToEnd())
            Response1.StatusCode = response.StatusCode
            Return Response1.ToString()
 
        End Function
 
        Public Sub ClearParameters()
            Me.Parameters = New JObject()
        End Sub
    End Class
 
    Public Class JsonRPCresponse
        Public Property id As Integer
        Public Property result As Object
        Public Property [error] As String
        Public Property StatusCode As HttpStatusCode
 
        Public Sub New()
        End Sub
 
        Public Overrides Function ToString() As String
            Return "{""id"":" &amp; id.ToString() &amp; ",""result"":""" &amp; result.ToString() &amp; """,""error"":" &amp; [error] &amp; (If((String.IsNullOrEmpty([error])), "null", """" &amp; [error] &amp; """")) &amp; "}"
        End Function
    End Class
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
 
    End Sub
 
    Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
 
        'Configure SSL/TLS settings
        ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12 Or SecurityProtocolType.Tls11 Or SecurityProtocolType.Tls
        ServicePointManager.ServerCertificateValidationCallback = Function(sender2, certificate, chain, sslPolicyErrors) True
 
 
 
 
        Dim Baseurl As String = "https://www.dcsmanagement.com.au/evf/admin/remotecontrol/"
        Dim client As JsnRPCclient = New JsnRPCclient(Baseurl)
        client.Method = "get_session_key"
        client.Parameters.Add("username", "admin")
        client.Parameters.Add("password", "123456")
        client.Post()
 
 
 
        Dim SessionKey As String = client.Response1.result.ToString()
        'Console.WriteLine(SessionKey.ToString)
        TextBox1.Text += SessionKey
        client.ClearParameters()
 
 
        If (client.Response1.StatusCode = System.Net.HttpStatusCode.OK) Then
            client.Method = "list_surveys"
            client.Parameters.Add("sSessionKey", SessionKey)
            client.Post()
        End If
 
        client.ClearParameters()
 
        Dim content As String = client.Response1.result.ToString()
 
        ' Read the response content as a string
 
        ' Dim jsonObject As JObject = JObject.Parse(content)
        Dim jsonArray As JArray = JArray.Parse(content)
        Dim t, i, d As String
 
        For Each item As JObject In jsonArray
            t = item.SelectToken("surveyls_title").ToString
            i = item.SelectToken("sid").ToString
            d = ""
            If t.Contains("<br>") Then
                Dim StringParts() As String = Split(t, "<br>", 3)
                d = StringParts(2).ToString
                t = t.Replace("<br>", " ")
                Literal1.Text += "<tr><td>" &amp; i.ToString &amp; "</td><td>" &amp; t.ToString &amp; "</td><td>" &amp; d.ToString &amp; "</td><tr>"
            ElseIf Not t.Contains("<br>") Then
                d = "---"
                t = t.Replace("<br>", " ")
                Literal1.Text += "<tr><td>" &amp; i.ToString &amp; "</td><td>" &amp; t.ToString &amp; "</td><td>" &amp; d.ToString &amp; "</td><tr>"
            End If
 
        Next
 
        TextBox1.Text += content
    End Sub
End Class


 
  • jlegg05
  • jlegg05's Avatar
18 Jul 2023 17:26 - 18 Jul 2023 17:29
Editing Public Statistics Page Graphs was created by jlegg05
Your LimeSurvey version:6.1.8
Own server or LimeSurvey hosting: Own Server
Survey theme/template: Fruity
==================
When loading the public statistics page,  I would like to be able to remove options from the graphs. I have already done this on the charts, as well as edited numerous other things within the page. I imagine it is located within userstatistics_helper.php, but I am not sure how to remove such options. For more detail, this is a graph within the statistics page:

 

Here, we can see that I have already removed the "No answer" and "Not completed or Not displayed" options from the chart. However, they still appear on the graph. How can I remove them from here? And further, what file includes the entire page? I know that template-core.js and userstatistics_helper.php determine the charts/graphs, however I cannot figure out which file determines the rest of the page, such as the title or background color.
  • Janina Schneider
  • Janina Schneider's Avatar
17 Jul 2023 11:30
Embedding of a Youtube Video is not working was created by Janina Schneider
 LimeSurvey version: LimeSurvey Cloud Version 5.6.29
==================
I've been trying to embed a youtube Video in my survey (starting from a specific timepoint and not from the beginning). I tried it in multiple ways, with the source code, as well as with the button in the user interface to embed a Video. 
For the source code I used the following code: 

<iframe width="760" height="415" src=" www.youtube.com/embed/Ko0pUIenk8Q?start=129 " title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen>

The only thing that happens then is that I get a problem record when I look into the question-preview: An error has occurred. Watch this video on Youtube.com or enable JavaScript if it is disabled in your browser. 

I checked, JavaScript is enabled in my browser. 
When I try to embed it with the user interface (just via the Youtube-Link: youtu.be/Ko0pUIenk8Q?t=129 ) it works, that the Video is embedded, but it starts from the beginning and not from minute 1:29 how it's supposed to be. 

Does anybody know what the problem could be or has had the same problem already? 
  • Joffm
  • Joffm's Avatar
11 Jul 2023 16:55

J'ai essayé pour avoir la même chose avec le tableau (Q07) mais j'obtiens le n° d'ordre du tableau et pas celui des sous questions.

Bien sûr que non:
qseq = séquence de questions

Mais vous pouvez pousser vos questions avec les classes CSS "no-question" et "no-bottom".
Code:
.no-question
   {
     border-top:0;
   }
.no-question .question-title-container,
.no-question .question-valid-container
   {
     display:none;
   }
.no-bottom
   {
     border-bottom:0;
     margin-bottom:0;
   }
.no-question .answer-container
   {
     padding-top: 0em;
     padding-bottom: 0.5em;
   }
.no-bottom .answer-container
  {
    padding-bottom: 0em;
  }  

 

 

File Attachment:

File Name: limesurvey...2781.lss
File Size:44 KB

Joffm
  • linuxhooligan
  • linuxhooligan's Avatar
10 Jul 2023 00:53 - 10 Jul 2023 03:29
Replied by linuxhooligan on topic Creating a new theme based on a core theme
Following up on this thread with information for noobs.  Details:

1) Tpartner - thanks for the response. 

2) I have a lot of non-nice things to say about NOT being able to just copy/paste an existing them, rename a few things in a file and go but I won't.  Not being able to just copy / paste an original theme, rename a few things in a text file and load it up and go is disappointing.  I just want to put the frustration out front so that I don't paint a rosy picture by accident.

.... however ...

3) Overall, the templating and theming system is extremely powerful and implemented at all of the levels of resolution necessary.  Being able to theme globally, group, per survey use variations is powerful.  I am okay with the complexity because I can see why it was done, it is future proofing the project and perhaps styling frustrations can be reduced a lot by extending some of the customization options + extending documentation in ways that make it at least easy to create variations of a theme which is what most people really want to be able to do.

In addition, as I was hacking around the variations css I was NOT able to break the templating system that on most systems can make the admin section / interface inaccessible without either ftp access or sometimes even having to dig into the database to turn off some parameter or two.  If the templating system is difficult for novices to use it is worth it simply because of this robust level of integration.

Whoever implemented the templating on LS did an amazing job, that was obviously a huge amount of work and everyone did a great job.

4) WORKFLOW  - I decided to EXTEND the Fruity theme and the process of that is just go to THEMES and select EXTEND on the theme.  I named my new theme appropriately and then I LEFT THE THEME ALONE.  I tried editing the theme using the Theme Editor but that was an absolutely useless process. 

The minimum changes I wanted to do would need to go into the custom.css file and it just wan't obvious on any level how to quickly select a css class, change the properties and go.  In addition, all of the suggestions to use Bootsrap customizers to generate css are useless, you cannot just generate a Bootstrap theme, drop the css into the custom.css file and go.

So created an extended theme and left it alone.  It's not worth the effort without doing coursework on the latest Bootstrap classes, on Twig and how to integrate everything nicely. 

5) THE SIMPLE SOLUTION - Apply my new theme and just create a VARIATION.

This was the chosen approach because I mostly just wanted to change colours.  The process is simple:

a) Copy one of the variation themes from /original-theme/css/variations/
b) Drop the source theme file into /your-new-extended-theme/css/variations/

Edit the new file and go.

6) IT'S NOT THAT SIMPLE - MY WORKFLOW

For any newbs reading / looking for information on how to quickly create a theme VARIATION, here is why I did:

a) Extend the Fruity theme - CONFIGURATION / ADVANCED / THEMES --> select EXTEND

b) Apply my new theme to an existing survey so that you can have a meaningful visual reference.  In the survey go to THEME OPTIONS and select CUSTOMIZE and then select a VARIATIONS theme in the SIMPLE OPTIONS tab.

c) FTP - Ftp into my server, download the Fruity theme as well as MY-NEW-EXTENDED-THEME. 

The official themes are located in your /install-directory/themes/surveys/ directory.
Your EXTENDED theme is located in your /installation-directory/upload/themes/survey directory.

d) On my machine, copy one of the variations from /fruity/css/variations/ to /my-new-extended-theme/css/variations

e) Rename the css I copied into my /variations folder to something meaningful.  It doesn't matter what you call it, just note the name because you will need to tell LS what the new VARIATIONS theme is called.

f) Add the name of my new VARIATION css to the /my-new-extended-theme/config.xml file in the options section at the bottom.  Here is what mine looks like:

<cssframework type="dropdown" category="Simple options" width="12" title="Variations" parent="cssframework">
            <dropdownoptions>
                <option value="css/variations/my-new-variation-theme.css">My New Variation Theme</option>
                <option value="css/variations/sea_green.css">Sea Green</option>
                <option value="css/variations/apple_blossom.css">Apple Blossom</option>
              </dropdownoptions>
        </cssframework>

g) Go back to the survey and in the THEME OPTIONS / SIMPLE OPTIONS tab you should now be able to select your new variation theme.

h) You can now start to edit the css and upload the updated css to your server so that you can see the changes.  Please note that these variation css files are WAY more complex than I expected them to be.  First, they need to be formatted to be human readable so you will need to do a search and replace on the } character with a }+carriage return in your editor so you have something you can work with.  Next finding the actual selectors is going to be a bit of a nightmare but it can be done. 

At minimum, it will be possible to change most of the base colours that cannot be changed in the THEME OPTIONS section of the survey or the theme.

f) APPLY THE FOLLOWING WORKFLOW: In order to retain your sanity editing the variations css, I had to apply the following workflow:

* Edit my variations file.
* Upload it to the server.
* In one browser tab have CONFIGURATION / GLOBAL OPEN and select: CLEAR NOW (Clear assets cache)
* In another browser tab have the survey admin section open and select PREVIEW SURVEY to see the changes.  NOTE:  You mostly cannot reload an open survey and see all of your changes because the system caches assets.  Making sure you select CLEAR NOW above helps keep your sanity in check.
* REPEAT

Once you get in the iteration groove it is okay and you can make quite a good amount of changes without knowing too much Bootstrap. 

5) SUMMARY: If you are just starting out and want to quickly create a theme for your survey with some minimal colour changes, I think this is probably the quickest workflow before it becomes necessary to learn Bootstrap, some of the advanced css features such as @mediaqueries as they are used here and the Twig templating framework.

Overall, I did hack around quite a bit and I could not get anything to break.  This speaks volumes for the quality of the engineering of LS and I really cannot actually complain.  I will try to help with some of the manuals and other documentation to help reduce the barrier to entry to future users that wan to jump into customization.

Thanks for your help Tpartner.




 
  • jaricianci
  • jaricianci's Avatar
23 Jun 2023 12:10
If Statement within unordered List was created by jaricianci
LimeSurvey version: Version 5.6.26+230613
Own server
==================

I want to add a list element within an unordered list using an if-statement. This does not seem to work. Other HTML Code within if-statements work fine so far:

<p>Title:</p>
<ul>
    <li>List element 1</li>
    <li>List element 2</li>
{if(TOKEN:ATTRIBUTE_1=="B",''<li>List element 3</li>,'')}
</ul>

Limesurvey auto adds list items to the code turning the above code to:

<p>Title:</p>
<ul>
    <li>List element 1</li>
    <li>List element 2</li>
    <li>{if(TOKEN:ATTRIBUTE_1=="B",''</li>
    <li>List element 3</li>
    <li>,'')}</li>
</ul>

Does anyone know how to correctly add a list item within an unordered list via if-statement?
Thanks for your help,



 
  • tpartner
  • tpartner's Avatar
22 Jun 2023 19:27
Replied by tpartner on topic File Upload Title
As you neglected to give the details of your LimeSurvey installation in the opening post, my workaround was developed for 5.x.

I will look into it next week as time allows.
  • tpartner
  • tpartner's Avatar
22 Jun 2023 19:04 - 22 Jun 2023 19:04
Replied by tpartner on topic File Upload Title
Here is some documentation on custom question themes - github.com/LimeSurvey/LimeSurvey/tree/master/themes/question

Feel free to copy some of these for inspiration - github.com/tpartner?tab=repositories
  • mnorden
  • mnorden's Avatar
22 Jun 2023 15:27
Hey Joffm,

thank you for replying.
I am sorry but I am not aware of having removed anything? I didn't see any questions from your side?

If I accidentally removed something (maybe when I changed the topic title?), please just send the questions again.

We know that there are better pure booking solutions but we would like to implement something on our own servers and combine it with some other survey-functions (check boxes). So far, we've used the DFN online calendar but it's not very customizable.

I'll check out your tutorial but would still be happy to follow up on this.

Thanks a lot,
mnorden
  • mathieulorenzo
  • mathieulorenzo's Avatar
22 Jun 2023 11:21
Replied by mathieulorenzo on topic Failing to randomly select questions in groups
Thank you Joffm for your answer.

It's optionnal for me to display groups in randomised order.

I assigned a random group name for each question according to these instructions (numer 11) : manual.limesurvey.org/Expression_Manager...e_Question_Per_Group

It says :"This survey shows how to ask a random subset of questions in a group. For example, show 5 random questions out of 10 questions located within a group.The survey has one group containing 10 questions. All questions are assigned the same randomization group name . As a result, they will be displayed in a random order on page load. Each question is given a relevance equation that the sum of the " relevanceStatus " of all other questions in the group is less than the number of questions you want to show. Since relevanceStatus is assigned as questions are rendered, this effectively totals the number of preceding questions.So, in our 5 out of 10 example, the equation for Q1 would be:sum(Q2.relevanceStatus, Q3.relevanceStatus, Q4.relevanceStatus, Q5.relevanceStatus, Q6.relevanceStatus, Q7.relevanceStatus, Q8.relevanceStatus, Q9.relevanceStatus, Q10.relevanceStatus) LT 5
For Q2, it would be:sum(Q1.relevanceStatus, Q3.relevanceStatus, Q4.relevanceStatus, Q5.relevanceStatus, Q6.relevanceStatus, Q7.relevanceStatus, Q8.relevanceStatus, Q9.relevanceStatus, Q10.relevanceStatus) LT 5
And so on..." I would love to avoid re-doing all my 356 equations...
Is there a way to make my survey work with this method or do I have to switch for one of the methods Joffm suggested ?
  • BIFI_research
  • BIFI_research's Avatar
12 Jun 2023 10:48
I requested this as a feature here .

I hope it will be successful, we'll see.

Thank you guys for your help!
  • roblej
  • roblej's Avatar
09 Jun 2023 17:34
Please help us help you and fill where relevant:
Your LimeSurvey version: LimeSurvey Community Edition Versión 5.4.10+221107
Own server or LimeSurvey hosting: Server Debian 11, Varnish, MySQL 5.5, PHP 8
Survey theme/template:
==================
We have set up a new server with the configuration: Server Debian 11, Varnish, MySQL 5.5, PHP 8

We have imported the surveys that were working correctly in LimeSurvey 3.25.15+210223 and when entering the survey for the first time by clicking on the survey title link, the error occurs:

Error 500:
round(): Argument #1 ($num) must be of type int|float, string given

However, by clicking on the "general settings and texts" icon to the left of the title, you can enter and the survey can be administered correctly. This error is reproduced a few times until you log out and log in again and then it disappears.

It also occurs in user surveys, almost always at the end, on the last screen.

We have seen questions in forums about this error for other similar applications (moodle, wordpress, drupal, etc.) and it seems that all agree that they are incompatibilities of the application with PHP8, mainly due to lack of development.

Does anyone have experience with this error in LimeSurvey 5?

Thanks and best regards
 
  • Lonnie
  • Lonnie's Avatar
07 Jun 2023 18:16 - 13 Jun 2023 19:56
[Gelöst] Übersetzung gelöscht was created by Lonnie
Bitte helfen Sie uns, Ihnen zu helfen und füllen Sie folgende Felder aus:
Ihre LimeSurvey-Version: Version 5.6.25+230605
Eigener Server oder LimeSurvey-Cloud: Server
Genutzte Designvorlage: fruity
==================
Hallo zusammen,

ich bin gerade dabei meine Umfrage zu übersetzten, da es mit der Auto-Übersetzung nicht funktioniert hat, mache ich diese manuell mit dem Schnell-Übersetzungs Tool. Als ich mit den Antwortoptionen fertig geworden bin, habe ich diese gespeichert und plötzlich sind alle Übersetzungen der Antwortoptionen (bis auf die erste) verschwunden. Bis zum Ende habe ich Zwischenstände immer wieder gespeichert. Daraufhin habe ich die Umfrage/Browser geschlossen und neu geöffnet, die übersetzten Antwortoptionen blieben verschwunden. Ich kann auch außer der ersten Antwortoption keine Übersetzung mehr speichern/ verändern.

Bei meiner Recherche bin ich auf folgendes gestoßen (s.u.) kann das schon die Lösung sein? Wenn ja, warum habe ich dann plötzlich den gesamten Fortschritt (bis auf eine Überstzung) bei den Antwortoptionen verloren, da ja zwischenzeitlich gespeichert wurde und dies auch funktioniert hat?

manual.limesurvey.org/index.php?title=Qu...8691#Troubleshooting
Troubleshooting
Q: When saving not all translations are saved.
A: With big surveys the number of variables sent to the server can easily exceed 1000. By default, PHP only allows 1000 post variables at a maximum, any variables beyond the first 1000 are ignored. You will need to modify your PHP configuration and set the variable 'max_input_vars' to a much higher value - try 5000 or better 10000. If you don't understand what you have to do, please contact your server administrator with this information!

edit:Rechtschreibung
 
Displaying 76 - 90 out of 100 results.

Lime-years ahead

Online-surveys for every purse and purpose