Showing posts with label tips. Show all posts
Showing posts with label tips. Show all posts

2012/10/29

Little bit of spying

Maybe under slight influence of the latest James Bond movie, but more probably because I was asked for it, I provide you with SQL query to spy on your teachers. This asnwers a question which courses have a teacher (or teachers) and when was the first time and last time they visited their courses.
It could be used for 1.8+ version of Moodle, with default setting of roles (as roleid = 3 means "teacher" role).
I don't know about speed of this thing, so be careful of running this on production servers under heavy load. Use it lightly, no whipping of lazy teachers please :)


Btw I used Adminer, very lightweight MySql tool, for running this. This can come really handy, if you don't have anything stronger at hand.

2009/04/08

Move category up, up and away!


Recently I needed to move newly created category name higher. So I logged as administrator, went to mymoodle.com/course/index.php page, pressed Turn editing On and..waited..waited..and waited.


I am not sure about using Ajax with moving up/down categories, but by default it could take a while to render form with all categories and subcategories. It surely took me a while for a form with 144 categories and subcategories. When you have subcategories in three level category tree it is getting to add up ;-).

Move newly created category, of course it placed itself just at the bottom, would be really bothersome with such a loading times.

So I got an idea with a quick, dirty solution. Maybe I am just dumb and you all know this, but it took me a while so I want to spare you some minutes thinking.

Survive first form loading, select category to be moved, press up or down arrow in the direction you want category to move, click it, wait for a second, just for page to start to render and stop the loading.

It's a red cross right of refresh button on your browser.



This will stop rendering form with categories and subcategories, but all hard work has already been done behind the curtains. So just enter URL in your address bar (there should be something like yourmoodle.com/course/index.php?moveup=66&sesskey=HoNFzG43Zy - moveup parameter is for category and sesskey is needed for security) or press refresh button (F5 key usually) and repeat stopping/refreshing page few steps needed for category to find new shiny place to live.

I hope I didn't insult my dear readers with such a lazy dirty trick, but these tricks are the best one and sometimes the hardest ones to think up.

2009/02/10

VPN driving me mad

Today something different than usual Moodle ramblings ;-).

I use VPN connection on one of my projects. VPN is for Virtual private network. You can picture VPN as small, safe island in rough sea of the Internet ;-). It combines conveniences of private network - security and global network - access from anywhere, you can mount disks from server as local disks etc.

Set up VPN is fairly easy, you can see tutorial with pictures for example here. I created VPN connection without problem, only thing that bothered me (I am used to restarting IM services - skype, icq when connecting to the VPN) was annoying popup window demanding me to login to VPN even if I didn't want to use it.

It jumped on me on random moments, I noticed, that this may have something to do with problems with internet connection. If there were some hiccup when loading web pages, VPN thought there is a problem with net, jumped in to save the day...which has happened to be very bothering and unnecessary.



I am using Windows XP and Firefox 3, I tried to find where is the problem. Checked the network setting to disallow VPN to redial, checked Firefox setting for connection, but without luck. At last I found solution where I have never expected it. You have to go to Internet Explorer setting and set VPN connection to never dial. Windows thinks VPN as dial-up connection and Firefox takes this setting directly from Internet Explorer (strange, I know).



You can find how to set this up for example on this page .

I hope this will help someone with same problem, saves you some needed time, nerves and hairs :-)

2007/10/18

Change confirmation email

Do you want to create cutting edge confirmation email which will catch your users and will show that your Moodle site is something different?

Maybe you are tired of formal sounding of Moodle confirmation emails. For changing its content you need to look for file /moodle/lang/en_utf8/moodle.php and there for line with $string['emailconfirmation'] =... and modify content there.
(For other languages you should look for same file, but in different directory. Lang packs are located in moodledata/lang/ directory usually.)

Just take care and don't delete some useful info, like variables starting with $a-> (for example $a->sitename for displaying name of your Moodle, $a->link link to your Moodle for users can find you etc.)

2007/09/25

Where has my Help gone?

In Moodle 1.8 is missing Help line in Administration block in the course. Solution?

Some of my teachers noticed, the Help line is missing. So i need to come for a rescue and i have found it again! (I have to add it)

If you are not interested in tech stuff and just want modified file, download it here, its for 1.8.2+

Not much stuff for techies. I just pasted there this section (see crippled a href for displaying reason):



/// show Help for teachers -dfa- START
if (has_capability('moodle/course:update', $context) && ($course->id!==SITEID))
$lang = str_replace('_utf8', '', current_language());
$this->content->items[]='< a href="http://docs.moodle.org/'.$lang.'/Teacher_documentation">'.get_string('help').'</a>';
$this->content->icons[] = '<img src="'.$CFG->wwwroot.'/mod/resource/icon.gif" class="icon" alt="'.get_string('help').'" />';
}
/// -dfa- END

I pasted this section right after section displaying Grades to achieve old look.
Hope this helps some confused teachers.

2007/09/23

Teacher assign Teachers

Teachers cannot add another Teachers to their courses in new version (1.8), as they have been used. This post will provide a solution.

I have written about changes in roles system and most noticeable change ordinary users will see is in my another post. But there is a another change!

Teachers can add new teachers to their's courses whenever they wanted, without asking administrator in older versions. But this has been changed in new version by default.

So if you want to turn back to "old times, good times" way, you have to ask your administrator to change some setting.

At first, role setting for Teacher has to be changed. You (admin) can find it on Administration > Users > Permissions > Define Roles then edit Teacher role and change line moodle/role:assign to ALLOW.



But this is not enough. Administrator mustn't forget to change settings on Allow role overrides on same page. There you can check roles you want your users can assign.

We are targeting teacher role in our case and we want, that teachers can assign some roles to users in their course.(Eg. we want, teachers can give users in their course roles of Guest(by default yes), Student(by default yes), Non-editing teacher(by default yes), Teacher (we want this!!!). See next image how to achieve this.



Administrator can play with various ways of allowing roles to assign on this page. But take care not to overdo it! We do not want (usually) to teachers can add Administrator role to everybody ;-).

2007/09/19

Eaccelerator was a bad idea...for now

I experimented with caching in 1.8.2+ Moodle, to tune my site. I selected eaccelerator in Administration > Server > Performance



But as a result i got a
Fatal error: Call to undefined function _get() in D:\xampp\htdocs\moodle\lib\eaccelerator.class.php on line 56
and been cut from my site.

So i searched my database with phpmyadmin, looked for table mdl_config, because i know that various settings are stored there.
Found row which were doing this mess, with names cachetype and rcache



I deleted value for cachetype and set rcache value to 0 and we are working correctly again!!

So it's time for another crazy idea how to mess with my installation.

If you are not sure about manipulating your database manually, you can use solution mentioned here:
http://moodle.org/mod/forum/discuss.php?d=75689&parent=355922
Eg. insert to config.php line with $CFG->rcache = false; This should be working too.

PK