Welcome to the LimeSurvey Community Forum

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

Search Results (Searched for: html)

  • linuxhooligan
  • linuxhooligan's Avatar
03 Jun 2024 12:14
Aha!

1) Okay, I will review that.

2) Email + pdf:

a) My LimeSurvey version: Version 5.6.55+240220

b)  Here is what the email looks like in my inbox:   

You will note the default template text at the top and the html report under neath it inthe body of the mail.
  • linuxhooligan
  • linuxhooligan's Avatar
03 Jun 2024 11:56 - 03 Jun 2024 11:58
No issue at all.  The error was on my side.

The pdfReport and limeMpdf plugs work kind of amazing actually.  Having the report emailed to the user is an incredible feature. 

Questions:

1) When running the demo reportPDF survey is activated and I run it, the first page shows an error:  "Email is deactivated on this instance".  The demos survey mails out the pdf as an attachment just fine and I don't see any settings on the system that might cause the issue.  Any thoughts on what might cause this and how to resolve it?

Screenshot:  

2) Where do I control the email that is being sent out?  Details:

a) I get two emails to the mailbox using the demo tmeplate: 

* Response submissions
* Confirmation email + pdf attachment.

I would like to:

* Only send out the confirmation email + pdf attachment
* Not include the pdf report in the body of the email, only a confirmation text + an attachment.

The confirmation email is setup correctly in the EMAIL TEMPLATES section of the survey but both emails sent to the user contain the HTML report in the body of the email underneath the confirmation email body configuration.

Suggestions on where to look?  I have googled, read the manuals and searched forums, not quite sure where to find that configuration.

Link to sample survey for reference:   

File Attachment:

File Name: limesurvey...2154.lss
File Size:34 KB


Thank you kindly.
  • DenisChenu
  • DenisChenu's Avatar
30 May 2024 08:19

However, the "!" icon remains. Is it possible to hide the "!" icon?
 
Sorry, i'm unclear about where to put it :). You get it it was in tip.

Else :

1. Report the issue
2. Maybe you can such solution in custom.js

gitlab.com/SondagesPro/SurveyThemes/skel...?ref_type=heads#L103
Code:
        $(document).on("html:updated", ".em_sq_fn_validation, .em_q_fn_validation", function () {
            if ($.trim($(this).text())) {
                $(this).removeClass("hidden");
            } else {
                $(this).addClass("hidden");
            }
        });
Not tested in last version
 
  • linuxhooligan
  • linuxhooligan's Avatar
27 May 2024 09:48
Replied by linuxhooligan on topic Storing and returning HTML formatted text.
Very much appreciate everyones suggestions. I will do HTML report and my nest step is to look into pdfReport as well.

I hope this helps other noobs as well when they search.

Thank you for your time.
  • DenisChenu
  • DenisChenu's Avatar
27 May 2024 09:25 - 27 May 2024 09:27
Replied by DenisChenu on topic Storing and returning HTML formatted text.
> What does this mean? Does Limesurvey have an ability to use variables?

Answer part : variable to be exported, and variable without HTML.

You can use MyQuestion.question for variable too : HTML allowed, no data saved, more clean.

I do HTML report since years now. It's really more easy to work with .question than with .NAOK.

But you can do what you want … it's just advice …

> The logical way to do this is to collect the totals and store them in one questions. Store the answers (perhaps with html formatting) in another question, store various triggers in a third question and then on the report page compose the final report using THIS_that_value.

When i need this : i use some text display question, and after a final report

{if(Q01.NAOK,Report1.question)}{if(Q02.NAOK,Report2.question)}

etc …
  • linuxhooligan
  • linuxhooligan's Avatar
26 May 2024 07:00
Replied by linuxhooligan on topic Storing and returning HTML formatted text.
Amazing feedback, including the critiques. Just to answer this question:

"Why do you expect to get something else than plain text like '<span style="color:red"><b>Tralala</b></span>'"

You are correct, I expect Lime to consider entries in questions as strings. As per recommendation html_entity_decode(x) is precisely what I was looking for.

Thank you for that.

Denis said the following: 1. I really never try to put HTML in answers part

What does this mean? Does Limesurvey have an ability to use variables? All of the examples that I have seen so far use questions to store data and later perform operations on this data in various ways. Denis, are you saying there is another way to store data?

I have a survey with about 200 questions and the final page needs to take the data and:

* Sort 30 possible options into 4 categories.
* Only show the questions in the category they score in.
* Display the 4 categories (of up to 30 possible options each) in a nice way which requires, divs, css classes and as little parsing and appending using join as possible because that is impossible to debug and maintain.

The logical way to do this is to collect the totals and store them in one questions. Store the answers (perhaps with html formatting) in another question, store various triggers in a third question and then on the report page compose the final report using THIS_that_value.

