Thanks to Jean-Michel and Andrew for giving us some insights in the mySQL syntax.
To further refine the mySql "formula", I suggest the following, which will set the feedback text at Correct for Grade = 100%, Partially correct for Grade <100% but >0% and Incorrect for Grade = 0% (normally it is not possible to record a Grade <0% in Moodle questions), while preserving actual feedback text if any.
UPDATE mdl_question_answers SET feedback = CONCAT('Correct. ', feedback) WHERE fraction = 100; UPDATE mdl_question_answers SET feedback = CONCAT('Partially Correct. ', feedback) WHERE fraction < 100 && fraction > 0; UPDATE mdl_question_answers SET feedback = CONCAT('Incorrect. ', feedback) WHERE fraction = 0;
Tried and tested on my local Moodle install mySql database, with phpMyAdmin.
Joseph