{"id":326,"date":"2024-07-03T11:55:23","date_gmt":"2024-07-03T11:55:23","guid":{"rendered":"https:\/\/www.veeform.com\/blog\/?page_id=326"},"modified":"2024-10-11T17:30:02","modified_gmt":"2024-10-11T17:30:02","slug":"quiz-logic","status":"publish","type":"page","link":"https:\/\/www.veeform.com\/blog\/quiz-logic\/","title":{"rendered":"Quiz logic"},"content":{"rendered":"<p><strong>Forenotes :<br \/>\n<\/strong>\u00a0&#8211; If you are creating a <strong>personality quiz<\/strong>, <a href=\"https:\/\/www.veeform.com\/blog\/scores-and-calculations-in-quizzes\/\">here is a tutorial<\/a>.<strong><br \/>\n<\/strong>\u00a0&#8211; In logic, <strong>we evaluate &#8220;And&#8221; before &#8220;Or&#8221;<\/strong> (more on that below).<\/p>\n<p>Quiz logic helps you redirect respondents to the right question path. Let&#8217;s see how it works.<\/p>\n<h2>Base principle<\/h2>\n<p>Logic is here to help you present relevant questions\/statements to your respondents. Let&#8217;s take an example.<\/p>\n<p>Let&#8217;s say that I have a question asking how my respondents&#8217; skin is like (number 3) and I want to display a statement based on their answer (number 4, 5, 6, 7).<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-335\" src=\"https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-0.jpg\" alt=\"\" width=\"747\" height=\"355\" srcset=\"https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-0.jpg 1895w, https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-0-300x142.jpg 300w, https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-0-1024x486.jpg 1024w, https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-0-768x365.jpg 768w, https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-0-1536x729.jpg 1536w\" sizes=\"(max-width: 747px) 100vw, 747px\" \/><\/p>\n<p>I select my question (number 3) and click on the &#8220;Question logic&#8221; icon, then on &#8220;+ Add rule&#8221; (cf screenshot below).<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-328\" src=\"https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-1.jpg\" alt=\"\" width=\"1896\" height=\"899\" srcset=\"https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-1.jpg 1896w, https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-1-300x142.jpg 300w, https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-1-1024x486.jpg 1024w, https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-1-768x364.jpg 768w, https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-1-1536x728.jpg 1536w\" sizes=\"(max-width: 1896px) 100vw, 1896px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>From there, I can decide what to do based on my respondent&#8217;s answer. So I create 4 rules : one for each answer and I redirect to the right statement.<\/p>\n<p>For instance, if the answer is &#8220;Tight, dry&#8221;, the respondent will go to statement number 4 (cf screenshot below).<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-329\" src=\"https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-2.jpg\" alt=\"\" width=\"1891\" height=\"903\" srcset=\"https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-2.jpg 1891w, https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-2-300x143.jpg 300w, https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-2-1024x489.jpg 1024w, https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-2-768x367.jpg 768w, https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-2-1536x733.jpg 1536w\" sizes=\"(max-width: 1891px) 100vw, 1891px\" \/><\/p>\n<p>I also want all statements to redirect to the next real question (number 8). So I click on those statements and change their logic as well.<\/p>\n<p>No need for a rule, I can directly set &#8220;Always go to&#8221; to &#8220;8. What is your primary skin concern?&#8221; (= the next real question).<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone size-full wp-image-330\" src=\"https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-3.jpg\" alt=\"\" width=\"1889\" height=\"903\" srcset=\"https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-3.jpg 1889w, https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-3-300x143.jpg 300w, https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-3-1024x490.jpg 1024w, https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-3-768x367.jpg 768w, https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-3-1536x734.jpg 1536w\" sizes=\"(max-width: 1889px) 100vw, 1889px\" \/><\/p>\n<p>And that&#8217;s it!<\/p>\n<h2>Combining multiple conditions in a rule<\/h2>\n<p>Before we dive into slightly more complicated matters, let&#8217;s define what we&#8217;re talking about.<\/p>\n<p>In a question logic, there may be one or multiple <strong>rules<\/strong> that contain one or multiple <strong>conditions<\/strong> each. Each rule will be evaluated in the order you see on the screen until a valid one is found : the corresponding &#8220;Then GO TO&#8221; question will be then shown. If no valid rule is found, the &#8220;Always go to&#8221; question will be shown.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-338\" src=\"https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-6.jpg\" alt=\"\" width=\"311\" height=\"451\" srcset=\"https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-6.jpg 642w, https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-6-207x300.jpg 207w\" sizes=\"(max-width: 311px) 100vw, 311px\" \/><\/p>\n<p>As you can see, you may have multiple conditions in a rule. In this case, conditions are linked using an operator, either &#8220;And&#8221; or &#8220;Or&#8221;.<\/p>\n<p>If we were to write the first rule of the screenshot above as a simple text, this would be : &#8220;If the answer to question 3 is &#8220;Tight, dry&#8221; and the answer to question 2 is &#8220;Below 18&#8243;, then go to question 4&#8221;.<\/p>\n<p>In a more compact way : IF <em>Q3 is &#8220;Tight, dry&#8221;<\/em> AND <em>Q2 is &#8220;Below 18&#8221;<\/em> THEN GO Q4<\/p>\n<p>Please note that <strong>we use boolean algebra and that &#8220;And&#8221; operators will be evaluated before &#8220;Or&#8221; operators<\/strong>. It only matters if you have more than 2 conditions in a single rule of course.<\/p>\n<h2>&#8220;And&#8221; operators are evaluated before &#8220;Or&#8221; operators<\/h2>\n<p>Let&#8217;s take the example below.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-339\" src=\"https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-7.jpg\" alt=\"\" width=\"256\" height=\"462\" srcset=\"https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-7.jpg 421w, https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-7-166x300.jpg 166w\" sizes=\"(max-width: 256px) 100vw, 256px\" \/><\/p>\n<p>The rule could be written like this:<\/p>\n<p>IF Cond1 AND Cond2 OR Cond3 THEN GO Q4<\/p>\n<p>And since &#8220;AND&#8221; is always evaluated before &#8220;OR&#8221; in boolean algebra, let&#8217;s add parentheses for more clarity :<\/p>\n<p>IF <strong>(<\/strong>Cond1 AND Cond2<strong>)<\/strong> OR Cond3 THEN GO Q4<\/p>\n<p>This means that if Cond3 alone is true, it is enough to redirect the respondent to Q4!<\/p>\n<p><strong>Pro tip :<\/strong> if you&#8217;d like to simulate an &#8220;OR&#8221; to be evaluated in priority and have a &#8220;multiple choice&#8221; question, you can use the &#8220;is one of&#8221; operator. For instance, on the screenshot below, the condition is IF Q3 is (tight OR oily) AND Q2 is 18-30 THEN GO Q6.<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" class=\"alignnone wp-image-344\" src=\"https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-8.jpg\" alt=\"\" width=\"390\" height=\"555\" srcset=\"https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-8.jpg 732w, https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-8-211x300.jpg 211w, https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-8-719x1024.jpg 719w\" sizes=\"(max-width: 390px) 100vw, 390px\" \/><\/p>\n<p>Anyway, if you want to be able to evaluate &#8220;OR&#8221; in priority over &#8220;AND&#8221; for other types of questions, please contact us at <a href=\"mailto:support@veeform.com\">support@veeform.com<\/a> and we will let you do it as soon as possible (we usually answer within 24 hours).<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Forenotes : \u00a0&#8211; If you are creating a personality quiz, here is a tutorial. \u00a0&#8211; In logic, we evaluate &#8220;And&#8221; before &#8220;Or&#8221; (more on that below). Quiz logic helps you redirect respondents to the right question path. Let&#8217;s see how it works. Base principle Logic is here to help you present relevant questions\/statements to your [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Quiz logic - VeeForm Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.veeform.com\/blog\/quiz-logic\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Quiz logic - VeeForm Blog\" \/>\n<meta property=\"og:description\" content=\"Forenotes : \u00a0&#8211; If you are creating a personality quiz, here is a tutorial. \u00a0&#8211; In logic, we evaluate &#8220;And&#8221; before &#8220;Or&#8221; (more on that below). Quiz logic helps you redirect respondents to the right question path. Let&#8217;s see how it works. Base principle Logic is here to help you present relevant questions\/statements to your [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.veeform.com\/blog\/quiz-logic\/\" \/>\n<meta property=\"og:site_name\" content=\"VeeForm Blog\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-11T17:30:02+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-0.jpg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.veeform.com\/blog\/quiz-logic\/\",\"url\":\"https:\/\/www.veeform.com\/blog\/quiz-logic\/\",\"name\":\"Quiz logic - VeeForm Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.veeform.com\/blog\/#website\"},\"datePublished\":\"2024-07-03T11:55:23+00:00\",\"dateModified\":\"2024-10-11T17:30:02+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.veeform.com\/blog\/quiz-logic\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.veeform.com\/blog\/quiz-logic\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.veeform.com\/blog\/quiz-logic\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.veeform.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Quiz logic\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.veeform.com\/blog\/#website\",\"url\":\"https:\/\/www.veeform.com\/blog\/\",\"name\":\"VeeForm Blog\",\"description\":\"Everything you need to know about forms and quizzes.\",\"publisher\":{\"@id\":\"https:\/\/www.veeform.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.veeform.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.veeform.com\/blog\/#organization\",\"name\":\"VeeForm\",\"url\":\"https:\/\/www.veeform.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.veeform.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2023\/04\/social.png\",\"contentUrl\":\"https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2023\/04\/social.png\",\"width\":1024,\"height\":1024,\"caption\":\"VeeForm\"},\"image\":{\"@id\":\"https:\/\/www.veeform.com\/blog\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Quiz logic - VeeForm Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.veeform.com\/blog\/quiz-logic\/","og_locale":"en_US","og_type":"article","og_title":"Quiz logic - VeeForm Blog","og_description":"Forenotes : \u00a0&#8211; If you are creating a personality quiz, here is a tutorial. \u00a0&#8211; In logic, we evaluate &#8220;And&#8221; before &#8220;Or&#8221; (more on that below). Quiz logic helps you redirect respondents to the right question path. Let&#8217;s see how it works. Base principle Logic is here to help you present relevant questions\/statements to your [&hellip;]","og_url":"https:\/\/www.veeform.com\/blog\/quiz-logic\/","og_site_name":"VeeForm Blog","article_modified_time":"2024-10-11T17:30:02+00:00","og_image":[{"url":"https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2024\/07\/logic-0.jpg"}],"twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.veeform.com\/blog\/quiz-logic\/","url":"https:\/\/www.veeform.com\/blog\/quiz-logic\/","name":"Quiz logic - VeeForm Blog","isPartOf":{"@id":"https:\/\/www.veeform.com\/blog\/#website"},"datePublished":"2024-07-03T11:55:23+00:00","dateModified":"2024-10-11T17:30:02+00:00","breadcrumb":{"@id":"https:\/\/www.veeform.com\/blog\/quiz-logic\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.veeform.com\/blog\/quiz-logic\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.veeform.com\/blog\/quiz-logic\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.veeform.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Quiz logic"}]},{"@type":"WebSite","@id":"https:\/\/www.veeform.com\/blog\/#website","url":"https:\/\/www.veeform.com\/blog\/","name":"VeeForm Blog","description":"Everything you need to know about forms and quizzes.","publisher":{"@id":"https:\/\/www.veeform.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.veeform.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.veeform.com\/blog\/#organization","name":"VeeForm","url":"https:\/\/www.veeform.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.veeform.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2023\/04\/social.png","contentUrl":"https:\/\/www.veeform.com\/blog\/wp-content\/uploads\/2023\/04\/social.png","width":1024,"height":1024,"caption":"VeeForm"},"image":{"@id":"https:\/\/www.veeform.com\/blog\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.veeform.com\/blog\/wp-json\/wp\/v2\/pages\/326"}],"collection":[{"href":"https:\/\/www.veeform.com\/blog\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.veeform.com\/blog\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.veeform.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.veeform.com\/blog\/wp-json\/wp\/v2\/comments?post=326"}],"version-history":[{"count":10,"href":"https:\/\/www.veeform.com\/blog\/wp-json\/wp\/v2\/pages\/326\/revisions"}],"predecessor-version":[{"id":586,"href":"https:\/\/www.veeform.com\/blog\/wp-json\/wp\/v2\/pages\/326\/revisions\/586"}],"wp:attachment":[{"href":"https:\/\/www.veeform.com\/blog\/wp-json\/wp\/v2\/media?parent=326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}