【发布时间】:2015-09-21 13:17:01
【问题描述】:
有谁知道是否可以以编程方式将活动添加到 Moodle 中的课程中?
我在想也许可以使用自定义插件的 lib.php 中的 module_add_instance() 类...
例如
function feedback_add_instance(stdClass $mod) {
global $DB;
$newmodule->timecreated = time();
// You may have to add extra stuff in here.
$newmodule->id = $DB->insert_record('exams', $newmodule);
unicexams_grade_item_update($newmodule);
return $newmodule->id;
}
但话又说回来:$mod 变量是什么?它包含什么以及如何构建它?
有人知道这方面的知识吗?或者有什么建议?
【问题讨论】: