The problem was with the non-UTF-8-safe way that a question name
was being constructed from the question text.
I have done a proper fix with methods in the base class to
carefully construct a question name that is reasonable, and
which will fit in the database column. Then I have changed all
importers to use the new methods.
I also remembered not to break the lesson in the process.
Using consants to refer to plugin names is crazy. The whole point of
plugins is that you can install more, hence the list of constants will
never be complete.
This change introduces #### as a separator for general feedback. You need
to add ####General feedback goes here as the last thing inside the {...}.
For example
// question: 123 name: Shortanswer
::Shortanswer::Which is the best animal?{
=Frog#Good!
=%50%Cat#What is it with Moodlers and cats?
=%0%*#Completely wrong
####Here is some general feedback!
}
Note that this change is not entirely backwards compatible. It will break
any existing GIFT file where the character sequence #### us used between the
{} as part of the question. This seems highly unlikely.
In a few situations, this full stop makes things a bit more grammatical,
but there are many other situations where it causes problems. So, on
balance we will remove it.
NUMBER(X,Y) typically come back from the DB as strings. If you don't
convert them to float, then when you display them, it appears as
1.0000000, which is not normally what you want.
Also, increase the size of the field on the edit form, so if you
question does have default mark 0.1234567, you can see that!
The changes between Moodle 1.9 and 2.1 made the marking of very small
answers like 10^-20 almost impossible. This change fixes it.
This fix is almost entirely due the the careful research of Pierre
Pichet, who carefully testing various proposals, and worked out that
this one seemed best.
The options that are remembered persistently are
* Also show questions from sub-categories
* Also show old questions
* Show question text in the question list
* Number of questions per page
This adds cron code which looks for question previews that have not been
touched for more than 24 hours, and deletes them.
We try to delete previews immediately. For example if the user clicks
start again, then we immediately delete their previous preview. However,
we can't do that if they just close the preview window. Hence we need
some cron code to clean up old preview that have got left lying around.
Normally, this code will not have much to do, so it will be very fast,
so we can afford to run it every cron.
This has been implemented in such a way that in future it will be easy
to add other cron code to the question bank.
Sadly, to make this work on MySQL, we require a horrible hack in the
already hacky delete_usage_records_for_mysql function.