Question Authors' Forum

Is it possible to display question author's solution immediately after a successful attempt?

Re: Is it possible to display question author's solution immediately after a successful attempt?

by Richard Lobb -
Number of replies: 0

What language are you teaching? We have been offering students the question author's answer in our Python course for the last month or two and it's going very well. Here's what the student sees after a correct submission:

Before clicking the button

And if they click the Show author's solution button, they see:

After clicking the button

Our Python3 question type can be found in the repo https://github.com/trampgeek/ucquestiontypes - it's called python3_stage1. If you download and import the xml file you should be able to create questions of type python3_stage1. If you open up the Question type details section of the author form, you'll see lots of template parameters; the one that turns on this feature is called showfeedbackwhenright (which is a bit of misnomer - it originally displayed the contents of the Feedback panel, but we found we were always just displaying the sample answer). You'll find you don't get the syntax colouring of the author's answer - that's another local feature that allows us to use the Ace static highlighter to colour code anywhere (thanks Matthew Toohey). But it should otherwise work - let me know if not.

I attach the xml export of the above question in case you need it.

Our question type also offers to show a scrambled version of the authors answer, with indentation removed, after a certain number of wrong submissions. This is the template parameter parsonsproblemthreshold. It's relatively straightforward to change that to show the full author's answer instead if that's what you want. 

If you want a language other than Python you have a lot of work to do, because you need to understand how to take complete control of the feedback by using a custom template grader. Not an exercise for the faint-hearted. But let us know what you want - we might be able to help. A lot of the framework for handling different languages is in place already and we use it for C.

Richard