うたがわさま
ご返信ありがとうございます。
確かに、私の質問は不躾な質問ばかりでした。大変申し訳ございません。
以後気をつけて参ります。
Yoshidaさま
ご返信ありがとうございます。
分かりにくい表現で大変申し訳ございません。
「このフォルダ」というのは新規に開発したディレクトリ(pluginという名で作成)を指しております。
pluginディレクトリに作成した、mod/quiz/locallib.phpの1500行目で読み込んでいる【plugin_quiz.php】のソースと
1500行目付近のソースを以下に記しておきます。
また、現在はMacBook Airで取り組んでおり、Windowsではどうなのか試してみて結果をここに書かせて頂きますので
よろしければ確認して頂けると幸いでございます。
よろしくお願い致します。
【mod/quiz/locallib.phpの1500行目付近のソース(追加部分を太字・下線部をつけて表示)】
/**
* Sends notification messages to the interested parties that assign the role capability
*
* @param object $recipient user object of the intended recipient
* @param object $a associative array of replaceable fields for the templates
*
* @return int|false as for {@link message_send()}.
*/
function quiz_send_notification($recipient, $submitter, $a) {
global $CFG, $DB, $USER, $COURSE;
require "/Applications/MAMP/htdocs/moodle29/blocks/plugin/plugin_quiz.php";
// Recipient info for template.
$a->useridnumber = $recipient->idnumber;
$a->username = fullname($recipient);
$a->userusername = $recipient->username;
// Prepare the message.
$eventdata = new stdClass();
$eventdata->component = 'mod_quiz';
$eventdata->name = 'submission';
$eventdata->notification = 1;
【plugin_quiz.phpのソース】
<?php
//mod,quiz,local.phpの1500目あたりに追加
require_once($CFG->dirroot . '/grade/querylib.php');
require_once($CFG->libdir . '/gradelib.php');
$course_id = $COURSE->id;
$user_id = $USER->id;
$course_modules = get_array_of_activities($course_id);
$user = $DB->get_record('user', array('id'=>$user_id));
$result = '';
foreach($course_modules as $key=>$item) {
if ($item->mod == 'quiz') {
$grading_info = grade_get_grades($course_id, 'mod', 'quiz', $item->id, $user_id);
$grade = reset($grading_info->items[0]->grades);
$result .= $item->name . ' - ' . $grade->str_long_grade . ', ';
}
}
$a->result = substr($result, 0, -2);
$sql = "SELECT ls.timecreated AS loggedintime
FROM {logstore_standard_log} ls
WHERE ls.action = :action AND ls.userid = :userid ORDER BY ls.timecreated";
$params = array('action' => 'loggedin', 'userid' => $user_id);
$now = time();
$week = strtotime('-7 day');
$login = '';
$total = 0;
$result2 = '';
$i = 0;
if ($results = $DB->get_records_sql($sql, $params)) {
$a->result2 = '';
foreach ($results as $res) {
$login = $res->loggedintime;
if($login <= $now && $week <= $login) {
$a->result2 .= "・" . date("Y/m/d H:i:s", $res->loggedintime) . " ";
$i++;
if($i % 3 == 0){
$a->result2 .= "\r";
}
}
}
$total = count($results);
$a->result2 .= "\r" . get_string('total') . get_string('login') . ":" . $total . "回";
}
?>