Welcome to the LimeSurvey Community Forum

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

Search Results (Searched for: html)

  • holch
  • holch's Avatar
03 Feb 2025 17:15 - 03 Feb 2025 17:17
Sorry, the screenshot has switched my brain from English to German. Here also an answer in English:

My suspicion is that you have simply copied this as text into the WYSIWYG-Editor. You need to either (1) switch to the code view of the editor or (2) switch the editor off completely or (3) create the link within the Editor.

 

Wie hast du denn diesen Link eingefügt? Via Kopie des ganzen Textes in den WYSIWYG-Editor? Dann ist die Darstellung ja richtig. Du hast LImesurvey beauftragt den Text so wie du ihn kopiert hast und das macht limesurvey.

Du musst diesen Text im Quellcode-Mode des Editors eintragen oder den LInk via den WYSWYG-Editor erstellen.

Wenn das alles nicht funktioniert, dann vermute ich, dass der XSS-Filter zuschlägt. Meines Wissens nach filtert der aber keine Links aus. Daher ist meine Vermutung einfach, dass du den Text mit dem HTML-Code einfach in den Editor kopiert hast.
  • Joffm
  • Joffm's Avatar
03 Feb 2025 16:57
Hi,

Can you help me there?


Maybe, if you explain what is

But the HTML Link does not work. 


Which HTML link?
Show, what you did so far?

Send the lss export.

Joffm
  • holch
  • holch's Avatar
03 Feb 2025 16:55
Not sure how including a HTML link into the description text of a question would help with accepting terms and conditions.

And html links can be included in question texts without any issues. So please describe further what the issue is here or provide a LSS file to show what you are trying to do.
  • Hakuhodo
  • Hakuhodo's Avatar
03 Feb 2025 16:25
[object Object] Please help us help you and fill where relevant:
LimeSurvey version: Latest Version
Own server or LimeSurvey Cloud: LS
Survey theme/template: fruity_twentythree
==================

Hey there, i want include a HTML link into the description text within a question, to accept the Terms and Conditions. But the HTML Link does not work. 
The need is, that we need to build a condition for people who are inserting their email adresses into the email field. IF this field is filled out, the Checkbox for accepting the Terms and Conditions should appear. 

Can you help me there?
  • jparis
  • jparis's Avatar
02 Feb 2025 21:01
pdfReport HowTo was created by jparis
Please help us help you and fill where relevant:
Your LimeSurvey version: 6.9.0+241218
Own server or LimeSurvey hosting: OWN (Debian 12)
Survey theme/template: Fruity TwentyThree
==================
Hi,

Using LimeSurvey from v3 and very happy with it. It's in use for several surveys in a school environment.
Now we want to go further and my colleagues request me a sort of test with several questions, each with 3 or 4 answers, only one is OK.
It's an easy request and had it done in minutes but now they want the students to see which questions they failed (or which were OK) at the end of the test.
I think I can't get this behaviour with LS, tried tha assessment system but it works as a global result of the test and can't make out of the answers so I thought about pdfReport could acomplish the task.
I installed and activated it but I need some guidance to generate the html text with the needed tags I could use to replace each question number (or text), and the same for the answers to be able to print if the question was correct or no...
I can't find any document about this, only that you can use the text of the upload question to generate the pdf and nothing about how to replace text from the "survey"
 
  • cheeseburger
  • cheeseburger's Avatar
28 Jan 2025 16:21
Thank you for spending the time to do that test and then send the exports. After reviewing them, I believe I see the difference. Please let me know if I am seeing it correctly: 

In your views/subviews/printanswers/question_types/template_numeric-multi.twig file I can see where you made the edit "I update here". 

When you made the edit, did you make it to the core file (the original primary singular file that is in its original location and NOT in the uploads folder and not in a TMP folder)? 

For example, this is where the core file is located in its original location after installing LimeSurvey: 
/efs/www/html/limesurvey/themes/survey/vanilla/views/subviews/printanswers/question_types/template_numeric-multi.twig

If this is where you make your edits that you can actually see in the final survey, that would make sense to us and we are likely to also have a successful result. 

However, in order to not have to worry about upgrades overwriting "core files", we found that we were able to place items in the UPLOAD directory and it would override the core files - just like it does when you use the GUI (Limesurvey Theme Editor) to modify an existing twig. You click to copy and save and it makes a duplicate inside of the uploads folder which then makes a copy in the tmp folder. 

We USED to be able to manually place files such as template_numeric-multi.twig into the uploads folder and it would behave like the files we can access through the theme editor even though you couldn't access them there. If we placed them in the uploads folder, they would be read in place of the actual file. That behavior has changed and we were wondering if it was still possible in order to not touch "the core file".

Thanks again!
  • moodleboy
  • moodleboy's Avatar
