<?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=Dlnsk</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=Dlnsk"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/Special:Contributions/Dlnsk"/>
	<updated>2026-08-01T07:01:57Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Implementing_Reset_course_functionality_in_a_module&amp;diff=6757</id>
		<title>Implementing Reset course functionality in a module</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Implementing_Reset_course_functionality_in_a_module&amp;diff=6757"/>
		<updated>2008-11-09T20:26:06Z</updated>

		<summary type="html">&lt;p&gt;Dlnsk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The course reset code is triggered from /course/reset.php. To have your module included, you need to implement the three fuctions described below. To work out how to do this, a good example is to look at the implementations in /mod/fourm/lib.php&lt;br /&gt;
&lt;br /&gt;
==&#039;&#039;mymodule&#039;&#039;_reset_course_form_definition(&amp;amp;$mform)==&lt;br /&gt;
&lt;br /&gt;
This is called directly by /course/reset.php. It needs to output some form controls to control different options for resetting your module. You should use Form API for create form.&lt;br /&gt;
&lt;br /&gt;
The convention is to call settings relating your your module reset_&#039;&#039;mymodule&#039;&#039;_&#039;&#039;something&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The forum implementation is a good model:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Called by course/reset.php&lt;br /&gt;
 */&lt;br /&gt;
function forum_reset_course_form_definition(&amp;amp;$mform) {&lt;br /&gt;
    $mform-&amp;gt;addElement(&#039;header&#039;, &#039;forumheader&#039;, get_string(&#039;modulenameplural&#039;, &#039;forum&#039;));&lt;br /&gt;
&lt;br /&gt;
    $mform-&amp;gt;addElement(&#039;checkbox&#039;, &#039;reset_forum_all&#039;, get_string(&#039;resetforumsall&#039;,&#039;forum&#039;));&lt;br /&gt;
&lt;br /&gt;
    $mform-&amp;gt;addElement(&#039;select&#039;, &#039;reset_forum_types&#039;, get_string(&#039;resetforums&#039;, &#039;forum&#039;), forum_get_forum_types_all(), array(&#039;multiple&#039; =&amp;gt; &#039;multiple&#039;));&lt;br /&gt;
    $mform-&amp;gt;setAdvanced(&#039;reset_forum_types&#039;);&lt;br /&gt;
    $mform-&amp;gt;disabledIf(&#039;reset_forum_types&#039;, &#039;reset_forum_all&#039;, &#039;checked&#039;);&lt;br /&gt;
&lt;br /&gt;
    $mform-&amp;gt;addElement(&#039;checkbox&#039;, &#039;reset_forum_subscriptions&#039;, get_string(&#039;resetsubscriptions&#039;,&#039;forum&#039;));&lt;br /&gt;
    $mform-&amp;gt;setAdvanced(&#039;reset_forum_subscriptions&#039;);&lt;br /&gt;
&lt;br /&gt;
    $mform-&amp;gt;addElement(&#039;checkbox&#039;, &#039;reset_forum_track_prefs&#039;, get_string(&#039;resettrackprefs&#039;,&#039;forum&#039;));&lt;br /&gt;
    $mform-&amp;gt;setAdvanced(&#039;reset_forum_track_prefs&#039;);&lt;br /&gt;
    $mform-&amp;gt;disabledIf(&#039;reset_forum_track_prefs&#039;, &#039;reset_forum_all&#039;, &#039;checked&#039;);&lt;br /&gt;
&lt;br /&gt;
    $mform-&amp;gt;addElement(&#039;checkbox&#039;, &#039;reset_forum_ratings&#039;, get_string(&#039;deleteallratings&#039;));&lt;br /&gt;
    $mform-&amp;gt;disabledIf(&#039;reset_forum_ratings&#039;, &#039;reset_forum_all&#039;, &#039;checked&#039;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==&#039;&#039;mymodule&#039;&#039;_reset_userdata($data)==&lt;br /&gt;
 &lt;br /&gt;
This actually does the resetting. It is called indirectly, /course/reset.php calls reset_course_userdata() in /lib/moodlelib.php, which then calls the functions for each module.&lt;br /&gt;
&lt;br /&gt;
The $data parameter is what came back from the form printed by forum_reset_course. In particular, $data-&amp;gt;courseid is the id of the coures we are cleaning up.&lt;br /&gt;
&lt;br /&gt;
The forum implementation is again a good one to study, here is a very simple example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
function example_reset_userdata($data) {&lt;br /&gt;
    if (!empty($data-&amp;gt;reset_example_frogs)) {&lt;br /&gt;
        if (delete_records(&#039;example_frogs&#039;, &#039;couresid&#039;, $data-&amp;gt;courseid) and $showfeedback) {&lt;br /&gt;
            notify(get_string(&#039;frogsdeleted&#039;, &#039;example&#039;), &#039;notifysuccess&#039;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    if (!empty($data-&amp;gt;reset_example_newts)) {&lt;br /&gt;
        if (delete_records(&#039;example_newts&#039;, &#039;couresid&#039;, $data-&amp;gt;courseid) and $showfeedback) {&lt;br /&gt;
            notify(get_string(&#039;newtsdeleted&#039;, &#039;example&#039;), &#039;notifysuccess&#039;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==&#039;&#039;mymodule&#039;&#039;_reset_course_form_defaults($course)==&lt;br /&gt;
&lt;br /&gt;
Used for set default values to form&#039;s elements displayed by &#039;&#039;mymodule&#039;&#039;_reset_course_form_definition. The forum implementation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
function forum_reset_course_form_defaults($course) {&lt;br /&gt;
    return array(&#039;reset_forum_all&#039;=&amp;gt;1, &#039;reset_forum_subscriptions&#039;=&amp;gt;0, &#039;reset_forum_track_prefs&#039;=&amp;gt;0, &#039;reset_forum_ratings&#039;=&amp;gt;1);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[ja:開発:コースのリセット機能をモジュールに実装する]]&lt;/div&gt;</summary>
		<author><name>Dlnsk</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Implementing_Reset_course_functionality_in_a_module&amp;diff=6756</id>
		<title>Implementing Reset course functionality in a module</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Implementing_Reset_course_functionality_in_a_module&amp;diff=6756"/>
		<updated>2008-11-07T19:08:46Z</updated>

		<summary type="html">&lt;p&gt;Dlnsk: Metods renamed, using Form API&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The course reset code is triggered from /course/reset.php. To have your module included, you need to implement the three fuctions described below. To work out how to do this, a good example is to look at the implementations in /mod/fourm/lib.php&lt;br /&gt;
&lt;br /&gt;
==&#039;&#039;mymodule&#039;&#039;_reset_course_form_definition(&amp;amp;$mform)==&lt;br /&gt;
&lt;br /&gt;
This is called directly by /course/reset.php. It needs to output some form controls to control different options for resetting your module. You should use Form API for create form.&lt;br /&gt;
&lt;br /&gt;
The convention is to call settings relating your your module reset_&#039;&#039;mymodule&#039;&#039;_&#039;&#039;something&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The forum implementation is a good model:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
/**&lt;br /&gt;
 * Called by course/reset.php&lt;br /&gt;
 */&lt;br /&gt;
function forum_reset_course_form_definition(&amp;amp;$mform) {&lt;br /&gt;
    $mform-&amp;gt;addElement(&#039;header&#039;, &#039;forumheader&#039;, get_string(&#039;modulenameplural&#039;, &#039;forum&#039;));&lt;br /&gt;
&lt;br /&gt;
    $mform-&amp;gt;addElement(&#039;checkbox&#039;, &#039;reset_forum_all&#039;, get_string(&#039;resetforumsall&#039;,&#039;forum&#039;));&lt;br /&gt;
&lt;br /&gt;
    $mform-&amp;gt;addElement(&#039;select&#039;, &#039;reset_forum_types&#039;, get_string(&#039;resetforums&#039;, &#039;forum&#039;), forum_get_forum_types_all(), array(&#039;multiple&#039; =&amp;gt; &#039;multiple&#039;));&lt;br /&gt;
    $mform-&amp;gt;setAdvanced(&#039;reset_forum_types&#039;);&lt;br /&gt;
    $mform-&amp;gt;disabledIf(&#039;reset_forum_types&#039;, &#039;reset_forum_all&#039;, &#039;checked&#039;);&lt;br /&gt;
&lt;br /&gt;
    $mform-&amp;gt;addElement(&#039;checkbox&#039;, &#039;reset_forum_subscriptions&#039;, get_string(&#039;resetsubscriptions&#039;,&#039;forum&#039;));&lt;br /&gt;
    $mform-&amp;gt;setAdvanced(&#039;reset_forum_subscriptions&#039;);&lt;br /&gt;
&lt;br /&gt;
    $mform-&amp;gt;addElement(&#039;checkbox&#039;, &#039;reset_forum_track_prefs&#039;, get_string(&#039;resettrackprefs&#039;,&#039;forum&#039;));&lt;br /&gt;
    $mform-&amp;gt;setAdvanced(&#039;reset_forum_track_prefs&#039;);&lt;br /&gt;
    $mform-&amp;gt;disabledIf(&#039;reset_forum_track_prefs&#039;, &#039;reset_forum_all&#039;, &#039;checked&#039;);&lt;br /&gt;
&lt;br /&gt;
    $mform-&amp;gt;addElement(&#039;checkbox&#039;, &#039;reset_forum_ratings&#039;, get_string(&#039;deleteallratings&#039;));&lt;br /&gt;
    $mform-&amp;gt;disabledIf(&#039;reset_forum_ratings&#039;, &#039;reset_forum_all&#039;, &#039;checked&#039;);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==&#039;&#039;mymodule&#039;&#039;_reset_userdata($data)==&lt;br /&gt;
 &lt;br /&gt;
This actually does the resetting. It is called indirectly, /course/reset.php calls reset_course_userdata() in /lib/moodlelib.php, which then calls the functions for each module.&lt;br /&gt;
&lt;br /&gt;
The $data parameter is what came back from the form printed by forum_reset_course. In particular, $data-&amp;gt;courseid is the id of the coures we are cleaning up.&lt;br /&gt;
&lt;br /&gt;
The forum implementation is again a good one to study, here is a very simple example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
function example_reset_userdata($data) {&lt;br /&gt;
    if (!empty($data-&amp;gt;reset_example_frogs)) {&lt;br /&gt;
        if (delete_records(&#039;example_frogs&#039;, &#039;couresid&#039;, $data-&amp;gt;courseid) and $showfeedback) {&lt;br /&gt;
            notify(get_string(&#039;frogsdeleted&#039;, &#039;example&#039;), &#039;notifysuccess&#039;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    if (!empty($data-&amp;gt;reset_example_newts)) {&lt;br /&gt;
        if (delete_records(&#039;example_newts&#039;, &#039;couresid&#039;, $data-&amp;gt;courseid) and $showfeedback) {&lt;br /&gt;
            notify(get_string(&#039;newtsdeleted&#039;, &#039;example&#039;), &#039;notifysuccess&#039;);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==&#039;&#039;mymodule&#039;&#039;reset_course_form_defaults($course)==&lt;br /&gt;
&lt;br /&gt;
Used for set default values to form&#039;s elements displayed by &#039;&#039;mymodule&#039;&#039;_reset_course_form_definition. The forum implementation:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&amp;lt;nowiki&amp;gt;&lt;br /&gt;
function forum_reset_course_form_defaults($course) {&lt;br /&gt;
    return array(&#039;reset_forum_all&#039;=&amp;gt;1, &#039;reset_forum_subscriptions&#039;=&amp;gt;0, &#039;reset_forum_track_prefs&#039;=&amp;gt;0, &#039;reset_forum_ratings&#039;=&amp;gt;1);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/nowiki&amp;gt;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[ja:開発:コースのリセット機能をモジュールに実装する]]&lt;/div&gt;</summary>
		<author><name>Dlnsk</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Filters_schema&amp;diff=866</id>
		<title>Filters schema</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Filters_schema&amp;diff=866"/>
		<updated>2008-03-27T09:48:48Z</updated>

		<summary type="html">&lt;p&gt;Dlnsk: get_html_head_contributions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The objective of this page is to document all the ideas and improvements to be implemented in the &amp;quot;Filters&amp;quot; functionality of Moodle.&lt;br /&gt;
&lt;br /&gt;
Every idea will be documented here, including its associated &amp;quot;thoughts&amp;quot; and potential &amp;quot;implementations&amp;quot;. Feel free to add/modify everything as you want!&lt;br /&gt;
&lt;br /&gt;
These are the main areas to discuss/analyse/implement:&lt;br /&gt;
&lt;br /&gt;
* [[Course/site filters | Enable/Disable Filters by Course and Site]]&lt;br /&gt;
* [[Course/site filter config | Optional Configuration of Filters by Course and Site]]&lt;br /&gt;
* [[Multilang filter | Changes in the Caching System to Support the Multilang Filter]]&lt;br /&gt;
* [[Enable/Disable Filters by Activities]]&lt;br /&gt;
* Allow filtering data before it will save in database? It will do possible exclude some data from text (like TeX formulas) and save in separate table. It will allow change formula by clicking on it and open popup window.&lt;br /&gt;
* It&#039;d be great if you could set the text cache lifetime for individual filters. This would be handy for filters that use external resources (e.g., Wikipedia) that sometimes have slow response times. I&#039;d guess that you could use a cache lifetime of a week or more for a Wikipedia filter without causing major usability problems.&lt;br /&gt;
* Mechanism like used with get_html_head_contributions in Questions&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*[http://moodle.org/bugs/bug.php?op=show&amp;amp;bugid=2400 Bug 2400] - a lot of ideas and request have been written here&lt;br /&gt;
http://tracker.moodle.org/browse/MDL-9443 - add support for filtering XHTML resources as well as HTML.&lt;br /&gt;
&lt;br /&gt;
[[Category:Filters schema]]&lt;/div&gt;</summary>
		<author><name>Dlnsk</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/dev/index.php?title=Wiki_features&amp;diff=7796</id>
		<title>Wiki features</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/dev/index.php?title=Wiki_features&amp;diff=7796"/>
		<updated>2008-03-05T12:12:02Z</updated>

		<summary type="html">&lt;p&gt;Dlnsk: Simple access to rendering pages outside Wiki module&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Features wanted for the Wiki in Moodle 2.0, and status of existence in existing wikis :&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;
|-&lt;br /&gt;
!Wanted feature&lt;br /&gt;
!eWiki (Moodle 1.8 etc)&lt;br /&gt;
!NWiki&lt;br /&gt;
!OUWiki &lt;br /&gt;
!Comment&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Mediawiki syntax&lt;br /&gt;
|No&lt;br /&gt;
|Yes&lt;br /&gt;
|No&lt;br /&gt;
|There should be option to use Mediawiki syntax also in forums, resources, etc. - new text format.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Ability to quickly summarize a students total overall contributions e.g. words added/words deleted/comments added&lt;br /&gt;
|No&lt;br /&gt;
|?&lt;br /&gt;
|Soon&lt;br /&gt;
|I have not had time to fully explore nwikis grading system, but suspect there is a way in there somewhere :)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Preserve line breaks&lt;br /&gt;
|?&lt;br /&gt;
|?&lt;br /&gt;
|No&lt;br /&gt;
|Information is often pasted into a wiki, a wiki is used by younger students, or there are a quick succession of edits during class, such as creating a list, that require preserved line breaks. Using Creole Wiki Markup as the ONLY  markup unfortunately destroys pasting in information and trying to find every crlf in a pasted document and replace it with a /n is beyond most users. We have to remember that wikis will often be used by those who have never used one before. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Ability to add an &amp;quot;add to the page&amp;quot; box anywhere, or multiple times, in a page&lt;br /&gt;
|no&lt;br /&gt;
|no&lt;br /&gt;
|no&lt;br /&gt;
|The &amp;quot;Add to the page&amp;quot; box would be added using very simple markup (e.g., it is a plus sign at the beginning of a line in Swiki). The button has a small text area with it that can be typed in and, when the button is clicked, the information goes straight to that spot in a wiki. We use this for brainstorming in class with several groups so they can work in a small group but see and build a common document. Adding comments to students&#039; pages, either by other students, or the students place the box at the top of the page and a teacher can quickly make a comment and move on. Even during meetings several of us share recording duties, and with the add to the page box, we can each be typing then submit. Properly implemented, this eliminates editing collisions in these situations. Each submit is treated as a separate page edit in the editing recored. Additional characters or markup beyond the one to insert the box would give the option of having lines between, keeping the box above the submissions (so it stays in place), or adding a time/date/user stamp in a different font to identify who added the information. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|RSS feeds on changes to a page and changes to the Wiki&lt;br /&gt;
|no&lt;br /&gt;
|?&lt;br /&gt;
|yes&lt;br /&gt;
|RSS is increasingly the way I like to consume and remix my information. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|Simple access to rendering pages outside Wiki module&lt;br /&gt;
|?&lt;br /&gt;
|dfWiki&lt;br /&gt;
|?&lt;br /&gt;
|Many many time ago I have developed tool for including wiki page in any other Moodle resources. Details here:&lt;br /&gt;
http://moodle.org/mod/forum/discuss.php?d=42325&lt;br /&gt;
&lt;br /&gt;
But in NWiki this became impossible because rendering page outside wiki module became very difficult!&lt;br /&gt;
I dream that in official Moodle&#039;s wiki this will once again become possible! And promise update this tool! ;-)&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
| &lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Reporting student contributions to OU wiki is one of the reports we are currently working on, I think.&lt;/div&gt;</summary>
		<author><name>Dlnsk</name></author>
	</entry>
</feed>