<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
	<id>http://wiki.mipt.ru/index.php?action=history&amp;feed=atom&amp;title=Development%3AScales</id>
	<title>Development:Scales - История изменений</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.mipt.ru/index.php?action=history&amp;feed=atom&amp;title=Development%3AScales"/>
	<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Development:Scales&amp;action=history"/>
	<updated>2026-05-07T16:09:51Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>http://wiki.mipt.ru/index.php?title=Development:Scales&amp;diff=11826&amp;oldid=prev</id>
		<title>Олег Давидович: 1 версия импортирована</title>
		<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Development:Scales&amp;diff=11826&amp;oldid=prev"/>
		<updated>2024-10-21T08:53:09Z</updated>

		<summary type="html">&lt;p&gt;1 версия импортирована&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Предыдущая версия&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Версия от 08:53, 21 октября 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Олег Давидович</name></author>
	</entry>
	<entry>
		<id>http://wiki.mipt.ru/index.php?title=Development:Scales&amp;diff=11825&amp;oldid=prev</id>
		<title>1&gt;Ekirving: Minor change to sorting</title>
		<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Development:Scales&amp;diff=11825&amp;oldid=prev"/>
		<updated>2010-03-11T10:46:25Z</updated>

		<summary type="html">&lt;p&gt;Minor change to sorting&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Infobox Project&lt;br /&gt;
|name = Scales&lt;br /&gt;
|state = Specification&lt;br /&gt;
|tracker = MDL-17258, MDL-13372&lt;br /&gt;
|discussion = [http://moodle.org/mod/forum/discuss.php?d=140907 Improving Scales in the Gradebook]&lt;br /&gt;
|assignee = [[User:Evan Irving-Pease|Evan Irving-Pease]]&lt;br /&gt;
}}&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
The scales in the Gradebook should be rewritten to:&lt;br /&gt;
&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Support arbitrary numeric values for scale items&amp;#039;&amp;#039;&amp;#039; – The current system of converting scale items into numeric values is both confusing and unconfigurable. This is requested in MDL-17258, and discussed in numerous forum threads (see [http://moodle.org/mod/forum/discuss.php?d=106031 106031], [http://moodle.org/mod/forum/discuss.php?d=120541#p532013 120541], and [http://moodle.org/mod/forum/discuss.php?d=130707 130707] for but a few examples).&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Allow descriptive text to be associated with scale items&amp;#039;&amp;#039;&amp;#039; – Currently you can describe the scale but not the individual items within the scale. This has been requested in MDL-13372 for usability reasons.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Allow commas in scale item names&amp;#039;&amp;#039;&amp;#039; – Because scale items are currently delimited by commas it is not possible to have a comma in the scale item name. This has been requested for [http://moodle.org/mod/forum/discuss.php?d=108183 internationalisation reasons].&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Support sort options on scale items&amp;#039;&amp;#039;&amp;#039; – Currently scales must be ordered from lowest to highest, however sort options should invlude &amp;quot;by value&amp;quot; or &amp;quot;by name&amp;quot; with a direction of either ASC or DESC.&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Improve database design&amp;#039;&amp;#039;&amp;#039; – At present the storage of scale items within a comma delimited text field fails [http://en.wikipedia.org/wiki/First_normal_form first normal form].&lt;br /&gt;
# &amp;#039;&amp;#039;&amp;#039;Use a standard API&amp;#039;&amp;#039;&amp;#039; – For consistency with other areas of the gradebook, accessing scales should be through a standard API. At present code directly accesses the table.&lt;br /&gt;
&lt;br /&gt;
==Updating Moodle code==&lt;br /&gt;
&lt;br /&gt;
Steps:&lt;br /&gt;
# Replace all direct access to the `scale` table with calls to the scales’ API, then test thoroughly to make sure nothing is broken.&lt;br /&gt;
# Add the `scale_items` table and drop the scale field in the `scale` table.&lt;br /&gt;
# Update the code behind the scales’ API to use the new table (for backwards compatibility, if the value field is not defined in the `scale_items` table then the value for a scale item will calculated in the same manner as it currently is).&lt;br /&gt;
# Write an upgrade script that converts old scales into the new format.&lt;br /&gt;
# Update the backup code to include the `scale_items` table.&lt;br /&gt;
# Update the scales edit/create page to include separate scale items, each with name, description, value and sortorder fields.&lt;br /&gt;
# Update the interface to use the `scale_items` description field, so users can see the description of each item.&lt;br /&gt;
# Add a new page, linked to from the scale administration page, which shows all current uses of a scale.&lt;br /&gt;
&lt;br /&gt;
== Current Database Structure ==&lt;br /&gt;
=== scale ===&lt;br /&gt;
&lt;br /&gt;
This table currently stores both the name and description of the scale as well as all the items that comprise the scale.&lt;br /&gt;
&lt;br /&gt;
[[Image:Gradebook-ERD-Current.png|200px|thumb|right|ERD of the Moodle 2.0 Gradebook]]&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;
|&amp;#039;&amp;#039;&amp;#039;Field&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Default&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Info&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;id&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
|int(10)  &lt;br /&gt;
|&lt;br /&gt;
|autoincrementing &lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;courseid&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|int(10)  &lt;br /&gt;
|&amp;lt;center&amp;gt;0&amp;lt;/center&amp;gt;&lt;br /&gt;
|The course this scale is specific to. If not set then this scale is available site-wide.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;userid&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
|int(10)  &lt;br /&gt;
| &lt;br /&gt;
|The user who created this scale. &lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;scale&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|text &lt;br /&gt;
| &lt;br /&gt;
|The comma delimited list of scale items. &lt;br /&gt;
|-&lt;br /&gt;
|description&lt;br /&gt;
|text &lt;br /&gt;
|&lt;br /&gt;
|The description of the scale. &lt;br /&gt;
|-&lt;br /&gt;
|descriptionformat  &lt;br /&gt;
|tinyint(2)  &lt;br /&gt;
| &lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|timemodified &lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The last time this scale was modified.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Proposed Database Structure ==&lt;br /&gt;
=== scale ===&lt;br /&gt;
This table stores the name and description of the scale, along with its creator and course (if set).&lt;br /&gt;
&lt;br /&gt;
[[Image:Gradebook-ERD-Proposed.png|200px|thumb|right|ERD of the proposed changes to the Moodle 2.0 Gradebook]]&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;
|&amp;#039;&amp;#039;&amp;#039;Field&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Default&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Info&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;id&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
|int(10)  &lt;br /&gt;
|&lt;br /&gt;
|autoincrementing &lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;courseid&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|int(10)  &lt;br /&gt;
|&amp;lt;center&amp;gt;0&amp;lt;/center&amp;gt;&lt;br /&gt;
|The course this scale is specific to. If not set then this scale is available site-wide.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;userid&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
|int(10)  &lt;br /&gt;
| &lt;br /&gt;
|The user who created this scale. &lt;br /&gt;
|-&lt;br /&gt;
|description&lt;br /&gt;
|text &lt;br /&gt;
|&lt;br /&gt;
|The description of the scale. &lt;br /&gt;
|-&lt;br /&gt;
|descriptionformat  &lt;br /&gt;
|tinyint(2)  &lt;br /&gt;
| &lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
|sortmode  &lt;br /&gt;
|tinyint(1)  &lt;br /&gt;
| &lt;br /&gt;
| The field to use for sorting; either SORT_NAME or SORT_VALUE.&lt;br /&gt;
|-&lt;br /&gt;
|sortdirection  &lt;br /&gt;
|tinyint(1)  &lt;br /&gt;
| &lt;br /&gt;
| The direction of the search; either ASC or DESC&lt;br /&gt;
|-&lt;br /&gt;
|timemodified &lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The last time this scale was modified.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== scale_items ===&lt;br /&gt;
This table stores the name and description of the scale item, along with its corresponding numeric value and sortorder.&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;
|&amp;#039;&amp;#039;&amp;#039;Field&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Type&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Default&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;Info&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;id&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
|int(10)  &lt;br /&gt;
|&lt;br /&gt;
|autoincrementing &lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;scaleid&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
|int(10)  &lt;br /&gt;
|&lt;br /&gt;
|The scale this scale item belongs to.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;#039;&amp;#039;&amp;#039;name&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
|varchar(255)  &lt;br /&gt;
| &lt;br /&gt;
|The name of the scale item. &lt;br /&gt;
|-&lt;br /&gt;
|description&lt;br /&gt;
|text &lt;br /&gt;
|&lt;br /&gt;
|The description of the scale item. &lt;br /&gt;
|-&lt;br /&gt;
|value&lt;br /&gt;
|float(10,5)&lt;br /&gt;
| &lt;br /&gt;
| The value assigned to the scale item, used in aggregation methods.&lt;br /&gt;
|-&lt;br /&gt;
|timemodified &lt;br /&gt;
|int(10)&lt;br /&gt;
|&lt;br /&gt;
|The last time this scale item was modified.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
==Public API ==&lt;br /&gt;
&lt;br /&gt;
Modules may use only functions which are marked as public.&lt;br /&gt;
&lt;br /&gt;
=== scale_get_items()===&lt;br /&gt;
&lt;br /&gt;
scale_get_items($scaleid)&lt;br /&gt;
&lt;br /&gt;
Returns a nested array containing the scale, along with all the scale items.&lt;br /&gt;
&lt;br /&gt;
== Private API ==&lt;br /&gt;
&lt;br /&gt;
Private API is used by gradebook plugins and core Moodle code.&lt;br /&gt;
&lt;br /&gt;
===scale_update()===&lt;br /&gt;
&lt;br /&gt;
scale_update($object)&lt;br /&gt;
&lt;br /&gt;
Updates, or creates if necessary, a scale; returns the scaleid.&lt;br /&gt;
&lt;br /&gt;
===scale_delete()===&lt;br /&gt;
&lt;br /&gt;
scale_delete($scaleid)&lt;br /&gt;
&lt;br /&gt;
Deletes a scale and all its scale items, if not in use.&lt;br /&gt;
&lt;br /&gt;
===scale_in_use()===&lt;br /&gt;
&lt;br /&gt;
scale_in_use($scaleid)&lt;br /&gt;
&lt;br /&gt;
Returns true if the scale is in use.&lt;br /&gt;
&lt;br /&gt;
===scale_get_usage()===&lt;br /&gt;
&lt;br /&gt;
scale_get_usage($scaleid)&lt;br /&gt;
&lt;br /&gt;
Gets the list of all the places where a given scale is used (e.g. courses, outcomes, activities, etc).&lt;br /&gt;
&lt;br /&gt;
===scale_item_update()===&lt;br /&gt;
&lt;br /&gt;
scale_item_ update($object)&lt;br /&gt;
&lt;br /&gt;
Updates, or creates if necessary, a scale item; returns the scaleitemid.&lt;br /&gt;
&lt;br /&gt;
===scale_item_delete()===&lt;br /&gt;
&lt;br /&gt;
scale_item_delete($scaleitemid)&lt;br /&gt;
&lt;br /&gt;
Deletes a scale item.&lt;br /&gt;
&lt;br /&gt;
===scale_item_get_value()===&lt;br /&gt;
&lt;br /&gt;
scale_item_get_value($scaleitemid, $method)&lt;br /&gt;
&lt;br /&gt;
Gets the value of a scale item, for aggregation calculations in the Gradebook.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* [[Development:Grades]]&lt;/div&gt;</summary>
		<author><name>1&gt;Ekirving</name></author>
	</entry>
</feed>