Enable opt-out for single choice questions (dropdown) server validation

Plus d'informations
il y a 2 mois 2 semaines #184066 par mpac_limes
For single choice questions (dropdown), there is a new server-side validation that only accepts as valid what it was initially defined as an answer. That makes impossible to dynamically (via javascript) generate content for select controls. This has been really unconvenient for me.

Was it intentional and there is a strong reason to do so? Could it be possible to enable an opt-out control for this question type validation? That would be great, even if the validation is set to true by default. This way you could have the best of two worlds.

Thanks

Connexion ou Créer un compte pour participer à la conversation.

LimeSurvey Partners
Plus d'informations
il y a 2 mois 2 semaines #184074 par DenisChenu

mpac_limes écrit: Was it intentional and there is a strong reason to do so?

Because if we don't filter : paerticpant can enter anything, and it's a really bad system … there still some effort to do (for example for array filter in choice).

mpac_limes écrit: Could it be possible to enable an opt-out control for this question type validation?

Not currently, but : you can ask for a new feature and make a pull request with updated code.

Else : you add the option before question view or after (user can enter anything) ?

If before question view : add the new answer code in manual.limesurvey.org/BeforeQuestionRender event
If after : 2 solution,
1. Add new answer code in a ajax event
2. Add a new answer code in manual.limesurvey.org/BeforeSurveyPage event (check POST value, if you're OK with POST value and need a new answer : create it) : this allow you to validate this value too.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 2 mois 1 semaine #184087 par mpac_limes

DenisChenu écrit:

mpac_limes écrit: Was it intentional and there is a strong reason to do so?

Because if we don't filter : paerticpant can enter anything, and it's a really bad system … there still some effort to do (for example for array filter in choice).

Well, in a text question, users can equally enter anything, and nothing bad happens. I imagine that answer codes not matching may be a concern, but I don't think my use case is so wild to fully disallow it without an alternative. Maybe questions marked as "not validated" could be treated like a free text value after the survey is submitted.

mpac_limes écrit: Could it be possible to enable an opt-out control for this question type validation?

Not currently, but : you can ask for a new feature and make a pull request with updated code.

Else : you add the option before question view or after (user can enter anything) ?

If before question view : add the new answer code in manual.limesurvey.org/BeforeQuestionRender event
If after : 2 solution,
1. Add new answer code in a ajax event
2. Add a new answer code in manual.limesurvey.org/BeforeSurveyPage event (check POST value, if you're OK with POST value and need a new answer : create it) : this allow you to validate this value too.


Javascript adds them after question view. Furthermore, it is something like a set cascading combos, so it is very dynamic. The options are loaded from an external source, so limesurvey will never be able to determine beforehand the set of correct answers.

So if I've understood well, my only options could be:

1) before the section submit, launch an ajax call that inserts the option as a valid answer option in answers table in the limesurvey BD

2) to make a plugin that would do the same than 1 but in the php

Nothing you would like to carry on your surveys :(

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 2 mois 1 semaine #184092 par DenisChenu
Then : why not use a text input ?

For example : www.devbridge.com/sourcery/components/jquery-autocomplete/ us a text input not a dropdown.

And <input type="search"> is shown as a text, not as a dropdown. And search is clearly near an autocomplete system.

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 2 mois 1 semaine #184155 par mpac_limes
I would rather give the users a dropdown. Having a look at selectable options may be of aid. Besides, if the question is open to type in whatever users want, we can get low quality input. If finally I use a text field I suppose that allowing only the generated answer options is doable with jquery autocomplete but it would need to be worked on.

Also, what happens with the IDs? I want to display question options as text but store the IDs in that field, not displaying selected ID at any time. If jQuery autocomplete supports it (I think it should and probably it does) that would be another custom configuration.

I agree that somehow you could get it working but the point is that something that former limesurvey versions allowed to do in a breeze, now needs a complex workaround.

I just expected newer versions to be easier to use than older ones, not the other way round. Sorry for my nitpicking, I guess LS developers have to make choices like that sometimes.

Thanks Denis

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 2 mois 1 semaine #184157 par DenisChenu

mpac_limes écrit: I agree that somehow you could get it working but the point is that something that former limesurvey versions allowed to do in a breeze, now needs a complex workaround.

And former version allow public user to broke DB … don't find way to compromise DB, but …

Else : did you post a feature request ?
Else : i don't understand : you want to show a real dropdown but allowing adding element via js ? Then it can‘t be a realdropdown …
Else : all can be possible : even use devbridgeAutocomplete with fixed value and send only code (id of answer)

Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .
Les utilisateur(s) suivant ont remercié: mpac_limes

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 2 mois 1 semaine #184162 par mpac_limes
Should I post a feature request when it seems like I'm the only one that misses that feature?

I don't mind actually if it's a real dropdown or not. What I would like is that it behaves like a dropdown and that when creating a survey, I have this functionality out of the box and it is not needed to lose time putting the workaround in place.

Connexion ou Créer un compte pour participer à la conversation.

Plus d'informations
il y a 2 mois 1 semaine #184172 par DenisChenu
Else
gitlab.com/SondagesPro/QuestionSettingsType/autoComplete#usage

autoCompleteAsDropdown: Disable javascript search system and show autocomplete as dropdown.


Assistance on LimeSurvey forum and LimeSurvey core development are on my free time.
I'm not a LimeSurvey GmbH member, professional service on demand .
An error happen ? Before make a new topic : remind the Debug mode .

Connexion ou Créer un compte pour participer à la conversation.

Commencez dès maintenant !

Créez simplement un compte et commencez à utiliser LimeSurvey dès aujourd'hui.

Inscrivez-vous maintenant

Inscrivez-vous à notre Newsletter!