multiple of same calculated question in a quiz

multiple of same calculated question in a quiz

by Daniele Moretti -
Number of replies: 11

Dear,

i've tried to insert multiple of the same WIRIS  question in a quiz without success,

Since this WIRIS question requires to solve always different inequalities I don't need other question in the quiz except several times of the same.

is it possible?

Thank you

Daniele

Average of ratings: -
In reply to Daniele Moretti

Re: multiple of same calculated question in a quiz

by WIRIS team -
Picture of Plugin developers
AFAIK, Moodle won't allow the same question instantiated more than once in a quiz, WIRIS' or not.
An easy workaround is to clone the question as many times as you need in the question bank, and then add the different copies to your quiz.
In reply to WIRIS team

Re: multiple of same calculated question in a quiz

by Daniele Moretti -

Thank you for your answer.

your solution is a good workaroud that will work but it is dirty

Daniele


In reply to Daniele Moretti

Re: multiple of same calculated question in a quiz

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

It really should be possible to do this (add multiple copies of the same calculated question to a quiz).

A long time ago, it would have been almost impossible to do that for technical reasons (question id was used as the part of the unique key for all sorts of quiz/question related data).

Over the years, I think all of those have been eliminated from the code. I least, that has been one of my goals. I think it has now been done, so really all that remains is to change the Edit quiz screen to let you add multiple copies of a question, if that question has multiple variants (like calculated, STACK, formulas, ... questions do.)

If anyone would like to test this, you could try creating a quiz like this manually, and test if it works. Please only do this on a test server, at least until you have done enough testing to verify that it actually works:

  1. Create a calculated question with a dataset of 10 items (or use another similar qtype of your choice).
  2. Also make sure that you have at least 9 other questions in your question bank.
  3. Create a quiz.
  4. Add the calculated question as Q1.
  5. Add the 9 other questions.
  6. Now, look in the question bank, in the quiz_slots table. Find the 10 rows that link the quiz to the 10 questions. It might look something like
    | slot | quizid | page | ... | questionid | ... |
    |   1  |   123  |   1  | ... |      456   | ... |
    |   2  |   123  |   2  | ... |      457   | ... |
    |   3  |   123  |   3  | ... |      458   | ... |
    |   4  |   123  |   4  | ... |      234   | ... |
    |   5  |   123  |   5  | ... |      235   | ... |
    |   6  |   123  |   6  | ... |      236   | ... |
    |   7  |   123  |   7  | ... |      237   | ... |
    |   8  |   123  |   8  | ... |      238   | ... |
    |   9  |   123  |   9  | ... |      459   | ... |
    |  10  |   123  |  10  | ... |      460   | ... |
    
  7. Now, edit that, so for all these rows, the questionid is 456 (the id of your calculated question).

Please test very carefully before assuming that it is working. Test:

  • Attempting the quiz as a student.
  • Verify that each variant of the question gets used once.
  • Viewing all the quiz reports after there are some student attempts.
  • In particular, how does the statistics report handle this?
  • Be very careful with the Edit quiz page after you have done this. Some edits may be safe, but others will probably break.

Testing this manual method would tell us how close we are to being able to implement this fully in Moodle, if anyone has time to do the testing.

In reply to Tim Hunt

Re: multiple of same calculated question in a quiz

by Daniele Moretti -
Thanks!


I can't run this test because we don't have a test server.

I hope that someone can run this test ASAP, so that is possible to change quiz's structure .

Daniele

In reply to Daniele Moretti

Re: multiple of same calculated question in a quiz

by Emma Richardson -
Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Plugin developers
There are lots of ways to fire up a test server - you should look at MAMP - you could have a server up and running on your computer in less than an hour. Realistically, even if someone did have the time to do testing for you (which is doubtful unless someone is wanting this solution too), are you going to trust their results and then try this on your live server?
In reply to Emma Richardson

Re: multiple of same calculated question in a quiz

by Daniele Moretti -
You're right, I'll try to turn on a test server.
However since I trust the updates of the whole platform, I also trust the tests, made by people more competent than me in the matter.
Otherwise I don't think it's wise for someone to do updates based only on my test.
Daniele
In reply to Daniele Moretti

Re: multiple of same calculated question in a quiz

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
If this is all core stuff you could get yourself . free MoodleCloud account and experiment there. Actually get yourself a MoodleCloud account anyway as it is just a really nice thing.
In reply to Marcus Green

Re: multiple of same calculated question in a quiz

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
With a MoodleCloud site, you won't be able to directly access the database and mess around!
In reply to Tim Hunt

Re: multiple of same calculated question in a quiz

by Marcus Green -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
OK, so ignore everything I said apart from.
'Actually get yourself a MoodleCloud account anyway as it is just a really nice thing.'
In reply to Tim Hunt

Re: multiple of same calculated question in a quiz

by Ewout ter Haar -
I just did this, using 3 questions and manually updating the quiz_slots table as you described.
  • The quiz edit page correctly displays three identical questions.
  • One immediate problem that arose is that the attempt page only shows 1 question.
  •  The review page says "Marks 0.00/3.00" (correctly).
  • The report overview page also has 3 question columns (as it should).
  • The responses report gives "Exception - Access to undeclared static property: question_state::$" (after " Trying to get property 'flagged' of non-object in /var/dados/html/moodle37/mod/quiz/report/attemptsreport_table.php on line 284"
  • The statistics report crashes :"Warning: Division by zero in /var/dados/html/moodle37/question/classes/statistics/questions/calculator.php on line 349" and "Unknown column 'NAN' in 'field list' INSERT INTO mdl_question_statistics "
haha, I think I'll stop now.

(Moodle 3.7)
In reply to Ewout ter Haar

Re: multiple of same calculated question in a quiz

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Thank you very much for trying this out. I guess there is more work to do than I though.

Probably the report page problems follow from the during the attempt problem.