Cloze end with backslash for no newline

This commit is contained in:
2023-03-06 09:25:14 -07:00
parent 40bc4fb019
commit 7fc671d71a

View File

@@ -33,17 +33,23 @@
(resolve 0)))))
(function :Void clozeShow [index textLines :StudyEngine engine :Void->Void cc]
(doFor [idx line] (enumerate textLines)
(engine.println
(doFor [idx &mut line] (enumerate textLines)
((if (StringTools.endsWith line "\\")
{
(set line (StringTools.replace line "\\" ""))
engine.print
}
engine.println)
(if (= idx index)
"????"
"???? "
(if (StringTools.startsWith line "?")
(line.substr 1)
line))))
(engine.delayForUserInput cc))
(function :Void clozeScore [index :Array<String> textLines :StudyEngine engine :Int->Void resolve]
(basicScore (.substr (nth textLines index) 1) engine resolve))
(basicScore (StringTools.replace (.substr (nth textLines index) 1) "\\" "") engine resolve))
(function :CardSide basicText [:String text]
(object