question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Feature: "fill in the blank"

See original GitHub issue

In educational environments, it is common to present students with a partially filled answer with some portions missing that they need to fill in:

This “fill in the blank” feature would allow the creation of a mathfield in “readonly” mode, that is the mathfield would behave as if it was a static element, except for some areas inside it that would be editable. Those areas would be indicated by a specific latex command, such as \placeholder.

Furthermore, it should be possible to read (or modify) the content of these areas programmatically and be notified when these areas are modified. To facilitate this, an identifier could get associated with each placeholder.

Example of what this could look like:

    <div id='mf'>\frac{8}{\placeholder[answer]{}}=2</div>
    MathLive.makeMathField('mf', {
        readOnly: true,
        onPlaceholderDidChange: (mf, id) => {
            console.log('The answer is ', mf.$getPlaceholderContent(id));
        }
    });

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:7
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
dangcuusoncommented, Jul 17, 2019

Just want to share my current “workaround” for this feature:

  1. Render static math (with \placeholder)
  2. Find all span with .ML__placeholder class
  3. Call makeMathField on each of those spans

image

It works great. Only drawback is the layout won’t look correct if I type another fraction in those boxes (obviously because it’s not aware that it’s already in another fraction). But it’s fine to me since my use cases don’t need to deal with nested fractions.

1reaction
caleb-florescommented, Jul 27, 2021

@arnog I am interested to work on this and submit the PR.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Fill In Blank Text Features Teaching Resources - TPT
This nonfiction unit is filled with activities to teach your students all about reindeer and work on the reading informational text ...
Read more >
Fill-in the blank . . . - Pathagoras
GroupNames work fine with the 'Fill-in-the-blank' feature. However, 'position' still controls. So, if the chosen member of the group is a 'fill-in' (let's...
Read more >
Fill Blank Cells in Excel Column - Contextures
To select the empty cells with Excel's built in Go To Special feature, follow these steps: Select columns A and B, that contain...
Read more >
How to add lines using "fill in the blank" feature? - Jotform
How do I add more lines that require filling out a blank using the fill in the blank feature?
Read more >
Fill In The Blank question (Silver/Gold Feature)
Fill In The Blank is a great tool for creating cloze tasks. Students are prompted to enter their answer right within the question!...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found