Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>So here is the scenario that I could understood from your question:</p> <p>The admin specify a relation between the previous questions' answers and another question, based on this conditions this question will have an automatically answer based on this relation, and this logic relation is specified manually. So for this, you will need two more tables:</p> <p><strong><code>PreviousQuestionsAnswers</code></strong>:</p> <ul> <li><code>QuestionId</code>,</li> <li><code>PreviousQuestionId</code>,</li> <li><code>PreviousAnswerID</code></li> </ul> <p><strong><code>QuestionPreAnswer</code></strong>:</p> <ul> <li><code>QuestionId</code>,</li> <li><code>AnswerId</code></li> </ul> <p>For instance:</p> <blockquote> <p>If a person answers: Question 1 = "HP", Question 2 = "Ubuntu", Question 3 = "OS X"; Question 4 is automatically set to "Puma"</p> </blockquote> <p>Then these two tables will have something like:</p> <p><code>PreviousQuestionsAnswers</code>:</p> <pre><code>QuestionId PreviousQuestionId PreviousAnswerId 4 1 1 4 2 2 4 3 3 </code></pre> <p><code>QuestionPreAnswer</code>:</p> <pre><code>QuestionId AnswerId 4 4 </code></pre> <p><strong>Note that:</strong> These data are preentered by the admin, so that, from the front end application after the OP that supposed to take that survey, you will match the answeres he entered in the previous questions that supposed to be entered in the <code>Answers</code> that you already have, with the pre defined conditions in the <code>PreviousQuestionsAnswers</code> table, if so then set the question with the choice <code>QuestionPreAnswer</code>. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload