<?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>David Mudrak&#039;s blog &#187; enrolments</title>
	<atom:link href="http://blog.mudrak.name/tag/enrolments/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.mudrak.name</link>
	<description>Moodle, Mahara and beer fan</description>
	<lastBuildDate>Sat, 07 Jan 2012 00:03:11 +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>Moodle development traffic 24/2010</title>
		<link>http://blog.mudrak.name/2010/06/moodle-development-traffic-242010/</link>
		<comments>http://blog.mudrak.name/2010/06/moodle-development-traffic-242010/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 23:03:34 +0000</pubDate>
		<dc:creator>David</dc:creator>
				<category><![CDATA[miscellaneous]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[enrolments]]></category>
		<category><![CDATA[moodle]]></category>
		<category><![CDATA[traffic]]></category>

		<guid isPermaLink="false">http://blog.mudrak.name/?p=301</guid>
		<description><![CDATA[Latest stable version 1.9.9+ There are 5 trivial commits into the stable branch from the last development week (from Tuesday Jun 15 to Monday Jun 21). David Mudrák (also known as &#8220;I&#8221; in this blog ) fixed coding error producing PHP notice and improved a check of user context existence in the list of users [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><h3>Latest stable version 1.9.9+</h3>
<p>There are 5 trivial commits into the stable branch from the last development week (from Tuesday Jun 15 to Monday Jun 21). David Mudrák (also known as &#8220;I&#8221; in this blog <img src='http://blog.mudrak.name/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> ) fixed coding error producing PHP notice and improved a check of user context existence in the list of users (c36671d). Helen Foster fixed spelling typo in a Quiz help file, spotted by Stuart Mealor (MDL-22842). Tim Hunt fixed several broken $Id$ CVS tags.</p>
<h3>Future version Moodle 2.0 Preview 3</h3>
<p>There are 69 commits into the main development branch from the last week. The highlighted one for this week is Sam Hemelryk&#8217;s one which adds a new element &#8211; colour picker &#8211; available for administrator config screens (MDL-22806).</p>
<h3>Quotes of the week</h3>
<blockquote><p>&#8220;Gentlemen, we have reached a milestone. The download is exactly 1,000,000 bytes. Now we have to get it in the right order.&#8221;<br />
&#8211; <a href="http://moodle.org/mod/cvsadmin/view.php?conversationid=5091#c206336">Martin Dougiamas</a> knows the secret of sofware engineering</p></blockquote>
<blockquote><p>&#8220;We do not need any new API for fetching of course record &#8211; we have DML with MUST_EXIST flag which is the right way now; we should not include course/lib.php on each page anyway.&#8221;<br />
&#8211; <a href="http://github.com/moodle/moodle/commit/1b048629bcacd847d212e443ca5176afb0918d2e">Petr Škoda</a> removed get_course_by_id(), get_course_by_idnumber() and get_course_by_shortname() from course/lib.php</p></blockquote>
<h3>Good morning, students, and welcome to the course</h3>
<p>On Monday, Petr Škoda committed the enrolments patch he was working on recently. The patch is quite huge &#8211; it touches 225 files, removes 7603 lines of code and inserts 11019 lines. You can see the changes nicely <a href="http://github.com/moodle/moodle/commit/df997f841f93d676d782a46cfb8547ebc7319102">at github</a>. This patch was one of the last significant things to be included in Moodle 2.0 release so let us have a closer look at it.<br />
Shortly said, the patch changes the enrolment implementation &#8211; that is where and how the information about the users participation in courses is kept. In old Moodle versions (up to 1.6) there used to be two database tables to hold the enrolment information &#8211; user_teachers and user_students. Each of these two tables represented a relationship with M:N cardinality between the table user and the table course, with some additional information (the start and end date of the enrolment etc). When Roles and capabilities were introduced in Moodle 1.7, these tables were dropped and the capability <a href="http://docs.moodle.org/en/Capabilities/moodle/course:view">moodle/course:view</a> started to control if the user is allowed to participate in the course.<br />
Subsequently, it become clear that the implementation based purely on capabilities is not enough in some real scenarios.</p>
<ul>
<li>There is a conceptual difference between &#8220;view the course&#8221; and &#8220;be seen as a course participant&#8221;. For example, you want to let school Inspectors to enter the course but nobody should be able to know about them. Therefore, hidden role assignments had to be introduced.</li>
<li>With the capability, it is pretty difficult &#8211; but not impossible &#8211; to manually order teachers names at the course information page (you know &#8211; all teachers in the course are equal, but some of them are more equal than others).</li>
<li>Many enrolment related information are kept in the course table and therefore must be shared by all enrolment plugins &#8211; for example the start/end dates of the enrolment availability, course cost, enrolment key etc.</li>
<li>Enrolments are not manageable with system-level groups of users.</li>
<li>Moodle should support common tasks like enrolling students in advance (so that the administrator can prepare the winter term enrolments during the summer), the enrolment can be temporarily disabled for the student or students should be given read-only access to the course after it has finished. These things are kind of doable in Moodle 1.x, though one could expect quite cleaner and more straight procedures from LMS.</li>
</ul>
<p>Petr tried to deal with these and many other issues by re-designing the internal enrolment system. In fact, Moodle 2.0 did a small step back to pre-1.7 enrolment ages and now there is again a table to hold the list of all course participants &#8211; user_enrolments. This table holds the list of all users that participate in a given course &#8211; that is they should be listed as course participants (in most cases, these are good old teachers and students). The enrolment record has its state flag &#8211; at the moment it can be ENROL_USER_ACTIVE or ENROL_USER_SUSPENDED. See is_enrolled() function for details.<br />
It must be said that the enrolment itself does not give the user any other privilege but to open the course home page. To submit assignments, post into forums or take a quiz, the user must have appropriate role assigned. Both edge cases are valid &#8211; enrolled user without any role (for example a student who finished the course or the learner with outdated subscription) and a user with a permission to visit the course without being considered as enrolled (for example the school headmaster or an inspector from the <a href="http://wiki.newspeakdictionary.com/wiki/Ministry_of_Truth">Minitrue</a>). From the UI perspective, the users from user_enrolments table are called Participants or Enrolled users. The users without the record in the table who have the capability moodle/course:view (typically administrators, managers, inspectors etc) are called Other users.<br />
Yet another big change is that enrolment plugins (that is manual enrolment, LDAP based enrolment, External database, PayPal etc.) now have instances in all courses they are used. All instances of enrolment plugins are registered in the table enrol. This table now contains columns that used to be in the table course. Therefore, every enrolment plugin instance can have its own configuration &#8211; like enrolment key, dates, expiry notification settings etc. The database table user_enrolments links the given user with the enrolment plugin instance (which in turn is linked with a course). Every instance is allowed to modify just own data &#8211; this helps to prevent situations like when a teacher manually unenrolled a student who was enrolled by an external system and the student got enrolled again during the next synchronisation. This is not allowed any more &#8211; one plugin can not modify data of an other one.<br />
From the developer point of view, it is nice that you can get course participants again at SQL level (this was not possible before due to complex permissions algebra). This may rapidly increase the performance of some parts of Moodle.</p>
<h3>Post scriptum</h3>
<p>My lovely wife won <a href="http://www.kentoya.cz/fck_userfiles/file/Apachestribrnylevybok.jpg">a motor scooter</a> in SMS contest! I may become 50 km/hour pirate of the roads. Yahgrr!</p>
<div class="shr-publisher-301"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://blog.mudrak.name/2010/06/moodle-development-traffic-242010/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

