select_multiple question type एक list प्रदर्शित करता है जहाँ उत्तरदाता एक या अधिक विकल्प चुन सकता है। Default रूप से choices checkboxes के रूप में render होती हैं। Stored value सभी selected choice values की space-separated list है।

Basic XLSForm Specification

survey worksheet:

typenamelabel
select_multiple cropscrops_grownHousehold किन crops को उगाता है?

choices worksheet:

list_namenamelabel
cropsmaizeMaize
cropsbeansBeans
cropsriceRice
cropsvegetablesसब्जियाँ
cropsotherअन्य

अधिक जानकारी के लिए XLSForm specification देखें।

Stored data format

Exported column selected values की space-separated list contains करता है:

  maize beans vegetables
  

Expressions में select_multiple values test करते समय = के बजाय selected() function का उपयोग करें (नीचे देखें)।

उपयोग

Select_multiple questions का उपयोग इनके लिए किया जाता है:

  1. Multiple applicable answers एकत्र करना (जैसे income के sources, उगाए गए crops, symptoms)
  2. Checkbox-style agreement items (जैसे “Select all that apply”)
  3. Language या skill inventories
  4. कोई भी प्रश्न जहाँ multiple answers एक साथ valid हों

Appearance options

Appearanceविवरण
(none)Default checkboxes, प्रति line एक
minimalDropdown multi-select widget
compactCompact grid, columns screen width के अनुसार adjust होते हैं
compact-NN columns पर forced Compact grid
horizontalHorizontal row में arranged Choices (web)
horizontal-compactHorizontal, compact spacing (web)
labelकेवल labels दिखाता है, कोई checkboxes नहीं (list-nolabel के साथ उपयोग करें)
list-nolabelकेवल checkboxes दिखाता है, कोई labels नहीं (label के साथ उपयोग करें)
columns(N)N columns में प्रदर्शित करें (rtSurvey extension)

उदाहरण: 3-column compact layout

typenamelabelappearance
select_multiple symptomssymptomsसभी observed symptoms चुनेंcompact-3

Expressions में selected() का उपयोग करना

क्योंकि stored value एक space-separated string है, आपको selected() का उपयोग करना होगा यह test करने के लिए कि कोई specific choice pick की गई थी। = का उपयोग करने से सही ढंग से काम नहीं होगा।

relevant में

केवल तभी follow-up question दिखाएं जब “other” चुना गया हो:

typenamelabelrelevant
select_multiple cropscrops_grownकौन से crops उगाए जाते हैं?
textcrops_otherकृपया अन्य crops निर्दिष्ट करेंselected(${crops_grown}, 'other')

constraint में

कम से कम 2 choices की आवश्यकता करें:

typenameconstraintconstraint_message
select_multiple issuesissuescount-selected(.) >= 2कम से कम 2 issues चुनें

अधिकतम 3 तक सीमित करें:

typenameconstraintconstraint_message
select_multiple prioritiesprioritiescount-selected(.) <= 3अधिकतम 3 priorities चुनें

calculate में — selected labels को join करना

पठनीय summary build करने के लिए selected-at(), count-selected(), और choice-label() को combine करें:

typenamecalculation
calculatecrops_summaryjoin(’, ‘, ${crops_grown})

“None of the above” / exclusive विकल्प

एक सामान्य pattern एक विकल्प को सभी अन्य विकल्पों के साथ mutually exclusive बनाना है। इसे enforce करने के लिए constraint का उपयोग करें:

typenamelabelconstraintconstraint_message
select_multiple issuesissuesसभी present issues चुनेंnot(selected(., 'none') and count-selected(.) > 1)“None” को अन्य विकल्पों के साथ नहीं चुना जा सकता

choices:

list_namenamelabel
issueswaterपानी की कमी
issuesroadsखराब सड़कें
issueshealthस्वास्थ्य सेवाओं का अभाव
issuesnoneइनमें से कोई नहीं

Selections की गिनती और summarising

FunctionExampleResult
count-selected(field)count-selected(${crops_grown})चुनी गई choices की संख्या
selected(field, value)selected(${crops_grown}, 'maize')true/false
selected-at(field, index)selected-at(${crops_grown}, 0)पहली selected value
choice-label(field, value)choice-label(${crops_grown}, 'maize')एक value के लिए label

Best Practices

  1. relevant, constraint, और calculate में हमेशा selected() का उपयोग करें — कभी = या != का नहीं।
  2. यदि question design की आवश्यकता हो तो selections की maximum संख्या सीमित करने के लिए constraint जोड़ें।
  3. “None” या “Not applicable” विकल्प शामिल करें जब zero selections एक valid उत्तर हो।
  4. लंबी lists (15+ choices) के लिए, अत्यधिक scrolling से बचने के लिए minimal (multi-select dropdown) का उपयोग करें।
  5. Data export करें और अपने analysis tool में string-splitting का उपयोग करें।

सीमाएं

  • Select_multiple values को = से directly compare नहीं किया जा सकता। हमेशा selected() का उपयोग करें।
  • Compact appearance बहुत लंबे choice labels के लिए अच्छी तरह render नहीं हो सकती।
  • choice_filter के साथ choices filter करते समय, filtering सभी displayed choices पर apply होती है, वैसे ही जैसे select_one में।
क्या यह पृष्ठ सहायक था?