View Issue Details

This bug affects 1 person(s).
 6
IDProjectCategoryView StatusLast Update
16230Bug reportsExpression Managerpublic2021-10-06 12:03
ReporterDenisChenu Assigned ToDenisChenu  
PrioritynoneSeverityminor 
Status assignedResolutionopen 
Product Version4.2.2 
Summary16230: Reload survey (token answer persistence) don't really reload …
DescriptionWhen using Equation to set question (if empty) : https://manual.limesurvey.org/Expression_Manager#Using_Assignment_Operator
This work when we are inside survey, but when reload survey (with token answer persistence) : data is resetted
Steps To ReproduceImport included survey,
Test a token link with newtest
Entre something other than 'prefilled'
Move next save
Quit browser
Open bronser and test again

See screencast
Additional Information2.6lts and 3.22 have the same issue.

Then : muts not "fix" for 4, but must document it ?
TagsNo tags attached.
Bug heat6
Complete LimeSurvey version number (& build)4.2.2 github
I will donate to the project if issue is resolvedNo
Browsernot relevant ?
Database type & versionnot relevant
Server OS (if known)not relevant
Webserver software & version (if known)not relevant
PHP Version7

Users monitoring this issue

User List There are no users monitoring this issue.

Activities

DenisChenu

DenisChenu

2020-05-05 17:06

developer  

Peek 05-05-2020 17-05.gif (357,662 bytes)
DenisChenu

DenisChenu

2020-06-29 13:21

developer   ~58540

Related to relevanceStatus : …
DenisChenu

DenisChenu

2021-06-23 08:52

developer   ~65002

Last edited: 2021-07-08 12:18

Partial fix (muts be improved)

- https://gitlab.com/SondagesPro/coreAndTools/reloadAnyResponse/-/commit/c7e59524e4398f940ba829de9b418ef4d965873f
- https://gitlab.com/SondagesPro/coreAndTools/reloadAnyResponse/-/commit/966794b13e3c50cb2822f43e25becaacf8b559d9

Then maybe a better solution are :

- create a maxpage column in database : have lastpage + maxpage
- when reload : LimeExpressionManager::JumpTo($maxpage, false, false, true); + LimeExpressionManager::JumpTo($lastpage, false, false, true);
galads

galads

2021-07-08 12:13

administrator   ~65259

Last edited: 2021-07-08 12:18

@DenisChenu will you like to create a pull request with the partial fix? I will create a task for the better solution you have mentioned and it will be picked up at a later stage
DenisChenu

DenisChenu

2021-07-19 09:29

developer   ~65505

By Partial fix : it's usage of the whole plugin … and clearly : this one is here for a lot of other things ;)
gabrieljenik

gabrieljenik

2021-09-20 15:05

manager   ~66528

We have been reviewing this and trying to reproduce it.
We could :)

### Here are some thoughts.

1) The response is completeley loaded from the database, that is, it is loaded with the data that had been previously completed.

2) When you advance to the first page (the one with the formula with the assignment) the expression is processed, which in this case is: DataSet = if (is_empty (DataSet.NAOK), 'prefilled', DataSet.NAOK)

DataSet.NAOK only returns the value it raised from the database if DataSet.relevanceStatus == true.

At that moment, relevanceStatus for DataSet is false, because that question has not been processed yet, so its relevanceStatus cannot be known.

When starting a survey and uploading the questions, it is very difficult to know the relevance status it had at the end of the previous upload since those are calculated on the fly. That makes .NAOK accessors to return always empty.

3) If the assignment is done on the same page it works, as relevanceStatus becomes true.

### Suggested actions:

- Generate new attribute ".raw" to use on EM. No dependance on relevance status.

- If the assignment needs to use .NAOK (or similar), and that requires relevanceStatus to be already calculated, does the assignment really works for setting default values?

So far, I believe it does only if equation is set on the same page as in the question to be defaulted (and view mode is not question by question). So, either
a) I believe we should remove the "forward-assignment" part from the manual (set default value) or
b) Ammend the manual to reflect so.
DenisChenu

DenisChenu

2021-09-20 15:28

developer   ~66531

> a) I believe we should remove the "forward-assignment" part from the manual (set default value) or

? I really don't see how some existing survey can not work without …

Again : We already have a lot of issue with maxtstep !== real max step

