How do I insert programming code inside a Questionnaire, so I can add-up certain numerical answers?

How do I insert programming code inside a Questionnaire, so I can add-up certain numerical answers?

by Rolf Cper -
Number of replies: 0

Hallo,
I tried to make the questioning-procedure as I describe below, by means of the Quiz activity-module.
I did not succeed, because quizzes are made for grading, and I need to add up the instances of certain choices made.
So, I am now trying to reconstruct my questioning-procedure by means of the Questionnaire activity-module, as my questions resemble vaguely a personality test.

Yet again, I still cannot figure out how I can add up certain aspects of answers (simple calculations).
Do you know a way?

Here is my challenge:
In my Question-bank I want to compose a complex quiz that can do the following:
One question consists of four statements that a student should evaluate according to his liking.
The student should use per four statements as an answer only one of the numbers: 1 or 2 or 3 or 4.
Each number should only show up once per round of four statements.
Each statement has a hidden property: Mammal, or Reptile, or Amphibian, or Bird.
Each statement must be answered by the student in a way that shows his appreciation:
very well (= 4), or well (= 3), or hardly (= 2), or not at all (= 1).

For example
Question 1:
"I like mice."       (Choose your answer from 1 to 4.) Answer chosen: 3.
"I like geese."      (Choose your answer from 1 to 4.) Answer chosen: 2.
"I like salamanders."   (Choose your answer from 1 to 4.) Answer chosen: 4.
"I like snakes."      (Choose your answer from 1 to 4.) Answer chosen: 1.

Question 2:
"At home, I would like to have a dog as pet."    (Choose your answer from 1 to 4.) Answer chosen: 4.
"At home, I would like to have a cat as pet."    (Choose your answer from 1 to 4.) Answer chosen: 3.
"At home, would like to I have a canary as pet." (Choose your answer from 1 to 4.) Answer chosen: 1.
"At home, would like to I have a lizard as pet." (Choose your answer from 1 to 4.) Answer chosen: 2.

Question 3: etcetera ...

Then, the Moodle quiz functionality should calculate from all questions together, which total points the hidden properties have received by this student.
If we look at the two questions above, adding up will result in the following outcome with regard to hidden property:
Mammal     : 10
Reptile    : 3
Amphibian  : 4
Bird       : 3
(The example above is fake, because the actual questions are more complex.)

So, there is no grading, but the content of the numerical answers should be used to form an impression.
The numerical answers should be added up regarding a communal property (mammal, reptile etc.).
The four final totals are a 'self-test grade' showing the personal preference of this student regarding four categories.
The student should not be bothered with all kinds of meta data and detailed information that come with Moodle quiz functionality (hidden?).

Now, I guess you know what I am going to ask:
Which Quiz-format, Questionnaire-settings or combination of question functionality should I use to build such a qustioning procedure?

Thanking you in advance, I await your answer,
Rges
Moodle 3.0

Average of ratings: -