{"id":2134,"date":"2020-04-17T23:20:13","date_gmt":"2020-04-17T20:20:13","guid":{"rendered":"https:\/\/loquiz.com\/support\/?p=2134"},"modified":"2021-07-02T17:10:49","modified_gmt":"2021-07-02T14:10:49","slug":"advanced-examples","status":"publish","type":"post","link":"https:\/\/loquiz.com\/support\/advanced-examples\/","title":{"rendered":"Advanced examples"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">Nesting WHEN- THEN statements<\/h2>\n\n\n\n<p>It helps to think about separate WHEN-THEN logic blocks as having OR operator between them.  If any of the separate condition blocks becomes TRUE then the action within WHEN-THEN STATEMENT is executed.<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"183\" class=\"wp-image-2136\" style=\"width: 300px;\" src=\"https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-sidebyside.png\" alt=\"\" srcset=\"https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-sidebyside.png 855w, https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-sidebyside-300x183.png 300w, https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-sidebyside-768x469.png 768w, https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-sidebyside-60x37.png 60w, https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-sidebyside-150x92.png 150w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n\n\n\n<p>In the sample above the TASK 2 is shown when the team is on TRACK 1 OR when they answer TASK 1, even if they are not on TRACK 1. Please note that two WHEN-THEN blocks do not need to be connected. The same applies also if they are single blocks. <\/p>\n\n\n\n<p>When nesting one WHEN-THEN logic block within another WHEN-THEN logic block then there is AND relation between the two blocks. The  innermost WHEN-THEN condition only becomes true if the outer WHEN-THEN statement and inner WHEN-THEN statement are both TRUE.<\/p>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"122\" class=\"wp-image-2135\" style=\"width: 300px;\" src=\"https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-nested.png\" alt=\"\" srcset=\"https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-nested.png 1004w, https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-nested-300x122.png 300w, https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-nested-768x312.png 768w, https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-nested-60x24.png 60w, https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-nested-150x61.png 150w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n\n\n\n<p>In the example above the TASK 2 is only shown when team is on TRACK 1 AND the have answered TASK 1.  <\/p>\n\n\n\n<p>The same can be achieved using AND operator like in the following sample.<img loading=\"lazy\" decoding=\"async\" width=\"400\" height=\"91\" class=\"wp-image-2137\" style=\"width: 400px;\" src=\"https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-nested-alternative-with-and.png\" alt=\"\" srcset=\"https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-nested-alternative-with-and.png 1391w, https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-nested-alternative-with-and-300x69.png 300w, https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-nested-alternative-with-and-1024x234.png 1024w, https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-nested-alternative-with-and-768x176.png 768w, https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-nested-alternative-with-and-60x14.png 60w, https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-nested-alternative-with-and-150x34.png 150w\" sizes=\"auto, (max-width: 400px) 100vw, 400px\" \/><br>However using nested WHEN-THEN blocks will make it much easier to include several compound conditions when one condition remains unchanged.  To achieve this you can nest multiple WHEN-THEN blocks within outer WHEN-THEN block or nest in several levels.<img loading=\"lazy\" decoding=\"async\" width=\"300\" height=\"339\" class=\"wp-image-2138\" style=\"width: 300px;\" src=\"https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-nested-multiple-levels.png\" alt=\"\" srcset=\"https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-nested-multiple-levels.png 537w, https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-nested-multiple-levels-265x300.png 265w, https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-nested-multiple-levels-53x60.png 53w, https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-nested-multiple-levels-133x150.png 133w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Nesting WHEN- THEN statements It helps to think about separate WHEN-THEN logic blocks as having OR operator between them. If any of the separate condition blocks becomes TRUE then the action within WHEN-THEN STATEMENT is executed. In the sample above the TASK 2 is shown when the team is on TRACK 1 OR when they [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[8],"tags":[],"class_list":["post-2134","post","type-post","status-publish","format-standard","hentry","category-creating-games"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Advanced examples - Loquiz knowledgebase<\/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:\/\/loquiz.com\/support\/advanced-examples\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Advanced examples - Loquiz knowledgebase\" \/>\n<meta property=\"og:description\" content=\"Nesting WHEN- THEN statements It helps to think about separate WHEN-THEN logic blocks as having OR operator between them. If any of the separate condition blocks becomes TRUE then the action within WHEN-THEN STATEMENT is executed. In the sample above the TASK 2 is shown when the team is on TRACK 1 OR when they [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/loquiz.com\/support\/advanced-examples\/\" \/>\n<meta property=\"og:site_name\" content=\"Loquiz knowledgebase\" \/>\n<meta property=\"article:published_time\" content=\"2020-04-17T20:20:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-07-02T14:10:49+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-sidebyside.png\" \/>\n<meta name=\"author\" content=\"Eric\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Eric\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/loquiz.com\\\/support\\\/advanced-examples\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/loquiz.com\\\/support\\\/advanced-examples\\\/\"},\"author\":{\"name\":\"Eric\",\"@id\":\"https:\\\/\\\/loquiz.com\\\/support\\\/#\\\/schema\\\/person\\\/146baa991dc15587d39906934da45dc7\"},\"headline\":\"Advanced examples\",\"datePublished\":\"2020-04-17T20:20:13+00:00\",\"dateModified\":\"2021-07-02T14:10:49+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/loquiz.com\\\/support\\\/advanced-examples\\\/\"},\"wordCount\":194,\"image\":{\"@id\":\"https:\\\/\\\/loquiz.com\\\/support\\\/advanced-examples\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/loquiz.com\\\/support\\\/wp-content\\\/uploads\\\/2020\\\/04\\\/when-then-sidebyside.png\",\"articleSection\":[\"4. Creating Games\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/loquiz.com\\\/support\\\/advanced-examples\\\/\",\"url\":\"https:\\\/\\\/loquiz.com\\\/support\\\/advanced-examples\\\/\",\"name\":\"Advanced examples - Loquiz knowledgebase\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/loquiz.com\\\/support\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/loquiz.com\\\/support\\\/advanced-examples\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/loquiz.com\\\/support\\\/advanced-examples\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/loquiz.com\\\/support\\\/wp-content\\\/uploads\\\/2020\\\/04\\\/when-then-sidebyside.png\",\"datePublished\":\"2020-04-17T20:20:13+00:00\",\"dateModified\":\"2021-07-02T14:10:49+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/loquiz.com\\\/support\\\/#\\\/schema\\\/person\\\/146baa991dc15587d39906934da45dc7\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/loquiz.com\\\/support\\\/advanced-examples\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/loquiz.com\\\/support\\\/advanced-examples\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/loquiz.com\\\/support\\\/advanced-examples\\\/#primaryimage\",\"url\":\"https:\\\/\\\/loquiz.com\\\/support\\\/wp-content\\\/uploads\\\/2020\\\/04\\\/when-then-sidebyside.png\",\"contentUrl\":\"https:\\\/\\\/loquiz.com\\\/support\\\/wp-content\\\/uploads\\\/2020\\\/04\\\/when-then-sidebyside.png\",\"width\":855,\"height\":522},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/loquiz.com\\\/support\\\/advanced-examples\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/loquiz.com\\\/support\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Advanced examples\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/loquiz.com\\\/support\\\/#website\",\"url\":\"https:\\\/\\\/loquiz.com\\\/support\\\/\",\"name\":\"Loquiz knowledgebase\",\"description\":\"Helping you run awesome games\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/loquiz.com\\\/support\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/loquiz.com\\\/support\\\/#\\\/schema\\\/person\\\/146baa991dc15587d39906934da45dc7\",\"name\":\"Eric\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a1e259c3c8e8b2207b5c23cb8d985fdf416d68c8b2854f582c0a0f89b81b6eba?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a1e259c3c8e8b2207b5c23cb8d985fdf416d68c8b2854f582c0a0f89b81b6eba?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/a1e259c3c8e8b2207b5c23cb8d985fdf416d68c8b2854f582c0a0f89b81b6eba?s=96&d=mm&r=g\",\"caption\":\"Eric\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Advanced examples - Loquiz knowledgebase","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:\/\/loquiz.com\/support\/advanced-examples\/","og_locale":"en_US","og_type":"article","og_title":"Advanced examples - Loquiz knowledgebase","og_description":"Nesting WHEN- THEN statements It helps to think about separate WHEN-THEN logic blocks as having OR operator between them. If any of the separate condition blocks becomes TRUE then the action within WHEN-THEN STATEMENT is executed. In the sample above the TASK 2 is shown when the team is on TRACK 1 OR when they [&hellip;]","og_url":"https:\/\/loquiz.com\/support\/advanced-examples\/","og_site_name":"Loquiz knowledgebase","article_published_time":"2020-04-17T20:20:13+00:00","article_modified_time":"2021-07-02T14:10:49+00:00","og_image":[{"url":"https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-sidebyside.png","type":"","width":"","height":""}],"author":"Eric","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Eric","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/loquiz.com\/support\/advanced-examples\/#article","isPartOf":{"@id":"https:\/\/loquiz.com\/support\/advanced-examples\/"},"author":{"name":"Eric","@id":"https:\/\/loquiz.com\/support\/#\/schema\/person\/146baa991dc15587d39906934da45dc7"},"headline":"Advanced examples","datePublished":"2020-04-17T20:20:13+00:00","dateModified":"2021-07-02T14:10:49+00:00","mainEntityOfPage":{"@id":"https:\/\/loquiz.com\/support\/advanced-examples\/"},"wordCount":194,"image":{"@id":"https:\/\/loquiz.com\/support\/advanced-examples\/#primaryimage"},"thumbnailUrl":"https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-sidebyside.png","articleSection":["4. Creating Games"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/loquiz.com\/support\/advanced-examples\/","url":"https:\/\/loquiz.com\/support\/advanced-examples\/","name":"Advanced examples - Loquiz knowledgebase","isPartOf":{"@id":"https:\/\/loquiz.com\/support\/#website"},"primaryImageOfPage":{"@id":"https:\/\/loquiz.com\/support\/advanced-examples\/#primaryimage"},"image":{"@id":"https:\/\/loquiz.com\/support\/advanced-examples\/#primaryimage"},"thumbnailUrl":"https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-sidebyside.png","datePublished":"2020-04-17T20:20:13+00:00","dateModified":"2021-07-02T14:10:49+00:00","author":{"@id":"https:\/\/loquiz.com\/support\/#\/schema\/person\/146baa991dc15587d39906934da45dc7"},"breadcrumb":{"@id":"https:\/\/loquiz.com\/support\/advanced-examples\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/loquiz.com\/support\/advanced-examples\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/loquiz.com\/support\/advanced-examples\/#primaryimage","url":"https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-sidebyside.png","contentUrl":"https:\/\/loquiz.com\/support\/wp-content\/uploads\/2020\/04\/when-then-sidebyside.png","width":855,"height":522},{"@type":"BreadcrumbList","@id":"https:\/\/loquiz.com\/support\/advanced-examples\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/loquiz.com\/support\/"},{"@type":"ListItem","position":2,"name":"Advanced examples"}]},{"@type":"WebSite","@id":"https:\/\/loquiz.com\/support\/#website","url":"https:\/\/loquiz.com\/support\/","name":"Loquiz knowledgebase","description":"Helping you run awesome games","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/loquiz.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/loquiz.com\/support\/#\/schema\/person\/146baa991dc15587d39906934da45dc7","name":"Eric","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/a1e259c3c8e8b2207b5c23cb8d985fdf416d68c8b2854f582c0a0f89b81b6eba?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/a1e259c3c8e8b2207b5c23cb8d985fdf416d68c8b2854f582c0a0f89b81b6eba?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/a1e259c3c8e8b2207b5c23cb8d985fdf416d68c8b2854f582c0a0f89b81b6eba?s=96&d=mm&r=g","caption":"Eric"}}]}},"_links":{"self":[{"href":"https:\/\/loquiz.com\/support\/wp-json\/wp\/v2\/posts\/2134","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/loquiz.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/loquiz.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/loquiz.com\/support\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/loquiz.com\/support\/wp-json\/wp\/v2\/comments?post=2134"}],"version-history":[{"count":1,"href":"https:\/\/loquiz.com\/support\/wp-json\/wp\/v2\/posts\/2134\/revisions"}],"predecessor-version":[{"id":2139,"href":"https:\/\/loquiz.com\/support\/wp-json\/wp\/v2\/posts\/2134\/revisions\/2139"}],"wp:attachment":[{"href":"https:\/\/loquiz.com\/support\/wp-json\/wp\/v2\/media?parent=2134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/loquiz.com\/support\/wp-json\/wp\/v2\/categories?post=2134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/loquiz.com\/support\/wp-json\/wp\/v2\/tags?post=2134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}