Welcome to the LimeSurvey Community Forum

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

HH:MM

  • brais24
  • brais24's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
3 years 7 months ago #222122 by brais24
HH:MM was created by brais24
Hi People, I have on the survey attached a question type array text, the question is P3P2 from the 3rd bloque of questions, and I want to set the column "hora de llegada real" format type to HH:MM (hours and minutes) I try with this ecuation validation question for the 2 first rows;

(is_empty(P3P2_SQ001_SQ004) or regexMatch('/^$|^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/',P3P2_SQ001_SQ004)) or
 (is_empty(P3P2_SQ002_SQ004) or regexMatch('/^$|^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/',P3P2_SQ002_SQ004))

With this on the help of validation question:

 {if((is_empty(P3P2_SQ001_SQ004) or regexMatch('/^$|^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/', P3P2_SQ001_SQ004)), '', 'Por favor, introduzca la hora en un formato válido (HH:MM).<br />')}
{if((is_empty(P3P2_SQ002_SQ004) or regexMatch('/^$|^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/', P3P2_SQ002_SQ004)), '', 'Por favor, introduzca la hora en un formato válido (HH:MM).<br />')}

and looks like works, but with this force me to put a value, i want to put the values with HH:MM format, but also let the cell empty, and I dont know why dont work when the regex command is correct.

Can someone help me please? My LS version is 3.25

Thanks for the help.

 

File Attachment:

File Name: limesurvey...2634.lss
File Size:331 KB
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 7 months ago #222132 by Joffm
Replied by Joffm on topic HH:MM
Hi,
please do not send a lss export of 330kB and nearly 70 questions.
At the start nearly all questions refer to a TOKEN:ATTRIBUTE which obviously throws an error.
And your question P3P2 does not contain a question validation.

We always ask for a lss export of the relevant question(s).
Therefore copy the survey remove everything that is not related to your issue and send the lss export of this survey.
Or create a new survey with just this question (without conditions and referrals to other previous questions).

Because when I only take this question without the ATTRIBUTES and the relevance equation I do not see an issue.

Joffm
 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The following user(s) said Thank You: DenisChenu
The topic has been locked.
  • brais24
  • brais24's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
3 years 7 months ago #222156 by brais24
Replied by brais24 on topic HH:MM
Ok, I send another limited Lss, the thing is between the P2 and P3, ignore the other 3 questions.

P3 is filtered by P2, and on P2 on the "Tiempo espera Web" column I want to let the people put a values with HH:MM value format or empty, I have now o P3 this

Ecuation validation question
(is_empty(P3_SQ001_SQ002) or regexMatch('/^$|^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/',P3_SQ001_SQ002)) or (is_empty(P3_SQ002_SQ002) or regexMatch('/^$|^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/',P3_SQ002_SQ002))

Help validation question
{if((is_empty(P3_SQ001_SQ002) or regexMatch('/^$|^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/', P3_SQ001_SQ002)), '', 'Por favor, introduzca la hora en un formato válido (HH:MM).<br />')}
{if((is_empty(P3_SQ002_SQ002) or regexMatch('/^$|^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/', P3_SQ002_SQ002)), '', 'Por favor, introduzca la hora en un formato válido (HH:MM).<br />')}

and its on the lss, i hope you can help me.

The problem is if the row of P3 is not showed, Limesurvey dont let me continue, force me to show the row to continue with an empty value.

For example, if I show all rows, I can continue with an empty value on that cells, but if 1 of them dont appear, Limesurvey dont let me continue.

Thanks for all.
 

File Attachment:

File Name: limesurvey...9374.lss
File Size:26 KB
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 7 months ago #222163 by Joffm
Replied by Joffm on topic HH:MM
Hi,
if a row is not displayed the value is not defined.
Therefore your equation fails.

You have to use ".NAOK"
[url] www.limesurvey.org/manual/ExpressionScri...ion/en#Usage_of_NAOK [/url]

Joffm

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • brais24
  • brais24's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
3 years 7 months ago #222164 by brais24
Replied by brais24 on topic HH:MM
I attach some images of the problem.

On this as you can see, I can continue the survey, the icon appears in purple

 

But on this, if the second row is not displayed, Limesurvey say that I have an error filling the response, I think this can be an error on regex sentence, but i dont know how can I do it.

 

Thanks for the help
The topic has been locked.
  • brais24
  • brais24's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
3 years 7 months ago #222165 by brais24
Replied by brais24 on topic HH:MM
I just notice right now, can be because I have to put .NAOK on each P3_SQ001_SQ002?
The topic has been locked.
  • brais24
  • brais24's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
3 years 7 months ago #222169 by brais24
Replied by brais24 on topic HH:MM
Using this on ecuation validation question

(is_empty(P3_SQ001_SQ002.NAOK) or regexMatch('/^$|^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/',P3_SQ001_SQ002.NAOK)) or
(is_empty(P3_SQ002_SQ002.NAOK) or regexMatch('/^$|^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/',P3_SQ002_SQ002.NAOK))

And this on help validation question

{if((is_empty(P3_SQ001_SQ002.NAOK) or regexMatch('/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/', P3_SQ001_SQ002.NAOK)), '', 'Por favor, introduzca la hora en un formato válido (HH:MM).<br />')}
{if((is_empty(P3_SQ002_SQ002.NAOK) or regexMatch('/^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/', P3_SQ002_SQ002.NAOK)), '', 'Por favor, introduzca la hora en un formato válido (HH:MM).<br />')}

Limesurvey mark all as good, Where do I have to put the NAOK, if that is the problem?

Thanks
The topic has been locked.
  • brais24
  • brais24's Avatar Topic Author
  • Offline
  • Elite Member
  • Elite Member
More
3 years 7 months ago #222172 by brais24
Replied by brais24 on topic HH:MM
I think Ive got it, the problem is the OR, I make tests and let you know.

Thanks.
The topic has been locked.
  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • LimeSurvey Community Team & Official Partner
  • LimeSurvey Community Team & Official Partner
More
3 years 7 months ago #222182 by DenisChenu
Replied by DenisChenu on topic HH:MM
About the little icon without text : it's a know issue.

I don't know if it was fixed in last version ?

In skelvanilla i fix it like this
gitlab.com/SondagesPro/SurveyThemes/skel...s/skelvanilla.js#L80
Code:
        $(".em_sq_fn_validation, .em_q_fn_validation").on("html:updated", function() {
            if($.trim($(this).text())) {
                $(this).removeClass("hidden");
            } else {
                $(this).addClass("hidden");
            }
        });

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member. - Professional support - Plugins, theme and development .
I don't answer to private message.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 7 months ago #222189 by Joffm
Replied by Joffm on topic HH:MM
Of course, it is the "OR".
If one of the parts is TRUE the whole equation is TRUE.
I admit it is really difficult to find an equation that covers all your options (row not displayed, field empty, regex)

But did you consider to insert a timepicker?

And: Your validation tip is not row dependend.
You do not say, "Por favor, introduzca la hora en un formato válido (HH:MM)  en línea xxx"
So it should be sufficient to enter
"Por favor, introduzca la hora en un formato válido (HH:MM)"
Nothing else.

You see the hint in green as long the condition is TRUE.
 

If there is an error it changes to red.
 

And this way you avoid this single character.

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Away
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
3 years 7 months ago - 3 years 7 months ago #222191 by Joffm
Replied by Joffm on topic HH:MM

Of course, it is the "OR".

It has to be "AND"
In each row these conditions (either "empty" or "regex") have to be fulfilled.
(is_empty(P3_SQ001_SQ002.NAOK) or regexMatch('/^$|^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/',P3_SQ001_SQ002.NAOK)) AND
(is_empty(P3_SQ002_SQ002.NAOK) or regexMatch('/^$|^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/',P3_SQ002_SQ002.NAOK)) AND
(is_empty(P3_SQ003_SQ002.NAOK) or regexMatch('/^$|^(0[0-9]|1[0-9]|2[0-3]):[0-5][0-9]$/',P3_SQ003_SQ002.NAOK)) AND

....

Volunteers are not paid.
Not because they are worthless, but because they are priceless
Last edit: 3 years 7 months ago by Joffm.
The following user(s) said Thank You: LISHANGQI
The topic has been locked.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose