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?

de către Richard Lobb-
Număr de răspunsuri: 3

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

Ca răspuns la Richard Lobb

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

de către 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
Ca răspuns la David Violeau

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

de către 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.
Ca răspuns la Richard Lobb

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

de către 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