questionnaire

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

questionnaire

tolumi
Hello,

I'm fairly new to OPS and i'm trying to create a form that will allow users to create questionnaires. The user should be able to input the question to be asked and then add the type of control that the question will use either text control or selection controls and the selection controls should be editable. Kinda like a combination of the "Wizard with switch" and the "Controls" on the OPS examples page. After which the output will be a question that the user can answer either by using the text area or picking a selection depending.

Does anyone have any idea how i might go about this or help with it?

Thanks

Tolumi



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws
Reply | Threaded
Open this post in threaded view
|

Re: questionnaire

Erik Bruchez
Administrator
Tolumi,

 > I'm fairly new to OPS and i'm trying to create a form that will
 > allow users to create questionnaires. The user should be able to
 > input the question to be asked and then add the type of control that
 > the question will use either text control or selection controls and
 > the selection controls should be editable. Kinda like a combination
 > of the "Wizard with switch" and the "Controls" on the OPS examples
 > page. After which the output will be a question that the user can
 > answer either by using the text area or picking a selection
 > depending.
 >
 > Does anyone have any idea how i might go about this or help with it?

Very roughly (I don't have time to actually write the app), you would:

o Decide on an XML format that describes the questionaire,
   i.e. without thinking much something like:

   <questionaire>
     <question @type="input" name="first-name">
       <label>First Name</label>
       <value/>
     </question>
     <question @type="select1" name="gender">
       <label>First Name</label>
       <value/>
       <itemset>
         <item>
           <label>M</label>
           <value>m</value>
         </item>
         <item>
           <label>F</label>
           <value>f</value>
         </item>
       </itemset>
     </question>
     ...
   </questionaire>

o Write an "editor" XForms page to edit that format. You can use
   xforms:repeat, xforms:insert, xforms:delete, etc. to build that
   questionaire document.

o Write a second "viewer" XForms page that displays that format (it
   could even be on the same page as the "editor" for preview, in a
   switch or directly visible). You can control what control is display
   with things like:

   <xforms:repeat nodeset="question">
     <xforms:group ref=".[../@type = 'input']">
       <xforms:input ref="value">
         <xforms:label ref="label"/>
       </xforms:input>
     </xforms:group>
     <xforms:group ref=".[../@type = 'select1']">
       <xforms:select1 ref=".[../@type = 'select1']">
         <xforms:label ref="label"/>
         <xforms:itemset nodeset="itemset/item">
           <xforms:label ref="label"/>
           <xforms:value ref="value"/>
         </xforms:itemset>
       </xforms:select1>
     </xforms:group>
   </xforms:repeat>

I hope this helps. That sounds like a cool thing to do with XForms!

-Erik

--
Orbeon - XForms Everywhere:
http://www.orbeon.com/blog/



--
You receive this message as a subscriber of the [hidden email] mailing list.
To unsubscribe: mailto:[hidden email]
For general help: mailto:[hidden email]?subject=help
ObjectWeb mailing lists service home page: http://www.objectweb.org/wws