28 Jan 2025 15:27 - 28 Jan 2025 17:27
Replied by moodleboy on topic Images shown in response export.
Hello, and thank you all for your quick responses.  Please allow me to address them, the best I can, in the order of your replies.

You can send the report to any email, but currently there are no way to include the image link./source to the PDF.

I think we can add an Expression Manager function : imgSrc(Qcode[index=0]) in a new plugin.

Else a plugin can create any PDF file using any PHP script Export plugin : www.limesurvey.org/manual/Export_plugin_development#newExport but more time consuming.

I followed the link in the above reply, but the page only had five items on it with no details.  Is there another page with additional details and/or instructions?

Hi, unfortunately you did not answer the question at the beginning about your hosting.

My apologies. I didn't see this.  I am on a dedicated server, so I have access to all files.

Now you may do an ajax-call to rename the files on the server.
Extract the filename and the extension by some stringfunctions (ExpressionScript) and run the ajax call in a question of type "short text" where you store the result of the call (the new name of the file)
Like this

I have a little experience with php and Java, but not much with AJAX.  Exactly where should this code go?

You see there is a php script called "renameFile.php" that you have to create (up to your needs)

My apologies, but this is a bit vague for me.  My needs are pretty specific, to include the actual images in the output.  What should go in this file?

As a temporary measure, I hacked part of the code in /application/helpers/admin/export/HtmlWriter.php as follows.  FULL DISCLAIMER: This is a terrible hack, and I am using this on a non-production site only for testing. I have extremely limited experience with the file structure and programming logic of limesurvey so I was just trying to see if I could access the files.  It works, but it leaves the images in a publicly available folder which is not good for security.  Please don't judge me on this code :-) /**
* Renders a question and recurses into subquestions.
* @param Question $question
* @param string $value
*/
protected function renderQuestion($question, $value, $header)
{
if (isset($value) && strlen($value) > 0) {
$this->openTag('tr', array(
'data-qid' => $question,
'class' => 'question'
));

$this->tag('td', $header);
$this->tag('td', $value);
if(substr($value,0,2) == "[{") {
$tempvalue = str_replace(""","",$value);

$tempvalue = str_replace("[{","",$tempvalue);
$tempvalue = str_replace("}];","",$tempvalue);
$filenamearray = array();
foreach(explode(',',$tempvalue) as $filenameitems) {
$filenameitem = explode(':',$filenameitems);
$filenamearray[$filenameitem[0]] = $filenameitem[1];
}
$original_filename = $filenamearray;
$new_filename = $filenamearray;
$new_url = "https://myserver/upload/surveys/surveynumber/files/temp/" . $new_filename;

$temp_directory = '/myserverpath/upload/surveys/surveynumber/files/temp/';
$main_directory = '/myserverpath/upload/surveys/surveynumber/files/';

$original_file = $main_directory . $original_filename;
$new_file = $temp_directory . $new_filename;

copy($original_file,$new_file);

echo "<img src=\"$new_url\" width=\"200\"><br>";



}
$this->closeTag();
}
}


Thank you again for all your help.
 



 
  • melisa.kurtt
  • melisa.kurtt's Avatar
28 Jan 2025 13:42
Hello,
I am using LimeSurvey Community v6.10.0 and PHP v8.1.31 on my own server.I have reinstalled LS with a new, empty PostgreSQL database on my Linux OS, but I am encountering an issue during the installation process. Every time I try to start my server, I receive the following error, and my website becomes unreachable as a result.I have checked the connection between my server and the database, and I am confident that the error is not due to connectivity issues. I have also tried deleting all tables in the database, despite them having no data. Strangely, the installation process still attempts to update the database even with no data present. Unfortunately, after the tables are recreated, I continue to experience the same errors.Could you help me understand why this might be happening?
CException: DataBase version are not found, seems LimeSurvey are not installed. in /var/www/html/application/commands/UpdateDbCommand.php:36
13Stack trace:
14#0 /var/www/html/vendor/yiisoft/yii/framework/console/CConsoleCommandRunner.php(71): UpdateDBCommand->run()
15#1 /var/www/html/vendor/yiisoft/yii/framework/console/CConsoleApplication.php(92): CConsoleCommandRunner->run()
16#2 /var/www/html/vendor/yiisoft/yii/framework/base/CApplication.php(185): CConsoleApplication->processRequest()
17#3 /var/www/html/application/commands/console.php(77): CApplication->run()
18#4 {main}
  • cheeseburger
  • cheeseburger's Avatar
27 Jan 2025 18:35
I will try to answer each point below (if I understood correctly): 

1. I am able to make the edits to any of the twig files within the question_type folder (for example, removing the ID of a question from being shown) by downloading them off of the server and then making a copy that I edit 

2. I uploaded the modified twig to a path such as this 

/efs/www/html/limesurvey/upload/themes/survey/MyCustomTheme/views/subviews/printanswers/question_types

and I have also uploaded them directly to a TMP folder where I am seeing other twig files that are part of the same file path structure such as 

/efs/www/html/limesurvey/tmp/assets/9f317068/views/subviews/printanswers/question_types/I_place_them_in_here

3. If I place them in the TMP folder manually, they do not get acknowledged

4. If I place them in the uploads folder they will cause an error and not display the questions using the question type twig I uploaded (even if it is just a copy with no edits to it at all)

5. If I set config's debug=1, then it stops using the TMP folder (cache) and it then uses my file in the upload directory AND IT WORKS PERFECTLY

I am just not sure how to get it to work when debug=0 and it wants to use the TMP directory. 

You are thinking that this is a bug of some sort and that I should post it in the bug tracker? 

Thanks!
 
  • cheeseburger
  • cheeseburger's Avatar
27 Jan 2025 17:00
I've tried several ways to clear or to force new cache related to the twig file. It just seems to not want to acknowledge twig files that are not editable and accessible within the LimeSurvey Theme Editor Control Panel.

So if I was to approach this from another angle, is there any known way to modify the twig files inside of /efs/www/html/limesurvey/themes/survey/vanilla/views/subviews/printanswers/question_types? 

Attaching a screen shot to remind us of the twigs that are inside of this folder. It is one per each type of question offered by LimeSurvey. 
  • moodleboy
  • moodleboy's Avatar
27 Jan 2025 16:03
Images shown in response export. was created by moodleboy
Hello,

I am using the LimeSurvey Community Edition Version 6.9.0+241218 and I have a question regarding exported responses.

We would like to use limesurvey to collect information regarding our campers and part of it requires submitting a few image files.  At the start of camp, we need to print all the records for legal compliance, and this requires the image to be printed as well.  Currently, when running an export, the images are not exported; only the filenames and other metadata are exported (see attached screenshot)

We have well over 300 campers, so the available process (which is to download the submitted files for each submission individually and then unzipping each file) is too cumbersome and impractical. Even the alternative option, which is to download all files, is even more impractical, since we would have to parse the submission numbers for over 1000 images to match with the 300 or so forms the campers' families submit.

I've searched the forums for a solution to this but I haven't found one.  There are a bunch of posts, but none seem to have a solution.  I have installed the "pdfReport" plugin, but it does not seem to do what I want it to do.  I believe it is for the person submitting the form to be able to print it for themselves.

Is there a way to accomplish this, so that the attached image files in a survey can be included, as images, in the resulting export? The export can either be in pdf or html format.

Thank you,
Paul
 
  • umrosa
  • umrosa's Avatar
27 Jan 2025 15:19
Replied by umrosa on topic Error: Extending a theme not working

You have the exact place of the warning no ?
You can upload the HTML file produced
 
I get the warning when I first try extending the theme "Fruity Twentythree" and then everytime I try opening the Theme Editor via Menu (Configuration > Advanced > Themes)

I have attached the html-File of the warning page (had to rename it to txt to be able to upload it) 

File Attachment:

File Name: PHP_warnin...heme.txt
File Size:29 KB
  • DenisChenu
  • DenisChenu's Avatar
27 Jan 2025 14:48
Replied by DenisChenu on topic Error: Extending a theme not working

Not sure what you mean by "debug mode", but I set debug=2 in config.php. this didn't add any information to the page with the PHP warning.

 
You have the exact place of the warning no ?
You can upload the HTML file produced
  • umrosa
  • umrosa's Avatar
27 Jan 2025 13:23
Replied by umrosa on topic Error: Extending a theme not working

Maybe :
1. Check if upload/themes/survey/mosafromfruity/ directory is created
2. Permission in this directory
 
1. yes, the directory is created
2. the owner of this directory is www-data and has read, write, execute permission

Uploading file work ?

Can you check with debug moxde before report the issue (you can put the HTML file with debug mode when report).

what do you mean with "uploading file"? what kind of file upload?

Not sure what you mean by "debug mode", but I set debug=2 in config.php. this didn't add any information to the page with the PHP warning.
since I don't have access to the php log file, I cannot tell you if there is any information in there.
  • DenisChenu
  • DenisChenu's Avatar
24 Jan 2025 16:00
Replied by DenisChenu on topic Error: Extending a theme not working
I try again on last version : no issue.

Maybe :
1. Check if upload/themes/survey/mosafromfruity/ directory is created
2. Permission in this directory

Uploading file work ?

Can you check with debug moxde before report the issue (you can put the HTML file with debug mode when report).
 
Displaying 76 - 90 out of 4957 results.

Lime-years ahead

Online-surveys for every purse and purpose