2014-02-25 95 views
0

我正在配置moodle證書插件,我有問題。通過考試後,有沒有辦法配置證書插件自動發送證書?Moodle自動發送證書

和第二個問題: 有沒有辦法通過電子郵件發送測驗結果?

感謝答案

+0

我投票結束這個問題,因爲它是關於配置Moodle,而不是編程。 –

回答

0

既不是「mod_certificate」也不是「mod_simplecertificate」必須通過電子郵件(通過「通過考試」自動發送證書的一個選擇,我假定你的意思是,「用戶完成某種活動在Moodle中)。

您可以將證書配置爲通過電子郵件發送給教師(或其他用戶的特定列表),以供學生查看(您可以將證書設置爲僅當某個標準爲滿足)。

做你想做的事情的唯一方法是讓開發人員通過代碼添加功能。

測驗模塊可以配置爲在測驗提交時(發送給老師和/或提交測驗的學生)自動發送電子郵件,並在測驗過期時發送電子郵件。您可以通過電子郵件發送結果的唯一方法是手動導出它們,然後自己發送電子郵件。

同樣,這是一個功能,可以由開發人員添加,但無法在沒有代碼更改的情況下完成。

2

有一個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/lib.php像

$handlers = array (
    'quiz_attempt_submitted' => array (
     'handlerfile'  => '/local/sendcertificate/lib.php', 
     'handlerfunction' => 'local_sendcertificate_quizsubmitted', 
     'schedule'   => 'instant', 
     'internal'   => 1, 
    ), 
); 

然後創建/local/sendcertificate/db/events.php

function local_sendcertificate_quizsubmitted($quizattempt) { 
    // Check if quizattempt is successful 
    // Generate the certificate as a pdf 
    // Email it to the user 
} 

你需要爲本地插件添加幾個文件

http://docs.moodle.org/dev/Local_plugins