<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Janvh</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/dev/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Janvh"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/Special:Contributions/Janvh"/>
	<updated>2026-04-19T12:20:56Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Competencies&amp;diff=14387</id>
		<title>Competencies</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Competencies&amp;diff=14387"/>
		<updated>2010-11-25T19:22:14Z</updated>

		<summary type="html">&lt;p&gt;Janvh: /* &amp;quot;Add / edit competency depth&amp;quot; admin page */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 2.0}}&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;&#039;&#039;&#039;Note&#039;&#039;&#039;: This page outlines ideas for the Competencies feature planned for Moodle 2.0. It&#039;s a &#039;&#039;specification under construction&#039;&#039;! If you have any comments or suggestions, please add them to the [[Development talk:Progress tracking|page comments]].&#039;&#039;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;PROJECT STATE: Proposal&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;MAIN TRACKER ISSUE&#039;&#039;&#039;: &lt;br /&gt;
* &#039;&#039;&#039;DISCUSSION&#039;&#039;&#039;: Not yet announced on Moodle.org&lt;br /&gt;
* &#039;&#039;&#039;COMMENTS&#039;&#039;&#039;: [[Development_talk:Competencies]]&lt;br /&gt;
* &#039;&#039;&#039;AUTHOR&#039;&#039;&#039;: [[User:Jonathan Newman|Jonathan Newman]] with help from [[Matt Clarkson|Matt Clarkson]] and others&lt;br /&gt;
&lt;br /&gt;
=Overview=&lt;br /&gt;
To support the range of different types of competency frameworks used by organisations, competencies in Moodle 2.0 needs to expand on the 1.9 outcomes architecture.&lt;br /&gt;
&lt;br /&gt;
==Goals==&lt;br /&gt;
# Measured amount of abstraction&lt;br /&gt;
#* Allow &amp;quot;admins&amp;quot; to organise competencies in a hierarchy&lt;br /&gt;
#* Allow &amp;quot;admins&amp;quot; to create unlimited hierarchical levels&lt;br /&gt;
#* Allow &amp;quot;admins&amp;quot; to map related competencies on a given depth level&lt;br /&gt;
#* Allow &amp;quot;admins&amp;quot; to define custom info fields on a given depth level&lt;br /&gt;
# Easy navigation&lt;br /&gt;
#* Allow &amp;quot;admins&amp;quot; to view the competency structure&lt;br /&gt;
#** Expanding/collapsing competencies&lt;br /&gt;
#** Sorting/searching/filtering by competency meta data&lt;br /&gt;
#* Allow &amp;quot;admins&amp;quot; to easily add new competencies and meta-data&lt;br /&gt;
# Linking competencies and evidence items&lt;br /&gt;
#* Allow &amp;quot;admins&amp;quot; to easily attach allowed evidence (course, activity, etc) to a competency (from a &#039;&#039;site-level competency view&#039;&#039;):&lt;br /&gt;
#* Allow &amp;quot;course creators&amp;quot; to attach competencies to evidence &#039;&#039;within a course&#039;&#039;:&lt;br /&gt;
# Portability&lt;br /&gt;
#* Allow &amp;quot;admins&amp;quot; to import competencies (using import plugins) into a Moodle install&lt;br /&gt;
#* Allow &amp;quot;admins&amp;quot; to export competencies (using export plugins) from a Moodle install&lt;br /&gt;
# Specifying expected proficiency levels&lt;br /&gt;
#* Allow &amp;quot;admins&amp;quot; to assign an expected proficiency level (i.e., competency scale value) to a competency and a competency evidence item&lt;br /&gt;
# Aggregating measured proficiency&lt;br /&gt;
#* Allow &amp;quot;admins&amp;quot; to specify aggregation methods for each competency&lt;br /&gt;
#* Reporting&lt;br /&gt;
#** Allow &amp;quot;admins&amp;quot; to view competency results for all students&lt;br /&gt;
#** Allow &amp;quot;teachers&amp;quot; to view student measured proficiencies related to evidence in his/her courses.&lt;br /&gt;
#** Allow &amp;quot;students&amp;quot; to view their own competency results (via either their personal profile or My Moodle).&lt;br /&gt;
# Specifying weights&lt;br /&gt;
#* Allow &amp;quot;admins&amp;quot; to assign weight to a competency or a competency evidence item&lt;br /&gt;
# Scalability&lt;br /&gt;
#* Store and retrieve data efficiently to allow the scalability to very large numbers of courses, users, competencies, evidence, etc&lt;br /&gt;
# Extensibility&lt;br /&gt;
#* Use a plugin architecture for evidence types&lt;br /&gt;
&lt;br /&gt;
==General requirements==&lt;br /&gt;
# We&#039;ll need to access and use the existing site-wide Outcomes [https://docs.moodle.org/en/Development:Grades#grade_outcomes Outcomes tables]&lt;br /&gt;
# We&#039;ll need to use the tables that indicate completion status for courses (these are not yet in place) [https://docs.moodle.org/en/Development:Course_completion Course Completion]&lt;br /&gt;
# We need to get aggregate information about the course outcomes and aggregate grades for each user from the gradebook API&lt;br /&gt;
&lt;br /&gt;
==Definitions==&lt;br /&gt;
&#039;&#039;&#039;Scale&#039;&#039;&#039;: A way to measure a competency using scale values.&lt;br /&gt;
&lt;br /&gt;
Example scales:&lt;br /&gt;
 &amp;quot;Average-based scale&amp;quot;&lt;br /&gt;
 &amp;quot;Competency-based scale&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Scale values&#039;&#039;&#039;: Descriptor or numeric values that comprise a scale. A scale value can have a id number (code) and description.&lt;br /&gt;
&lt;br /&gt;
Example scales values (with descriptors and numerical values) for the scale examples above:&lt;br /&gt;
 &amp;quot;Below average [1], Average [2], Above average [3]&lt;br /&gt;
 &amp;quot;Not yet competent [0], Competent [100]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Competency&#039;&#039;&#039;: A measurable knowledge, skill, ability, attitude or other learning-related characteristic which a student may have. Competencies can be organised into a hierarchy. &lt;br /&gt;
