{"name":"QuizSafe Save","key":"quizsafesave","version":"1.0.0","instructions":"Add this widget in an HTML block on quiz pages containing ONE Poodll recording or ONE Cloud Poodll question, to prevent user leaving page without uploading.","showatto":"1","showplayers":"0","requirecss":"","requirejs":"","shim":"","defaults":"qtype=\"poodllrecording|cloudpoodll\"","amd":"1","body":"<div id='@@AUTOID@@'>You must finish uploading, before you can leave this page.</div>","bodyend":"","script":"var savebtn = $('.submitbtns .mod_quiz-next-nav');\n\n//Cloud Poodll Recording Question\nif(@@qtype@@ =='cloudpoodll'){ \n  document.addEventListener(\"cpquestionStarted\", function (e) {\n    savebtn.attr('disabled','disabled');\n  });\n  document.addEventListener(\"cpquestionUploaded\", function (e) {\n    savebtn.removeAttr('disabled');\n  });\n\n//Poodll Recording Question\n}else{\n  savebtn.attr('disabled','disabled');\n  document.addEventListener(\"prquestionUploaded\", function (e) {\n    savebtn.removeAttr('disabled');\n  });\n\n}\n\n","style":"","dataset":"","datasetvars":"","alternate":"","alternateend":""}