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

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

de Richard Moreham -
Número de respuestas: 5

Hi there

I'm something of a newbie to CodeRunner, but finding it very useful for simple Python and SQL quiz questions.  The immediate feedback that compares their solution to the expected output is very useful, but is it also possible to immediately display the question author's solution - either once they have submitted a correct answer or possibly after a certain number of failed attempts?

The question author's solution for each question is available once the whole quiz is submitted, but it would be helpful for instructional quizzes if students could see this while they are working on each question.

I am only using the standard templates for each question type and have not investigated the customisable architecture behind them, but if this can be customised some pointers for where to begin would be much appreciated.

Cheers,  Richard 

En respuesta a Richard Moreham

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

de Tim Hunt -

This is something we want at the OU (mainly in the context of using CodeRunner with our embedded question plugin https://moodle.org/plugins/filter_embedquestion).

And, it has come up before here, for example:

Actually doing this, rather than discussing it, is moving closer to the top of my todo list, but it is not quite there yet.
En respuesta a Richard Moreham

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

de Richard Lobb -

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

En respuesta a Richard Lobb

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

de David Violeau -
Hello
I am very interested by this PROTOTYPE. I tried to import the ucquestiontype and the example but when I tried to Verify the answer it is said that python 3.10 is not found. I saw on the deposit that you added a file Files.zip but I don't know where to use it in order to pass this python error.
Thank you in advance
En respuesta a David Violeau

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

de Richard Lobb -
Since your first posting, Tim Hunt has added the Stop button option, which lets students give up at any stage and see the sample answer. You'll see it there in the question authoring form if you're running a recent enough version of CodeRunner. That's probably what you want?

However, if you do wish to explore the python3_stage1 question type further, I've updated  the .xml export of the question type on https://github.com/trampgeek/ucquestiontypes to avoid the hard-coded use of python3.10. Please realise though that this question type is very complex and comes with no guarantee of support (thought if you ask an interesting enough question I probably won't be able to stop myself answering it).

And FWIW, the Files.zip file is the zip archive of all the support files in the prototype question: the one that was causing problems for you was __pystylechecker.py.
En respuesta a Richard Lobb

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

de David Violeau -
Thank you for your quick answer. I did not see that Stop Button is exactly what I want. And what is more if I use it with mark penalties, solution appears after some trials !
I like Coderunner, it changed my life ! Thank you very much