{"id":643,"date":"2014-04-07T18:05:20","date_gmt":"2014-04-07T18:05:20","guid":{"rendered":"http:\/\/blackbirdsolutions.com\/?p=643"},"modified":"2014-10-30T03:07:17","modified_gmt":"2014-10-30T03:07:17","slug":"mel-data-symbols-201-scoring-items-using-getarg-and-getnargs","status":"publish","type":"post","link":"https:\/\/blackbirdsolutions.com\/?p=643","title":{"rendered":"MEL Data Symbols 201:  Scoring items using getarg and getnargs"},"content":{"rendered":"<p>It&#8217;s not uncommon to want a form component to have the ability to do some scoring. \u00a0The scoring might be some kind of risk factors thing; PHQ-9, Falls, and Drug and Alcohol (DAST) screenings are just a few examples.<\/p>\n<p>Sometimes the scoring is a one-to-one relationship where each question is responsible for a point and other times \u00a0the scoring might have many-to-one relationship where multiple questions could be responsible for the same point. \u00a0In either instance you can use getarg and getnargs within your loop but it&#8217;s particularly useful when you&#8217;d like to utilize the same fn to do many-to-one style calculations or anytime you&#8217;d like to use a function multiple times with varying numbers of arguments.<\/p>\n<p>This is an example form:<br \/>\n<a href=\"https:\/\/blackbirdsolutions.com\/wp-content\/uploads\/2014\/10\/getarg2.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blackbirdsolutions.com\/wp-content\/uploads\/2014\/10\/getarg2-300x85.jpg\" alt=\"getarg2\" class=\"alignnone wp-image-645 size-medium\" width=\"300\" height=\"85\" srcset=\"https:\/\/blackbirdsolutions.com\/wp-content\/uploads\/2014\/10\/getarg2-300x85.jpg 300w, https:\/\/blackbirdsolutions.com\/wp-content\/uploads\/2014\/10\/getarg2-1024x291.jpg 1024w, https:\/\/blackbirdsolutions.com\/wp-content\/uploads\/2014\/10\/getarg2.jpg 1128w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>This is what the scoring code looks like:<br \/>\n<a href=\"https:\/\/blackbirdsolutions.com\/wp-content\/uploads\/2014\/10\/getarg1.jpg\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blackbirdsolutions.com\/wp-content\/uploads\/2014\/10\/getarg1-300x229.jpg\" alt=\"getarg1\" class=\"alignnone size-medium wp-image-644\" width=\"300\" height=\"229\" srcset=\"https:\/\/blackbirdsolutions.com\/wp-content\/uploads\/2014\/10\/getarg1-300x229.jpg 300w, https:\/\/blackbirdsolutions.com\/wp-content\/uploads\/2014\/10\/getarg1.jpg 589w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s not uncommon to want a form component to have the ability to do some scoring. \u00a0The scoring might be some kind of risk factors thing; PHQ-9, Falls, and Drug and Alcohol (DAST) screenings are just a few examples. Sometimes the scoring is a one-to-one relationship where each question is responsible for a point and [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-643","post","type-post","status-publish","format-standard","hentry","category-confentional-forms"],"_links":{"self":[{"href":"https:\/\/blackbirdsolutions.com\/index.php?rest_route=\/wp\/v2\/posts\/643","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blackbirdsolutions.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blackbirdsolutions.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blackbirdsolutions.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blackbirdsolutions.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=643"}],"version-history":[{"count":1,"href":"https:\/\/blackbirdsolutions.com\/index.php?rest_route=\/wp\/v2\/posts\/643\/revisions"}],"predecessor-version":[{"id":646,"href":"https:\/\/blackbirdsolutions.com\/index.php?rest_route=\/wp\/v2\/posts\/643\/revisions\/646"}],"wp:attachment":[{"href":"https:\/\/blackbirdsolutions.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=643"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blackbirdsolutions.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=643"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blackbirdsolutions.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=643"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}