Check out the LimeSurvey source code on GitHub!
Welcome, Guest
Username: Password:
  • Page:
  • 1
  • 2

TOPIC: Prevent accidentially closing the survey

Prevent accidentially closing the survey 2 years 3 months ago #107456

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9290
  • Thank you received: 1325
  • Karma: 384
Assistance on LimeSurvey forum and LimeSurvey core developpement are on my free time (Say thanks ?).
A bug not reported is a bug not corrected. | Please, read the documentation | La doc en français à besoin de vous
The administrator has disabled public write access.

Prevent accidentially closing the survey 2 years 3 months ago #107466

  • david2013
  • david2013's Avatar
  • Offline
  • Senior Lime
  • Posts: 59
  • Thank you received: 7
  • Karma: 3
It seems it will jump to next compulsory question. If I have 50 questions on 50 different pages. Each question are compulsory. Now I want to test skip logic around Q40. Currently, I have to answer all the questions up to Q40. Are we able to let question index jump to Q40 directly? It will save a lot of time when testing.
The administrator has disabled public write access.

Prevent accidentially closing the survey 2 years 3 months ago #107467

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9290
  • Thank you received: 1325
  • Karma: 384
No .... stop at first error, but don't stop at actual page.
Assistance on LimeSurvey forum and LimeSurvey core developpement are on my free time (Say thanks ?).
A bug not reported is a bug not corrected. | Please, read the documentation | La doc en français à besoin de vous
The administrator has disabled public write access.

Prevent accidentially closing the survey 2 years 3 months ago #107913

  • jonsen
  • jonsen's Avatar
  • Offline
  • Expert Lime
  • Posts: 83
  • Thank you received: 8
  • Karma: 1
Denis, thanks again for your solution! The reason why it did not work for me was that I changed the wrong template - d'oh! ;)

But I have one (I think quite important) addition to your code. In order for participants to be able to leave the survey without a message AFTER completing, I added another condition to the if-statement:
if(!$('#submitted').length && !$('#completed').length)
(It detects if the div with the id "completed" exists on that page.)

If you agree, can you please add it to your code?

Best
Jonsen
The administrator has disabled public write access.

Prevent accidentially closing the survey 2 years 3 months ago #107915

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9290
  • Thank you received: 1325
  • Karma: 384
Hi,

Plese fill free to update our wiki :
manual.limesurvey.org/Workarounds:_Surve...y_closing_the_survey

;)
Assistance on LimeSurvey forum and LimeSurvey core developpement are on my free time (Say thanks ?).
A bug not reported is a bug not corrected. | Please, read the documentation | La doc en français à besoin de vous
The administrator has disabled public write access.
The following user(s) said Thank You: jonsen

Prevent accidentially closing the survey 2 years 3 months ago #107916

  • jonsen
  • jonsen's Avatar
  • Offline
  • Expert Lime
  • Posts: 83
  • Thank you received: 8
  • Karma: 1
I edited your post in the wiki...

Thanks and see you!
The administrator has disabled public write access.

Prevent accidentially closing the survey 2 years 3 months ago #107917

  • DenisChenu
  • DenisChenu's Avatar
  • Offline
  • Moderator Lime
  • Posts: 9290
  • Thank you received: 1325
  • Karma: 384
And maybe it's best to use something like this:
if(!$('#submitted').length || $('.button,[name='move']').length)

Think it's best (have to test ...)
Assistance on LimeSurvey forum and LimeSurvey core developpement are on my free time (Say thanks ?).
A bug not reported is a bug not corrected. | Please, read the documentation | La doc en français à besoin de vous
The administrator has disabled public write access.

Prevent accidentially closing the survey 2 years 3 months ago #107997

  • jonsen
  • jonsen's Avatar
  • Offline
  • Expert Lime
  • Posts: 83
  • Thank you received: 8
  • Karma: 1
DenisChenu wrote:
$('.button,[name='move']').length

Yes, that's probably better than finding it out based on the <div>. I'm not sure if that then covers all cases...
The administrator has disabled public write access.

Prevent accidentially closing the survey 2 years 1 week ago #111049

  • LS_SR
  • LS_SR's Avatar
  • Offline
  • Premium Lime
  • Posts: 30
  • Thank you received: 2
  • Karma: 0
Where can I change the alert text and the alert-button text?

I tryed the program Poedit, but that's not working.
The administrator has disabled public write access.

Prevent accidentially closing the survey 2 years 1 week ago #111050

  • jonsen
  • jonsen's Avatar
  • Offline
  • Expert Lime
  • Posts: 83
  • Thank you received: 8
  • Karma: 1
Hi LS_SR,

you can adapt the German sentences in the code (at e.returnValue and return) BUT for Firefox and similar browsers, the text is built-in and you cannot change it. You would need to rewrite the function for Firefox. Also, you cannot change the text of the button of javascript's alert() function, so you would have to use a differnet solution to implement an alert with a custom button, like using jQuery's alert functions...

Best
jonsen
The administrator has disabled public write access.
The following user(s) said Thank You: LS_SR

Prevent accidentially closing the survey 2 years 1 week ago #111051

  • LS_SR
  • LS_SR's Avatar
  • Offline
  • Premium Lime
  • Posts: 30
  • Thank you received: 2
  • Karma: 0
Thanks for your fast answer.
The administrator has disabled public write access.

Prevent accidentially closing the survey 1 year 6 months ago #116036

  • fanepic
  • fanepic's Avatar
  • Offline
  • Junior Lime
  • Posts: 21
  • Karma: 0
Thanks a lot for your Code.
Do you now how it's possible to make en exception for the languagechanger?

Cheers
Benny
The administrator has disabled public write access.

Prevent accidentially closing the survey 1 year 6 months ago #116038

  • jonsen
  • jonsen's Avatar
  • Offline
  • Expert Lime
  • Posts: 83
  • Thank you received: 8
  • Karma: 1
Hi fanepic,

please try to add ".changelang" to the jQuery "on" action by changing this:
$(document).on('click',".button,[name='move']", ...

to this:
$(document).on('click',".button,.changelang,[name='move']", ...

Please leave a quick comment if this works, otherwise I'll have a closer look.

Best
jonsen
The administrator has disabled public write access.
The following user(s) said Thank You: fanepic

Prevent accidentially closing the survey 1 year 6 months ago #116039

  • jonsen
  • jonsen's Avatar
  • Offline
  • Expert Lime
  • Posts: 83
  • Thank you received: 8
  • Karma: 1
The administrator has disabled public write access.

Prevent accidentially closing the survey 1 year 6 months ago #116042

  • fanepic
  • fanepic's Avatar
  • Offline
  • Junior Lime
  • Posts: 21
  • Karma: 0
Thank you jonson works fine.

Do you also now how to make it Multilanguage like only show if it's German?

Regards
fanepic
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Moderators: ITEd
Time to create page: 0.410 seconds
Imprint                   Data Protection Statement                  Revocation information and revocation form