<?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%3ANEWMODULE_FAQ</id>
	<title>Development:NEWMODULE FAQ - История изменений</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.mipt.ru/index.php?action=history&amp;feed=atom&amp;title=Development%3ANEWMODULE_FAQ"/>
	<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Development:NEWMODULE_FAQ&amp;action=history"/>
	<updated>2026-05-07T19:20:40Z</updated>
	<subtitle>История изменений этой страницы в вики</subtitle>
	<generator>MediaWiki 1.42.1</generator>
	<entry>
		<id>http://wiki.mipt.ru/index.php?title=Development:NEWMODULE_FAQ&amp;diff=11454&amp;oldid=prev</id>
		<title>Олег Давидович: 1 версия импортирована</title>
		<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Development:NEWMODULE_FAQ&amp;diff=11454&amp;oldid=prev"/>
		<updated>2024-10-21T08:51:35Z</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:51, 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:NEWMODULE_FAQ&amp;diff=11453&amp;oldid=prev</id>
		<title>1&gt;Nakohdo: Category:FAQ added</title>
		<link rel="alternate" type="text/html" href="http://wiki.mipt.ru/index.php?title=Development:NEWMODULE_FAQ&amp;diff=11453&amp;oldid=prev"/>
		<updated>2010-11-09T10:21:00Z</updated>

		<summary type="html">&lt;p&gt;&lt;a href=&quot;/index.php?title=%D0%9A%D0%B0%D1%82%D0%B5%D0%B3%D0%BE%D1%80%D0%B8%D1%8F:FAQ&quot; title=&quot;Категория:FAQ&quot;&gt;Category:FAQ&lt;/a&gt; added&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Template:Work in progress}}&lt;br /&gt;
{{New_Module}}&lt;br /&gt;
&lt;br /&gt;
== Where do I have to start? ==&lt;br /&gt;
A: The content of your module is in moodle/mod/widget/view.php&lt;br /&gt;
If you look inside that file you will find the row: &amp;quot;Write your code here&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== How can I check required variables like &amp;quot;Course Module ID&amp;quot; and &amp;quot;widget ID&amp;quot;? ==&lt;br /&gt;
A: Use&lt;br /&gt;
&amp;lt;code php&amp;gt;$id = optional_param(&amp;#039;id&amp;#039;, 0, PARAM_INT); // Course Module ID&amp;lt;/code&amp;gt; or&lt;br /&gt;
&amp;lt;code php&amp;gt;$a = optional_param(&amp;#039;a&amp;#039; , 0, PARAM_INT); // widget ID&amp;lt;/code&amp;gt;&lt;br /&gt;
An example of use of these two checks can be easily found in your moodle/mod/widget/view.php (rows 15 to 41). &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Warning&amp;#039;&amp;#039;&amp;#039;: If you miss this step, the file can be called directly by writing the address in the web browser and unauthorized users can get them.&lt;br /&gt;
&lt;br /&gt;
== Are some more variables needed to check for security reasons? ==&lt;br /&gt;
A: ???????????&lt;br /&gt;
&lt;br /&gt;
== What is provided &amp;quot;for free&amp;quot; by the Moodle environment? That is, which set of variables are provided as &amp;quot;ready to use&amp;quot;? ==&lt;br /&gt;
A: You have availability of all the global Moodle variables ($CFG-&amp;gt;xxx), the object $USER (in which all the information the current user entered in his/her login form is saved).&lt;br /&gt;
Moreover, you have the availability of the $course array and of some information about your specific widget module.&lt;br /&gt;
The following is a description of the variables you are free to use:&lt;br /&gt;
&amp;lt;code php&amp;gt;$CFG-&amp;gt;$USER&lt;br /&gt;
$course-&amp;gt;id&lt;br /&gt;
$cm-&amp;gt;id&amp;lt;/code&amp;gt;&lt;br /&gt;
There are a lot more variables that are beyong the scope of this Moodle docs page that are, for this reason, going to be neglected.&lt;br /&gt;
Belonging to this list of neglected variables, for instance, is $THEME, $???.&lt;br /&gt;
Some examples:&lt;br /&gt;
&amp;lt;code php&amp;gt;if ($CFG-&amp;gt;xxx == &amp;#039;&amp;#039;) {&lt;br /&gt;
&lt;br /&gt;
}&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Why is this set of variables so important? ==&lt;br /&gt;
A: At any moment you may need to:&lt;br /&gt;
*reload the widget page&lt;br /&gt;
To call the instance of you module page, you need to call:&lt;br /&gt;
&amp;lt;code php&amp;gt;$CFG-&amp;gt;wwwroot.&amp;#039;/mod/newmodule/view.php?id=&amp;#039;.$cm-&amp;gt;id&amp;lt;/code&amp;gt;&lt;br /&gt;
$cm stands for course module (Is this true??????????)&lt;br /&gt;
*return to the main course page&lt;br /&gt;
To return back to the course page, you need to call:&lt;br /&gt;
&amp;lt;code php&amp;gt;$CFG-&amp;gt;wwwroot.&amp;#039;/course/view.php?id=&amp;#039;.$course-&amp;gt;id&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== My module lives in the view.php page only. How can I tell my code I want an output (of something) in a different page and not at the bottom of the view.php page? ==&lt;br /&gt;
A:&lt;br /&gt;
&lt;br /&gt;
== How can I add a form to a module? ==&lt;br /&gt;
A:&lt;br /&gt;
&lt;br /&gt;
== How can I distinguish part of code for admins/teachers/ from the code for simple users? That is, how can I take advantages of the new features available in Moodle 1.9? ==&lt;br /&gt;
*groups&lt;br /&gt;
*role&lt;br /&gt;
*capabilities&lt;br /&gt;
A:&lt;br /&gt;
&lt;br /&gt;
== How can I provide the needed code to ==&lt;br /&gt;
*backup my widget module?&lt;br /&gt;
*restore my widget module?&lt;br /&gt;
A:&lt;br /&gt;
&lt;br /&gt;
== How can I provide the needed code to: ==&lt;br /&gt;
*upgrade the XML tables my module is based on?&lt;br /&gt;
A: Use the moodle-&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How can I push students&amp;#039; grades from the module into the Moodle gradebook? ==&lt;br /&gt;
&lt;br /&gt;
A: ???&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:FAQ]]&lt;/div&gt;</summary>
		<author><name>1&gt;Nakohdo</name></author>
	</entry>
</feed>