View Issue Details

This bug affects 1 person(s).
 8
IDProjectCategoryView StatusLast Update
20114Bug reportsExpression Managerpublic2025-07-03 16:07
ReporterMazi Assigned Toadamzammit  
PrioritynoneSeverityblock 
Status assignedResolutionopen 
Product Version6.6.x 
Summary20114: queXML export doesn't replace EM placeholders
Description

When enabling the "Print answers" feature at a survey, there is a "Export to queXML PDF" button shown. When exporting the given data set to queXML, EM placeholders do not get replaced and the export looks weird - actually you can not really use it, see attached screenshot.

Steps To Reproduce

Steps to reproduce

Import and activate the attached survey.
Run the survey.
Click "Print answers" link at the thank you page.
Use queXML PDF export.

Expected result

Replace EM placeholders for given data set.

Actual result

Unreadable EM syntax is still shown

TagsNo tags attached.
Attached Files
image.png (42,910 bytes)   
image.png (42,910 bytes)   
limesurvey_survey_654535.lss (1,410,168 bytes)
Bug heat8
Complete LimeSurvey version number (& build)6.13.3
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMariaDB 10.1.48
Server OS (if known)
Webserver software & version (if known)
PHP Version8.2

Relationships

related to 20139 ready for testingtibor.pacalat Export as QueXML with debug 2 and 8.3.22 : throw error 

Users monitoring this issue

There are no users monitoring this issue.

Activities

Mazi

Mazi

2025-05-20 10:36

updater   ~82713

@adamzammit, not sure if you usually deal with such queXML stuff?!

adamzammit

adamzammit

2025-05-21 04:16

developer   ~82727

thanks @Mazi. Yes queXML is my area.

If the user wants the queXML PDF export at the "print answers" functionality just for seeing their web responses on a form, it does make sense to execute/replace all the EM code.

But if the user is using it to produce a semi-filled form to later use queXF to process the paper form, then processing the EM will likely break the form's compatibility with queXF as the variable nature will change the layout of the pages.

I'm happy to make a change to execute the EM code, but my preference would be for it to be a configuration option that isn't the default. Would that suit you?

Adam

Mazi

Mazi

2025-05-21 10:01

updater   ~82728

@adamzammit, I fully agree. This adjustment only makes sense for writing a single data set as PDF. We should be able to differentiate this from the other use cases so it would be great if you could look into this.

Mazi

Mazi

2025-06-11 12:15

updater   ~82863

@adamzammit, is there any news regarding a fix for this issue? The user is asking because they want to run a large study at the end of the month.

adamzammit

adamzammit

2025-06-12 05:19

developer   ~82866

thanks for checking in @Mazi.

I've run into a bit of a roadblock. Processing EM for a response currently relies on the survey session being set.

I can get it to process the EM for things like this {rand(0,100)} but for prefills response data I'm not sure if this can be done without messing around with session data

Mazi

Mazi

2025-06-12 09:29

updater   ~82867

@adamzammit, I think there is no other way then generating the session data for the given data set ID. But maybe @DenisChenu has some ideas on how to deal with this?

DenisChenu

DenisChenu

2025-06-12 11:13

developer   ~82868

Last edited: 2025-06-12 11:13

I've run into a bit of a roadblock. Processing EM for a response currently relies on the survey session being set.

It's the case when you came for Print answers after survey done. Maybe check if session is set, if yes : use Expresssion manager.
If not : do not use it.

https://github.com/LimeSurvey/LimeSurvey/blob/edc725d17768264e547d17c4ddd32c9306e37d67/application/controllers/PrintanswersController.php#L51

I think there is no other way then generating the session data for the given data set ID. But maybe @DenisChenu has some ideas on how to deal with this?

https://gitlab.com/SondagesPro/RemoteControl/RemoteManageResponse/-/blob/main/RemoteControlHandler.php?ref_type=heads#L193
and the older one
https://gitlab.com/SondagesPro/coreAndTools/reloadAnyResponse/-/blob/master/reloadResponse.php?ref_type=heads#L55

adamzammit

adamzammit

2025-06-18 07:00

developer   ~82893

hi @Mazi can you give this change a test and see what you think.

https://github.com/LimeSurvey/LimeSurvey/compare/master...adamzammit:LimeSurvey:fix-20114

adamzammit

adamzammit

2025-06-19 07:58

developer   ~82907

@DenisChenu - please reset the queXMLPDF export settings to default. This is unusual and I do not think it is related to this bug.

DenisChenu

DenisChenu

2025-06-19 08:58

developer   ~82908

@adamzammit : where i reset it ?

adamzammit

adamzammit

