Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Design for User defined Questionnaires
Message
De
31/07/2006 17:03:29
 
 
À
31/07/2006 16:43:40
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP1
Database:
MS SQL Server
Divers
Thread ID:
01141863
Message ID:
01141948
Vues:
16
Thanks Dragan,

I think I can make it even simpler than I first thought. Since this is a heavy duty data entry app, I am trying to get all data entered as numbers, so the data entry person only uses the number pad on the keyboard. If the answers are coded (as in each checkbox is assigned a number) then I only need to allow for an integer value being entered. This means I don't need to design the screen to look like the questionnaire. Of course some of the questions have an extra text field or two so here is what I've come up with so far:

Questions Table:
Question Primary Key
Question text (may make this a memo)

Answers table:
Answers Primary Key
Questions Foreign Key
Answer Text
Answer needs an extra textbox (logical)
Answer needs an "other" textbox (logical)
Extra text box label
Other text box label
List of valid responses (comma separated list, would normally be 1,2,3,4,5,6)

Responses:
Responses Primary Key
Answers Foreign Key
Respondents Foreign Key
Response Value (validated against list of valid responses)
Extra response
Other response

I'll create a class that has the Question text as a label, the answer text as a label and a text box that updates the Responses.Response Value field (catering for multiple answers). I'll also have a label for each of the Extra text box label and Other text box label and corresponding text boxes for these responses. These objects will only be visible if the Answer need extra textbox and Answer needs other textbox fields are true.

I think that should work for me.

Let me know what you all think.

>>Hi,
>>
>>I need to design a system whereby the user can define certain questions and possible answers, then my code will display the data entry screen for these questions. It is basically a survey type system.
>>
>>The specs as I have understood them are:
>>
>>Unlimited number of questions are possible.
>>
>>Each question will consist of a string of text that gets displayed for the data entry clerk.
>>
>>Each question will have answers that are either checkboxes or text.
>
>I did this back in '99, in VFP5. I had at least three tables - one for question types (which class will be instantiated), one for questions themselves, one for questionnaires (i.e. sets of questions, as there were more of these), and one for answers. The other tables (who the answers belong to, etc) were involved on the side.
>
>Each question was represented by a container; the container had on it controls corresponding to that type of question. The yes/no questions had an optiongroup of two buttons; most of the questions required answers from 1 to 9 - that one had an optiongroup with radio buttons arranged in 3x3 square. There was a type of question where a long text was expected - it had an editbox. Some had a yes/no/if not, why - optiongroup with 2 and an editbox. All containers had the same width.
>
>A questionnaire with appear on a form as a bunch of such containers one below another, all of them in one very tall container which then was in another container which was as big as the form would allow. The tall container's .top was adjusted as focus shifted to the next question (so it was mostly negative), which provided the scrolling of questions in the form.
Frank.

Frank Cazabon
Samaan Systems Ltd.
www.samaansystems.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform