testxlog

testxlog

Create fill-in-the-blank questions in Obsidian and export them as a PDF with blanks for easy printing.

1. Requirements#

  • Create fill-in-the-blank questions in Obsidian
  • In preview mode, the answer should be displayed when the mouse pointer hovers over it instead of clicking
  • It should also be exportable as a PDF with blanks for easy printing on paper

2. Attempt One#

  • Using the Masking Type plugin
  • And modifying some code
    • Add the following code to its styles.css file
/* The following is for printing fill-in-the-blank questions */

/* Cloze and Hover in Source Mode */

span.cm-em.cm-formatting.cm-formatting-em {
  display: none;
}

.hoverText em, span.cm-em {
  color: transparent;
  background-color: transparent;
  border-bottom: 1px solid #000000;
  font-style: normal;
}

.hoverText em:hover, span.cm-em:hover {
  color: #000000;
}

/* Cloze and Hover in Preview Mode */

@media print {

  em {
    color: transparent;
    background-color: transparent;
    border-bottom: 1px solid #000000;
    font-style: normal;
  }

}
  • Search for Click in its manifest.json file and replace all with mouseenter

3. Result One#

  • Content enclosed in asterisks will be obscured
  • The answer is displayed when the mouse hovers in the preview view
  • It can correctly export PDFs with blanks under various themes
  • Shortcomings: The answer is displayed when the mouse hovers, but it does not automatically obscure when the mouse moves away; it needs to be hovered over again
  • Plan to raise an issue with the plugin author to achieve the above requirements

4. Attempt Two (Preferred)#

  • Using the Cloze plugin
  • Can display bold, italic, highlighted content as fill-in-the-blanks
  • Shortcomings: Same as above
  • Additionally, it can export PDFs with blanks in preview mode, but the answer still shows in edit view

photo by Greg Rakozy(https://unsplash.com/@grakozy?utm_source=templater_proxy&utm_medium=referral&fit=crop&mask=corners) on Unsplash

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.