Willkommen, Gast
Benutzername: Passwort: Angemeldet bleiben:

THEMA: Conditional after long free text?

Conditional after long free text? 1 Jahr 6 Monate her #93033

  • sD960
  • sD960s Avatar
  • OFFLINE
  • Senior Lime
  • Beiträge: 45
  • Dank erhalten: 1
  • Karma: 0
Hello-

I'd like a (non-text) question to appear after a mandatory long free text question, contingent on the survey-taker entering anything at all in the long free text box. (The survey-takers are non-anonymous adults who can be trusted to write something meaningful.) I'm assuming I use regular expressions for this. I've made the second question conditional on /^[-\w]+(?:\W+[-\w]+){0,299}\W*$/ for the first question, but all that happens is Limesurvey thinks the survey ends with the long free text question--that is, the SUBMIT button shows up rather than the NEXT button below the long free text question.

I've no idea what I'm doing wrong. And, for the record, I've never (knowingly) dealt with a regular expression before in my whole life--so please don't be too cryptic in your explanation!

We're using 2.00, Build 121213, and will upgrade in the future but not now. Can't risk changing anything at this point.

Thanks!
Der Administrator hat öffentliche Schreibrechte deaktiviert.

Conditional after long free text? 1 Jahr 6 Monate her #93070

  • sD960
  • sD960s Avatar
  • OFFLINE
  • Senior Lime
  • Beiträge: 45
  • Dank erhalten: 1
  • Karma: 0
Solved it! There's a "SPECIAL NOTE: Regular Expressions in conditions" in the manual that says "Note that when using regular expressions in the condition editor, do NOT include the beginning and ending slash."

I replaced /^[-\w]+(?:\W+[-\w]+){0,299}\W*$/ with ^[-\w]+(?:\W+[-\w]+){0,299}\W*$ and it works fine. The second question appears as soon as anything is typed into the first long free text question. I assume if I wanted the second question to not appear until after at least several words have been typed into the text box, I'd simply change the 0 in {0,299} to some positive number approximating the number of characters in a short sentence.

So, no response needed unless there's something I missed. Hope this is helpful to someone else!
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Folgende Benutzer bedankten sich: holch

Conditional after long free text? 1 Jahr 6 Monate her #93072

  • holch
  • holchs Avatar
  • OFFLINE
  • LimeSurvey Team
  • Beiträge: 2637
  • Dank erhalten: 310
  • Karma: 114
Thank you for posting your solution. I might help others with a similar problem.
Have a look at the manual! It is a really valuable source for information. Here some helpful links:
Manual (EN) | Question Types | Question Attributes | Workarounds

If you found this answer helpful and it saved you some time please consider a donation to the project to keep Limesurvey going!
Der Administrator hat öffentliche Schreibrechte deaktiviert.
Moderatoren: ITEd
Ladezeit der Seite: 0.194 Sekunden
Donation Image