PennController for IBEX › Forums › Support › html layout/event times/selector vs. scale/ compatibility › Reply To: html layout/event times/selector vs. scale/ compatibility
March 28, 2022 at 9:29 am
#7978
Keymaster
Hi,
The code of the blank function you report seem to be missing a few lines, but if I understand its purpose correctly, you can rewrite it in a more concise way, eg:
blank = sentence => Object({html:
sentence.replace(/_+/g, (t,i)=>`<textarea name='blank${i}' rows=1 cols=${t.length+1} style='max-height: 1.7em'></textarea>`)
});
Then you can use it the way you discuss, either creating a Form item using the standard Ibex syntax:
items = [
["blank", "Form", blank("It was so ea__ to get lost in an anc__ buil____")]
]
Or injecting a Form controller inside a PennController trial:
newTrial("blank",
newController("Form", blank("It was so ea__ to get lost in an anc__ buil____"))
.log()
.print()
.wait()
)
Jeremy