moodle

On Course Completion update external database

大兔子大兔子 提交于 2019-12-10 10:32:14
问题 My scenario; A user in Moodle completes a course. I'd like to update an external database once this happens. My understanding is that the course_completed event is triggered every time the cron job is run. Which is the best approach to update an external database with some simple values e.g Username/ID, CourseID and maybe Date of Completion, of the completed courses? I'd rather not hack the completion/cron.php to do this, but will if I have to! 回答1: You'll need to create a local plugin. http:

how to load external JS file into moodle?

♀尐吖头ヾ 提交于 2019-12-10 02:02:28
问题 how to load external JS file into moodle ? using moodle api ,i.e moodle libraries .. 回答1: In Moodle 2.0 I have always used $PAGE->requires->js() . To start with, make $PAGE available to your code by doing: require_once($CFG->libdir . '/pagelib.php'); global $PAGE; and then in your code: $PAGE->requires->js( new moodle_url($CFG->wwwroot . '/blocks/your_block/script.js') ); It is required to put moodle_url() around your path! 回答2: <?php //you have load $CFG , firstly check in config.php //after

cURL works from Terminal, but not from PHP

血红的双手。 提交于 2019-12-10 01:02:42
问题 I'm running into a rather strange issue. I'm trying to log into a remote moodle install using curl from PHP. I have a curl command, which works perfectly in the Terminal. When I translate the same thing into PHP, it works, but it just doesn't login. The exact same value which successfully login via terminal, somehow trips up the login system via PHP and it doesn't login. Instead, it returns the login page again. My cURL command (data section ommitted as it has my username and password): curl

Path to profile picture in Moodle?

前提是你 提交于 2019-12-09 13:48:12
问题 I was programming something in moodle web-application and was looking into retrieving the path of the user profile images. I assumed I could find the path somewhere in the database but I only got to mdl_user.picture and mdl_user.imagealt, so practically I know who has uploaded a picture but can't get to which picture he/she uploaded. Is there a way to get it from the database? Thanks for your help, OM 回答1: If you want the image tag you can use print_user_picture() and pass the user object

Why is moodle not available?

落花浮王杯 提交于 2019-12-09 07:38:27
I configured moodle but I'm getting an error message: Fatal error: $CFG->dataroot is not configured properly, directory does not exist or is not accessible! Exiting. My moodle directory is in var/www/html/moodle and in my moodle/config.php is $CFG->dataroot = '/var/moodledata'; Still nothing works when I try to start moodle. What can be done about it? I think the moodledata folder does not have write permission. provide 0777 permission to the folder then it should be accessible. Moodle does need to create and delete files within its working folder. If the folder owner is Apache , then you

How to override a renderer such that the functionality of the overridden renderer also remains available?

社会主义新天地 提交于 2019-12-08 11:53:20
问题 Moodle has a Multichoice question-type plugin . These questions are used in Quizes . I have different types of multiple choice questions which I want to be displayed. They are all basically MCQ's, but are rendered in different ways. Forexample some are *simple MCQ'*s, while others have a reading passage associated with them (which the student has to read and find the answer from it) which needs to be displayed. Then the reading passage can be displayed in different ways in further different

how to edit echo $OUTPUT->main_content() MOODLE

谁说我不能喝 提交于 2019-12-08 08:49:09
问题 How to change the contents of this output?? I'm trying to change , but can not find the file q make this change how to edit echo $OUTPUT->main_content(); in BCU theme 回答1: The function main_content() is in /lib/outputrenderers.php But you should override it by adding function main_content() to class theme_bcu_core_renderer in /theme/bcu/renderers.php 来源: https://stackoverflow.com/questions/35607210/how-to-edit-echo-output-main-content-moodle

moodle “Can not initialise PHP session, please verify that your browser accepts cookies.”

丶灬走出姿态 提交于 2019-12-08 02:15:22
问题 I'm trying to install MOODLE locally and i face this problem Can not initialize PHP session, please verify that your browser accepts cookies. I'm trying to enable cookie (I'm using chrome) following these steps https://support.google.com/accounts/bin/answer.py?hl=en&answer=61416 and I also tried to config php.ini http://support.qualityunit.com/021373-How-To-Enable-Session-Support-for-PHP but still can't solve it anyone can help me? php configuration <br/> session Session Support enabled

HTML5 CORS request fails in safari after redirect

不羁的心 提交于 2019-12-07 22:07:11
问题 I am crafting a CORS request with jQuery to accomplish a SSO type system. User logs into wordpress and with a hook at the same time also logs into Moodle. The problem I'm having is that in Safari (and only safari ~7+) when the inital POST request is set to moodlesite.com/login/index.php there is a redirect to: moodlesite.com/login/index.php?testsession=user_id. When this redirect occurs Safari drops the applicable CORS headers and then the request to the redirected URL fails. 回答1: I posted

Moodle 2.0 with Nginx backend

扶醉桌前 提交于 2019-12-07 14:58:58
问题 Hello I am looking for a tutorial on how to configure a server for Moodle 2.0 with nginx as the server and PHP-FPM or FastCGI with mySQL as the backend. Sorry if I am confusing these terms bit of a server architecture noob. Probably would run it on Ubuntu/Debian machine found a tutorial for older versions of Moodle with older PHP and PostgreSQL compiled from source. This would slow down my deployment plans and seems deprecated. Also would prefer MySQL over Postgres based on my experience