&lt;br /&gt;
Example hierarchy of competencies:&lt;br /&gt;
 top-level competency: &amp;quot;Literacy&amp;quot;&lt;br /&gt;
     -&amp;gt; child competency: &amp;quot;Reading Comprehension&amp;quot;&lt;br /&gt;
         -&amp;gt; child competency: &amp;quot;Responding to Text&amp;quot;&lt;br /&gt;
             -&amp;gt; child competency: &amp;quot;Initial Understanding of Literary Text&amp;quot;&lt;br /&gt;
                 -&amp;gt; child competency: &amp;quot;Demonstrate initial understanding of elements of literary texts (including text read aloud, reading independently&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Competency evidence type&#039;&#039;&#039;: A form of evidence that can be accepted as evidence that a competency has been achieved. Examples:&lt;br /&gt;
 Activity grade&lt;br /&gt;
 Activity completion&lt;br /&gt;
 Activity outcome&lt;br /&gt;
 Course completion&lt;br /&gt;
 Course grade&lt;br /&gt;
 File (diploma)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Competency evidence&#039;&#039;&#039;: A competency can be measured by one or more competency evidence types. Evidence can be stated to include the evidence type, evidence date, and measured value. Examples:&lt;br /&gt;
 &amp;quot;Quiz - 4:00pm May 28, 2009 - Grade 90% out of 100%&amp;quot;&lt;br /&gt;
 &amp;quot;Certificate - Public Speaking Institute - 4:00pm May 28, 2009 - Passed.&amp;quot;&lt;br /&gt;
 &amp;quot;File - College Diploma - 4:00pm May 28, 2009 - Bachelor of Science Computer Science&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Expected proficiency level&#039;&#039;&#039;: The expected (or required) rating (based on a scale descriptor or numerical value) for a competency. Examples:&lt;br /&gt;
 &amp;quot;Average&amp;quot;&lt;br /&gt;
 &amp;quot;5&amp;quot;&lt;br /&gt;
 &amp;quot;50%&amp;quot;&lt;br /&gt;
 &amp;quot;Passed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Measured proficiency level&#039;&#039;&#039;: A user&#039;s observed, scored, reported proficiency level for a competency.&lt;br /&gt;
 &amp;quot;Above average&amp;quot;&lt;br /&gt;
 &amp;quot;8&amp;quot;&lt;br /&gt;
 &amp;quot;80%&amp;quot;&lt;br /&gt;
 &amp;quot;Passed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Competency weighting&#039;&#039;&#039;: Child competencies can be assigned weights which can be used for aggregating either sums or averages of child competencies. Examples:&lt;br /&gt;
&lt;br /&gt;
Example with percentage weights&lt;br /&gt;
 -&amp;gt; top-level competency: &amp;quot;Communication&amp;quot;&lt;br /&gt;
     -&amp;gt; child competency: &amp;quot;Written Communication&amp;quot; : weight: 60%&lt;br /&gt;
     -&amp;gt; child competency: &amp;quot;Oral Communication&amp;quot; : weight: 40%&lt;br /&gt;
&lt;br /&gt;
==Example frameworks==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 1:&#039;&#039;&#039; Competency hierarchy with activity outcomes as evidence&lt;br /&gt;
&lt;br /&gt;
The example data below is based roughly on the [http://education.vermont.gov/ Department of Education for the State of Vermont]&#039;s [http://education.vermont.gov/new/html/pgm_curriculum/literacy/gle.html Grade 1 Expectations for Literacy] for Reading.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Depth level&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Depth name&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Competency&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;full name&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Competency&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;evidence&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Competency&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;aggregation method&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Competency&lt;br /&gt;
&#039;&#039;&#039;weight&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Competency&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;proficiency expected&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|&amp;quot;Curriculum&amp;quot;&lt;br /&gt;
|&amp;quot;Literacy&amp;quot;&lt;br /&gt;
|none&lt;br /&gt;
|all&lt;br /&gt;
|20%&lt;br /&gt;
|80%&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|&amp;quot;Type&amp;quot;&lt;br /&gt;
|&amp;quot;Reading&amp;quot;&lt;br /&gt;
|none&lt;br /&gt;
|all&lt;br /&gt;
|20%&lt;br /&gt;
|100%&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|&amp;quot;Standard&amp;quot;&lt;br /&gt;
|&amp;quot;Standard 1.1 Reading Strategies&amp;quot;&lt;br /&gt;
|none&lt;br /&gt;
|all&lt;br /&gt;
|20%&lt;br /&gt;
|80%&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|&amp;quot;Strategy&amp;quot;&lt;br /&gt;
|&amp;quot;Early Reading Skills and Strategies: Phonological Awareness&amp;quot;&lt;br /&gt;
|none&lt;br /&gt;
|all&lt;br /&gt;
|100%&lt;br /&gt;
|80%&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|&amp;quot;Code&amp;quot;&lt;br /&gt;
|&amp;quot;RK: 1 - Applies phonological knowledge and skills by...&amp;quot;&lt;br /&gt;
|activity outcome &amp;quot;Recognizing pairs of rhyming words and producing rhymes&amp;quot;&lt;br /&gt;
&lt;br /&gt;
activity outcome &amp;quot;Blending and segmenting syllables and onset-rimes&amp;quot;&lt;br /&gt;
&lt;br /&gt;
activity outcome &amp;quot;Isolating phonemes in single-syllable words (e.g., &amp;quot;tell me the first sound in &#039;mop&#039; &amp;quot;; &amp;quot;tell me the last sound in &#039;mop,&#039;&amp;quot; &amp;quot;tell me the middle sound in &#039;mop&#039;&amp;quot;)&amp;quot;&lt;br /&gt;
|all&lt;br /&gt;
|50%&lt;br /&gt;
|80%&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|&amp;quot;Strategy&amp;quot;&lt;br /&gt;
|&amp;quot;Early Reading Skills and Strategies - Concepts of Print&amp;quot;&lt;br /&gt;
|none&lt;br /&gt;
|all&lt;br /&gt;
|50%&lt;br /&gt;
|80%&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|&amp;quot;Code&amp;quot;&lt;br /&gt;
|&amp;quot;RK: 2 - Demonstrates understanding of concepts of print during shared or individual reading by...&amp;quot;&lt;br /&gt;
|activity outcome: &amp;quot;Distinguishing between printed letters and words&amp;quot;&lt;br /&gt;
&lt;br /&gt;
activity outcome: &amp;quot;Following text with finger-pointing (e.g., charts, simple books), demonstrating left-to-right and top-to-bottom directionality&amp;quot;&lt;br /&gt;
&lt;br /&gt;
activity outcome: &amp;quot;Identifying the first and last parts of a word (beginning/end of the word)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
activity outcome: &amp;quot;Identifying key parts of a book: front and back, print, illustrations&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|all&lt;br /&gt;
|50%&lt;br /&gt;
|80%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See [https://docs.moodle.org/en/Development:Competencies_example here] for how the data above fits into the proposed schema.&lt;br /&gt;
&lt;br /&gt;
=Settings=&lt;br /&gt;
==Site settings==&lt;br /&gt;
[https://docs.moodle.org/en/Development:Conditional_activities#Completion_tracking_2 Activity Completion] provides an &amp;quot;Enable outcomes&amp;quot; setting (found in the Site Administration block&#039;s Advanced features / optional subsystems settings page). We need to keep outcomes, however we will need to add competencies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Proposed changes:&#039;&#039;&#039;&lt;br /&gt;
* Create a new setting named &amp;quot;Enable competencies&amp;quot; (the setting will allow competencies to be defined)&lt;br /&gt;
&lt;br /&gt;
=User interface=&lt;br /&gt;
&lt;br /&gt;
==Site Administration block==&lt;br /&gt;
When competencies are enabled, a &amp;quot;Competencies&amp;quot; menu item should appear in the Site Administration block. An &amp;quot;Add / edit competencies&amp;quot; option should appear when &amp;quot;Competencies&amp;quot; is clicked. The &amp;quot;Add / edit competencies&amp;quot; will point to the &amp;quot;Add / edit competencies&amp;quot; admin page.&lt;br /&gt;
&lt;br /&gt;
==&amp;quot;Add/edit competencies&amp;quot; admin page==&lt;br /&gt;
[[Image:Competencies_add_edit_default.png|thumb|400px|Mockup of the Add/edit competencies admin page (default)]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Competencies_add_edit.png|thumb|400px|Mockup of the Add/edit competencies admin page (with competencies from Example 1 framework)]]&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;admin&amp;quot; can use this page to add and edit competencies and competency depth levels, using buttons and features available in a table.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Buttons&#039;&#039;&#039;&lt;br /&gt;
* An &amp;quot;Add a new competency&amp;quot; button will link to the &amp;quot;Add a competency&amp;quot; admin page.&lt;br /&gt;
* An &amp;quot;Add a new depth level&amp;quot; button will link to the &amp;quot;Add a depth level&amp;quot; admin page.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Table rows&#039;&#039;&#039;&lt;br /&gt;
* A &amp;quot;plus&amp;quot; / &amp;quot;minus&amp;quot; icon will appear on the right of each row in the table, allowing all child competencies to be shown or hidden.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Table columns&#039;&#039;&#039;&lt;br /&gt;
* A default, top-level competency depth named &amp;quot;Competency&amp;quot; will appear in a table as a column on the left. The default competency depth name can be changed (e.g., &amp;quot;Competency Area&amp;quot;, &amp;quot;Standard&amp;quot;, &amp;quot;Development Area&amp;quot;, etc).&lt;br /&gt;
* When a new competency depth is added, it will appear as column to the right of the next highest competency depth level.&lt;br /&gt;
* Appearing to the right of the competency depth level columns will be the following &amp;quot;standard&amp;quot; interface columns: &amp;quot;Evidence items&amp;quot;, &amp;quot;Edit&amp;quot;, and &amp;quot;Move competency to&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Below are more specifics on the table columns and content:&lt;br /&gt;
* &#039;&#039;[Competency depth level 0 name]&#039;&#039;, &#039;&#039;[Competency depth level 1 name]&#039;&#039;, &#039;&#039;[Competency depth level 2 name]&#039;&#039;, ... &#039;&#039;[Competency depth level n name]&#039;&#039;&lt;br /&gt;
** Columns of depth levels will be ordered from highest/top-level (on the left) to the lowest (on the right).&lt;br /&gt;
** An edit icon will appear beside each competency depth name, and will link to the &amp;quot;Edit competency depth&amp;quot; page (which will allow an &amp;quot;admin&amp;quot; to change the name of the competency depth name).&lt;br /&gt;
** The competency name will be displayed, and will link to a page containing meta data and possibly summary proficiency achievement stats about the competency.&lt;br /&gt;
* &#039;&#039;Evidence item&#039;&#039;&lt;br /&gt;
** By default the number of evidence items will be &amp;quot;0&amp;quot;. The number shown will link to the &amp;quot;Add / edit evidence items&amp;quot; admin page for the given competency.&lt;br /&gt;
* &#039;&#039;Edit&#039;&#039;&lt;br /&gt;
** Three icons appear providing the following functionality:&lt;br /&gt;
*** &amp;quot;edit&amp;quot; icon points to the &amp;quot;Edit competency&amp;quot; page for the competency&lt;br /&gt;
*** &amp;quot;delete&amp;quot; icon points to a confirmation page for deleting the competency&lt;br /&gt;
*** &amp;quot;up&amp;quot; / &amp;quot;down&amp;quot; icons will appear beside child competencies when a parent has two or more child competencies. A competency can only be moved up or down with respect to a parent competency.Only the down arrow will appear for the highest child competency, and only the up arrow will appear for the lowest child competency.&lt;br /&gt;
* &#039;&#039;Move competency to&#039;&#039;&lt;br /&gt;
** A drop down menu appears containing all parent competencies at the next highest depth. &lt;br /&gt;
** Competencies can only be moved from one parent to another parent in the same depth level.&lt;br /&gt;
&lt;br /&gt;
==&amp;quot;Add / edit a competency&amp;quot; admin page==&lt;br /&gt;
[[Image:Competencies_add.png|thumb|400px|Mockup of the Add competencies admin page]]&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;admin&amp;quot; will use this page to add or edit a new competency, with the following settings:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;General settings&#039;&#039;&lt;br /&gt;
* Parent competency&lt;br /&gt;
* Competency full name&lt;br /&gt;
* Competency short name&lt;br /&gt;
* Competency ID number&lt;br /&gt;
* Description&lt;br /&gt;
* Aggregation method&lt;br /&gt;
* Scale&lt;br /&gt;
* Proficiency expected&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Custom depth level settings&#039;&#039;&lt;br /&gt;
* Form elements based on custom fields for selected depth level (based on the parent competency)&lt;br /&gt;
* Changing the selected parent competency should update the custom fields shown, if the depth level of the parent changes&lt;br /&gt;
&lt;br /&gt;
==&amp;quot;Add / edit competency depth&amp;quot; admin page==&lt;br /&gt;
[[Image:Competencies_depth_add.png|thumb|400px|Mockup of the Add competency depth admin page]]&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;admin&amp;quot; will use this page to add / edit a new competency depth, with the following settings:&lt;br /&gt;
* Depth full name&lt;br /&gt;
* Depth short name&lt;br /&gt;
* Description&lt;br /&gt;
&lt;br /&gt;
Also, the depth level will be displayed&lt;br /&gt;
&lt;br /&gt;
==&amp;quot;Add / edit competency evidence&amp;quot; admin page==&lt;br /&gt;
[[Image:Competencies_evidence_add_edit.png|thumb|400px|Mockup of the Add / edit competency evidence admin page with Example 1 competencies]]&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;admin&amp;quot; will be use this page to view / add / edit evidence for a competency. The top of the page should display the existing general data for the competency, the number of &amp;quot;students&amp;quot; who have achieved the competency, and a table showing data and functionality for each evidence item:&lt;br /&gt;
* The name of the competency evidence (which links to the evidence item in context, e.g., the course if course completion is specified, etc)&lt;br /&gt;
* The type of evidence &lt;br /&gt;
* The activity (if the evidence is an activity outcome or activity grade)&lt;br /&gt;
* The weight of the evidence&lt;br /&gt;
* Options to edit or remove the evidence&lt;br /&gt;
* The number of &amp;quot;students&amp;quot; who have achieved the evidence&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;Add new competency evidence&amp;quot; button should link to the &amp;quot;Add new competency evidence&amp;quot; admin page.&lt;br /&gt;
&lt;br /&gt;
==&amp;quot;Competencies summary&amp;quot; user profile page==&lt;br /&gt;
&lt;br /&gt;
[[Image:Competencies_user_profile_activity.png|thumb|400px|Mockup of user profile page with Example 1 competencies]]&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;student&amp;quot; or a user with permission to view a student&#039;s competencies will be able to view the proficiency status for each competency as a table with the following columns:&lt;br /&gt;
* Competency depth(s)&lt;br /&gt;
* Evidence items&lt;br /&gt;
* Proficiency&lt;br /&gt;
* Scale&lt;br /&gt;
&lt;br /&gt;
Each competency name should link to a pop-up containing the competency details (full name, description, aggregation method, scale, and meta data) and list of evidence items.&lt;br /&gt;
&lt;br /&gt;
Each number of competency items should link to a pop-up containing a list of evidence items.&lt;br /&gt;
&lt;br /&gt;
=Data structures=&lt;br /&gt;
&lt;br /&gt;
[[Image:Competency_data_model.png|thumb|400px|Competencies data model]]&lt;br /&gt;
&lt;br /&gt;
===scale===&lt;br /&gt;
Scales (introduced in Moodle 1.9) give a scale value a single attribute: text (i.e., the name of the scale value like &amp;quot;below standard,&amp;quot; &amp;quot;meets standard,&amp;quot; &amp;quot;above standard&amp;quot;). Scale values can be particularly useful if given attributes including: numerical equivalent, idnumber (code id), and a description. The new attributes will require a new table.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Proposed changes:&#039;&#039; Create a new table &#039;scale_values&#039; that includes a foreign key to the &#039;scale&#039; table, and migrate the &#039;scale&#039; field values from the &#039;scale&#039; table (as serialised text) to the &#039;scale_values&#039; table (as separate records). A sort order field will be used to track ranking (starting with the lowest with a sortorder of 0). &lt;br /&gt;
&lt;br /&gt;
Below is the proposed &#039;scale&#039; table, and further below is the proposed &#039;scale_value&#039; table.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Field&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Type&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Default&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Info&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Auto incrementing &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;courseid&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Id of the course, which the scale belongs to&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;userid&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Id of the user who last modified the scale&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;name&#039;&#039;&#039;&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|&lt;br /&gt;
|Name of the scale value&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;description&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|Description of the scale value&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;timemodified&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Timestamp of when the scale was modified&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===scale_values===&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Field&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Type&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Default&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Info&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Auto incrementing &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;scaleid&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Id of the scale that the scale value describes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;name&#039;&#039;&#039;&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|&lt;br /&gt;
|Name of the scale value&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;idnumber&#039;&#039;&#039;&lt;br /&gt;
|varchar(100)&lt;br /&gt;
|&lt;br /&gt;
|Optional id, code number or local identifier for the scale value (used for reporting).&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;description&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|Description of the scale value&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;numeric&#039;&#039;&#039;&lt;br /&gt;
|number(8)&lt;br /&gt;
|&lt;br /&gt;
|Numerical value for the scale value&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;sortorder&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The order for the scale value&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;timemodified&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Timestamp of when the scale value was modified&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===competency===&lt;br /&gt;
&lt;br /&gt;
A competency can be part of a hierarchy and can have evidence attached to it.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Field&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Type&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Default&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Info&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Auto incrementing &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;shortname&#039;&#039;&#039;&lt;br /&gt;
|varchar(100)&lt;br /&gt;
|&lt;br /&gt;
|The shortname for the competency&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;fullname&#039;&#039;&#039;&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|&lt;br /&gt;
|The full name for the competency&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;description&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|The description of the competency&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;idnumber&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The id, code number or local identifier for the competency used for reporting&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;parentid&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The id of the parent competency&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;sortorder&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The order number of this competency (useful for ordering competencies for viewing/navigation/reporting)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;depthid&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The id of the depth level the competency belongs to&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;path&#039;&#039;&#039;&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|&lt;br /&gt;
|The path to the competency&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;aggregationmethod&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|A constant representation one of the competency aggregation methods (any, all, unit, fraction, sum of weighted, average of weighted)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;scaleid&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The scale used to measure the competency&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;proficiencyexpected&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The expected proficiency for the competency, foreign key to the scale_value table&#039;s id&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;timecreated&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The time when the competency was created&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;timemodified&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The time when the competency was modified&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;usermodified&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The userid of the person who last modified the competency&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===competency_relations===&lt;br /&gt;
&lt;br /&gt;
For tracking relations between competencies.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Field&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Type&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Default&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Info&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Auto incrementing &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;description&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|Info about how competencies are related&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;competencyid1&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The id of a competency&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;competencyid2&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The id of a related competency&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===competency_depth===&lt;br /&gt;
&lt;br /&gt;
Data for a competency depth level.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Field&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Type&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Default&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Info&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Auto incrementing&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;shortname&#039;&#039;&#039;&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|&lt;br /&gt;
|Shortname for the depth level&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;fullname&#039;&#039;&#039;&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|&lt;br /&gt;
|Full name for the depth level&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;description&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|Description for the depth level&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;level&#039;&#039;&#039;&lt;br /&gt;
|int(2)&lt;br /&gt;
|&lt;br /&gt;
|The actual depth level, starting at 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===competency_depth_info_field===&lt;br /&gt;
&lt;br /&gt;
Data for a competency depth level field.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Field&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Type&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Default&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Info&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Auto incrementing&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;shortname&#039;&#039;&#039;&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|&lt;br /&gt;
|Shortname for the field&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;fullname&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|Full name for the field&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;depthid&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The id of the competency depth for the field. Foreign key to the competency_depth table&#039;s id&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;datatype&#039;&#039;&#039;&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|&lt;br /&gt;
|The type of field data&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;description&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|Description of the field&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;categoryid&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The id for the field category. Foreign key to the competency_depth_info_category table&#039;s id field&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;sortorder&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The sort order for the field within its category&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;hidden&#039;&#039;&#039;&lt;br /&gt;
|int(1)&lt;br /&gt;
|&lt;br /&gt;
|The field should be hidden&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;required&#039;&#039;&#039;&lt;br /&gt;
|int(1)&lt;br /&gt;
|&lt;br /&gt;
|The field required&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;defaultdata&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|Default text for the selected parameter&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;param1&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|Parameter text&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;param2&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|Parameter text&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;param3&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|Parameter text&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;param4&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|Parameter text&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;param5&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|Parameter text&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===competency_depth_info_category===&lt;br /&gt;
&lt;br /&gt;
A competency&#039;s depth level can have categories for its fields.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Field&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Type&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Default&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Info&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Auto incrementing&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;name&#039;&#039;&#039;&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|&lt;br /&gt;
|Shortname for the depth level category&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;sortorder&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The order number for this category&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===competency_depth_info_data===&lt;br /&gt;
&lt;br /&gt;
Data for a depth level field.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Field&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Type&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Default&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Info&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Auto incrementing&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;fieldid&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The id for the field&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;competencyid&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The id for the competency&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;data&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|The actual data for the competency field&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===competency_evidence_items===&lt;br /&gt;
&lt;br /&gt;
A competency can be achieved by one or more forms of evidence.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Field&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Type&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Default&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Info&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Auto incrementing &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;competencyid&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The id for the competency that this evidence describes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;itemtype&#039;&#039;&#039;&lt;br /&gt;
|varchar(30)&lt;br /&gt;
|&lt;br /&gt;
|The type of evidence &#039;course/outcome&#039;, &#039;mod/outcome&#039;, &#039;course/completion&#039;, &#039;mod/completion&#039;, &#039;course/grade&#039;, &#039;mod/grade&#039;, &#039;file&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;itemmodule&#039;&#039;&#039;&lt;br /&gt;
|varchar(30)&lt;br /&gt;
|&lt;br /&gt;
|The type of evidence &#039;quiz&#039;, &#039;scorm&#039;, etc&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&#039;&#039;&#039;iteminstance&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The id for the evidence instance (ie, grade_outcome id, course id, course_modules id, grade_item id, files id)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;weight&#039;&#039;&#039;&lt;br /&gt;
|num(10)&lt;br /&gt;
|&lt;br /&gt;
|The weight applied to this evidence item (for aggregation)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;timecreated&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The time when this competency evidence was allowed&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;timemodified&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The time when this competency evidence was last changed&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;usermodified&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The user who last modified this evidence&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===competency_evidence===&lt;br /&gt;
&lt;br /&gt;
Track historical and current competency information for each user.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Field&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Type&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Default&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Info&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|auto-incrementing&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;userid&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The id of the user&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;competencyid&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The id of the competency&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;proficiencymeasured&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The measured/evaluated proficiency level for the user&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;timecreated&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The time when this competency evidence was started&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;timemodified&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The time when this competency evidence was last changed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Plugin architecture=&lt;br /&gt;
&#039;&#039;&#039;Competency evidence type plugins&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each type of evidence will need its own methods for interacting with the competency architecture and will need to interact via a base competency evidence API. Below are the item types.&lt;br /&gt;
&lt;br /&gt;
* Course completion&lt;br /&gt;
* Course grade&lt;br /&gt;
* Course outcome&lt;br /&gt;
* Activity completion&lt;br /&gt;
* Activity grade&lt;br /&gt;
* Activity outcome&lt;br /&gt;
* File&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Report plugins&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Similar to the gradebook, we need to allow development of report plugins for competencies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Import/Export plugins&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We need to be able to import and export data related to competencies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Competency framework import/export&#039;&#039;&#039;&lt;br /&gt;
A competency framework should be able to be exported using an appropriate format in either xml and csv file format. There are some standards on exchanging competencies including:&lt;br /&gt;
* IEEE P1484.20.1 Standard on Reusable Competency Definitions and the IEEE Draft Standard on Simple Reusable Competency Map&lt;br /&gt;
* ISO/IEC PDTR 24763 Conceptual Reference Model for Competencies and Related Objects&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Competency evidence import/export&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There are a variety of standards for exchanging competencies evidence including:&lt;br /&gt;
* IMS Reusable Definition of Competency or Educational Objectives Spec (RDCEO)&lt;br /&gt;
* IMS Learner Information Package Spec (LIP)&lt;br /&gt;
* HR-XML Competencies (Measurable Characteristics) Recommendation, 2007 April 15&lt;br /&gt;
&lt;br /&gt;
IMS RDCEO and LIP recommend formats as shown in the examples below (more [http://www.imsglobal.org/competencies/index.html IMS RDCEO here] and [http://www.imsglobal.org/profiles/index.html IMS LIP home]). Special thanks to Sarveswaran Kengatharaiyer (GSOC 2008 student for the Moodle Progress Tracker project) who developed these examples.&lt;br /&gt;
&lt;br /&gt;
 rdceo.identifier = rdceo434323&lt;br /&gt;
 rdceo.title = Identify verbs in simple sentences&lt;br /&gt;
 rdceo.description = “Identify verbs in simple sentences”&lt;br /&gt;
 rdceo.definition.statement.&lt;br /&gt;
    statementid = 123&lt;br /&gt;
    statementname = Always&lt;br /&gt;
    statementtext = Scale&lt;br /&gt;
    statementtoken = scl55435&lt;br /&gt;
 rdceo.definition.statement.&lt;br /&gt;
    statementid = 124&lt;br /&gt;
    statementname = Never&lt;br /&gt;
    statementtext = Scale&lt;br /&gt;
    statementtoken = scl55436&lt;br /&gt;
 rdceo.definition.statement.&lt;br /&gt;
    statementid = 125&lt;br /&gt;
    statementname = Sometimes&lt;br /&gt;
    statementtext = Scale&lt;br /&gt;
    statementtoken = scl55437&lt;br /&gt;
 &lt;br /&gt;
 lip.contenttype.referencial.sourceid.id = jenney_profile&lt;br /&gt;
 lip.identification.cotenttype.referential.indexid = id123&lt;br /&gt;
 lip.identification.name.partname.typename=Jenny &lt;br /&gt;
 lip.competency&lt;br /&gt;
    cotenttype.referential.indexid = j123&lt;br /&gt;
    exrefrecord = rdceo434323&lt;br /&gt;
    description = Always&lt;br /&gt;
&lt;br /&gt;
HR-XML recommends a format like shown below in an example which uses recursive competencies (more [http://ns.hr-xml.org/2_5/HR-XML-2_5/CPO/Competencies.html#_Toc127531664 here]).&lt;br /&gt;
 &amp;lt;Competency name=&amp;quot;Communication Skills&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;Competency name=&amp;quot;Written Communication Skills&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;CompetencyEvidence name=&amp;quot;WRITTENTEST1-A&amp;quot; dateOfIncident=&amp;quot;1995-01-01&amp;quot; lastUsed=&amp;quot;2000-01-01&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;NumericValue minValue=&amp;quot;3&amp;quot; maxValue=&amp;quot;5&amp;quot; description=&amp;quot;SEP-equivalent Skill-Level Range&amp;quot;&amp;gt;5&amp;lt;/NumericValue&amp;gt;&lt;br /&gt;
             &amp;lt;/CompetencyEvidence&amp;gt;&lt;br /&gt;
             &amp;lt;CompetencyWeight&amp;gt;&lt;br /&gt;
                    &amp;lt;NumericValue minValue=&amp;quot;0&amp;quot; maxValue=&amp;quot;100&amp;quot;&amp;gt;35&amp;lt;/NumericValue&amp;gt;&lt;br /&gt;
             &amp;lt;/CompetencyWeight&amp;gt;&lt;br /&gt;
       &amp;lt;/Competency&amp;gt;&lt;br /&gt;
       &amp;lt;Competency name=&amp;quot;Oral Communication Skills&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;CompetencyEvidence name=&amp;quot;ManagerObservation&amp;quot; dateOfIncident=&amp;quot;1996-01-01&amp;quot; lastUsed=&amp;quot;2000-01-01&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;NumericValue minValue=&amp;quot;1&amp;quot; maxValue=&amp;quot;5&amp;quot; description=&amp;quot;Company XYZ Skill Range&amp;quot;&amp;gt;5&amp;lt;/NumericValue&amp;gt;&lt;br /&gt;
             &amp;lt;/CompetencyEvidence&amp;gt;&lt;br /&gt;
             &amp;lt;CompetencyWeight&amp;gt;&lt;br /&gt;
                    &amp;lt;NumericValue minValue=&amp;quot;0&amp;quot; maxValue=&amp;quot;100&amp;quot;&amp;gt;65&amp;lt;/NumericValue&amp;gt;&lt;br /&gt;
             &amp;lt;/CompetencyWeight&amp;gt;&lt;br /&gt;
       &amp;lt;/Competency&amp;gt;&lt;br /&gt;
 &amp;lt;/Competency&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Logging=&lt;br /&gt;
All competency related changes should be logged in history tables.&lt;br /&gt;
&lt;br /&gt;
=Role capabilities and permissions=&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Capability&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|View competency competencies&lt;br /&gt;
|moodle/competency:viewcompetencies&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|View hidden competencies&lt;br /&gt;
|moodle/competency:viewhiddencompetencies&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Manage competencies&lt;br /&gt;
|moodle/competency:managecompetencies&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Ideas for the future=&lt;br /&gt;
# Allow competencies to be attached to an individual user (either by user profile field or by drag and drop).&lt;br /&gt;
# Allow competencies to be tagged (in a folksonomy) using Moodle&#039;s tag/lib.&lt;br /&gt;
&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Janvh</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Competencies&amp;diff=14386</id>
		<title>Competencies</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Competencies&amp;diff=14386"/>
		<updated>2010-11-25T19:21:33Z</updated>

		<summary type="html">&lt;p&gt;Janvh: /* &amp;quot;Add / edit a competency&amp;quot; admin page */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle 2.0}}&amp;lt;p class=&amp;quot;note&amp;quot;&amp;gt;&#039;&#039;&#039;Note&#039;&#039;&#039;: This page outlines ideas for the Competencies feature planned for Moodle 2.0. It&#039;s a &#039;&#039;specification under construction&#039;&#039;! If you have any comments or suggestions, please add them to the [[Development talk:Progress tracking|page comments]].&#039;&#039;&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;PROJECT STATE: Proposal&#039;&#039;&#039;&lt;br /&gt;
* &#039;&#039;&#039;MAIN TRACKER ISSUE&#039;&#039;&#039;: &lt;br /&gt;
* &#039;&#039;&#039;DISCUSSION&#039;&#039;&#039;: Not yet announced on Moodle.org&lt;br /&gt;
* &#039;&#039;&#039;COMMENTS&#039;&#039;&#039;: [[Development_talk:Competencies]]&lt;br /&gt;
* &#039;&#039;&#039;AUTHOR&#039;&#039;&#039;: [[User:Jonathan Newman|Jonathan Newman]] with help from [[Matt Clarkson|Matt Clarkson]] and others&lt;br /&gt;
&lt;br /&gt;
=Overview=&lt;br /&gt;
To support the range of different types of competency frameworks used by organisations, competencies in Moodle 2.0 needs to expand on the 1.9 outcomes architecture.&lt;br /&gt;
&lt;br /&gt;
==Goals==&lt;br /&gt;
# Measured amount of abstraction&lt;br /&gt;
#* Allow &amp;quot;admins&amp;quot; to organise competencies in a hierarchy&lt;br /&gt;
#* Allow &amp;quot;admins&amp;quot; to create unlimited hierarchical levels&lt;br /&gt;
#* Allow &amp;quot;admins&amp;quot; to map related competencies on a given depth level&lt;br /&gt;
#* Allow &amp;quot;admins&amp;quot; to define custom info fields on a given depth level&lt;br /&gt;
# Easy navigation&lt;br /&gt;
#* Allow &amp;quot;admins&amp;quot; to view the competency structure&lt;br /&gt;
#** Expanding/collapsing competencies&lt;br /&gt;
#** Sorting/searching/filtering by competency meta data&lt;br /&gt;
#* Allow &amp;quot;admins&amp;quot; to easily add new competencies and meta-data&lt;br /&gt;
# Linking competencies and evidence items&lt;br /&gt;
#* Allow &amp;quot;admins&amp;quot; to easily attach allowed evidence (course, activity, etc) to a competency (from a &#039;&#039;site-level competency view&#039;&#039;):&lt;br /&gt;
#* Allow &amp;quot;course creators&amp;quot; to attach competencies to evidence &#039;&#039;within a course&#039;&#039;:&lt;br /&gt;
# Portability&lt;br /&gt;
#* Allow &amp;quot;admins&amp;quot; to import competencies (using import plugins) into a Moodle install&lt;br /&gt;
#* Allow &amp;quot;admins&amp;quot; to export competencies (using export plugins) from a Moodle install&lt;br /&gt;
# Specifying expected proficiency levels&lt;br /&gt;
#* Allow &amp;quot;admins&amp;quot; to assign an expected proficiency level (i.e., competency scale value) to a competency and a competency evidence item&lt;br /&gt;
# Aggregating measured proficiency&lt;br /&gt;
#* Allow &amp;quot;admins&amp;quot; to specify aggregation methods for each competency&lt;br /&gt;
#* Reporting&lt;br /&gt;
#** Allow &amp;quot;admins&amp;quot; to view competency results for all students&lt;br /&gt;
#** Allow &amp;quot;teachers&amp;quot; to view student measured proficiencies related to evidence in his/her courses.&lt;br /&gt;
#** Allow &amp;quot;students&amp;quot; to view their own competency results (via either their personal profile or My Moodle).&lt;br /&gt;
# Specifying weights&lt;br /&gt;
#* Allow &amp;quot;admins&amp;quot; to assign weight to a competency or a competency evidence item&lt;br /&gt;
# Scalability&lt;br /&gt;
#* Store and retrieve data efficiently to allow the scalability to very large numbers of courses, users, competencies, evidence, etc&lt;br /&gt;
# Extensibility&lt;br /&gt;
#* Use a plugin architecture for evidence types&lt;br /&gt;
&lt;br /&gt;
==General requirements==&lt;br /&gt;
# We&#039;ll need to access and use the existing site-wide Outcomes [https://docs.moodle.org/en/Development:Grades#grade_outcomes Outcomes tables]&lt;br /&gt;
# We&#039;ll need to use the tables that indicate completion status for courses (these are not yet in place) [https://docs.moodle.org/en/Development:Course_completion Course Completion]&lt;br /&gt;
# We need to get aggregate information about the course outcomes and aggregate grades for each user from the gradebook API&lt;br /&gt;
&lt;br /&gt;
==Definitions==&lt;br /&gt;
&#039;&#039;&#039;Scale&#039;&#039;&#039;: A way to measure a competency using scale values.&lt;br /&gt;
&lt;br /&gt;
Example scales:&lt;br /&gt;
 &amp;quot;Average-based scale&amp;quot;&lt;br /&gt;
 &amp;quot;Competency-based scale&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Scale values&#039;&#039;&#039;: Descriptor or numeric values that comprise a scale. A scale value can have a id number (code) and description.&lt;br /&gt;
&lt;br /&gt;
Example scales values (with descriptors and numerical values) for the scale examples above:&lt;br /&gt;
 &amp;quot;Below average [1], Average [2], Above average [3]&lt;br /&gt;
 &amp;quot;Not yet competent [0], Competent [100]&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Competency&#039;&#039;&#039;: A measurable knowledge, skill, ability, attitude or other learning-related characteristic which a student may have. Competencies can be organised into a hierarchy. &lt;br /&gt;
&lt;br /&gt;
Example hierarchy of competencies:&lt;br /&gt;
 top-level competency: &amp;quot;Literacy&amp;quot;&lt;br /&gt;
     -&amp;gt; child competency: &amp;quot;Reading Comprehension&amp;quot;&lt;br /&gt;
         -&amp;gt; child competency: &amp;quot;Responding to Text&amp;quot;&lt;br /&gt;
             -&amp;gt; child competency: &amp;quot;Initial Understanding of Literary Text&amp;quot;&lt;br /&gt;
                 -&amp;gt; child competency: &amp;quot;Demonstrate initial understanding of elements of literary texts (including text read aloud, reading independently&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Competency evidence type&#039;&#039;&#039;: A form of evidence that can be accepted as evidence that a competency has been achieved. Examples:&lt;br /&gt;
 Activity grade&lt;br /&gt;
 Activity completion&lt;br /&gt;
 Activity outcome&lt;br /&gt;
 Course completion&lt;br /&gt;
 Course grade&lt;br /&gt;
 File (diploma)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Competency evidence&#039;&#039;&#039;: A competency can be measured by one or more competency evidence types. Evidence can be stated to include the evidence type, evidence date, and measured value. Examples:&lt;br /&gt;
 &amp;quot;Quiz - 4:00pm May 28, 2009 - Grade 90% out of 100%&amp;quot;&lt;br /&gt;
 &amp;quot;Certificate - Public Speaking Institute - 4:00pm May 28, 2009 - Passed.&amp;quot;&lt;br /&gt;
 &amp;quot;File - College Diploma - 4:00pm May 28, 2009 - Bachelor of Science Computer Science&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Expected proficiency level&#039;&#039;&#039;: The expected (or required) rating (based on a scale descriptor or numerical value) for a competency. Examples:&lt;br /&gt;
 &amp;quot;Average&amp;quot;&lt;br /&gt;
 &amp;quot;5&amp;quot;&lt;br /&gt;
 &amp;quot;50%&amp;quot;&lt;br /&gt;
 &amp;quot;Passed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Measured proficiency level&#039;&#039;&#039;: A user&#039;s observed, scored, reported proficiency level for a competency.&lt;br /&gt;
 &amp;quot;Above average&amp;quot;&lt;br /&gt;
 &amp;quot;8&amp;quot;&lt;br /&gt;
 &amp;quot;80%&amp;quot;&lt;br /&gt;
 &amp;quot;Passed&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Competency weighting&#039;&#039;&#039;: Child competencies can be assigned weights which can be used for aggregating either sums or averages of child competencies. Examples:&lt;br /&gt;
&lt;br /&gt;
Example with percentage weights&lt;br /&gt;
 -&amp;gt; top-level competency: &amp;quot;Communication&amp;quot;&lt;br /&gt;
     -&amp;gt; child competency: &amp;quot;Written Communication&amp;quot; : weight: 60%&lt;br /&gt;
     -&amp;gt; child competency: &amp;quot;Oral Communication&amp;quot; : weight: 40%&lt;br /&gt;
&lt;br /&gt;
==Example frameworks==&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Example 1:&#039;&#039;&#039; Competency hierarchy with activity outcomes as evidence&lt;br /&gt;
&lt;br /&gt;
The example data below is based roughly on the [http://education.vermont.gov/ Department of Education for the State of Vermont]&#039;s [http://education.vermont.gov/new/html/pgm_curriculum/literacy/gle.html Grade 1 Expectations for Literacy] for Reading.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Depth level&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Depth name&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Competency&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;full name&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Competency&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;evidence&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Competency&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;aggregation method&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Competency&lt;br /&gt;
&#039;&#039;&#039;weight&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Competency&#039;&#039;&#039;&lt;br /&gt;
&#039;&#039;&#039;proficiency expected&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|0&lt;br /&gt;
|&amp;quot;Curriculum&amp;quot;&lt;br /&gt;
|&amp;quot;Literacy&amp;quot;&lt;br /&gt;
|none&lt;br /&gt;
|all&lt;br /&gt;
|20%&lt;br /&gt;
|80%&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|1&lt;br /&gt;
|&amp;quot;Type&amp;quot;&lt;br /&gt;
|&amp;quot;Reading&amp;quot;&lt;br /&gt;
|none&lt;br /&gt;
|all&lt;br /&gt;
|20%&lt;br /&gt;
|100%&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|2&lt;br /&gt;
|&amp;quot;Standard&amp;quot;&lt;br /&gt;
|&amp;quot;Standard 1.1 Reading Strategies&amp;quot;&lt;br /&gt;
|none&lt;br /&gt;
|all&lt;br /&gt;
|20%&lt;br /&gt;
|80%&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|&amp;quot;Strategy&amp;quot;&lt;br /&gt;
|&amp;quot;Early Reading Skills and Strategies: Phonological Awareness&amp;quot;&lt;br /&gt;
|none&lt;br /&gt;
|all&lt;br /&gt;
|100%&lt;br /&gt;
|80%&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|&amp;quot;Code&amp;quot;&lt;br /&gt;
|&amp;quot;RK: 1 - Applies phonological knowledge and skills by...&amp;quot;&lt;br /&gt;
|activity outcome &amp;quot;Recognizing pairs of rhyming words and producing rhymes&amp;quot;&lt;br /&gt;
&lt;br /&gt;
activity outcome &amp;quot;Blending and segmenting syllables and onset-rimes&amp;quot;&lt;br /&gt;
&lt;br /&gt;
activity outcome &amp;quot;Isolating phonemes in single-syllable words (e.g., &amp;quot;tell me the first sound in &#039;mop&#039; &amp;quot;; &amp;quot;tell me the last sound in &#039;mop,&#039;&amp;quot; &amp;quot;tell me the middle sound in &#039;mop&#039;&amp;quot;)&amp;quot;&lt;br /&gt;
|all&lt;br /&gt;
|50%&lt;br /&gt;
|80%&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|3&lt;br /&gt;
|&amp;quot;Strategy&amp;quot;&lt;br /&gt;
|&amp;quot;Early Reading Skills and Strategies - Concepts of Print&amp;quot;&lt;br /&gt;
|none&lt;br /&gt;
|all&lt;br /&gt;
|50%&lt;br /&gt;
|80%&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|4&lt;br /&gt;
|&amp;quot;Code&amp;quot;&lt;br /&gt;
|&amp;quot;RK: 2 - Demonstrates understanding of concepts of print during shared or individual reading by...&amp;quot;&lt;br /&gt;
|activity outcome: &amp;quot;Distinguishing between printed letters and words&amp;quot;&lt;br /&gt;
&lt;br /&gt;
activity outcome: &amp;quot;Following text with finger-pointing (e.g., charts, simple books), demonstrating left-to-right and top-to-bottom directionality&amp;quot;&lt;br /&gt;
&lt;br /&gt;
activity outcome: &amp;quot;Identifying the first and last parts of a word (beginning/end of the word)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
activity outcome: &amp;quot;Identifying key parts of a book: front and back, print, illustrations&amp;quot;&lt;br /&gt;
&lt;br /&gt;
|all&lt;br /&gt;
|50%&lt;br /&gt;
|80%&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See [https://docs.moodle.org/en/Development:Competencies_example here] for how the data above fits into the proposed schema.&lt;br /&gt;
&lt;br /&gt;
=Settings=&lt;br /&gt;
==Site settings==&lt;br /&gt;
[https://docs.moodle.org/en/Development:Conditional_activities#Completion_tracking_2 Activity Completion] provides an &amp;quot;Enable outcomes&amp;quot; setting (found in the Site Administration block&#039;s Advanced features / optional subsystems settings page). We need to keep outcomes, however we will need to add competencies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Proposed changes:&#039;&#039;&#039;&lt;br /&gt;
* Create a new setting named &amp;quot;Enable competencies&amp;quot; (the setting will allow competencies to be defined)&lt;br /&gt;
&lt;br /&gt;
=User interface=&lt;br /&gt;
&lt;br /&gt;
==Site Administration block==&lt;br /&gt;
When competencies are enabled, a &amp;quot;Competencies&amp;quot; menu item should appear in the Site Administration block. An &amp;quot;Add / edit competencies&amp;quot; option should appear when &amp;quot;Competencies&amp;quot; is clicked. The &amp;quot;Add / edit competencies&amp;quot; will point to the &amp;quot;Add / edit competencies&amp;quot; admin page.&lt;br /&gt;
&lt;br /&gt;
==&amp;quot;Add/edit competencies&amp;quot; admin page==&lt;br /&gt;
[[Image:Competencies_add_edit_default.png|thumb|400px|Mockup of the Add/edit competencies admin page (default)]]&lt;br /&gt;
&lt;br /&gt;
[[Image:Competencies_add_edit.png|thumb|400px|Mockup of the Add/edit competencies admin page (with competencies from Example 1 framework)]]&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;admin&amp;quot; can use this page to add and edit competencies and competency depth levels, using buttons and features available in a table.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Buttons&#039;&#039;&#039;&lt;br /&gt;
* An &amp;quot;Add a new competency&amp;quot; button will link to the &amp;quot;Add a competency&amp;quot; admin page.&lt;br /&gt;
* An &amp;quot;Add a new depth level&amp;quot; button will link to the &amp;quot;Add a depth level&amp;quot; admin page.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Table rows&#039;&#039;&#039;&lt;br /&gt;
* A &amp;quot;plus&amp;quot; / &amp;quot;minus&amp;quot; icon will appear on the right of each row in the table, allowing all child competencies to be shown or hidden.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Table columns&#039;&#039;&#039;&lt;br /&gt;
* A default, top-level competency depth named &amp;quot;Competency&amp;quot; will appear in a table as a column on the left. The default competency depth name can be changed (e.g., &amp;quot;Competency Area&amp;quot;, &amp;quot;Standard&amp;quot;, &amp;quot;Development Area&amp;quot;, etc).&lt;br /&gt;
* When a new competency depth is added, it will appear as column to the right of the next highest competency depth level.&lt;br /&gt;
* Appearing to the right of the competency depth level columns will be the following &amp;quot;standard&amp;quot; interface columns: &amp;quot;Evidence items&amp;quot;, &amp;quot;Edit&amp;quot;, and &amp;quot;Move competency to&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Below are more specifics on the table columns and content:&lt;br /&gt;
* &#039;&#039;[Competency depth level 0 name]&#039;&#039;, &#039;&#039;[Competency depth level 1 name]&#039;&#039;, &#039;&#039;[Competency depth level 2 name]&#039;&#039;, ... &#039;&#039;[Competency depth level n name]&#039;&#039;&lt;br /&gt;
** Columns of depth levels will be ordered from highest/top-level (on the left) to the lowest (on the right).&lt;br /&gt;
** An edit icon will appear beside each competency depth name, and will link to the &amp;quot;Edit competency depth&amp;quot; page (which will allow an &amp;quot;admin&amp;quot; to change the name of the competency depth name).&lt;br /&gt;
** The competency name will be displayed, and will link to a page containing meta data and possibly summary proficiency achievement stats about the competency.&lt;br /&gt;
* &#039;&#039;Evidence item&#039;&#039;&lt;br /&gt;
** By default the number of evidence items will be &amp;quot;0&amp;quot;. The number shown will link to the &amp;quot;Add / edit evidence items&amp;quot; admin page for the given competency.&lt;br /&gt;
* &#039;&#039;Edit&#039;&#039;&lt;br /&gt;
** Three icons appear providing the following functionality:&lt;br /&gt;
*** &amp;quot;edit&amp;quot; icon points to the &amp;quot;Edit competency&amp;quot; page for the competency&lt;br /&gt;
*** &amp;quot;delete&amp;quot; icon points to a confirmation page for deleting the competency&lt;br /&gt;
*** &amp;quot;up&amp;quot; / &amp;quot;down&amp;quot; icons will appear beside child competencies when a parent has two or more child competencies. A competency can only be moved up or down with respect to a parent competency.Only the down arrow will appear for the highest child competency, and only the up arrow will appear for the lowest child competency.&lt;br /&gt;
* &#039;&#039;Move competency to&#039;&#039;&lt;br /&gt;
** A drop down menu appears containing all parent competencies at the next highest depth. &lt;br /&gt;
** Competencies can only be moved from one parent to another parent in the same depth level.&lt;br /&gt;
&lt;br /&gt;
==&amp;quot;Add / edit a competency&amp;quot; admin page==&lt;br /&gt;
[[Image:Competencies_add.png|thumb|400px|Mockup of the Add competencies admin page]]&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;admin&amp;quot; will use this page to add or edit a new competency, with the following settings:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;General settings&#039;&#039;&lt;br /&gt;
* Parent competency&lt;br /&gt;
* Competency full name&lt;br /&gt;
* Competency short name&lt;br /&gt;
* Competency ID number&lt;br /&gt;
* Description&lt;br /&gt;
* Aggregation method&lt;br /&gt;
* Scale&lt;br /&gt;
* Proficiency expected&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Custom depth level settings&#039;&#039;&lt;br /&gt;
* Form elements based on custom fields for selected depth level (based on the parent competency)&lt;br /&gt;
* Changing the selected parent competency should update the custom fields shown, if the depth level of the parent changes&lt;br /&gt;
&lt;br /&gt;
==&amp;quot;Add / edit competency depth&amp;quot; admin page==&lt;br /&gt;
[[Image:Competencies_depth_add.png|thumb|400px|Mockup of the Add competency depth admin page]]&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;admin&amp;quot; will be use this page to add / edit a new competency depth, with the following settings:&lt;br /&gt;
* Depth full name&lt;br /&gt;
* Depth short name&lt;br /&gt;
* Description&lt;br /&gt;
&lt;br /&gt;
Also, the depth level will be displayed&lt;br /&gt;
&lt;br /&gt;
==&amp;quot;Add / edit competency evidence&amp;quot; admin page==&lt;br /&gt;
[[Image:Competencies_evidence_add_edit.png|thumb|400px|Mockup of the Add / edit competency evidence admin page with Example 1 competencies]]&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;admin&amp;quot; will be use this page to view / add / edit evidence for a competency. The top of the page should display the existing general data for the competency, the number of &amp;quot;students&amp;quot; who have achieved the competency, and a table showing data and functionality for each evidence item:&lt;br /&gt;
* The name of the competency evidence (which links to the evidence item in context, e.g., the course if course completion is specified, etc)&lt;br /&gt;
* The type of evidence &lt;br /&gt;
* The activity (if the evidence is an activity outcome or activity grade)&lt;br /&gt;
* The weight of the evidence&lt;br /&gt;
* Options to edit or remove the evidence&lt;br /&gt;
* The number of &amp;quot;students&amp;quot; who have achieved the evidence&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;Add new competency evidence&amp;quot; button should link to the &amp;quot;Add new competency evidence&amp;quot; admin page.&lt;br /&gt;
&lt;br /&gt;
==&amp;quot;Competencies summary&amp;quot; user profile page==&lt;br /&gt;
&lt;br /&gt;
[[Image:Competencies_user_profile_activity.png|thumb|400px|Mockup of user profile page with Example 1 competencies]]&lt;br /&gt;
&lt;br /&gt;
An &amp;quot;student&amp;quot; or a user with permission to view a student&#039;s competencies will be able to view the proficiency status for each competency as a table with the following columns:&lt;br /&gt;
* Competency depth(s)&lt;br /&gt;
* Evidence items&lt;br /&gt;
* Proficiency&lt;br /&gt;
* Scale&lt;br /&gt;
&lt;br /&gt;
Each competency name should link to a pop-up containing the competency details (full name, description, aggregation method, scale, and meta data) and list of evidence items.&lt;br /&gt;
&lt;br /&gt;
Each number of competency items should link to a pop-up containing a list of evidence items.&lt;br /&gt;
&lt;br /&gt;
=Data structures=&lt;br /&gt;
&lt;br /&gt;
[[Image:Competency_data_model.png|thumb|400px|Competencies data model]]&lt;br /&gt;
&lt;br /&gt;
===scale===&lt;br /&gt;
Scales (introduced in Moodle 1.9) give a scale value a single attribute: text (i.e., the name of the scale value like &amp;quot;below standard,&amp;quot; &amp;quot;meets standard,&amp;quot; &amp;quot;above standard&amp;quot;). Scale values can be particularly useful if given attributes including: numerical equivalent, idnumber (code id), and a description. The new attributes will require a new table.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Proposed changes:&#039;&#039; Create a new table &#039;scale_values&#039; that includes a foreign key to the &#039;scale&#039; table, and migrate the &#039;scale&#039; field values from the &#039;scale&#039; table (as serialised text) to the &#039;scale_values&#039; table (as separate records). A sort order field will be used to track ranking (starting with the lowest with a sortorder of 0). &lt;br /&gt;
&lt;br /&gt;
Below is the proposed &#039;scale&#039; table, and further below is the proposed &#039;scale_value&#039; table.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Field&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Type&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Default&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Info&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Auto incrementing &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;courseid&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Id of the course, which the scale belongs to&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;userid&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Id of the user who last modified the scale&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;name&#039;&#039;&#039;&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|&lt;br /&gt;
|Name of the scale value&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;description&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|Description of the scale value&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;timemodified&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Timestamp of when the scale was modified&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===scale_values===&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Field&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Type&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Default&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Info&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Auto incrementing &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;scaleid&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Id of the scale that the scale value describes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;name&#039;&#039;&#039;&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|&lt;br /&gt;
|Name of the scale value&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;idnumber&#039;&#039;&#039;&lt;br /&gt;
|varchar(100)&lt;br /&gt;
|&lt;br /&gt;
|Optional id, code number or local identifier for the scale value (used for reporting).&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;description&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|Description of the scale value&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;numeric&#039;&#039;&#039;&lt;br /&gt;
|number(8)&lt;br /&gt;
|&lt;br /&gt;
|Numerical value for the scale value&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;sortorder&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The order for the scale value&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;timemodified&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Timestamp of when the scale value was modified&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===competency===&lt;br /&gt;
&lt;br /&gt;
A competency can be part of a hierarchy and can have evidence attached to it.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Field&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Type&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Default&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Info&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Auto incrementing &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;shortname&#039;&#039;&#039;&lt;br /&gt;
|varchar(100)&lt;br /&gt;
|&lt;br /&gt;
|The shortname for the competency&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;fullname&#039;&#039;&#039;&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|&lt;br /&gt;
|The full name for the competency&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;description&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|The description of the competency&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;idnumber&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The id, code number or local identifier for the competency used for reporting&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;parentid&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The id of the parent competency&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;sortorder&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The order number of this competency (useful for ordering competencies for viewing/navigation/reporting)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;depthid&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The id of the depth level the competency belongs to&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;path&#039;&#039;&#039;&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|&lt;br /&gt;
|The path to the competency&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;aggregationmethod&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|A constant representation one of the competency aggregation methods (any, all, unit, fraction, sum of weighted, average of weighted)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;scaleid&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The scale used to measure the competency&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;proficiencyexpected&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The expected proficiency for the competency, foreign key to the scale_value table&#039;s id&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;timecreated&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The time when the competency was created&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;timemodified&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The time when the competency was modified&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;usermodified&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The userid of the person who last modified the competency&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===competency_relations===&lt;br /&gt;
&lt;br /&gt;
For tracking relations between competencies.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Field&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Type&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Default&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Info&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Auto incrementing &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;description&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|Info about how competencies are related&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;competencyid1&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The id of a competency&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;competencyid2&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The id of a related competency&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===competency_depth===&lt;br /&gt;
&lt;br /&gt;
Data for a competency depth level.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Field&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Type&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Default&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Info&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Auto incrementing&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;shortname&#039;&#039;&#039;&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|&lt;br /&gt;
|Shortname for the depth level&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;fullname&#039;&#039;&#039;&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|&lt;br /&gt;
|Full name for the depth level&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;description&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|Description for the depth level&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;level&#039;&#039;&#039;&lt;br /&gt;
|int(2)&lt;br /&gt;
|&lt;br /&gt;
|The actual depth level, starting at 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===competency_depth_info_field===&lt;br /&gt;
&lt;br /&gt;
Data for a competency depth level field.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Field&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Type&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Default&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Info&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Auto incrementing&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;shortname&#039;&#039;&#039;&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|&lt;br /&gt;
|Shortname for the field&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;fullname&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|Full name for the field&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;depthid&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The id of the competency depth for the field. Foreign key to the competency_depth table&#039;s id&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;datatype&#039;&#039;&#039;&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|&lt;br /&gt;
|The type of field data&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;description&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|Description of the field&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;categoryid&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The id for the field category. Foreign key to the competency_depth_info_category table&#039;s id field&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;sortorder&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The sort order for the field within its category&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;hidden&#039;&#039;&#039;&lt;br /&gt;
|int(1)&lt;br /&gt;
|&lt;br /&gt;
|The field should be hidden&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;required&#039;&#039;&#039;&lt;br /&gt;
|int(1)&lt;br /&gt;
|&lt;br /&gt;
|The field required&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;defaultdata&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|Default text for the selected parameter&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;param1&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|Parameter text&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;param2&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|Parameter text&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;param3&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|Parameter text&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;param4&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|Parameter text&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;param5&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|Parameter text&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===competency_depth_info_category===&lt;br /&gt;
&lt;br /&gt;
A competency&#039;s depth level can have categories for its fields.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Field&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Type&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Default&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Info&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Auto incrementing&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;name&#039;&#039;&#039;&lt;br /&gt;
|varchar(255)&lt;br /&gt;
|&lt;br /&gt;
|Shortname for the depth level category&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;sortorder&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The order number for this category&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===competency_depth_info_data===&lt;br /&gt;
&lt;br /&gt;
Data for a depth level field.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Field&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Type&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Default&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Info&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Auto incrementing&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;fieldid&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The id for the field&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;competencyid&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The id for the competency&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;data&#039;&#039;&#039;&lt;br /&gt;
|text&lt;br /&gt;
|&lt;br /&gt;
|The actual data for the competency field&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===competency_evidence_items===&lt;br /&gt;
&lt;br /&gt;
A competency can be achieved by one or more forms of evidence.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Field&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Type&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Default&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Info&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|Auto incrementing &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;competencyid&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The id for the competency that this evidence describes&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;itemtype&#039;&#039;&#039;&lt;br /&gt;
|varchar(30)&lt;br /&gt;
|&lt;br /&gt;
|The type of evidence &#039;course/outcome&#039;, &#039;mod/outcome&#039;, &#039;course/completion&#039;, &#039;mod/completion&#039;, &#039;course/grade&#039;, &#039;mod/grade&#039;, &#039;file&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;itemmodule&#039;&#039;&#039;&lt;br /&gt;
|varchar(30)&lt;br /&gt;
|&lt;br /&gt;
|The type of evidence &#039;quiz&#039;, &#039;scorm&#039;, etc&lt;br /&gt;
|-&lt;br /&gt;
&lt;br /&gt;
|&#039;&#039;&#039;iteminstance&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The id for the evidence instance (ie, grade_outcome id, course id, course_modules id, grade_item id, files id)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;weight&#039;&#039;&#039;&lt;br /&gt;
|num(10)&lt;br /&gt;
|&lt;br /&gt;
|The weight applied to this evidence item (for aggregation)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;timecreated&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The time when this competency evidence was allowed&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;timemodified&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The time when this competency evidence was last changed&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;usermodified&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The user who last modified this evidence&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===competency_evidence===&lt;br /&gt;
&lt;br /&gt;
Track historical and current competency information for each user.&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Field&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Type&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Default&#039;&#039;&#039; &lt;br /&gt;
|&#039;&#039;&#039;Info&#039;&#039;&#039; &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;id&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|auto-incrementing&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;userid&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The id of the user&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;competencyid&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The id of the competency&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;proficiencymeasured&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The measured/evaluated proficiency level for the user&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;timecreated&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The time when this competency evidence was started&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;timemodified&#039;&#039;&#039;&lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The time when this competency evidence was last changed&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Plugin architecture=&lt;br /&gt;
&#039;&#039;&#039;Competency evidence type plugins&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Each type of evidence will need its own methods for interacting with the competency architecture and will need to interact via a base competency evidence API. Below are the item types.&lt;br /&gt;
&lt;br /&gt;
* Course completion&lt;br /&gt;
* Course grade&lt;br /&gt;
* Course outcome&lt;br /&gt;
* Activity completion&lt;br /&gt;
* Activity grade&lt;br /&gt;
* Activity outcome&lt;br /&gt;
* File&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Report plugins&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Similar to the gradebook, we need to allow development of report plugins for competencies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Import/Export plugins&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
We need to be able to import and export data related to competencies.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Competency framework import/export&#039;&#039;&#039;&lt;br /&gt;
A competency framework should be able to be exported using an appropriate format in either xml and csv file format. There are some standards on exchanging competencies including:&lt;br /&gt;
* IEEE P1484.20.1 Standard on Reusable Competency Definitions and the IEEE Draft Standard on Simple Reusable Competency Map&lt;br /&gt;
* ISO/IEC PDTR 24763 Conceptual Reference Model for Competencies and Related Objects&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Competency evidence import/export&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
There are a variety of standards for exchanging competencies evidence including:&lt;br /&gt;
* IMS Reusable Definition of Competency or Educational Objectives Spec (RDCEO)&lt;br /&gt;
* IMS Learner Information Package Spec (LIP)&lt;br /&gt;
* HR-XML Competencies (Measurable Characteristics) Recommendation, 2007 April 15&lt;br /&gt;
&lt;br /&gt;
IMS RDCEO and LIP recommend formats as shown in the examples below (more [http://www.imsglobal.org/competencies/index.html IMS RDCEO here] and [http://www.imsglobal.org/profiles/index.html IMS LIP home]). Special thanks to Sarveswaran Kengatharaiyer (GSOC 2008 student for the Moodle Progress Tracker project) who developed these examples.&lt;br /&gt;
&lt;br /&gt;
 rdceo.identifier = rdceo434323&lt;br /&gt;
 rdceo.title = Identify verbs in simple sentences&lt;br /&gt;
 rdceo.description = “Identify verbs in simple sentences”&lt;br /&gt;
 rdceo.definition.statement.&lt;br /&gt;
    statementid = 123&lt;br /&gt;
    statementname = Always&lt;br /&gt;
    statementtext = Scale&lt;br /&gt;
    statementtoken = scl55435&lt;br /&gt;
 rdceo.definition.statement.&lt;br /&gt;
    statementid = 124&lt;br /&gt;
    statementname = Never&lt;br /&gt;
    statementtext = Scale&lt;br /&gt;
    statementtoken = scl55436&lt;br /&gt;
 rdceo.definition.statement.&lt;br /&gt;
    statementid = 125&lt;br /&gt;
    statementname = Sometimes&lt;br /&gt;
    statementtext = Scale&lt;br /&gt;
    statementtoken = scl55437&lt;br /&gt;
 &lt;br /&gt;
 lip.contenttype.referencial.sourceid.id = jenney_profile&lt;br /&gt;
 lip.identification.cotenttype.referential.indexid = id123&lt;br /&gt;
 lip.identification.name.partname.typename=Jenny &lt;br /&gt;
 lip.competency&lt;br /&gt;
    cotenttype.referential.indexid = j123&lt;br /&gt;
    exrefrecord = rdceo434323&lt;br /&gt;
    description = Always&lt;br /&gt;
&lt;br /&gt;
HR-XML recommends a format like shown below in an example which uses recursive competencies (more [http://ns.hr-xml.org/2_5/HR-XML-2_5/CPO/Competencies.html#_Toc127531664 here]).&lt;br /&gt;
 &amp;lt;Competency name=&amp;quot;Communication Skills&amp;quot;&amp;gt;&lt;br /&gt;
       &amp;lt;Competency name=&amp;quot;Written Communication Skills&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;CompetencyEvidence name=&amp;quot;WRITTENTEST1-A&amp;quot; dateOfIncident=&amp;quot;1995-01-01&amp;quot; lastUsed=&amp;quot;2000-01-01&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;NumericValue minValue=&amp;quot;3&amp;quot; maxValue=&amp;quot;5&amp;quot; description=&amp;quot;SEP-equivalent Skill-Level Range&amp;quot;&amp;gt;5&amp;lt;/NumericValue&amp;gt;&lt;br /&gt;
             &amp;lt;/CompetencyEvidence&amp;gt;&lt;br /&gt;
             &amp;lt;CompetencyWeight&amp;gt;&lt;br /&gt;
                    &amp;lt;NumericValue minValue=&amp;quot;0&amp;quot; maxValue=&amp;quot;100&amp;quot;&amp;gt;35&amp;lt;/NumericValue&amp;gt;&lt;br /&gt;
             &amp;lt;/CompetencyWeight&amp;gt;&lt;br /&gt;
       &amp;lt;/Competency&amp;gt;&lt;br /&gt;
       &amp;lt;Competency name=&amp;quot;Oral Communication Skills&amp;quot;&amp;gt;&lt;br /&gt;
             &amp;lt;CompetencyEvidence name=&amp;quot;ManagerObservation&amp;quot; dateOfIncident=&amp;quot;1996-01-01&amp;quot; lastUsed=&amp;quot;2000-01-01&amp;quot;&amp;gt;&lt;br /&gt;
                    &amp;lt;NumericValue minValue=&amp;quot;1&amp;quot; maxValue=&amp;quot;5&amp;quot; description=&amp;quot;Company XYZ Skill Range&amp;quot;&amp;gt;5&amp;lt;/NumericValue&amp;gt;&lt;br /&gt;
             &amp;lt;/CompetencyEvidence&amp;gt;&lt;br /&gt;
             &amp;lt;CompetencyWeight&amp;gt;&lt;br /&gt;
                    &amp;lt;NumericValue minValue=&amp;quot;0&amp;quot; maxValue=&amp;quot;100&amp;quot;&amp;gt;65&amp;lt;/NumericValue&amp;gt;&lt;br /&gt;
             &amp;lt;/CompetencyWeight&amp;gt;&lt;br /&gt;
       &amp;lt;/Competency&amp;gt;&lt;br /&gt;
 &amp;lt;/Competency&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Logging=&lt;br /&gt;
All competency related changes should be logged in history tables.&lt;br /&gt;
&lt;br /&gt;
=Role capabilities and permissions=&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;0&amp;quot; cellpadding=&amp;quot;2&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Description&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Capability&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|View competency competencies&lt;br /&gt;
|moodle/competency:viewcompetencies&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|View hidden competencies&lt;br /&gt;
|moodle/competency:viewhiddencompetencies&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Manage competencies&lt;br /&gt;
|moodle/competency:managecompetencies&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=Ideas for the future=&lt;br /&gt;
# Allow competencies to be attached to an individual user (either by user profile field or by drag and drop).&lt;br /&gt;
# Allow competencies to be tagged (in a folksonomy) using Moodle&#039;s tag/lib.&lt;br /&gt;
&lt;br /&gt;
[[Category:Project]]&lt;/div&gt;</summary>
		<author><name>Janvh</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Creating_a_web_service_and_a_web_service_function&amp;diff=16367</id>
		<title>Creating a web service and a web service function</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Creating_a_web_service_and_a_web_service_function&amp;diff=16367"/>
		<updated>2010-10-29T06:34:11Z</updated>

		<summary type="html">&lt;p&gt;Janvh: /* Test the web service function */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Moodle_2.0}}&lt;br /&gt;
In this document you will learn how to create a web service function.&lt;br /&gt;
&lt;br /&gt;
This document expect that you first read the administration manual [[Setting_up_a_web_service]].&amp;lt;br/&amp;gt; &lt;br /&gt;
To explain how to write a new web service function, we will write a web service function &#039;&#039;create_groups($groups)&#039;&#039;. This function create a group into a Moodle course. - actually the function already exists into Moodle. You&#039;ll be able to browse CVS to have a look to the actual code. &lt;br /&gt;
&lt;br /&gt;
This function will take a list of group object as parameters and it will return the same groups with their newly created id. If ever one group creation  fails, the function will throw an exception, and no creation will happen. &lt;br /&gt;
&lt;br /&gt;
We&#039;ll finally add the web service function to a core web service.&lt;br /&gt;
&lt;br /&gt;
== Preparation ==&lt;br /&gt;
We need to identify: &lt;br /&gt;
* &#039;&#039;&#039;the core functions&#039;&#039;&#039;: for our case we will use &#039;&#039;groups_create_group()&#039;&#039; from [http://cvs.moodle.org/moodle/group/ /group/lib.php]. Of course not every core function exists and in some other cases you could have to write them.  &lt;br /&gt;
* &#039;&#039;&#039;the parameter types&#039;&#039;&#039;: for our case we&#039;ll send a list of object. This object are groups, with id/name/courseid.&lt;br /&gt;
* &#039;&#039;&#039;the returned value types&#039;&#039;&#039;: for our case we want to send back a list of group object with their id.&lt;br /&gt;
* &#039;&#039;&#039;the user capabilities&#039;&#039;&#039;: for our case the user will need the &#039;&#039;moodle/course:managegroups&#039;&#039; capability.&lt;br /&gt;
&lt;br /&gt;
== Declare the web service function ==&lt;br /&gt;
Web service functions are declared into &#039;&#039;db/services.php&#039;&#039; of each component. In our case &#039;&#039;create_groups()&#039;&#039; is a core external function, so we will add the function to [http://cvs.moodle.org/moodle/lib/db/ /lib/db/services.php].&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
$functions = array(&lt;br /&gt;
    &#039;moodle_group_create_groups&#039; =&amp;gt; array(         //web service function name&lt;br /&gt;
        &#039;classname&#039;   =&amp;gt; &#039;moodle_group_external&#039;,  //class containing the external function&lt;br /&gt;
        &#039;methodname&#039;  =&amp;gt; &#039;create_groups&#039;,          //external function name&lt;br /&gt;
        &#039;classpath&#039;   =&amp;gt; &#039;group/externallib.php&#039;,  //file containing the class/external function&lt;br /&gt;
        &#039;description&#039; =&amp;gt; &#039;Creates new groups.&#039;,    //human readable description of the web service function&lt;br /&gt;
        &#039;type&#039;        =&amp;gt; &#039;write&#039;,                  //database rights of the web service function (read, write)&lt;br /&gt;
    ),&lt;br /&gt;
);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here you should ask yourself what is the difference between a web service function and an external function. Web service function could be considered as a redirection to the external function. The web service function name is the name that is served by web service server to the client. By this way the client doesn&#039;t know about the external functions.&lt;br /&gt;
&lt;br /&gt;
The web service function name is arbitrary, but it must be globally unique so we highly recommend using the component name as prefix (and &amp;quot;moodle&amp;quot; for core functions).&lt;br /&gt;
&lt;br /&gt;
== Define the web service description ==&lt;br /&gt;
Some web service protocol need a full description of the web service function parameters and return value. For example we need to generate a full WSDL for SOAP if we expect a JAVA/.Net client to call our function. This WSDL need a complete and fully detailed description of the parameters.&amp;lt;br/&amp;gt;&lt;br /&gt;
Moreover we implemented a web service parameters validation process that also require a full description of these parameters.&amp;lt;br/&amp;gt;&lt;br /&gt;
In conclusion, you must write these descriptions. These descriptions are not applied on the web service function but the external function, remember that the web service function is just a kind of redirection.&amp;lt;br/&amp;gt;&amp;lt;br/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Descriptions are usually located into a class into an externallib.php in the component folder. You probably remember that we referenced this &#039;&#039;moodle_group_external&#039;&#039; class into [http://cvs.moodle.org/moodle/lib/db/ /lib/db/services.php]. Let&#039;s take a minuteto talk about the [http://cvs.moodle.org/moodle/group/ /group/externallib.php] that we need to create.&lt;br /&gt;
&lt;br /&gt;
This file will contain all external functions. These functions are all related together. In our case the externallib.php file will contain all &#039;&#039;group&#039;&#039; related functions. For each external function, we will have:&lt;br /&gt;
* the external function, calling a core function.&lt;br /&gt;
* a function describing the parameters of the external function&lt;br /&gt;
* a function describing the return values of the external function&lt;br /&gt;
&lt;br /&gt;
Now we&#039;ll have look to the description of the &#039;&#039;create_group($groups)&#039;&#039; parameters. All parameter descriptions are included into a function called &#039;&#039;externalfunctionname_parameters()&#039;&#039;. In our case it will be &#039;&#039;create_groups_parameters()&#039;&#039; :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
require_once(&amp;quot;$CFG-&amp;gt;libdir/externallib.php&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
class moodle_group_external extends external_api {&lt;br /&gt;
&lt;br /&gt;
    /**&lt;br /&gt;
     * Returns description of method parameters&lt;br /&gt;
     * @return external_function_parameters&lt;br /&gt;
     */&lt;br /&gt;
    public static function create_groups_parameters() {&lt;br /&gt;
        return new external_function_parameters(&lt;br /&gt;
            array(&lt;br /&gt;
                &#039;groups&#039; =&amp;gt; new external_multiple_structure(&lt;br /&gt;
                    new external_single_structure(&lt;br /&gt;
                        array(&lt;br /&gt;
                            &#039;courseid&#039; =&amp;gt; new external_value(PARAM_INT, &#039;id of course&#039;),&lt;br /&gt;
                            &#039;name&#039; =&amp;gt; new external_value(PARAM_TEXT, &#039;multilang compatible name, course unique&#039;),&lt;br /&gt;
                            &#039;description&#039; =&amp;gt; new external_value(PARAM_RAW, &#039;group description text&#039;),&lt;br /&gt;
                            &#039;enrolmentkey&#039; =&amp;gt; new external_value(PARAM_RAW, &#039;group enrol secret phrase&#039;),&lt;br /&gt;
                        )&lt;br /&gt;
                    )&lt;br /&gt;
                )&lt;br /&gt;
            )&lt;br /&gt;
        );&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Ok you are probably already here :) We have to understand this function very well. There is different approaches to understand this function, here is my personal one.&amp;lt;br/&amp;gt;&lt;br /&gt;
The function &#039;&#039;xxx_parameters()&#039;&#039; always return an &#039;&#039;external_function_parameters&#039;&#039; object. This object is initialized with an associative array. This array contains the parameter descriptions. If the external function have three parameters, this array will have three elements, the keys being the paramters name.&lt;br /&gt;
Each of its element is a parameter description. A parameter can be a list (external_multiple_structure), an object (external_single_structure) or a primary type (external_value).&lt;br /&gt;
&lt;br /&gt;
Our create_groups() function expect one parameter named &#039;&#039;groups&#039;&#039;, so we will first write:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    /**&lt;br /&gt;
     * Returns description of method parameters&lt;br /&gt;
     * @return external_function_parameters&lt;br /&gt;
     */&lt;br /&gt;
    public static function create_groups_parameters() {&lt;br /&gt;
        return new external_function_parameters(&lt;br /&gt;
            array(&lt;br /&gt;
                &#039;groups&#039; =&amp;gt; ...&lt;br /&gt;
                &lt;br /&gt;
            )&lt;br /&gt;
        );&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This &#039;&#039;groups&#039;&#039; parameter is a list of group. So we will write :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;  &lt;br /&gt;
                &#039;groups&#039; =&amp;gt; new external_multiple_structure(&lt;br /&gt;
                    ...&lt;br /&gt;
                )          &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An external_multiple_structure object (list) can be initialized with external_single_structure (object), external_value (primary type) or another external_multiple_structure (list). You will respectively obtain a list of a unique object type, a list of a unique primary type, or a list of a list. These last case being probably bad design.&amp;lt;br/&amp;gt;&lt;br /&gt;
In our case we want a list of group, a group being a object. Have a look on how would describe a group :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;             &lt;br /&gt;
                    new external_single_structure(&lt;br /&gt;
                        array(&lt;br /&gt;
                            &#039;courseid&#039; =&amp;gt; ...,&lt;br /&gt;
                            &#039;name&#039; =&amp;gt; ...,&lt;br /&gt;
                            &#039;description&#039; =&amp;gt; ...,&lt;br /&gt;
                            &#039;enrolmentkey&#039; =&amp;gt; ...,&lt;br /&gt;
                        )&lt;br /&gt;
                    )           &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From this code you can guess that a external_single_structure is initialize with an associative array. This array containing the object attibuts.&amp;lt;br/&amp;gt; &lt;br /&gt;
Thus a list of group will be defined :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;  &lt;br /&gt;
                &#039;groups&#039; =&amp;gt; new external_multiple_structure(&lt;br /&gt;
                    new external_single_structure(&lt;br /&gt;
                        array(&lt;br /&gt;
                            &#039;courseid&#039; =&amp;gt; ...,&lt;br /&gt;
                            &#039;name&#039; =&amp;gt; ...,&lt;br /&gt;
                            &#039;description&#039; =&amp;gt; ...,&lt;br /&gt;
                            &#039;enrolmentkey&#039; =&amp;gt; ...,&lt;br /&gt;
                        )&lt;br /&gt;
                    )&lt;br /&gt;
                )          &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Every of the group attribut are primary type. &#039;&#039;courseid&#039;&#039; is an integer. &#039;&#039;name&#039;&#039; is a string, &#039;&#039;description&#039;&#039; is a string, and &#039;&#039;enrolmentkey&#039;&#039; is also a string. To define a primary type we use the &#039;&#039;external_value&#039;&#039; object. This &#039;&#039;external_value&#039;&#039; is initialize with a non associative array containing three elements:&lt;br /&gt;
# the primary type&lt;br /&gt;
# a human readable description&lt;br /&gt;
# is the parameter optional (if the parameter is mandatory we don&#039;t need this third element)&lt;br /&gt;
&lt;br /&gt;
For example for the &#039;&#039;courseid&#039;&#039; and &#039;&#039;name&#039;&#039; attribut we would define:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;                 &lt;br /&gt;
                            &#039;courseid&#039; =&amp;gt; new external_value(PARAM_INT, &#039;id of course&#039;),&lt;br /&gt;
                            &#039;name&#039; =&amp;gt; new external_value(PARAM_TEXT, &#039;multilang compatible name, course unique&#039;),                         &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So our list of object description will be :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;  &lt;br /&gt;
                &#039;groups&#039; =&amp;gt; new external_multiple_structure(&lt;br /&gt;
                    new external_single_structure(&lt;br /&gt;
                        array(&lt;br /&gt;
                            &#039;courseid&#039; =&amp;gt; new external_value(PARAM_INT, &#039;id of course&#039;),&lt;br /&gt;
                            &#039;name&#039; =&amp;gt; new external_value(PARAM_TEXT, &#039;multilang compatible name, course unique&#039;),&lt;br /&gt;
                            &#039;description&#039; =&amp;gt; new external_value(PARAM_RAW, &#039;group description text&#039;),&lt;br /&gt;
                            &#039;enrolmentkey&#039; =&amp;gt; new external_value(PARAM_RAW, &#039;group enrol secret phrase&#039;),&lt;br /&gt;
                        )&lt;br /&gt;
                    )&lt;br /&gt;
                )          &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now you should be able to understand this parameter description function. You also should be able to deduce how to write the return value description function. &lt;br /&gt;
&lt;br /&gt;
Return value function always return one primary or complex value, so we don&#039;t need to return external_function_parameters object. In our case we want to return the exact same list of groups. The only change being that we want the group to have an id attribut. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
public static function create_groups_returns() {&lt;br /&gt;
        return new external_multiple_structure(&lt;br /&gt;
            new external_single_structure(&lt;br /&gt;
                array(&lt;br /&gt;
                    &#039;id&#039; =&amp;gt; new external_value(PARAM_INT, &#039;group record id&#039;),&lt;br /&gt;
                    &#039;courseid&#039; =&amp;gt; new external_value(PARAM_INT, &#039;id of course&#039;),&lt;br /&gt;
                    &#039;name&#039; =&amp;gt; new external_value(PARAM_TEXT, &#039;multilang compatible name, course unique&#039;),&lt;br /&gt;
                    &#039;description&#039; =&amp;gt; new external_value(PARAM_RAW, &#039;group description text&#039;),&lt;br /&gt;
                    &#039;enrolmentkey&#039; =&amp;gt; new external_value(PARAM_RAW, &#039;group enrol secret phrase&#039;),&lt;br /&gt;
                )&lt;br /&gt;
            )&lt;br /&gt;
        );&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here ends the most difficult part of the web service infrastructure implementation. Congratulation!&lt;br /&gt;
&lt;br /&gt;
=== Mandatory, Optional or Default ===&lt;br /&gt;
An attribut can be defined MANDATORY, OPTIONAL, or DEFAULT. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;                 &lt;br /&gt;
                            &#039;yearofstudy&#039; =&amp;gt; new external_value(PARAM_INT, &#039;year of study&#039;,VALUE_DEFAULT, 1979),                        &lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The third parameter VALUE_DEFAULT indicates that &#039;yearofstudy&#039; is set to a default value if the attribut is not supply. When you set VALUE_DEFAULT in the description, you must also write a default value as fourth parameter. Here the default value of &#039;yearofstudy&#039; is 1979.&lt;br /&gt;
&lt;br /&gt;
The three values can be understood like it:&lt;br /&gt;
* VALUE_REQUIRED - if the parameter is not supplied, then the server throw an exception&lt;br /&gt;
* VALUE_OPTIONAL - if the parameter is not supplied, then the param has no value&lt;br /&gt;
* VALUE_DEFAULT - if the parameter is not supplied, then the default value is used&lt;br /&gt;
&lt;br /&gt;
== Define the external function ==&lt;br /&gt;
We declared our web service function and we defined the external function parameters and return values. We will now implement the external function. Let&#039;s have a full look to the external function.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
    /**&lt;br /&gt;
     * Create groups&lt;br /&gt;
     * @param array $groups array of group description arrays (with keys groupname and courseid)&lt;br /&gt;
     * @return array of newly created groups&lt;br /&gt;
     */&lt;br /&gt;
    public static function create_groups($groups) { //Don&#039;t forget to set it as static&lt;br /&gt;
        global $CFG, $DB;&lt;br /&gt;
        require_once(&amp;quot;$CFG-&amp;gt;dirroot/group/lib.php&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
        $params = self::validate_parameters(self::create_groups_parameters(), array(&#039;groups&#039;=&amp;gt;$groups));&lt;br /&gt;
&lt;br /&gt;
        $transaction = $DB-&amp;gt;start_delegated_transaction();&lt;br /&gt;
&lt;br /&gt;
        $groups = array();&lt;br /&gt;
&lt;br /&gt;
        foreach ($params[&#039;groups&#039;] as $group) {&lt;br /&gt;
            $group = (object)$group;&lt;br /&gt;
&lt;br /&gt;
            if (trim($group-&amp;gt;name) == &#039;&#039;) {&lt;br /&gt;
                throw new invalid_parameter_exception(&#039;Invalid group name&#039;);&lt;br /&gt;
            }&lt;br /&gt;
            if ($DB-&amp;gt;get_record(&#039;groups&#039;, array(&#039;courseid&#039;=&amp;gt;$group-&amp;gt;courseid, &#039;name&#039;=&amp;gt;$group-&amp;gt;name))) {&lt;br /&gt;
                throw new invalid_parameter_exception(&#039;Group with the same name already exists in the course&#039;);&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
            // now security checks&lt;br /&gt;
            $context = get_context_instance(CONTEXT_COURSE, $group-&amp;gt;courseid);&lt;br /&gt;
            self::validate_context($context);&lt;br /&gt;
            require_capability(&#039;moodle/course:managegroups&#039;, $context);&lt;br /&gt;
&lt;br /&gt;
            // finally create the group&lt;br /&gt;
            $group-&amp;gt;id = groups_create_group($group, false);&lt;br /&gt;
            $groups[] = (array)$group;&lt;br /&gt;
        }&lt;br /&gt;
&lt;br /&gt;
        $transaction-&amp;gt;allow_commit();&lt;br /&gt;
&lt;br /&gt;
        return $groups;&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
First let&#039;s have a look at &lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
 $params = self::validate_parameters(self::create_groups_parameters(), array(&#039;groups&#039;=&amp;gt;$groups));&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
This &#039;&#039;validate_parameters&#039;&#039; function validates the external function parameters against the description. It will return an exception if some required parameters are missing, if parameters are not well-formed, and check the parameters validity. The array(&#039;groups&#039;=&amp;gt;$groups) take the expected parameters by the description function. &lt;br /&gt;
&lt;br /&gt;
A very important point: the parameters of your external function (&#039;&#039;$groups&#039;&#039; into &#039;&#039;public static function create_groups(&#039;&#039;&#039;$groups&#039;&#039;&#039;) {&#039;&#039;) should be in the exact same order as the ones into your description function (&#039;&#039;&#039;return new external_function_parameters( array( &#039;&#039;&#039;&#039;groups&#039;&#039;&#039;&#039; =&amp;gt; ... )&#039;&#039;&#039;). I agree that our example function doesn&#039;t give us a good example :)&lt;br /&gt;
&lt;br /&gt;
Then we have the following line&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
 $transaction = $DB-&amp;gt;start_delegated_transaction();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Our function has for goal to create multiple group. The function is calling multiple time the &#039;&#039;&#039;groups_create_group()&#039;&#039;&#039; core function. If ever one function fail and return an exception, we do not want to commit any change. It&#039;s why we declare this line that suspend any commit till we write the following line&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
 $transaction-&amp;gt;allow_commit();&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will also notice that our function throws exception. It is automatically handle by Moodle web service servers.&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
throw new invalid_parameter_exception(&#039;Group with the same name already exists in the course&#039;);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And yet again another important point: the context checking and capability checking happens into the external function. In a long term, in Moodle 2.0, all context/capability checks will disappear from the core functions and will be located into the external functions&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
/// now security checks&lt;br /&gt;
$context = get_context_instance(CONTEXT_COURSE, $group-&amp;gt;courseid);&lt;br /&gt;
self::validate_context($context);&lt;br /&gt;
require_capability(&#039;moodle/course:managegroups&#039;, $context);&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Last point, the return values will be parsed by the Moodle web service servers. Only the required values describe into the function description will be returned. An error will be returned if the external function doesn&#039;t return some required values.&lt;br /&gt;
&lt;br /&gt;
== Add the web service function into a service ==&lt;br /&gt;
In some specific case we could want to set a service by default, so the Moodle administrator doesn&#039;t need to set a new one. We can do that by writing the following code into [http://cvs.moodle.org/moodle/lib/db/ /lib/db/services.php]:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
  $services = array(&lt;br /&gt;
      &#039;groupservice&#039; =&amp;gt; array(                                                //the name of the web service&lt;br /&gt;
          &#039;functions&#039; =&amp;gt; array (&#039;moodle_add_groups&#039;, &#039;moodle_create_groups&#039;), //web service functions of this service&lt;br /&gt;
          &#039;requiredcapability&#039; =&amp;gt; &#039;some/capability:specified&#039;,                //if set, the web service user need this capability to access &lt;br /&gt;
                                                                              //any function of this service                   &lt;br /&gt;
          &#039;restrictedusers&#039; = &amp;gt;1,                                             //if enabled, the Moodle administrator must link some user to this service&lt;br /&gt;
                                                                              //into the administration&lt;br /&gt;
          &#039;enabled&#039;=&amp;gt;0,                                                       //if enabled, the service can be reachable on a default installation&lt;br /&gt;
       )&lt;br /&gt;
  );&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In this code we created a service called &#039;&#039;groupservice&#039;&#039;. This service contains two functions &#039;&#039;moodle_add_groups&#039;&#039;/&#039;&#039;moodle_create_groups&#039;&#039;. &amp;lt;br/&amp;gt;&lt;br /&gt;
This possibility to preset a service exists to facilitate the administrator life. He can easily enable a bunch of function. &amp;lt;br/&amp;gt;&lt;br /&gt;
However it is not possible for an administrator to add/remove any function from preset service. For security purpose, it is not a recommended to preset a service.&lt;br /&gt;
&lt;br /&gt;
== Test the web service function ==&lt;br /&gt;
Moodle is bundled with a test client that can be accessed into [http://cvs.moodle.org/moodle/webservice/ webservice/testclient.php]. You are more than adviced to run it before to look at the code as the client can be used for multiple protocols, and multiple functions. You will have a better understanding.&amp;lt;br/&amp;gt;&lt;br /&gt;
In order to support our function we will need to add a form into [http://cvs.moodle.org/moodle/webservice/ webservice/testclient_forms.php].&lt;br /&gt;
&amp;lt;code php&amp;gt;&lt;br /&gt;
class moodle_group_create_groups_form extends moodleform {&lt;br /&gt;
    public function definition() {&lt;br /&gt;
        global $CFG;&lt;br /&gt;
&lt;br /&gt;
        $mform = $this-&amp;gt;_form;&lt;br /&gt;
&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;header&#039;, &#039;wstestclienthdr&#039;, get_string(&#039;testclient&#039;, &#039;webservice&#039;));&lt;br /&gt;
&lt;br /&gt;
        //note: these element are intentionally text aera without validation - we want users to test any rubbish as parameters&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;text&#039;, &#039;wsusername&#039;, &#039;wsusername&#039;);&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;text&#039;, &#039;wspassword&#039;, &#039;wspassword&#039;);&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;text&#039;, &#039;courseid&#039;, &#039;courseid&#039;);&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;text&#039;, &#039;name&#039;, &#039;name&#039;);&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;text&#039;, &#039;description&#039;, &#039;description&#039;);&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;text&#039;, &#039;enrolmentkey&#039;, &#039;enrolmentkey&#039;);&lt;br /&gt;
&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;hidden&#039;, &#039;function&#039;);&lt;br /&gt;
        $mform-&amp;gt;setType(&#039;function&#039;, PARAM_SAFEDIR);&lt;br /&gt;
&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;hidden&#039;, &#039;protocol&#039;);&lt;br /&gt;
        $mform-&amp;gt;setType(&#039;protocol&#039;, PARAM_SAFEDIR);&lt;br /&gt;
&lt;br /&gt;
        $mform-&amp;gt;addElement(&#039;static&#039;, &#039;warning&#039;, &#039;&#039;, get_string(&#039;executewarnign&#039;, &#039;webservice&#039;));&lt;br /&gt;
&lt;br /&gt;
        $this-&amp;gt;add_action_buttons(true, get_string(&#039;execute&#039;, &#039;webservice&#039;));&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public function get_params() {&lt;br /&gt;
        if (!$data = $this-&amp;gt;get_data()) {&lt;br /&gt;
            return null;&lt;br /&gt;
        }&lt;br /&gt;
        // remove unused from form data&lt;br /&gt;
        unset($data-&amp;gt;submitbutton);&lt;br /&gt;
        unset($data-&amp;gt;protocol);&lt;br /&gt;
        unset($data-&amp;gt;function);&lt;br /&gt;
        unset($data-&amp;gt;wsusername);&lt;br /&gt;
        unset($data-&amp;gt;wspassword);&lt;br /&gt;
&lt;br /&gt;
        $params = array();&lt;br /&gt;
        $params[&#039;groups&#039;] = array();&lt;br /&gt;
        $params[&#039;groups&#039;][] = (array)$data;&lt;br /&gt;
&lt;br /&gt;
        return $params;&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
That&#039;s all for our create_groups() function. We&#039;ve been able to implement it and to test it. &amp;lt;br/&amp;gt; In [[Creating_a_web_service_client]] we will talk about web service client.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
* [[Web services]]&lt;br /&gt;
* [[External services security]]&lt;br /&gt;
* [[External services description]]&lt;br /&gt;
* [[Creating_a_web_service_client]]&lt;br /&gt;
* [[Setting_up_a_web_service]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Web Services]]&lt;/div&gt;</summary>
		<author><name>Janvh</name></author>
	</entry>
</feed>