2025-06-24 05:07

developer   ~82935

Hi @DenisChenu: please go to the main export menu, choose queXML PDF export, then at the bottom of that page press the red "Reset Now" button.

DenisChenu

DenisChenu

2025-06-24 08:20

developer   ~82937

@adamzammit via discord :(

Mazi

Mazi

2025-06-30 10:24

updater   ~83012

@DenisChenu, have you been able to test the fix?

Mazi

Mazi

2025-07-03 15:24

updater   ~83017

@adamzammit, we replaced the two edited files at a 6.13 version but at our initial testing the placeholders have NOT been replaced. We may have done something wrong though... any hints on what else we should consider?
Which survey and LS version should we best test with?

DenisChenu

DenisChenu

2025-07-03 15:46

developer   ~83018

  1. It work only for question : maybe add it for subquestions and answers (see survey attached)

But : the worst part : a big issue

  1. Do the survey and enter "current" in question
  2. Print as QueXML : OK
  3. Go to browse response
  4. Click on 1st tool line, export as QueXML

Wait : Not update text OR updated with 1st response
Have : text updated by last response.

My opinion LimeExpressionManager::ProcessStepString must be done only for particpânt print, not for admin print.

Maybe create a Feature Request to have a integrated way to start a survey by LimeSurvey core API after and use it here.

589315-4-queXML.pdf (4,507,712 bytes)
Mazi

Mazi

2025-07-03 15:53

updater   ~83019

@DenisChenu, "add it for subquestions and answers" is exactly what we were missing. At our example, sub-questions were using placeholders as can be seen at the screenshot we had added. So this still doesn't work.

bismark

bismark

2025-07-03 16:00

reporter   ~83020

Here is a minimum survey that shows the problem in concrete terms. It takes me almost 2 minutes to generate the PDF. I have applied Adam's commit as a patch, but I get the same result as before

https://github.com/LimeSurvey/LimeSurvey/commit/f2d90f065573a6141ed81d509d328541e1e20fbf.patch

237912-1-queXML-2.pdf (5,182,860 bytes)
DenisChenu

DenisChenu

2025-07-03 16:07

developer   ~83021

The lsa i upload is a 3 question for demonstration .

With replacement on question, subquestion and answer text

Issue History

Date Modified Username Field Change
2025-05-20 10:35 Mazi New Issue
2025-05-20 10:35 Mazi File Added: image.png
2025-05-20 10:35 Mazi File Added: limesurvey_survey_654535.lss
2025-05-20 10:36 Mazi Note Added: 82713
2025-05-20 10:36 Mazi Bug heat 6 => 8
2025-05-21 04:16 adamzammit Note Added: 82727
2025-05-21 04:16 adamzammit Bug heat 8 => 10
2025-05-21 10:01 Mazi Note Added: 82728
2025-05-28 10:05 tibor.pacalat Assigned To => adamzammit
2025-05-28 10:05 tibor.pacalat Status new => assigned
2025-06-11 12:15 Mazi Note Added: 82863
2025-06-12 05:19 adamzammit Note Added: 82866
2025-06-12 09:29 Mazi Note Added: 82867
2025-06-12 11:13 DenisChenu Note Added: 82868
2025-06-12 11:13 DenisChenu Bug heat 10 => 12
2025-06-12 11:13 DenisChenu Note Edited: 82868
2025-06-13 09:47 Mazi View Status private => public
2025-06-13 09:47 Mazi Bug heat 12 => 6
2025-06-18 07:00 adamzammit Note Added: 82893
2025-06-18 10:10 DenisChenu Relationship added related to 20139
2025-06-19 07:58 adamzammit Note Added: 82907
2025-06-19 08:58 DenisChenu Note Added: 82908
2025-06-24 05:07 adamzammit Note Added: 82935
2025-06-24 08:20 DenisChenu Note Added: 82937
2025-06-30 10:24 Mazi Note Added: 83012
2025-07-03 15:24 Mazi Note Added: 83017
2025-07-03 15:46 DenisChenu Note Added: 83018
2025-07-03 15:46 DenisChenu File Added: 589315-4-queXML.pdf
2025-07-03 15:46 DenisChenu File Added: survey_archive_589315.lsa
2025-07-03 15:53 Mazi Note Added: 83019
2025-07-03 16:00 bismark Note Added: 83020
2025-07-03 16:00 bismark File Added: survey_archive_237912.lsa
2025-07-03 16:00 bismark File Added: 237912-1-queXML-2.pdf
2025-07-03 16:00 bismark Bug heat 6 => 8
2025-07-03 16:07 DenisChenu Note Added: 83021