Closed christianp closed 8 years ago
To do this:
numberentry.give your answer to precision
to the locale file saying something like "give your answer to %s %s", where the parameters are the number of places and kind of precision.themes/default/xslt/question.xslt
, in the template for numberentry part with mode="typespecific", add a span after the input and preview, with data-bind="html: precisionHint
. Make sure it's only shown when the part has no parent.themes/default/files/scripts/display.js
, add a ko.computed observable called precisionHint
to the NumberEntryPartDisplay
object which returns the message string. The relevant properties are this.part.settings.precisionType
and this.part.settings.precision
.You could also add an option to not display the message, which would involve touching the editor.
Hi is it ok if I take this up?
Sure! Thanks!
I'm not sure what you meant by 'Make sure it's only shown when the part has no parent' in point 2, my web development is a bit rusty. Please have a look at the pull request and comment on any necessary changes
I ended up adding an option to show the hint or not - the main reason is that we've got a lot of existing questions which have the same text in the question prompt already. It also lets us have the text in gapfill parts, but allow it to be omitted when the layout would make it awkward.
@wandeg: I suggest you get a local copy of the Numbas editor installed before making any more changes. Thanks for taking the first step and making a pull request, though!
Will do. Thanks for marking it as up-for-grabs for first timers .
Pretty much every number entry question I write has "give your answer to 3 decimal places" in the prompt.
This text should automatically be displayed next to the input, for non-gapfill numberentry parts. For gapfills, I don't think there's a way of showing the hint without interfering with the layout.