STACK plugin: Error writing to database when adding a PRT

STACK plugin: Error writing to database when adding a PRT

by Oleg Melnikov -
Number of replies: 5

Hi All. I'm facing this error in STACK Plugin whenever I try to add 20th potential response trees (PRT), regardless of the name or location in the question. I exported the question. XML looks neat and clean. Then imported it back hoping that any weird character will drop. It did not help. I'm still facing the same error, when trying to add one more PRT. Notably, additional input/validation do not cause this error. 

Is there a limit on PRTs? If so, is there an easy way to raise it? If there is no limit, what may I not be doing correctly? 

UPDATE: I just tried creating a new STACK question with 20 PRTs and succeeded. So, something else in the question clashes with an additional PRT. What might this be? I can share the designed STACK question (privately), if it helps.

Here is the error:

error

Average of ratings: -
In reply to Oleg Melnikov

Re: STACK plugin: Error writing to database when adding a PRT

by Oleg Melnikov -
Update: I ended up re-creating the problem from scratch (besides copy-pasting former text), starting with building 20+ PRTs. It is now seems to be working correctly. I'm guessing there might have been some corrupted character or setting. If anyone has ideas on how to "clean" or "repair" STACK questions, please share your thoughts.
In reply to Oleg Melnikov

Re: STACK plugin: Error writing to database when adding a PRT

by Christopher Sangwin -
Picture of Particularly helpful Moodlers Picture of Plugin developers
This may be a pre-existing bug, in which case I'm sorry. One way to "clean" things is to export the XML. This is not pleasant to read, but you can read and edit it. We occasionally do bulk question cleaning on the XML but this is not for the timid, inexperienced or beginner!
In reply to Christopher Sangwin

Re: STACK plugin: Error writing to database when adding a PRT

by Oleg Melnikov -
Hi Chris. Thanks for a quick reply. I am comfortable with reading/exporting XML and did so, but was unable to find anything obviously wrong with XML content. When I imported it back, the issue persisted. Is there some specific way to clean up XML ? For example, I have not tried re-saving XML as ASCII to delete invisible and potentially problematic characters (although, I'd also lose my emoji engagers smile ).
In reply to Oleg Melnikov

Re: STACK plugin: Error writing to database when adding a PRT

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
If you are hitting a cryptic error like this, then in Moodle you can go to Admin -> Development -> Debugging and set the level to 'Developer', then you will get to see a lot more details about errors. You should not do that on a live Moodle site, but I see you are running on localhost here.
Average of ratings: Useful (1)
In reply to Tim Hunt

Re: STACK plugin: Error writing to database when adding a PRT

by Oleg Melnikov -
Hi Tim. This is very helpful! I'll turn it on (on a localhost only), if there is a similar issue.