Custom Quiz Activity Development that uses the Quiz module

Custom Quiz Activity Development that uses the Quiz module

by James Roberts -
Number of replies: 2

Hi there,

I am currently trying to develop a new activity plugin that utilizes the quiz module to display various questions to students. The plugin will aim to help students learn C#. This plugin will make use of the Coderunner question type to asses their code.

I have managed to display a questions on the activities page for a start. It looks like the questions are submitted properly and graded by my Job Engine successfully (I can see the data in the database tables). But the problem is when the page reloads, the $quba ( question_usage_by_activity) reloads and no results of the submission are displayed, and no student written code is present. It is as if the question has been reset completely. It should display the results of the code underneath the question. I know coderunner uses an adapted adaptive question behavior.

I think I am going wrong with my question_usage_by_activity objects somewhere.

Is there something else you have to do to get the results of a question to display on the page once "check" is clicked and the question is submitted?

I have been following this resource: https://docs.moodle.org/dev/Using_the_question_engine_from_module

And have been looking through the quiz and question moodle code.

Edit: Also their doesn't seem to be any quiz_attempt data stored in the database when my activity is being used? Is this a major problem?


Any help would be very appreciated.


Average of ratings: Useful (1)
In reply to James Roberts

Re: Custom Quiz Activity Development that uses the Quiz module

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

It probably is an issue that you are not seeing attempt data. I recommend you take a look at the studentquiz  and quiz practice plugins as other examples of using questions outside the context of the core quiz. And also read everything Tim Hunt has ever written about the quiz and questions smile

Average of ratings: Useful (2)