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

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

报告相同问题?

悬赏问题

  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP