{"id":72,"date":"2025-10-12T18:27:56","date_gmt":"2025-10-12T17:27:56","guid":{"rendered":"https:\/\/www.rezeau.org\/wp-h5p\/\/?page_id=72"},"modified":"2025-10-25T22:45:42","modified_gmt":"2025-10-25T20:45:42","slug":"advanced-fill-the-blanks-papi-jo-documentation-2","status":"publish","type":"page","link":"https:\/\/www.rezeau.org\/wp-h5p\/advanced-fill-the-blanks-papi-jo-documentation-2\/","title":{"rendered":"FITB Documentation"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Current version: 1.3.1 October 2025<\/h3>\n\n\n\n<h2 class=\"wp-block-heading\">Rationale<\/h2>\n\n\n\n<p>The Advanced Fill in the Blanks &#8216;papi Jo&#8217; H5P activity is based on the <em>semi-official<\/em> <a href=\"https:\/\/h5p.org\/tutorial-advanced-fill-in-the-blanks\">H5P Advanced Fill in the Blanks<\/a> activity by Sebastian Rettig. The bug fixes and improvements listed below have been submitted to Sebastian who approved them. My initial aim was to incite Sebastian to include my suggestions into his distribution. However, that was not possible and Sebastian encouraged me to create my own fork.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Bug fixes<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Make Highlight Positions &#8220;stick&#8221; when editing a content. Simply added double quotes to values in Semantics e.g. &#8220;value&#8221;:<strong> &#8220;-1&#8221;<\/strong>, &#8220;label&#8221;: &#8220;- 1 (right before the blank)&#8221;.<\/li>\n\n\n\n<li>Show confirmation dialog on &#8220;Check&#8221;.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Improvements<\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>In Semantics, added <em>display overall feedback<\/em> and <em>incorrect answers<\/em> &#8220;expanded&#8221;: false to avoid cluttered editing screen especially when there are lots of incorrect answers provided.<\/li>\n\n\n\n<li>Added a <em>Feedback for correct answer field<\/em>.This (optional) feedback can be used to confirm that the user found the correct answer in order to re-enforce his choice.<\/li>\n\n\n\n<li>Added a regular expression option for wrong answers with 2 main features: <em>detect wrong answers <\/em>or parts of answers and <em>detect missing words<\/em>. That is the main improvement.<\/li>\n\n\n\n<li>Added an option for <em>Show Solutions<\/em> to display either only the first correct answer OR all of the alternatives (as in the original H5P Blanks activity).<\/li>\n\n\n\n<li>Allow the use of the forward slash in correct answers, e.g. 10\/20, by escaping the slash like this 10\\\\\/20.<\/li>\n\n\n\n<li>For correct and showing solution input fields, <em>fit the field size <\/em>to the answer being contained (needs a <em>monospace font<\/em> for correct display, see point 9 below).<\/li>\n\n\n\n<li>Various <em>adjustments <\/em>to the ticks and crosses and tip icons for a more aesthetic display (subjective).<\/li>\n\n\n\n<li>Hide tip icon if blank was answered correctly OR blank showing solution<\/li>\n\n\n\n<li>Placed a link to Google Font &#8216;Roboto Mono&#8217; in the CSS file. This is needed to display a better fit for text inside input fields. The &#8216;Roboto Mono&#8217; font looks much better than the default Courier or monospace fonts available.<\/li>\n\n\n\n<li>Added an <em>automatic grow text field<\/em> feature for the input field (on Sebastian&#8217;s TODO list). It&#8217;s working OK except when using Del or Backspace to delete already entered characters, so will need to be refined.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Tutorial<\/h3>\n\n\n\n<p>Since the Advanced Fill in the Blanks &#8216;papi Jo&#8217; H5P activity is based on the <a href=\"https:\/\/h5p.org\/tutorial-advanced-fill-in-the-blanks\">H5P Advanced Fill in the Blanks<\/a> activity, please refer to the original tutorial linked above. In this tutorial I will only add all the necessary information related to the <em>differences<\/em> between the 2 versions.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Step 1: Topic<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Step 2: Creating Advanced Fill in the Blanks<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Step 3: Advanced Fill in the Blanks editor<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Step 4: Task Description<\/h3>\n\n\n\n<p><em>Which compound adjective would you use to describe the following:<\/em><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step 4b: Behaviour settings<\/h4>\n\n\n\n<p>Our tutorial is based on the use of the regular expressions (new) feature, so before proceeding you need to select the following options in the Behaviour settings:<\/p>\n\n\n\n<p><em><strong>Answer mode<\/strong>: The user types in the answers<br><strong>Use Regular Expressions<\/strong>: Check this box<\/em><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step 5: Text with Blanks<\/h4>\n\n\n\n<p>Under&nbsp;<strong>Text with Blanks&nbsp;<\/strong>we will type the exercise like this:<\/p>\n\n\n\n<p><em>a little girl who was born !!5 (five)!! !!years!! ago? a ____ girl<\/em><\/p>\n\n\n\n<p>Now we should define all the possible correct alternatives as well as the potential incorrect ones. This is done in the &#8220;Blanks used in the text&#8221; section.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">1.- For the first blank, we&#8217;ll add the below as a correct answer:&nbsp;<\/h5>\n\n\n\n<p><strong>Correct answer<\/strong>: <em>five-year-old\/5-year-old<\/em><br><strong>Hint<\/strong>: you may leave this empty or add a hint<br><strong>Feedback for correct answer: <\/strong><em>Correct, a little girl that is 5 years old is a 5-year-old girl.<\/em><br>This feedback should confirm that the user found the correct answer in order to re-enforce his choice. New feature in the &#8216;papi Jo&#8217; version.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\">2.- And below add a set of incorrect answers and feedback if one of them is chosen:<\/h5>\n\n\n\n<p><strong>Note<\/strong>.- When using the Regular Expressions option in the detection of potential incorrect answers, you have a choice of detecting a) <em>the presence of incorrect elements<\/em> or b) <em>the absence of needed correct elements<\/em> in the student&#8217;s answer. In the incorrect answer text, absent needed elements are preceded by a double minus sign, e.g. &#8211;year.<\/p>\n\n\n\n<p>Here are some examples. You can view the complete list of those potential incorrect answers together with the associated feedback messages if you download the H5P ADV FITB &#8216;papi Jo&#8217; template to your computer.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Incorrect answer #0: detect the presence of an incorrect word in the student&#8217;s answer<\/strong><\/h5>\n\n\n\n<p>Incorrect answer text: <em>(little|small)<\/em><br>Feedback: <em>Of course, that&#8217;s a little girl, but you must <\/em>write a <em>compound <\/em>adjective in your answer.<\/p>\n\n\n\n<p>Here we are using a very simple regular expression, <a href=\"https:\/\/www.regular-expressions.info\/alternation.html\" target=\"_blank\" rel=\"noreferrer noopener\">Alternation with The Vertical Bar or Pipe Symbol<\/a>. The enclosing brackets are optional here.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Incorrect answer #1: detect the absence of the word &#8216;year&#8217; in the student&#8217;s answer<\/strong><\/h5>\n\n\n\n<p>Incorrect answer text: <em>&#8211;year<\/em><br>Feedback: <em>You need to use the noun &#8220;year&#8221; <\/em>to form this <em>compound <\/em>adjective.<\/p>\n\n\n\n<p>Please note that the use of the double minus sign here is <strong><em>not <\/em><\/strong>part of the set of conventional regular expressions. It&#8217;s used to simplify things. The double minus sign can be followed by any valid regular expression.<\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Incorrect answer #2: detect the absence of the words &#8216;5&#8217; or &#8216;five&#8217; in the student&#8217;s answer<\/strong><\/h5>\n\n\n\n<p>Incorrect answer text: <em>&#8211;(5|five)<\/em><br>Feedback: You must specify <em>the age <\/em>of the little girl in your compound adjective (use <strong>5<\/strong> or <strong>five<\/strong>).<\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Incorrect answer #3: detect the incorrect presence of extra spaces on either side of the hyphen sign in the compound adjective<\/strong><\/h5>\n\n\n\n<p>Incorrect answer text: ( -|- )<br>Feedback: <em>Do not put a space <\/em>(or any other punctuation mark) before or after the hyphen character (-).<\/p>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Incorrect answer #4: Detect the incorrect presence of extra words on either side of the compound adjective<\/strong><\/h5>\n\n\n\n<p>Incorrect answer text: (-.*-.*)\\\\s(\\\\w+)|\\\\s(\\\\w+)(-.*-.*)<br>Feedback: Have you not put one word too many at the beginning or at the end of your answer?<\/p>\n\n\n\n<p>That&#8217;s a <em>very <\/em>complex regular expression. You will probably never have to go to that extreme, unless you are or become an expert in regular expressions!<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p><strong>Extra options<\/strong><\/p>\n\n\n\n<p>You can also define which part of the text will highlight when the feedback is shown. This is done by putting the word between (&#8220;!!&#8221;). For example:<\/p>\n\n\n\n<p><em>a little girl who was born !!5 (five)!! !!years!! ago? a ____ girl<\/em><\/p>\n\n\n\n<p>Putting the words &#8220;5 (five)&#8221; between !! means that this word will highlight when we display the feedback for the first set of incorrect answers.<\/p>\n\n\n\n<p>You should now see something like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"637\" height=\"977\" src=\"https:\/\/www.rezeau.org\/wp-h5p\/\/wp-content\/uploads\/2025\/10\/fitb_img01.jpg\" alt=\"\" class=\"wp-image-78\" srcset=\"https:\/\/www.rezeau.org\/wp-h5p\/wp-content\/uploads\/2025\/10\/fitb_img01.jpg 637w, https:\/\/www.rezeau.org\/wp-h5p\/wp-content\/uploads\/2025\/10\/fitb_img01-196x300.jpg 196w\" sizes=\"auto, (max-width: 637px) 100vw, 637px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/www.rezeau.org\/moodle\/draftfile.php\/5\/user\/draft\/704173500\/2022-03-16_16-33-35.jpg\" alt=\"\"\/><\/figure>\n\n\n\n<h4 class=\"wp-block-heading\">Step 6: Adding more sentences<\/h4>\n\n\n\n<p>Proceed as with sentence #1<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Step 7: Behaviour settings<\/h4>\n\n\n\n<p>We can now return to the Behaviour settings to select some more options.<\/p>\n\n\n\n<p><em><strong>Answer mode<\/strong><\/em><\/p>\n\n\n\n<p>If you are <strong>not <\/strong>using the Regular options option, then you can select The user selects from options as per the original ADV FITB activity.<\/p>\n\n\n\n<p><strong>Behaviour when user makes a spelling error<\/strong><br><em>Warn the user about the error<br>Accept it as a correct answer<br>Consider it a regular mistake<\/em><\/p>\n\n\n\n<p>These 3 options work in conjunction with the <em>Regular Expressions<\/em> option. I recommend selecting <em>Warn the user about the error<\/em>.<\/p>\n\n\n\n<p><strong>Case sensitive<\/strong><\/p>\n\n\n\n<p>This option also works in conjunction with the <em>Regular Expressions<\/em> option.<\/p>\n\n\n\n<p><strong>Automatically check answers after input<br>Enable &#8220;Show solutions&#8221; button<br>Require all fields to be answered before the solution can be viewed<br>Enable &#8220;Retry&#8221;<\/strong><\/p>\n\n\n\n<p>These 4 options work as per the original ADV FITB activity.<\/p>\n\n\n\n<p><strong>Show all alternative solutions<\/strong><br>If your blanks have more than one correct solution, check this to display all the alternatives when showing solutions. This is a new &#8216;papi Jo&#8217; option.<\/p>\n\n\n\n<p>Please note that the size of the blanks are automatically adjusted to the text they contain, upon checking answers or showing solutions. This is possible because the text inside the blanks use a fixed-width font from Google, &#8216;Roboto Mono&#8217;.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Snippets<\/h4>\n\n\n\n<p>If you create a number of similar sentences with blanks within one H5P ADV FITB activity, you may find the Snippets feature quite useful. Snippets are texts that can be reused in feedback texts by inserting @snippetname into the feedback texts.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Using regular expressions<\/h3>\n\n\n\n<p>Regular expressions are a powerful tool for analysing students&#8217; answers with a view to provide ever more relevant feedback messages to help their learning. But they can be quite hard to master. Of course you can always limit the regular expressions you enter for the potential incorrect answers to a few simple expressions.<\/p>\n\n\n\n<p>You can find some help in the documentation I have written for my <a href=\"https:\/\/docs.moodle.org\/en\/Regular_Expression_Short-Answer_question_type\" target=\"_blank\" rel=\"noreferrer noopener\">Moodle Regexp Question Type here<\/a>. although the regular expressions system is not identical. This part is the most relevant to using regular expressions in H5P ADV FITB &#8216;papi jo&#8217;: <a href=\"https:\/\/docs.moodle.org\/en\/Regular_Expression_Short-Answer_question_type#Detecting_missing_required_words_or_character_strings\" target=\"_blank\" rel=\"noreferrer noopener\">Detecting missing required words or character strings<\/a>.<\/p>\n\n\n\n<p>For more general help about Regular Expressions, visit these sites:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/regex101.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/regex101.com\/<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.regular-expressions.info\/\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.regular-expressions.info\/<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/www.regexplanet.com\/advanced\/java\/index.html\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/www.regexplanet.com\/advanced\/java\/index.html<\/a><\/li>\n<\/ul>\n\n\n\n<p>Unfortunately there is no mechanism to test if your regular expressions are valid within the H5P editor system. The only point that is tested is whether your expressions have correct matching of square or round brackets. If an incorrect matching is detected, you will get an error message <em>upon saving<\/em> your H5P activity. Something like this:<\/p>\n\n\n\n<p>ERROR!!! Your round or square brackets are not correctly balanced in the following regular expression(s):<br>Blank # 1 <strong>small|little)<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Current version: 1.3.1 October 2025 Rationale The Advanced Fill in the Blanks &#8216;papi Jo&#8217; H5P activity is based on the semi-official H5P Advanced Fill in the Blanks activity by Sebastian Rettig. The bug fixes and improvements listed below have been submitted to Sebastian who approved them. My initial aim was to incite Sebastian to include&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"categories":[62,58],"tags":[],"class_list":["post-72","page","type-page","status-publish","hentry","category-fill-in-the-blanks","category-papi-jo-libraries"],"_links":{"self":[{"href":"https:\/\/www.rezeau.org\/wp-h5p\/wp-json\/wp\/v2\/pages\/72","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rezeau.org\/wp-h5p\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.rezeau.org\/wp-h5p\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.rezeau.org\/wp-h5p\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rezeau.org\/wp-h5p\/wp-json\/wp\/v2\/comments?post=72"}],"version-history":[{"count":11,"href":"https:\/\/www.rezeau.org\/wp-h5p\/wp-json\/wp\/v2\/pages\/72\/revisions"}],"predecessor-version":[{"id":660,"href":"https:\/\/www.rezeau.org\/wp-h5p\/wp-json\/wp\/v2\/pages\/72\/revisions\/660"}],"wp:attachment":[{"href":"https:\/\/www.rezeau.org\/wp-h5p\/wp-json\/wp\/v2\/media?parent=72"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rezeau.org\/wp-h5p\/wp-json\/wp\/v2\/categories?post=72"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rezeau.org\/wp-h5p\/wp-json\/wp\/v2\/tags?post=72"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}