Automatic generation of Multiple Choice Quiz

Automatic generation of Multiple Choice Quiz

Ingmar Evers írta időpontban
Válaszok szám: 5
Hello,

as a part of my diploma thesis, i have to develope a software which automatically generates a multiple choice quiz when pushing a button in moodle. The needed Data is provided by a tuplespace architecture.
I have spent a lot of time searching in the code, which methodes i have to call in order to use the moodle code for inserting these quizzes and questions correctly into the database without success. I then moved over to directly insert values into the sql database, which from my point of view, is not very nice and a lot of code.
So my question is, if there is an "api documentation" how to use the quiz module, or which mehtodes to call.
I am using Moodle 1.9.6 Build 20091028

If you need more informations, on what i am doing in my thesis, don't hesitate to contact me.

Kind Regards
Ingmar Evers
Értékelések átlaga: -
Válasz erre: Ingmar Evers

Re: Automatic generation of Multiple Choice Quiz

Joseph Rézeau írta időpontban
Kép Kép Kép Kép Kép
Hi Ingmar,
There is no such thing as a "multiple choice quiz". A quiz (in moodle or elsewhere) consists of a number of questions. Questions can be of different types : multiple choice (with variants single / multiple answers); short answer (open); numerical, etc.
Can you please re-state your query and explain in more detail what you mean by "automatic generation"?
Joseph
Válasz erre: Joseph Rézeau

Re: Automatic generation of Multiple Choice Quiz

Ingmar Evers írta időpontban
Ok, here is my project in more detail:

I have transformed a university course into an Ontology. This Ontology is uploaded into a tuplespace. From there, serveral Agents are transforming and preparing this ontology into true statements.
A student now has a button in Moodle for creating a new Quiz from that Ontology. When pushing this button, an agent creates a Question/Answer combination from the prepared ontology by taking a statement and adding x different statements as "wrong answers".
This then looks like a "Question" in Moodle, which i want to insert into the SQL Database. Repeating this step several times should give me a Quiz with Multiple Choice Answer Option, which also needs to be registered in the Database, as far as I have found out by Database Dumps.
At the moment I directly insert this Data into the mySQL Database.
But as Moodle does nearly the same, only Using a Web Frontend to collect the Data for the Questions and the Quiz, i wonder, if i couldn't use Moodles functions for creating such a Quiz, but I didn't get any clue from the code, which methodes to call.

Hope that helps to better understand my question.

Ingmar

<Edit>
What I need to get my hands on is, how and where Moodle inserts Questions and Quiz into the Database.
</Edit>
Válasz erre: Ingmar Evers

Re: Automatic generation of Multiple Choice Quiz

hon wai lau írta időpontban
What is the ontology you mean and the tuplespace? A philosophy class?

Do you mean something like a set of logical statement:

Q1 => A1
Q2 => A2
Q3 => A3
...
Q100 => A100

where Q1: something like premise/condition, A1: something like deduction/conclusion

And you want the question be generated like:

Q2 => A2(correct), A11, A43, A55
Q10 => A10(correct), A41, A77, A33
...

Then bind all question together to form a quiz?

The saving question is specified in the question/type/questiontype.php with function save_question_options and save_question. Quiz just bind a set of questions together with some settings.


Válasz erre: hon wai lau

Re: Automatic generation of Multiple Choice Quiz

Ingmar Evers írta időpontban
Thanks for your help so far,

no, the ontology is no philosophy class, its just owl Data format.
The Tuplespace itself is a sql space.
One last question about the Quiz:
I have figured out, how to insert Multiple Choice Questions into the database, but haven't found any function for "binding" these questions together to a quiz.
Do you have any hint for me, which file to investigate for this function in the quiz directory?

Kind Regards
Ingmar Evers
Válasz erre: Ingmar Evers

Re: Automatic generation of Multiple Choice Quiz

Tim Hunt írta időpontban
Kép Kép Kép Kép Kép
To answer the meta-question "How do you work out which Moodle code does X?"

Look at the URL in your web browser. For example, when you are editing a question, and then click save, the URL is question/question.php, and that is the script to look at.

Editing a quiz is mod/quiz/edit.php.

Both of those scripts use various functions or methods to do the actual work. For a question it is default_questiontype::save_question. To understand what is going on, try adding

print_object($question);
print_object($form);
exit;

to save_question, then editing a question.