duanchuo7741 2013-02-19 04:23
浏览 47
已采纳

如何使用moodle核心并摆脱其他一切?

(Using Moodle 2.4)

In my company we need to program a web app that uses moodle's inner mechanisms that manage courses, users, database connections, etc., but only that. Nothing else.

We want to get rid of YUI, the GUI, and anything graphical. We don't want $PAGE or anything similar since it doesn't have anything to do with the important data in moodle (users, course content, etc). We just want the core. We'll make a completely new frontend. We have our own framework.

Is there a PHP file(s) that we can include in our scripts, that lets us call some functions or send some commands to the moodle core, to create an user, get user listing, create a course, etc?

If so, which ones are they? Where to start?

I've been looking this for months; in handbooks, in moodle's documentation, etc. But I still don't have a straightforward answer.

I hope you know what I mean. Something like

require_once('moodle_core.php');
$MOODLE_CORE -> create_user('Joe Winston','JW','123Password');

Does such thing exist? Is there a tutorial or a book about that?

  • 写回答

1条回答 默认 最新

  • duan7772 2013-02-19 18:04
    关注

    Moodle magic begins when you include main config file for example -

    require_once 'config.php';
    
    //load course lib file to use course related functions
    require_once $CFG->dirroot.'/course/lib.php';
    
    $course = new stdClass();
    $course->category = 1;
    $course->fullname = 'My_test_course';
    
    create_course($course);
    

    For detail functions look into moodle documentation - http://docs.moodle.org/dev/Core_APIs

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 随身WiFi网络灯亮但是没有网络,如何解决?
  • ¥15 gdf格式的脑电数据如何处理matlab
  • ¥20 重新写的代码替换了之后运行hbuliderx就这样了
  • ¥100 监控抖音用户作品更新可以微信公众号提醒
  • ¥15 UE5 如何可以不渲染HDRIBackdrop背景
  • ¥70 2048小游戏毕设项目
  • ¥20 mysql架构,按照姓名分表
  • ¥15 MATLAB实现区间[a,b]上的Gauss-Legendre积分
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 linux驱动,linux应用,多线程