<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>James&#039; Tools and Tricks &#187; Delete</title>
	<atom:link href="http://jrudd.org/tag/delete/feed/" rel="self" type="application/rss+xml" />
	<link>http://jrudd.org</link>
	<description>Tools, Tips and Hints for managing a network.</description>
	<lastBuildDate>Sun, 08 Jan 2012 03:50:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Some useful Moodle SQL Queries</title>
		<link>http://jrudd.org/2007/12/some-useful-moodle-sql-queries/</link>
		<comments>http://jrudd.org/2007/12/some-useful-moodle-sql-queries/#comments</comments>
		<pubDate>Fri, 14 Dec 2007 14:28:55 +0000</pubDate>
		<dc:creator>James Rudd</dc:creator>
				<category><![CDATA[Moodle]]></category>
		<category><![CDATA[Bulk Operations]]></category>
		<category><![CDATA[Delete]]></category>
		<category><![CDATA[Roles]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Statistics]]></category>

		<guid isPermaLink="false">http://jrudd.org/wordpress/2007/12/15/some-useful-moodle-sql-queries/</guid>
		<description><![CDATA[I occasionally use the following SQL statements to clean-up our Moodle system and identify old courses. I recommend backing up your database before using any and knowing enough SQL to understand what they are doing before running them. I usually use phpMyAdmin for execution and export, but use what ever works best for you. Find <a href='http://jrudd.org/2007/12/some-useful-moodle-sql-queries/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>I occasionally use the following SQL statements to clean-up our Moodle system and identify old courses. I recommend backing up your database before using any and knowing enough SQL to understand what they are doing before running them. I usually use <a href="http://www.phpmyadmin.net/" target="_blank">phpMyAdmin</a> for execution and export, but use what ever works best for you.</p>
<h2>Find Empty Moodle Courses</h2>
<p>If you use an auto-enrolment module you will often find you have lots of courses created that are never used. We have used the LDAP and Database enrolment before and both have created large numbers of courses. Some are not used by teachers,others are just used as child courses for year wide meta courses. Either way at the end of the year you may wish to identify any class that hasn&#8217;t been used. (Perhaps to delete using the <a href="http://jrudd.org//2007/12/14/moodle-bulk-deletion-operations/" target="_blank">Bulk Deletion</a> options).</p>
<h3>No Content</h3>
<p>Following SQL code I&#8217;ve written will generate a list containing a sum of most of the resources and activities a course has, allowing you to quickly identify those with little to no content. It bases this count on having no labels, resources, assignments, etc.</p>
<pre class="brush: sql; title: ; notranslate">
SELECT m.id, m.`shortname` , m.fullname, cCount.totalcount
FROM mdl_course m
LEFT JOIN (

SELECT courseCount.course, sum( courseCount.subcount ) AS totalcount
FROM (

SELECT course, count( * ) AS subcount
FROM mdl_resource
GROUP BY course
UNION ALL SELECT course, count( * ) AS subcount
FROM mdl_quiz
GROUP BY course
UNION ALL SELECT course, count( * ) AS subcount
FROM mdl_assignment
GROUP BY course
UNION ALL SELECT course, count( * ) AS subcount
FROM mdl_survey
GROUP BY course
UNION ALL SELECT course, count( * ) AS subcount
FROM mdl_label
GROUP BY course
UNION ALL SELECT course, count( * ) AS subcount
FROM mdl_glossary
GROUP BY course
UNION ALL SELECT course, count( * ) AS subcount
FROM mdl_homework
GROUP BY course
UNION ALL SELECT course, count( * ) AS subcount
FROM mdl_wiki
GROUP BY course
) AS courseCount
GROUP BY courseCount.course
) AS cCount ON cCount.course = m.id
</pre>
<p>You may need to edit above code if you do not have an activity installed (eg homework).</p>
<h3>No Users</h3>
<p>The following code generates a list of all your courses together with how many students are enrolled in each. Useful to find out if you have any courses with no one enrolled.</p>
<pre class="brush: sql; title: ; notranslate">

SELECT cr.shortname, cr.fullname, count( ra.id ) AS enrolled
FROM `mdl_course` cr
JOIN `mdl_context` ct ON ( ct.instanceid = cr.id )
LEFT JOIN `mdl_role_assignments` ra ON ( ra.contextid = ct.id )
WHERE ct.contextlevel =50
GROUP BY cr.shortname, cr.fullname
ORDER BY `enrolled` ASC
</pre>
<p>You can export either of the above queries into Excel and manipulate it from there. Order by the counts then copy the short names&#8217; of courses to delete, paste into a text file and upload to the <a href="http://jrudd.org//2007/12/14/moodle-bulk-deletion-operations/" target="_blank">Bulk Course Deletion</a> addon. Goodbye excess courses.</p>
<h2>Data Cleanup: Roles without Users</h2>
<p>Sometimes when a user gets deleted Moodle doesn&#8217;t clean up after it self as well as it should. The following code will list all the rows in your <span class="syntax"><span class="syntax_quote syntax_quote_backtick">role assignments </span></span>table that no longer match to a user:</p>
<pre class="brush: sql; title: ; notranslate">SELECT *
FROM `mdl_role_assignments`
WHERE `userid` NOT
IN (
SELECT id
FROM mdl_user
)
</pre>
<p>If you wish to the delete all of these just run following. As always make sure you have a good backup before deleting anything from DB.</p>
<pre class="brush: sql; title: ; notranslate">DELETE
FROM `mdl_role_assignments`
WHERE `userid` NOT
IN (
SELECT id
FROM mdl_user
)
</pre>
]]></content:encoded>
			<wfw:commentRss>http://jrudd.org/2007/12/some-useful-moodle-sql-queries/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Moodle: Bulk Deletion Operations</title>
		<link>http://jrudd.org/2007/12/moodle-bulk-deletion-operations/</link>
		<comments>http://jrudd.org/2007/12/moodle-bulk-deletion-operations/#comments</comments>
		<pubDate>Fri, 14 Dec 2007 00:30:32 +0000</pubDate>
		<dc:creator>James Rudd</dc:creator>
				<category><![CDATA[Moodle]]></category>
		<category><![CDATA[Bulk Operations]]></category>
		<category><![CDATA[Delete]]></category>

		<guid isPermaLink="false">http://jrudd.org/wordpress/2007/12/14/moodle-bulk-deletion-operations/</guid>
		<description><![CDATA[At the recent CC day some people asked about bulk deletion of users and courses. Moodle 1.9 beta now supports bulk user operations, such as deleting, sending messages or confirming the account. You can use a filter to easily select the users you want. The Filter allows selection based on everything from name, last access, <a href='http://jrudd.org/2007/12/moodle-bulk-deletion-operations/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>At the recent CC day some people asked about bulk deletion of users and courses.<br />
<a href="http://docs.moodle.org/en/Release_Notes#Moodle_1.9_Beta" target="_blank">Moodle 1.9 beta</a> now supports bulk user operations, such as deleting, sending messages or confirming the account. You can use a filter to easily select the users you want. The Filter allows selection based on everything from name, last access, role, authentication system (manual, LDAP, etc.) to email as well as many other options. Hopefully it will be upgraded in the future to allow filtering by other user attributes such as ID number, Departments, Institution or the new attributes that can be added to users. For Bulk Deletion of courses there is a <a href="http://moodle.org/file.php/5/moddata/forum/33/367033/delete_course_for_1.7-1.8---v1.zip" target="_blank">php</a> file posted by <a href="http://moodle.org/mod/forum/discuss.php?d=82932#p367033" target="_blank">Jeff Church</a> which you can place somewhere in your Moodle installation and run manually to delete your courses. It takes a text file of the courses’ short names to delete, then confirms what to remove before deleting them all. I ran it recently to remove 323 courses from 2005-2006 and it removed them with no problems.</p>
<p>For some useful SQL queries that can be used to identify unused courses please see <a href="http://jrudd.org//2007/12/15/some-useful-moodle-sql-queries/">Some useful Moodle SQL Queries.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://jrudd.org/2007/12/moodle-bulk-deletion-operations/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CC Day T4 2007: Installing and Using Moodle</title>
		<link>http://jrudd.org/2007/12/cc-day-t4-2007-installing-and-using-moodle/</link>
		<comments>http://jrudd.org/2007/12/cc-day-t4-2007-installing-and-using-moodle/#comments</comments>
		<pubDate>Wed, 12 Dec 2007 05:58:16 +0000</pubDate>
		<dc:creator>James Rudd</dc:creator>
				<category><![CDATA[Moodle]]></category>
		<category><![CDATA[Active Directory]]></category>
		<category><![CDATA[Delete]]></category>
		<category><![CDATA[DET]]></category>
		<category><![CDATA[Email]]></category>
		<category><![CDATA[Gallery]]></category>
		<category><![CDATA[Ganderton]]></category>
		<category><![CDATA[LDAP]]></category>
		<category><![CDATA[Mac OS]]></category>
		<category><![CDATA[Novell]]></category>
		<category><![CDATA[Presentation]]></category>
		<category><![CDATA[School]]></category>
		<category><![CDATA[SMTP]]></category>

		<guid isPermaLink="false">http://jrudd.org/wordpress/2007/12/12/cc-day-t4-2007-installing-and-using-moodle/</guid>
		<description><![CDATA[This was very similar to a previous presentation given as part of the Tech KNOW Tour. However the Using Moodle presentation has some slight additions from Paul for a more technical audience and the spoken part of my presentation concentrated on a more technical side. Some additional notes: To use the DET mail server you <a href='http://jrudd.org/2007/12/cc-day-t4-2007-installing-and-using-moodle/'>[...]</a>]]></description>
			<content:encoded><![CDATA[<p>This was very similar to a previous presentation given as part of the <a href="http://jrudd.org//2007/11/17/tech-know-tour-07-moodle/" target="_blank">Tech KNOW Tour</a>. However the Using Moodle presentation has some slight additions from Paul for a more technical audience and the spoken part of my presentation concentrated on a more technical side.</p>
<h3>Some additional notes:</h3>
<p>To use the DET mail server you can either add <em>mail.det.nsw.edu.au</em> to the mail section of your php.ini file or add it to the<br />
Admin -&gt; Server -&gt; Email: SMTP Hosts section.<br />
If you wish to restrict to sending to DET emails you can add following to the <em>Allowed email domains</em> : &#8220;<em>education.nsw.gov.au det.nsw.edu.au</em>&#8220;.<br />
<ins datetime="2007-12-16T20:24:28">Make sure to test the mail server settings before adding any restrictions to domains.</ins></p>
<p>If using Novell or Mac OS you will need to use a different LDAP browser as <a href="http://jrudd.org//2007/11/20/ad-explorer/">AD Explorer</a> only works with Active Directory.<br />
For Novell I usually use the free Windows program <a href="http://www.ldapbrowser.com/download.htm" target="_blank">Softerra LDAP Browser</a> (<a href="http://www.ldapbrowser.com/download.htm" target="_blank">MSI</a>).<br />
There are a few Java based LDAP browsers that should work with Mac. A good Java based LDAP browser is <a href="http://www.jxplorer.org/" target="_blank">JXplorer</a> this should work on Mac, Windows and Linux. For some more info on Mac and LDAP look at this article on <a href="http://www.macdevcenter.com/pub/a/mac/2004/05/25/ldap.html" target="_blank">LDAP in Mac OS X Server</a> from the Mac Dev Center, it is not fully applicable as it also has home drive mapping but it does contain some useful info.</p>
<p>Paul Ganderton has made his <a href="http://www.sydneyboyshigh.com/intranet/moodle/course/view.php?id=822" target="_blank">Geography HSC</a> site avaliable for guests. You can also view some of the other course on our Moodle site. Look for this logo <img src="http://www.sydneyboyshigh.com/intranet/moodle/pix/i/user.gif" alt="Guest Access" width="16" height="16" />which means guest access is allowed.</p>
<p><strong>Bulk Operations:</strong> Some people asked about bulk deletion of users and courses.<br />
This section has been moved to <a href="http://jrudd.org//2007/12/14/moodle-bulk-deletion-operations/" target="_blank">Moodle: Bulk Deletion Operations.</a></p>
<h3>Presentations:</h3>
<ul>
<li>Note: There is a file embedded within this post, please visit this post to download the file.</li>
<li>Note: There is a file embedded within this post, please visit this post to download the file.</li>
<li>Note: There is a file embedded within this post, please visit this post to download the file.</li>
<li>Note: There is a file embedded within this post, please visit this post to download the file.</li>
<li>Note: There is a file embedded within this post, please visit this post to download the file.</li>
</ul>
<h3>Plugins used by Moodle</h3>
<p>Some of the items shown during talk are produced by plugins to Moodle. Below is a list of some of our favourites:</p>
<ul>
<li><a href="http://moodle.org/mod/data/view.php?d=13&amp;rid=319" target="_blank">Book</a>: Allows structuring resource pages with chapters and pages.</li>
<li><a href="http://jrudd.org//2007/11/30/moodle-and-gallery-212/">Gallery</a>: Shows slide shows and generates thumbnails of images. You can upload a zip file containing an entire folder structure of pictures, and auto-generate albums and sub-albums from it.</li>
<li><a href="http://moodle.org/mod/data/view.php?d=13&amp;rid=926">Course Menu</a>: Creates a Tree Structure as a block on side of page to assist navigation.</li>
<li>Note: There is a file embedded within this post, please visit this post to download the file. On the main SBHS Moodle page there is also a Library block that sends search queries to our Sentral library page. This will need to be customised by schools to point to their Sentral system or the new DET <em>My Library</em> system (only accessible inside DET WAN). Just modify the block_library.php file to point to your Library search page. To install place the library directory in your Moodle blocks folder.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://jrudd.org/2007/12/cc-day-t4-2007-installing-and-using-moodle/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

