The following SQL script was contributed by Poodll user Ben Haensel for converting from: qtype_poodll to qtype_cloudpoodll

ie, from the Poodll Recording Question to the Cloud Poodll Recording Question. It allows you to convert course by course, by setting the courseid and running the script.


Please note that this needs to be used with some caution. It will convert the question type in the database to the new question type. But it won't bring over existing user data (responses) and since Cloud Poodll Question Type does not support snapshot or whiteboard response types, it wont work for those questions. It only works for audio and video recording questions.


So:

i) reset the quiz attempts for affected quizzes (since the pre-converted user data will be lost for the questions)

ii) backup the course/quizzes, so you can rollback if necessary

iii) set the courseid in the @course=xxx; line of the script

iv) run it.


Good Luck


------------------------
###This is a HUGE Timesaver for converting Audio and Video questions, and the change is irreversible###
###This omits changes to PICTURE (whiteboard) questions###
###FIRST clear (reset) all quiz attempts with poodll questions###

set @course = 875;

insert ignore into mdl_qtype_cloudpoodll_opts (questionid,responseformat,graderinfo,graderinfoformat,qresource,timelimit,language,expiredays,transcode,transcriber,audioskin,videoskin,safesave)

select
po.questionid,
po.responseformat,
po.graderinfo,
po.graderinfoformat,
po.qresource,
po.timelimit,
(select value from mdl_config_plugins where plugin = 'qtype_cloudpoodll' and name = 'language') language,
(select value from mdl_config_plugins where plugin = 'qtype_cloudpoodll' and name = 'expiredays') expiredays,
(select value from mdl_config_plugins where plugin = 'qtype_cloudpoodll' and name = 'transcode') transcode,
(select value from mdl_config_plugins where plugin = 'qtype_cloudpoodll' and name = 'transcriber') transcriber,
(select value from mdl_config_plugins where plugin = 'qtype_cloudpoodll' and name = 'audioskin') audioskin,
(select value from mdl_config_plugins where plugin = 'qtype_cloudpoodll' and name = 'videoskin') videoskin,
po.safesave
from mdl_qtype_poodllrecording_opts po
join mdl_question qu on po.questionid = qu.id
join mdl_quiz_slots qs on qu.id = qs.questionid
join mdl_quiz q on q.id = qs.quizid
where q.course = @course
and po.responseformat <> 'picture'
and qu.qtype = 'poodllrecording';

delete po.* from mdl_qtype_poodllrecording_opts po
join mdl_question qu on po.questionid = qu.id
join mdl_quiz_slots qs on qu.id = qs.questionid
join mdl_quiz q on q.id = qs.quizid
where q.course = @course
and po.responseformat <> 'picture'
and qu.qtype = 'poodllrecording';

update mdl_question qu
join mdl_quiz_slots qs on qu.id = qs.questionid
join mdl_quiz q on q.id = qs.quizid
left join mdl_qtype_poodllrecording_opts po on po.questionid = qu.id and po.responseformat = 'picture'
set qu.qtype = 'cloudpoodll'
where q.course = @course
and po.id is null
and qu.qtype = 'poodllrecording';
-----------------------