المواضيع التي نشرها Judy Hsu

Moodle in English -> Text editors -> looking for the file that control the HTML editor default size

بواسطة - Judy Hsu
Hi, all, sorry that I'm not that familiar with the HTML editor codes. I'm trying to make the default html editor "text area" size a little bit bigger (I believe the moodle default is rows="10" cols="45" for textarea class in HTML editor), but I don't know exactly which file has control or hard-coded for this setting. Can someone please help? Thanks!
متوسط التقييمات: -

Hi all, I'm new to hacking moodle forum module and hope I could get some help from people here.

I noticed that after moodle 1.7(?), when you create a new "forum", the option (pull-down menu) of "Can a student post to this forum" has disappeared. I believe this is now being handled by the role overwrite/permission tab, which to be honest, is sort of confusing and not really user-friendly.

So I'm trying to add this pull-down menu option back to Moodle 1.9.x, and I have located the GUI file (/mod/forum/mod_form.php) and made some changes at around line #35 (see screenshot). However, I'm not familiar with the permission functions and don't know how to tie the front-end GUI codes with the backend. Could anyone please give me some hints or help about how to do that (for example, which file or function I should look into, and what permission/capability functions to use and how to use them)? Thanks guys!

المرفق mod_form_hack.png
متوسط التقييمات: -

Moodle in English -> Roles and permissions -> Replace isadmin() with has_capability in /course/edit_form.php

بواسطة - Judy Hsu
Hi there...

As we have an seperate authentication system and we don't want our teachers to change the course Full name, Short name, Course ID number in the "Edit course settings" page, so I have implemented the following code in the /course/edit_form.php to add a isadmin() check

if (isadmin()) {
$mform->setHelpButton('category', array('coursecategory', get_string('category')));
$mform->setDefault('category', $category->id);
$mform->setType('category', PARAM_INT);

$mform->addElement('text','fullname', get_string('fullname'),'maxlength="254" size="50"');
$mform->setHelpButton('fullname', array('coursefullname', get_string('fullname')), true);
$mform->setDefault('fullname', get_string('defaultcoursefullname'));
$mform->addRule('fullname', get_string('missingfullname'), 'required', null, 'client');
$mform->setType('fullname', PARAM_MULTILANG);

$mform->addElement('text','shortname', get_string('shortname'),'maxlength="100" size="20"');
$mform->setHelpButton('shortname', array('courseshortname', get_string('shortname')), true);
$mform->setDefault('shortname', get_string('defaultcourseshortname'));
$mform->addRule('shortname', get_string('missingshortname'), 'required', null, 'client');
$mform->setType('shortname', PARAM_MULTILANG);

$mform->addElement('text','idnumber', get_string('idnumbercourse'),'maxlength="100" size="10"');
$mform->setHelpButton('idnumber', array('courseidnumber', get_string('idnumbercourse')), true);
$mform->setType('idnumber', PARAM_RAW);

} else {
$mform->addElement('text','fullname', get_string('fullname'),'disabled maxlength="254" size="50"');
$mform->setHelpButton('fullname', array('coursefullname', get_string('fullname')), true);
$mform->addElement('text','shortname', get_string('shortname'),'disabled maxlength="100" size="20"');
$mform->setHelpButton('shortname', array('courseshortname', get_string('shortname')), true);
$mform->addElement('text','idnumber', get_string('idnumbercourse'),'disabled maxlength="100" size="10"');
$mform->setHelpButton('idnumber', array('courseidnumber', get_string('idnumbercourse')), true);
}

However I think in moodle 1.9 this is probably not the best way to implement it as we should probably avoid using isadmin(). However I couldn't find a matching "has_capability()" to implmement this. Any suggestion? Thanks!
المرفق edit_course_settings.png
متوسط التقييمات: -

Moodle in English -> General help -> 3rd party plugin to quickly generate 40000+ user accounts?

بواسطة - Judy Hsu
Hi I remember that I saw something in download.moodle.org (under modules and plugins section) before but can't really find it anymore. Does anyone know of a simple way (a script or something) to quickly generate 40000+ user accounts and 4000+ courses and randomly assign these pseudo students into these randomly created fake courses for testing issues? Thanks much!
متوسط التقييمات: -