Is there a better way to do this?
  • Joffm
  • Joffm's Avatar
25 May 2024 17:22
Replied by Joffm on topic Storing and returning HTML formatted text.
Fully agreed, @Denis.

One more word.
Why do you expect to get something else than plain text like '<span style="color:red"><b>Tralala</b></span>'
LimeSurvey doesn't know that you want to use inline css.
It's a text answer like everything else.
In a test it could be the answer to questions like
"Please enter the inline css to display the word "Tralala" in bold and red."
"Which HTML tag is used for an inline container?"
In these cases you obviously do not want the answer to be rendered.

Therefore you have to tell that it is displayed as HTMl code.

Joffm
  • DenisChenu
  • DenisChenu's Avatar
25 May 2024 14:05
Replied by DenisChenu on topic Storing and returning HTML formatted text.
1. I really never try to put HTML in answers part
2. I always deactivate HTML editor for complex part
3. I use multiple Question type - Text display when it's complex
4. If filterxsshtml is activated : i can not start a tag but not close on same function
5. If filterxsshtml is activated : i can not use html_entity_decode
  • Joffm
  • Joffm's Avatar
25 May 2024 04:24
Replied by Joffm on topic Storing and returning HTML formatted text.
You have to use
"html_entity_decode(x)"
[url] manual.limesurvey.org/ExpressionScript_-...mplemented_functions [/url]

Several threads about this
[url] forums.limesurvey.org/forum/can-i-do-thi...xt-nested-conditions [/url]





Nevertheless: Did you consider pdfReport?
And you should use classes.

Joffm

P.S.
If you enter code, please use the "code" button of the editor.
It's easier to read.
  • linuxhooligan
  • linuxhooligan's Avatar
25 May 2024 04:03 - 26 May 2024 07:25
Replied by linuxhooligan on topic Storing and returning HTML formatted text.
For reference point, if anyone has not yet tried to do inline styling, here is what a basic two factor (testing for two personality traits) last page report might look like:
Code:
 
<div style="border-radius: 25px;border: 2px solid #73AD21;padding: 20px;">
 
{join(
 
 
 
if(VAR_adaptability>27,join(
 
'<span style="font-weight',
':',
'bold;">',
'ANXIETY - Your score is: ',
VAR_anxiety,
'</span>',
 
'<br />',
 
'<span style="font-style',
':',
'italic;">',
'A brief description.',
'</span>',
 
'<br />',
 
'<span style="font-style',
':',
'font-size:16px;">',
'Another supplementary description.',
'</span>',
 
'<br /><br />'
 
),''),
 
 
if(VAR_anxiety>27,join(
 
'<span style="font-weight',
':',
'bold;">',
'ANXIETY - Your score is: ',
VAR_anxiety,
'</span>',
 
'<br />',
 
'<span style="font-style',
':',
'italic;">',
'A brief description.',
'</span>',
 
'<br />',
 
'<span style="font-style',
':',
'font-size:16px;">',
'Another supplementary description.',
'</span>',
 
'<br /><br />'
 
),''),
 
)}
 
</div>
 

Please note that it is spaced vertically like that for "maintainability" as developing a somewhat complicate survey requires that the actuall expression script be documented somewhere and made easy to update + copy paste back into the web interface.

However, if you pay attention to the substantial amount of apppend required for the join to to create the proper <span style=".."> tags without triggering parsing errors in Limesurvey makes something like this EXTREMELY unwieldy.

This is a live example of WHY I wanted to just shove a whole bunch of html tagged content into an Array Text question and then just be able to do VAR_item to have it display properly. That would be much easier to maintain.

For any noobs out there looking for examples on how to use join in a slightly more complicated way, this example here is pretty good.  It is based on the example from this page:  manual.limesurvey.org/ExpressionScript_examples
  • linuxhooligan
  • linuxhooligan's Avatar
24 May 2024 23:21 - 25 May 2024 00:18
Replied by linuxhooligan on topic Storing and returning HTML formatted text.
Here is a small example of what I am trying to do:

<p>{join(if(VAR_adaptability>27,VAL01adaptability,''),if(VAR_anxiety>27,VAL02anxiety_SQ001,''),if(VAR_artappreciation>27,VAL03artappreciation,''))}</p>

I am:

1) I am using an Array Numbers question to store the numeric results of a quiz.

2) I am using an Array Text question to store the text values of responses that I want to provide based on the results of the test.

3) In the provided code sample, I do a test for each test item:

a) If test item (VARitem) is greater than 27 return (VALitem) otherwise return nothing.

b) VARitem refers to the array numbers question. VALitem refers to the array text question.

4) What I was expecting to be able to do is embed <b> <i> <div> tags as necessary in order to style up text stores in VALitem.

Currently I have to do it manually inside '<b>this</b><i>that</i>' and limesurvey seems to actually have problems parsing anything other than plain text inside of ' '. For example:

{join(if(VAR_adaptability>27,'<br>this</b><i>that</i>',''),if(VAR_anxiety>27,VAL02anxiety_SQ001,''),if(VAR_artappreciation>27,VAL03artappreciation,''))}

The reason that I am trying to store html is that the top statement is much easier to debug than the bottom expression script statement.  The bottom expression script also has problems parsing and rendering depending on the tags used, I have not figured out yet what the specific cause of the issue might be.

5) Here is what actually happens:

a) Lets say I want to store some html formatted text into an array text question as follows:  {VARarraytext_SQ001_2='<span style="border-radius:25px;background:#73AD21;padding:20px;width:200px;height:150px;">asdfasdf asdfasadf </span>'}

b) Let's say that I want to present that html formatted text on a page with: {VARarraytext_SQ001_2}

c) I get the following result with the text encapsulated in html (which makes sense, I am not complaining): <p><span style="border-radius:25px;background:#73AD21;padding:20px;width:200px;height:150px;">asdfasdf asdfasadf </span></p>

QUESTION: Is it possible to store html tags in array text questions or do i have to manually style up the answers like in the code sample here in point #4?
  • DenisChenu
  • DenisChenu's Avatar
24 May 2024 09:45
Replied by DenisChenu on topic Storing and returning HTML formatted text.
Where did you return the HTML ?
How did you return the HTML ?

Why you need to store HTML ?

A solution is to construct your HTML directly in the content of a question and use {MyQuestion.question} in end page, for example.

Do you know gitlab.com/SondagesPro/ExportAndStats/pdfReport ?
  • linuxhooligan
  • linuxhooligan's Avatar
24 May 2024 07:06
Storing and returning HTML formatted text. was created by linuxhooligan
Please help us help you and fill where relevant:
Your LimeSurvey version: Version 5.6.55+240220
Own server or LimeSurvey hosting:  shared hosting
Survey theme/template: fruity
==================
I am doing a few deep dives into what kinds of variables I can store and play with.  There are a lot of good options:

* Question: Equation
* Question: Array Text
* Question: Array Number

I am building a report and one of the things I "think" I want to do is store formatted HTML and then have the results appear in a page with a report.  The reason for this would be to make the final formula simpler to read, debug and update.

Currently, I can store everything that I need in the ArrayText question type but when I return the result of that field as {VARarraytext}, this outputs the string including the html as plain text that encapsulates the return in html tags so the results ends up looking something like: "<b>My sentence.</b>"

QUESTION: Is there a way to either store fully formatted text and return the html, or perhaps somehow just make sure that the return of a string is not encapsulated in html tages on a page?

I think that I may actually be abusing Limesurvey with this approach and I would be happy to hear any comments and suggestions including "don't do that, this is a bad idea".

Thanks for any feedback.
 
  • yjeanrenaud
  • yjeanrenaud's Avatar
22 May 2024 13:54
Replied by yjeanrenaud on topic license for code snipplets and plugins
code obfuscation violates GPLv2 significantly as it makes it harder to read and modify:
www.gnu.org/licenses/old-licenses/gpl-2.0.html

The source code for a work means the preferred form of the work for making modifications to it.

  • Finn Marten
  • Finn Marten's Avatar
22 May 2024 11:02
Dear forum members,

I struggle with the following problem:
1. I fill an aray type question with randomized text input with pjax scriptcomplete. The array is of no importance and serves only for randomization of text inputs for follow up questions. It will later be hidden. The text input can be something like "Scenario 2", where I want to highlight the number two. I create different text inputs and a function that chooses a single text input per field in the array (choice). I can display the text input in the array with code like this:

Code # 1        $('#question{QID} tr[id^="javatbd"]:eq(2) td:eq(0)').html(choiceA2[0]);     this displays: "Scenario 2"

I have also experimented with code like this: 

Code # 2       $('#question{QID} tr[id^="javatbd"]:eq(1) input[type="text"]:eq(0)').val(choiceB1[0]);    which displays: "Scenario <b>2</b>"


2. I try to display the text inputs in an html table in a second question with pjax scriptcomplete but for Code #1 nothing is displayed at all. For code #2 it displays  "Scenario <b>2</b>" once again. I am looking for a way to display the text input with the number actually beeing shown in bold: "Scenario 2". After days of research in forums, tutorials and elsewhere I decided to ask for a little advice here. I would be deeply thankful for any advice or comments. I attached a lss file with a mock survey than contains my problem. The underlying code for creating the array is in the question QPP and the code for displaying the html table is in question Q1. Hopefully someone knows the remedy to my problems. Thanks in advance.

 
Displaying 16 - 30 out of 4771 results.

Lime-years ahead

Online-surveys for every purse and purpose