0
Hello, I am building a calibration tool (given a Checklist the user needs to select the fields that are in agreement (or not) with a link or script.
Ex.: 1)Colaborador inicia o atendimento conforme diretrizes. a) conforme b) não conforme c) não se aplica.
At first the tool will allow you to select the field type ( radio,checkbox,select and text).
Currently I have a good part ready, the question is: what is the best way to structure my bank? How should I relate the answers and the questions? currently my tables are like this:
Form Table
CREATE TABLE [dbo].[formulario](
[id] [varchar](13) NULL,
[nome] [varchar](150) NULL,
[descricao] [varchar](max) NULL,
[pergunta] [varchar](150) NULL,
[resposta] [varchar](150) NULL,
[tipo] [varchar](100) NULL,
[iPergunta] [int] NULL,//indice da pergunta
[iResposta] [int] NULL,//indice da resposta
[qtdPerguntas] [int] NULL,//total de perguntas
[qtdRespostas] [int] NULL,
[responsavel] [varchar](150) NULL,
[criacao] [datetime] NULL,
[atualizacao] [datetime] NULL
)
Response Table:
CREATE TABLE [dbo].[resposta](
[formulario] [varchar](13) NULL,
[pergunta] [varchar](150) NULL,
[resposta] [varchar](150) NULL,
[respondente] [varchar](150) NULL,
[data] [datetime] NULL
)
I need another table for the Adm can tell which are the correct answers, but this structure does not seem appropriate.
What are the fields for
iPergunta
andiResposta
? By what to understand they serve to tell which question and answer the form. It is important to understand this so that the community can give a more appropriate response to you.– Thiago Magalhães
Good Thiago, they are the answer and the question, kind of an accountant.
– fgpereira
From what I understand
iPergunta
would receive the id of the form question. But if the form has several questions, by the modeling that showed, I believe that it would not work.– Thiago Magalhães
No, the iPergunta is the index. see, suppose I entered 2 questions, the first with 3 answers and the second with two, the structure would be: Question 1: iPergunta 0 Answer to iResposta 0 Answer b iResposta 1 Answer c iResposta 2 Question 2 iPergunta 2 Answer to iResposta 3 Reply b iResposta 4
– fgpereira