Welcome to the LimeSurvey Community Forum

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

Red MArking when wrong answer after validation

More
9 years 4 months ago #134721 by max12
Hi there,

I want subjects in an experiment to work on a right answer for a question. The correct answer is validated. The problem is now that subjects could start guessing, since if they type in the wrong answer, the field turns red, even before they hit the continue button. They simply need to type in different answers until the field does not run red. I would like to prevent the field from turning red if the answer is not the validated one. Is there a way to do that? This would force subjects to hit “continue” if they want to find out, whether their solution is in fact correct. I have a small follow up question: Is it possible to build in a time delay? So if subjects have typed in a wrong solution they stay on the same page (because their solution is not the validated one), but they cannot immediately type in a new answer, but have to wait something like ten seconds? Many thanks for your help!
The topic has been locked.
More
9 years 4 months ago #134727 by DenisChenu
It's in template. Depend of your template, search for .error part in template.css, first try to remove it.

Best is to use a html dev helper (firebug for example).

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.
More
9 years 4 months ago #134733 by max12
Thank you so much! So I looked in the template list (I have version 2.00). I find some called blueendgrey, citronade for example. When I open the template list, default is marked. Only the template "experiments" allows me to actually search for template.css. Is this normal? When I search in CSS I find this:

.warning {
display:block;
}
.error,.errormandatory,.warningjs {
color: red;
}
.errormandatory,.warningjs {
font-size: 12px;
font-weight: 700;
}

Is this correct? Would I delete everything of it and then save?

Many thanks, Max
The topic has been locked.
More
9 years 4 months ago #134736 by tpartner

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
9 years 4 months ago #134743 by max12
I can delete it. I can copy the Default template and delete the section in the copied template. Now I guess I have to tell the survey , which si already programmed to us the new altered default template?
The topic has been locked.
More
9 years 4 months ago #134778 by tpartner

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
9 years 4 months ago #134781 by max12
May be the problem is too simple. However, I find in the manual how I can produce a new template, but not how I could actually use that template for an existing survey. I created a new template, supposedly deleted the red error feedback, but cannot use the new template.
The topic has been locked.
More
9 years 4 months ago - 9 years 4 months ago #134816 by tpartner
Assuming you have the correct permissions - Survey properties --> General settings --> Presentation & navigation.


Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
Last edit: 9 years 4 months ago by tpartner.
The topic has been locked.
More
9 years 4 months ago #134837 by max12
Ok perfect :)! I found it and can now switch the template to the one I customized.

I deleted the error warnings I posted above in the template.CSS. But I still get the red warning, if I enter a wrong answer. I also found this section and deleted it.

/* Tips / Validation Messages */
/* If the question is invalid, but has not been submitted, give it a pleasant warning color */
div.em_num_answers.good {
color: green;
}

/* If it is still invalid after submit, flag it in red */
.input-error div.error {
color: red;
display: block;
}


However, I still get the red underlining if a wrong answer is tryped in. Any ideas?
The topic has been locked.
More
9 years 4 months ago #134839 by tpartner
You will need to use a developer tool like Firebug for Firefox to see what styles are affecting the element.

Cheers,
Tony Partner

Solutions, code and workarounds presented in these forums are given without any warranty, implied or otherwise.
The topic has been locked.
More
9 years 4 months ago #134879 by max12
Hey, I used firebug now. I opened up the page I want to change in the browser and identified the two elements that affect the item. Here s one of them:
Once I delete the two items with Firebugs on the particular page, the the red warning is not shown if I enter a wrong input.
So I deleted the two items in the customized template and told limesurvey to us the customized template. However, the red warning again shows up. Whn I look in the cusomized template the two items are indeed deleted.
The topic has been locked.
More
9 years 4 months ago #134881 by max12
I have it! It seems you nede to copy the template, then make all changes and only then let the survey use the newly created template. It sems you cannot make the changes when the survey is already using the template. In that case the changes do not appear in the survey. Many thanks for your help!

Do you also have an idea fr the second question? How could I delay the appearance of the answer field by a few seconds, when a subjects typed in a wrong answer? I want to prevent guessing. so if the waiting period is long enough guessing the anser is not worthwhile.
The topic has been locked.
More
9 years 4 months ago #134958 by max12
Here is the section of the template.css that needs to be deleted:

input.em_sq_validation.error, textarea.em_sq_validation.error {
color: black;
background-color: pink;
}
The topic has been locked.
More
9 years 4 months ago #135032 by max12
Now a follow up problem occurs: If the participant types in the wrong answer a helping note appears stating that the subject should rethink the format of her input. This hint appears even before the subjects has pressed continue. So I need to delete it. With Firebug I find the following section to cause the hint:

<div class="em_regex_validation error" id="vmsg_3295_regex_validation">Bitte überprüfen Sie das Format Ihrer Antwort.</div>

However, I did not find the section in the template.css and therefore cannot delete it. Any idea where I could find the section to delete it? Many thanks!
The topic has been locked.
More
9 years 4 months ago #135086 by DenisChenu
Hi,

input-error is the class added to the question when trye to submit an invalid part.

If you want to hide a "helper" before submitting and show it only after error : try this;
- Set question help to hidden
- Put this in your template
Code:
.hide-tip .error {display: none;}
.input-error .hide-tip .error {display: block;}
/* with or witout hide tipe */
div.em_regex_validation.error{display: none;}
.input-error div.em_regex_validation.error{display: none;}

ANd maybe is time to look at css manual and system : www.w3.org/Style/CSS/ .

Denis

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.
Moderators: tpartnerholch

Lime-years ahead

Online-surveys for every purse and purpose