Ajax feature in moodle

Ajax feature in moodle

Karthick B發表於
Number of replies: 2
Hi,

I am using moodle 1.9.x and i know it supports Ajax features.

1 . Can anyone tell me in what are all cases moodle uses Ajax feature?

2. Is there any way to restrict students not to select whether they want ajax feature or not while editing their profile. (ie) i want to give the admin only to decide whether to use Ajax feature or not for the student via the role settings?

Thanks
Karthick B
評比平均分數: -
In reply to Karthick B

Re: Ajax feature in moodle

John White發表於
Karthick,

The only Activity that up to 1.9.4 offers AJAX in its admin panel is the Forum, so maybe its the only one so far that uses it. The Chameleon theme uses it apparently, and Ed Coyne is working on Ajax Student Projects.

Preventing uses turning off this feature would probably mean a code change...
Open the file public_html/user/editlib.php in a proper html/php/text editor and look for the block...

if (empty($CFG->enableajax)) {
$mform->addElement('static', 'ajaxdisabled', get_string('ajaxuse'), get_string('ajaxno'));
$mform->setAdvanced('ajaxdisabled');
} else {
$choices = array();
$choices['0'] = get_string('ajaxno');
$choices['1'] = get_string('ajaxyes');
$mform->addElement('select', 'ajax', get_string('ajaxuse'), $choices);
$mform->setDefault('ajax', 0);
$mform->setAdvanced('ajax');
}

...comment this out with the usual /* ... */

Do not forget that users can just switch off Javascript in their local browser if they really want to!!!

Regards,

John

See also discussion about Eloy's work on forum Ajax: http://moodle.org/mod/forum/discuss.php?d=114500