Welcome to the LimeSurvey Community Forum

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

Impostare valori massimi diversi nelle domande a inserimento numerico

  • FrancescaP
  • FrancescaP's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 11 months ago #216161 by FrancescaP
Buongiorno,

ho creato una domanda a inserimento numerico multiplo, ma vorrei impostare valori massimi diversi per ciascuna risposta.
La mia domanda prevede solo 2 risposte. La prima dovrebbe avere un valore massimo pari a 60, la seconda pari a 11. Come posso fare?

Grazie mille,
Francesca
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago #216169 by Joffm
BGuongiorno,
Validazione: Q1_SQ001 le 60 E Q1_SQ002 le 11

È questione di ore e minuti?
Forse un altro tipo di domanda: matrice (testi) con menu a discesa?
   


Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • FrancescaP
  • FrancescaP's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 11 months ago #216171 by FrancescaP
Si tratta di due risposte alternative: una su anni e l'altra su mesi.
 
The topic has been locked.
More
2 years 11 months ago #216173 by lfanfoni
Se sono alternative ti conviene prima chiedere se è più o meno di un anno e poi metti due domande una per gli anni e una per i mesi, ovviamente mostri una delle due in base alla scelta della domanda precedente

Se mi vuoi contattare, non mandare messaggi privati qui, bensì scrivi a lfanfoni at gmail.com
Per le livestream in italiano vai su: www.youtube.com/playlist?list=PLOSjjxAG9...SiiCsSz_JxIH7xJwLdPd
Le soluzioni LimeSurvey per l'Italia si trovano su: github.com/lfanfoni
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago #216176 by Joffm
a. Equazione di convalida della domanda: 
(count(self)==1) and (self.sq_SQ001<=60) and (self.sq_SQ002<=11)

b. Suggerimento di convalida della domanda: 
{if(count(self.NAOK)==0,"Per favore rispondi alla domanda ",if(count(self.NAOK)==2,"Per favore, solo una risposta",if(self.sq_SQ001.NAOK>60,"Per favore, non più di 60 anni",if(self.sq_SQ002.NAOK>11,"Per favore, non più di 11 mesi ","Tutto bene"))))}

 

 

 

 


 

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
  • FrancescaP
  • FrancescaP's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 11 months ago #216191 by FrancescaP
I controlli funzionano, ma non riesco ad andare avanti col questionario. Dice che "non è stata fornita una risposta valida" pur avendo inserito i numeri giusti.
The topic has been locked.
  • Joffm
  • Joffm's Avatar
  • Offline
  • LimeSurvey Community Team
  • LimeSurvey Community Team
More
2 years 11 months ago #216200 by Joffm
Questo è facile da correggere.
Inserisci is_empty(...)

(count(self)==1) and (is_empty(self.sq_SQ001) OR self.sq_SQ001<=60) and (is_empty(self.sq_SQ002) OR self.sq_SQ002<=11)

Volunteers are not paid.
Not because they are worthless, but because they are priceless
The topic has been locked.
More
2 years 11 months ago #216285 by cesoielampo
Possibile che tu abbia impostato la domanda come obbligatoria?
Se imposti la domanda come obbligatoria LS si aspetta di avere entrambi i campi compilati, il che collide con l'equazione di validazione.
The topic has been locked.
  • FrancescaP
  • FrancescaP's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 11 months ago - 2 years 11 months ago #216314 by FrancescaP
Si, avevo impostato sia la domanda come obbligatoria che l'esclusività alle due opzioni oltre all'equazione. Adesso funziona tutto correttamente.
Grazie mille a tutti.
Last edit: 2 years 11 months ago by FrancescaP.
The topic has been locked.

Lime-years ahead

Online-surveys for every purse and purpose