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

Mehr
2 Wochen 5 Tage her #184066 von mpac_limes
COM_KUNENA_MESSAGE_CREATED_NEW
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

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

LimeSurvey Partners
Mehr
2 Wochen 5 Tage her #184074 von DenisChenu
COM_KUNENA_MESSAGE_REPLIED_NEW

mpac_limes schrieb: 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 schrieb: 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 .

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Wochen 5 Tage her #184087 von mpac_limes
COM_KUNENA_MESSAGE_REPLIED_NEW

DenisChenu schrieb:

mpac_limes schrieb: 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 schrieb: 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 :(

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Wochen 5 Tage her #184092 von DenisChenu
COM_KUNENA_MESSAGE_REPLIED_NEW
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 .

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Wochen 3 Tage her #184155 von mpac_limes
COM_KUNENA_MESSAGE_REPLIED_NEW
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

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Wochen 3 Tage her #184157 von DenisChenu
COM_KUNENA_MESSAGE_REPLIED_NEW

mpac_limes schrieb: 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 .
Folgende Benutzer bedankten sich: mpac_limes

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Wochen 3 Tage her #184162 von mpac_limes
COM_KUNENA_MESSAGE_REPLIED_NEW
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.

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Mehr
2 Wochen 3 Tage her #184172 von DenisChenu
COM_KUNENA_MESSAGE_REPLIED_NEW
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 .

Bitte Anmelden oder Registrieren um an der Konversation teilzunehmen.

Jetzt loslegen!

Melden Sie sich jetzt an, und erstellen Sie in wenigen Minuten Ihre erste Umfrage.

Account einrichten

Abonnieren Sie unseren Newsletter

Abonnieren Sie unseren Newsletter für alle Neuigkeiten rund um LimeSurvey
captcha