我正在配置moodle证书插件,我有问题。有没有办法将证书插件配置为考试通过后自动发送证书?
第二个问题:有没有办法通过电子邮件发送测验结果?
感谢您的回答
发布于 2014-02-26 08:10:50
有一个quiz_attempt_submitted事件
/mod/quiz/db/events.php
,它发送具有以下属性的对象
->component = 'mod_quiz';
->attemptid = // The id of the quiz attempt that was submitted.
->timefinish = // The timestamp of when the attempt was submitted.
->timestamp = // The timestamp of when the attempt was submitted.
->userid = // The user id that the attempt belongs to.
->submitterid = // The user id of the user who sumitted the attempt.
->quizid = // The quiz id of the quiz the attempt belongs to.
->cmid = // The course_module id of the quiz the attempt belongs to.
->courseid = // The course id of the course the quiz belongs to.
您可以编写一个本地插件来响应提交的事件,并检查它们是否通过了考试。如果他们有,那就发一封电子邮件。
http://docs.moodle.org/dev/Events_API#Handling_an_event
创建/local/sendcertificate/db/events.php,如下所示
$handlers = array (
'quiz_attempt_submitted' => array (
'handlerfile' => '/local/sendcertificate/lib.php',
'handlerfunction' => 'local_sendcertificate_quizsubmitted',
'schedule' => 'instant',
'internal' => 1,
),
);
然后在/local/sendcertificate/lib.php中
function local_sendcertificate_quizsubmitted($quizattempt) {
// Check if quizattempt is successful
// Generate the certificate as a pdf
// Email it to the user
}
您还需要为本地插件添加几个文件
发布于 2014-02-26 07:52:45
'mod_certificate‘和'mod_simplecertificate’都没有通过电子邮件自动发送证书的选项(‘通过考试’,我想你的意思是‘用户在Moodle中完成了某种活动’)。
您可以将证书配置为在学生查看证书时通过电子邮件发送给教师(或其他用户的特定列表)(并且可以将证书设置为仅在满足特定条件时才可查看)。
要做你想做的事情,唯一的方法是让开发人员通过代码添加功能。
可以将测验模块配置为在提交测验时自动发送电子邮件(向提交测验的教师和/或学生),并在测验过期时发送电子邮件。您可以通过电子邮件发送结果的唯一方法是手动导出结果,然后自己通过电子邮件发送。
同样,这是一个可以由开发人员添加的功能,但如果不更改代码,则无法完成此功能。
https://stackoverflow.com/questions/22026954
复制