{"id":82,"date":"2014-04-04T23:24:11","date_gmt":"2014-04-04T23:24:11","guid":{"rendered":"http:\/\/wiki.psychwire.co.uk\/?page_id=82"},"modified":"2023-10-17T22:23:49","modified_gmt":"2023-10-17T22:23:49","slug":"displaying-from-datasource","status":"publish","type":"page","link":"http:\/\/wiki.psychwire.co.uk\/?page_id=82","title":{"rendered":"Displaying from Datasource"},"content":{"rendered":"<p>Since we have just deleted our\u00a0<em>IMAGE_RESOURCE\u00a0<\/em>from our\u00a0<em>DISPLAY_SCREEN<\/em>, the trials will now not contain any pictures. We therefore need to add the\u00a0<em>IMAGE_RESOURCE\u00a0<\/em>back in.\u00a0But this time we don&#8217;t just want one particular picture to be shown; we want all of them shown, one at a time, to give a series of different trials.<\/p>\n<p>Before we get to that, note how under the <i>Properties\u00a0<\/i>panel of the\u00a0<em>SEQUENCE<\/em>, it now has an\u00a0<em>Iteration Count\u00a0<\/em>of 4, as below:<\/p>\n<p><a href=\"http:\/\/wiki.psychwire.co.uk\/wp-content\/uploads\/2014\/04\/ic.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-213\" alt=\"ic\" src=\"http:\/\/wiki.psychwire.co.uk\/wp-content\/uploads\/2014\/04\/ic.png\" width=\"507\" height=\"597\" srcset=\"http:\/\/wiki.psychwire.co.uk\/wp-content\/uploads\/2014\/04\/ic.png 507w, http:\/\/wiki.psychwire.co.uk\/wp-content\/uploads\/2014\/04\/ic-254x300.png 254w\" sizes=\"auto, (max-width: 507px) 100vw, 507px\" \/><\/a><\/p>\n<p>This is because there are 4 lines (trials) in our datasource. This means that we will now see what is in the\u00a0<em>SEQUENCE <\/em>four times, as it will run through everything in the<em> SEQUENCE <\/em>four times. The below sequence of events will be repeated once for each row in our datasource:<em><br \/>\n<\/em><\/p>\n<p><a href=\"http:\/\/wiki.psychwire.co.uk\/wp-content\/uploads\/2014\/04\/seqorder.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-214\" alt=\"seqorder\" src=\"http:\/\/wiki.psychwire.co.uk\/wp-content\/uploads\/2014\/04\/seqorder.png\" width=\"1406\" height=\"180\" srcset=\"http:\/\/wiki.psychwire.co.uk\/wp-content\/uploads\/2014\/04\/seqorder.png 1406w, http:\/\/wiki.psychwire.co.uk\/wp-content\/uploads\/2014\/04\/seqorder-300x38.png 300w, http:\/\/wiki.psychwire.co.uk\/wp-content\/uploads\/2014\/04\/seqorder-1024x131.png 1024w\" sizes=\"auto, (max-width: 1406px) 100vw, 1406px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>We want a different picture to be displayed for each of the four times\u00a0<em>DISPLAY_SCREEN\u00a0<\/em>will be run. To set this up, go to the\u00a0<em>DISPLAY_SCREEN\u00a0<\/em>action in your\u00a0<em>SEQUENCE\u00a0<\/em>and insert a new <i>IMAGE_RESOURCE<\/i>, as you did before. Select any of the four images and insert one of them, as below.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" alt=\"\" src=\"http:\/\/www.personal.soton.ac.uk\/hg102\/ul\/datasourcedisplayscreen.gif\" width=\"1235\" height=\"828\" \/><\/p>\n<p>Next, select the\u00a0<em>IMAGE_RESOURCE\u00a0<\/em>you have just added. On the left side of the screen, you&#8217;ll see that, like everything else, the\u00a0<em>IMAGE_RESOURCE\u00a0<\/em>also has special properties associated with it in the\u00a0<em>Properties\u00a0<\/em>pane. In order to present a different image each trial, we just need to point the\u00a0<em>Source File Name\u00a0<\/em>to our datasource, rather than the name that it has to begin with. When you click on the\u00a0<em>Value\u00a0<\/em>for\u00a0<em>Source File Name<\/em>, you&#8217;ll see a button with three dots appear. Click that button. It will open up a new window that will enable you to point the image name to anything you want. In this case, you want to point it to the image_name column in your datasource, as below. To do this, click on the datasource node and then double-click on the image_name column to set it as the new attribute.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone\" alt=\"\" src=\"http:\/\/www.personal.soton.ac.uk\/hg102\/ul\/datasourcedisplayscreen1.gif\" width=\"1235\" height=\"828\" \/><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since we have just deleted our\u00a0IMAGE_RESOURCE\u00a0from our\u00a0DISPLAY_SCREEN, the trials will now not contain any pictures. We therefore need to add the\u00a0IMAGE_RESOURCE\u00a0back in.\u00a0But this time we don&#8217;t just want one particular picture to be shown; we want all of them shown, one at a time, to give a series of different trials. Before we get to [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":74,"menu_order":3,"comment_status":"closed","ping_status":"open","template":"","meta":{"footnotes":""},"class_list":["post-82","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"http:\/\/wiki.psychwire.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/82","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/wiki.psychwire.co.uk\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"http:\/\/wiki.psychwire.co.uk\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"http:\/\/wiki.psychwire.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/wiki.psychwire.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=82"}],"version-history":[{"count":4,"href":"http:\/\/wiki.psychwire.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/82\/revisions"}],"predecessor-version":[{"id":347,"href":"http:\/\/wiki.psychwire.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/82\/revisions\/347"}],"up":[{"embeddable":true,"href":"http:\/\/wiki.psychwire.co.uk\/index.php?rest_route=\/wp\/v2\/pages\/74"}],"wp:attachment":[{"href":"http:\/\/wiki.psychwire.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=82"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}