hiding input fields in STACK

hiding input fields in STACK

by Martin Kraska -
Number of replies: 6

I think this is not a bug but my lack of STACK command.

I can't get rid of the input fields in the attached question "quiz-T-B2..." with JSXGraph input.

If I try to use the extra input option "hideanswer" then I get the message that it is not supported by the input type.

According to the table in the input doc page the numeric input type should accept this option.

I also inspected other STACK questions (for example the attached "quiz-MMM-2..." with JSXGraph input where the input fields are hidden. Yet I don't see what setting actually makes the difference.



Average of ratings: -
In reply to Martin Kraska

Re: hiding input fields in STACK

by Christopher Sangwin -
Picture of Particularly helpful Moodlers Picture of Plugin developers

The numeric input type adds in extra validation rules for students' benefit and so you know you have a number in the PRT.  If you are hiding the input, e.g. JSX graph, then you don't need these rules: you JS should ensure validation before it gets to the input. At least, I can think of no reason why you need these additional rules! Just use the algebraic input type.  If you really need me to add "hideanswer" to the numeric input type, let me know.

In reply to Christopher Sangwin

Re: hiding input fields in STACK

by Martin Kraska -
Thanks for the response. Actually I just tried numeric input, because algebraic input didn't work either (doesn't accept "hideanswer")
and leaving the option empty doesn't hide the input. In the attachment of the topic starter post, there actually 3 of four inputs were of type algebraic and just one of numeric. I felt encouraged to use numeric, because by doc table this should also respect "hideanswer".

In reply to Martin Kraska

Re: hiding input fields in STACK

by Stephan Bach -

Hi Martin,
the point of the option "hideanswer" is to suppress the display of the correct answer ("A correct answer is ..."), even if this is enabled on quiz level (review options). When working with JSX-Graph the correct answer often is not really helpful for students and you may want to hide it. The option might actually be interesting for your question too, but it is not what you wanted.
I have the same error message ("the option is not supported for this input type") with numerical input though. I guess this is different in the current version of STACK, because the option used to be supported only for strings.

If you want to hide the input fields you can use the CSS property "display" (display:none) to hide the division or paragraph the token input:ans1 is in.

Stephan.


In reply to Stephan Bach

Re: hiding input fields in STACK

by Martin Kraska -
Thank you for clarifying this. The critical hint was to solve this via html. Messing around with "hideanswer" was totally off track. Yet I didn't use CSS (have never used it) but rather something like this:

<p hidden>input:ans1 validation:ans1</p>
<p hidden>input:ans2 validation:ans2</p>
<p hidden>input:ans4 validation:ans4</p>
<p hidden>input:ans5 validation:ans5</p>
<p>feedback:prt1</p>
Essentially this means that I don't need at all the hideanswer option as long as I switch off the "right answer" in the quiz options. I usually do so because I think it is not very helpful in multipart questions anyway.

In reply to Martin Kraska

Re: hiding input fields in STACK

by Stephan Bach -

Normally I also switch off the display of the "right answer" in the quiz options, because I'm using multipart questions.

But if I have a quiz which includes both, questions with rather complex syntax (here the correct answer can actually be helpful) and questions which have to be answered by modifying a JSX-Graph (here the correct answer is rather irritating), I like to hide it only in the latter case.

Stephan.

In reply to Martin Kraska

Re: hiding input fields in STACK

by Stephan Bach -

I just saw that according to the documentation on GitHub hideanswer is only supported for string input type. This is different from the information in the documentation.

@Chris: Is "hideanswer" supported for the input types Alg, Num, T/F, String and Notes in the latest STACK version already?