Why not
- create a maxpage column in database : have lastpage + maxpage
- when reload : LimeExpressionManager::JumpTo($maxpage, false, false, true); + LimeExpressionManager::JumpTo($lastpage, false, false, true);
gabrieljenik

gabrieljenik

2021-09-20 23:50

manager   ~66547

Last edited: 2021-09-20 23:51

View 2 revisions

> Why not
> - create a maxpage column in database : have lastpage + maxpage
> - when reload : LimeExpressionManager::JumpTo($maxpage, false, false, true); + LimeExpressionManager::JumpTo($lastpage, false, false, true);

I feel more comfortable adding .raw then updating the rendering process.
Still, I understand your point.

Just thkinking outloud, wouldn't it be just enough with:
LimeExpressionManager::JumpTo($lastpage, false, false, true); two times?
First one will be usefull for setting relevance.
Second one will be usefull for overwritting any values miss set on first pass.
DenisChenu

DenisChenu

2021-09-21 08:30

developer   ~66549

> LimeExpressionManager::JumpTo($lastpage, false, false, true); two times?

No the point is : when reloading you are never sure lastpage in response table are the max page.

Then you need to save :
- lastpage : the current page seen
- maxpage : the max page seen

And you need to move to the maxpage before move to lastpage

See :
1. https://gitlab.com/SondagesPro/coreAndTools/reloadAnyResponse/-/blob/master/reloadResponse.php#L69-75
2. https://gitlab.com/SondagesPro/coreAndTools/reloadAnyResponse/-/blob/master/reloadResponse.php#L164-167

It's really used like this and it work.
I try to use a response DB column : but it break

I stop here : i already have the solution, i already answer multiple time on the how to fix the issue.
If someone have this issue : he can contact me for an offer. I'm really tired on the way it work now.
gabrieljenik

gabrieljenik

2021-09-21 14:38

manager   ~66572

> And you need to move to the maxpage before move to lastpage
You are right.

Still, that's like a great update.

ping @c_schmitz @ollehar for comments.
DenisChenu

DenisChenu

2021-10-06 08:12

developer   ~66761

Want to discuss on zoho but https://projects.limesurvey.org/portal/limesurvey#taskdetail/85781000000271009/85781000001007039/85781000001035097 seems deleted.
galads

galads

2021-10-06 11:50

administrator   ~66765

@DenisChenu it is not deleted. I added you to task owner and you should be able to comment now.
DenisChenu

DenisChenu

2021-10-06 12:03

developer   ~66768

OK thanks :)
Seems zoho don't show the good error … … a 403 is really better.

Issue History

Date Modified Username Field Change
2020-05-05 17:06 DenisChenu New Issue
2020-05-05 17:06 DenisChenu File Added: survey_archive_reloadAndSetIfEmpty.lsa
2020-05-05 17:06 DenisChenu File Added: Peek 05-05-2020 17-05.gif
2020-06-29 13:21 DenisChenu Note Added: 58540
2021-06-23 08:52 DenisChenu Note Added: 65002
2021-07-05 10:29 galads Assigned To => galads
2021-07-05 10:29 galads Status new => testing
2021-07-08 12:13 galads Note Added: 65259
2021-07-08 12:14 galads Assigned To galads => DenisChenu
2021-07-08 12:14 galads Status testing => assigned
2021-07-08 12:18 galads Sync to Zoho Project => |Yes|
2021-07-19 08:59 galads Assigned To DenisChenu => galads
2021-07-19 08:59 galads Status assigned => confirmed
2021-07-19 09:29 DenisChenu Note Added: 65505
2021-09-10 09:08 galads Assigned To galads => gabrieljenik
2021-09-10 09:08 galads Status confirmed => assigned
2021-09-20 15:05 gabrieljenik Note Added: 66528
2021-09-20 15:05 gabrieljenik Bug heat 4 => 6
2021-09-20 15:28 DenisChenu Note Added: 66531
2021-09-20 23:50 gabrieljenik Note Added: 66547
2021-09-20 23:51 gabrieljenik Note Edited: 66547 View Revisions
2021-09-21 08:30 DenisChenu Note Added: 66549
2021-09-21 14:38 gabrieljenik Note Added: 66572
2021-09-27 08:45 c_schmitz Assigned To gabrieljenik => DenisChenu
2021-10-06 08:12 DenisChenu Note Added: 66761
2021-10-06 11:50 galads Note Added: 66765
2021-10-06 12:03 DenisChenu Note Added: 66768