episphere / quest

experimenting with the idea of a questionnaire markup
https://episphere.github.io/quest/
2 stars 11 forks source link

Issue with previous results in rendered #383

Closed boyd-mj closed 2 years ago

boyd-mj commented 2 years ago

Hi @danielruss , we seem to be having an issue testing in the rendered using previous results. This is the section we're looking at:

[INTRONONCISWOM,displayif=and(or(equals(SEX,1),equals(SEX,2)),or(or(equals(GEN,0),equals(GEN,3)),or(equals(GEN,4),equals(GEN,55))))]Our next questions will ask you about your use of hormones.

[HORNONCISWOM?,displayif=and(or(equals(SEX,1),equals(SEX,2)),or(or(equals(GEN,0),equals(GEN,3)),or(equals(GEN,4),equals(GEN,55))))] Have you ever used hormones or other medications to make your body better reflect your gender (for example, estrogen or testosterone-blockers)?
(0) No
(1) Yes, I used hormones or other medications to make my body look more feminine in the past
(2) Yes, I am currently using hormones or other medications to make my body look more feminine
< -> SECTION3 >

It requires specifying both SEX and GEN. When done through the previous results, it's not working. If we cut and paste those questions into the markup box we don't have the issue. Could you see if something is going on with that feature? Thanks!

danielruss commented 2 years ago

@boyd-mj @naiyume I think I can re-create the bug. The module below works as expected.

[SEX]  What is your sex?

   (1) One
   (2) Two
   (3) Three

[GEN] What is your gender?
   (0)
   (1) One
   (2) Two
   (3) Three
  (4). Four
  (55)  Fifty-five

[HORNONCISWOM,displayif=and(or(equals(SEX,1),equals(SEX,2)),or(or(equals(GEN,0),equals(GEN,3)),or(equals(GEN,4),equals(GEN,55))))] Have you ever used hormones or other medications to make your body better reflect your gender (for example, estrogen or testosterone-blockers)?
(0) No
(1) Yes, I used hormones or other medications to make my body look more feminine in the past
(2) Yes, I am currently using hormones or other medications to make my body look more feminine

[Q2] Q2….

SEX:  {$SEX} 
GEN: {$GEN}

[END]. That's alll

However, when you test the following module with previous results it fails. input:

{
  "SEX":1,
  "GEN":0
}
[Q1] Q1….  

SEX:  {$SEX} 
GEN: {$GEN}

[HORNONCISWOM,displayif=and(or(equals(SEX,1),equals(SEX,2)),or(or(equals(GEN,0),equals(GEN,3)),or(equals(GEN,4),equals(GEN,55))))] Have you ever used hormones or other medications to make your body better reflect your gender (for example, estrogen or testosterone-blockers)?
(0) No
(1) Yes, I used hormones or other medications to make my body look more feminine in the past
(2) Yes, I am currently using hormones or other medications to make my body look more feminine

[Q2] Q2….

[END]. That's alll

It turns out that if you change the input data to

{
  "SEX":1,
  "GEN":3
}

It works. The issues is that the GEN:0 is returning False when GEN==0. @naiyume Do you agree?

danielruss commented 2 years ago

Ok... Fixed..

guinevere83 commented 2 years ago

I'm still seeing issues using previous results in module 2. The expected intro doesn't display when using these combinations of results:

SEX = 2, GEN = 0 - NOT DISPLAYED SEX = 2, GEN = 3 - NOT DISPLAYED SEX = 2, GEN = 4 - WENT TO WH SEX = 2, GEN = 55 - NOT DISPLAYED

Combinations with SEX = 1 seem to work and adding the questions from module 1 into the markup also work.

danielruss commented 2 years ago

For the intro: it is coded to only show if if SEX==2 AND SEX2==5 or 6

|displayif=or(equals(SEX,0),and(equals(SEX,2),or(equals(SEX2,5),equals(SEX2,6))))|