-
-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fill in the blank rework #1857
Fill in the blank rework #1857
Conversation
-Added prompt def and atom - =Box atom with captureSelection when !promptMode + styling -Added CSS rules for prompt classes
This looks really good. Thanks for this PR. One small feedback: I'm wondering if it would be useful to add some other states for correctness. Currently, a prompt with a corrected property is not editable, but it seems that in some use cases it might be useful to have (i.e. so you can go back and modify your answer if it was wrong). Perhaps there could be four states: Also, there are some conflicts with the head now (sorry, I checked-in a bunch of changes recently). Do you want to go through them or would you like me to? |
I guess I can see that being useful, it just hadn't occurred to me since its outside my use case. I might just make locked / unlocked a third argument, since I think the behavior can almost always be inferred just from correctness. As for conflicts, they all seem trivial enough. I'll see if I can commit some conflict free version tonight. |
Done! There is also now a I'm happy to maintain this as needed, since its a pretty core part of the platform we're building. Feel free to @ me on any related issues. |
@WildYellowfin an issue has been reported. I'm not sure why you made the change, so I reverted it for now, but happy to discuss the proper way to handle what you were trying to do (see bb3d25e). |
@arnog ahh this wasn't an intended change. I was trying to debug the Webkit |
#1838
Summary
\placeholder[id][correctness?]{body}
. IDs are not enforced to be unique, but duplicate IDs will mess with behavior of related commands.\placeholder[id][defaultValue?]{}
is still supported, but will be serialized from now on as\placeholder[id]{defaultValue}
. If abody
is provided,defaultValue
is ignored.correctness
is read through this same argument space, but it is inferred to be a default value if the content is not"correct"
or"incorrect"
.readOnly
mathfield is editable, unless it hascorrectness
set.Keyboard navigation:
APIs
getPrompt(id): string
getAllPrompts(): string[]
setPromptContent(id, content)
setPromptCorrectness(id, correctness: 'correct' | 'incorrect' | undefined)
Styling
readOnly
, prompts are greyed outreadOnly
, prompts are styled like a mathfield.correctness
provided, box shadow is added. Onincorrect
, box will be "crossed out"--correct-color
/incorrect-color
(green/red by default)Other:
enclose
serializationUntitled.mov
Suggested documentation example:
\frac{\placeholder[0]{x+y}}{\placeholder[1]{\sqrt{2}}} \begin{pmatrix}
\placeholder[2][incorrect]{} & \placeholder[3]{} & \placeholder[4]{} \
\placeholder[5]{} & \placeholder[6]{} & \placeholder[7][correct]{}
\end{pmatrix}