<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://docs.moodle.org/36/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Timtak</id>
	<title>MoodleDocs - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://docs.moodle.org/36/en/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Timtak"/>
	<link rel="alternate" type="text/html" href="https://docs.moodle.org/36/en/Special:Contributions/Timtak"/>
	<updated>2026-04-16T09:15:24Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://docs.moodle.org/36/en/index.php?title=Cron&amp;diff=25682</id>
		<title>Cron</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/36/en/index.php?title=Cron&amp;diff=25682"/>
		<updated>2007-08-06T13:26:36Z</updated>

		<summary type="html">&lt;p&gt;Timtak: /* Using the crontab program on Unix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Some of Moodle&#039;s modules require continual checks to perform tasks. For example, Moodle needs to check the discussion forums so it can mail out copies of posts to people who have subscribed.&lt;br /&gt;
&lt;br /&gt;
The script that does all this is located in the admin directory, and is called cron.php. However, it can not run itself, so you need to set up a mechanism where this script is run regularly (eg every five or ten minutes). This provides a &amp;quot;heartbeat&amp;quot; so that the script can perform functions at periods defined by each module. This kind of regular mechanism is known as a &#039;&#039;&#039;cron service&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The cron.php script looks through all the module directories for function module-name_cron in lib.php files and runs them.  These files can contain cleanup functions, email functions or anything that needs to be run on a regular basis. For example, cron will trigger the system to create the backups of courses at the time specified in the administration settings. It also triggers any messaging module or forum email notifications, but not all functions are called each time the cron runs. Some functions, such as unenrolling students who have not logged in or deleting old copies of log files, are only run occasionally. The cron.php file has a section which will randomly call these core tasks approximately 1 in 5 times the cron runs.&lt;br /&gt;
&lt;br /&gt;
Note that the machine performing the cron &#039;&#039;&#039;does not need to be the same machine that is running Moodle&#039;&#039;&#039;. For example, if you have a limited web hosting service that does not have a cron service, then you might choose to run cron on another server or on your home computer. All that matters is that the cron.php file is called regularly.&lt;br /&gt;
&lt;br /&gt;
The load of this script is not very high, so 5 minutes is usually reasonable, but if you&#039;re worried about it you can reduce the time period to something like 15 minutes or even 30 minutes. It&#039;s best not to make the time period too long, as delaying mail-outs can slow down activity within the course. Remember that mail-outs also wait for the editing time to expire before being queued for sending.&lt;br /&gt;
&lt;br /&gt;
First, test that the script works by running it directly from your browser: &#039;&#039;&amp;lt;nowiki&amp;gt;http://example.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If cron is called from the command line by any user logged in to your Moodle it will create a temporary admin environment in order to run and then log the user out. You can disable command line running of cron by disabling the appropriate section in the cron.php file.&lt;br /&gt;
&lt;br /&gt;
Now, you need to set up some of way of running the script automatically and regularly.&lt;br /&gt;
&lt;br /&gt;
==On Windows systems==&lt;br /&gt;
&lt;br /&gt;
There are two different ways for setting-up Moodle cron.php on Windows systems:&lt;br /&gt;
&lt;br /&gt;
*Use the &#039;&#039;&#039;Moodle Cron package&#039;&#039;&#039;. The simplest way is to use this little package [http://download.moodle.org/download.php/sourceforge/MoodleCron-Setup.exe MoodleCron-Setup.exe], which makes this whole thing very easy by installing a small Windows service. Run it and forget about it! :-)&lt;br /&gt;
*Use a &#039;&#039;&#039;Scheduled Task&#039;&#039;&#039;. If you prefer to use the built-in Windows Scheduler or are having trouble with moodle-cron-for-windows package, you can use wget for windows or php from the command line and setup a scheduled task. Just follow these steps:&lt;br /&gt;
** Choose either the &#039;&#039;&#039;php.exe/php-win.exe (command line binary)&#039;&#039;&#039; or &#039;&#039;&#039;wget&#039;&#039;&#039;&lt;br /&gt;
::The php.exe or php-win.exe binary (for PHP version 5 or later) is installed in your php folder (e.g. c:\php) will give you better performance when running the cron script.&lt;br /&gt;
::If you want to use wget, download a compiled version of wget for windows from the native GNU Win32 ports (http://unxutils.sourceforge.net/), from Heiko Herold&#039;s wget for windows page (http://xoomer.virgilio.it/hherold/) or Bart Puype&#039;s wget for windows page (http://users.ugent.be/~bpuype/wget/). If you use Heiko Herold&#039;s package, copy all of the .DLL files to your C:\Windows\system32 directory. Copy the wget.exe file to c:\windows (this makes sure wget is always in the search path).&lt;br /&gt;
:* Setup a &#039;&#039;&#039;Scheduled Task&#039;&#039;&#039;. &lt;br /&gt;
:: - Go to Start &amp;gt;&amp;gt; Control Panel &amp;gt;&amp;gt; Scheduled Tasks &amp;gt;&amp;gt; Add Scheduled Task.&lt;br /&gt;
:: - Click &amp;quot;Next&amp;quot; to start the wizard:&lt;br /&gt;
:: - Click in the &amp;quot;Browse...&amp;quot; button and browse to c:\php\php.exe or c:\windows\wget.exe and click &amp;quot;Open&amp;quot;&lt;br /&gt;
:: - Type &amp;quot;Moodle Cron&amp;quot; as the name of the task and select &amp;quot;Daily&amp;quot; as the schedule. Click &amp;quot;Next&amp;quot;.&lt;br /&gt;
:: - Select &amp;quot;12:00 AM&amp;quot; as the start time, perform the task &amp;quot;Every Day&amp;quot; and choose today&#039;s date as the starting date. Click &amp;quot;Next&amp;quot;.&lt;br /&gt;
:: - Enter the username and password of the user the task will run under (it doesn&#039;t have to be a priviledged account at all). Make sure you type the password correctly. Click &amp;quot;Next&amp;quot;.&lt;br /&gt;
:: - Mark the checkbox titled &amp;quot;Open advanced properties for this task when I click Finish&amp;quot; and click &amp;quot;Finish&amp;quot;.&lt;br /&gt;
:: - In the new dialog box, type the following in the &amp;quot;Run:&amp;quot; text box: &amp;lt;pre&amp;gt;c:\windows\wget.exe -q -O NUL http://my.moodle.site/moodle/admin/cron.php&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;c:\php\php.exe -f c:\moodle\admin\cron.php&amp;lt;/pre&amp;gt; Replace &amp;quot;c:\moodle&amp;quot; with the path to your moodle directory or &amp;quot;my.moode.site&amp;quot; with the name of your site.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
:: - Click on the &amp;quot;Schedule&amp;quot; tab and there in the &amp;quot;Advanced...&amp;quot; button.&lt;br /&gt;
:: - Mark the &amp;quot;Repeat task&amp;quot; checkbox and set &amp;quot;Every:&amp;quot; to 5 minutes, and set &amp;quot;Until:&amp;quot; to &amp;quot;Duration&amp;quot; and type &amp;quot;23&amp;quot; hours and &amp;quot;59&amp;quot; minutes.&lt;br /&gt;
:: - Click &amp;quot;OK&amp;quot; and you are done.&lt;br /&gt;
* &#039;&#039;&#039;Test your scheduled task&#039;&#039;&#039;. You can test that your scheduled task can run successfully by clicking it with the right button and chosing &amp;quot;Run&amp;quot;. If everything is correctly setup, you will briefly see a DOS command window while wget/php executes and fetches the cron page and then it disappears. If you refresh the scheduled tasks folder, you will see the &#039;&#039;Last Run Time column&#039;&#039; (in detailed folder view) reflects the current time, and that the Last Result column displays &amp;quot;0x0&amp;quot; (everything went OK). If either of these is different, then you should recheck your setup.&lt;br /&gt;
* &#039;&#039;&#039;Logging cron output&#039;&#039;&#039;. You may want to log the output of the cron script as it executes, in case you see the job is producing errors, backups are not being completed or users are experiencing delays in receiving forum emails. To do this, adjust the command so that it stores the output in a file called (for example c:\moodle\admin\cron.log). Here is an example of the php-win.exe command:&lt;br /&gt;
&amp;lt;pre&amp;gt;c:\php\php-win.exe -f c:\moodle\admin\cron.php &amp;gt; c:\moodle\admin\cron.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==On web hosting services==&lt;br /&gt;
&lt;br /&gt;
Your web-based control panel may have a web page that allows you to set up this cron process. &lt;br /&gt;
&lt;br /&gt;
If you are using CPanel, login then look for the heading &amp;quot;Advanced&amp;quot; on the page. Click on Cron Jobs -&amp;gt; Advanced (unix style). Enter the following for the cron to run every 30 minutes.&lt;br /&gt;
&lt;br /&gt;
 Email address for output: emailaddress@mydomain.con&lt;br /&gt;
 Minute:*/30&lt;br /&gt;
 Hour:*&lt;br /&gt;
 Day:*&lt;br /&gt;
 Month:*&lt;br /&gt;
 Weekday:* &lt;br /&gt;
 Command: wget -q -O /dev/null http://www.mydomain.com/moodle/admin/cron.php&lt;br /&gt;
&lt;br /&gt;
Click Commit Changes. Check your email for the output. An example is shown below:&lt;br /&gt;
&lt;br /&gt;
[[Image:Cpanel-cron-setup.JPG]]&lt;br /&gt;
&lt;br /&gt;
For other systems, look for a button called &amp;quot;Cron jobs&amp;quot;. In there you can put the same sort of Unix commands as listed below.&lt;br /&gt;
&lt;br /&gt;
==Using the command line on Unix==&lt;br /&gt;
&lt;br /&gt;
There are different command line programs you can use to call the page from the command line. Not all of them may be available on a given server.&lt;br /&gt;
&lt;br /&gt;
For example, you can use a Unix utility like &#039;wget&#039;:&lt;br /&gt;
&lt;br /&gt;
 wget -q -O /dev/null &amp;lt;nowiki&amp;gt;http://example.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note in this example that the output is thrown away (to /dev/null).&lt;br /&gt;
&lt;br /&gt;
A number of users of Moodle have found that &#039;wget&#039; sometimes fails. Especially if you have trouble with email digests not being sent on a daily basis to all users, an alternative command that solves the problem is:&lt;br /&gt;
&lt;br /&gt;
 php &amp;lt;nowiki&amp;gt;http://example.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same thing using lynx:&lt;br /&gt;
&lt;br /&gt;
 lynx -dump &amp;lt;nowiki&amp;gt;http://example.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt; &amp;gt; /dev/null&lt;br /&gt;
&lt;br /&gt;
Note in this example that the output is thrown away (to /dev/null).&lt;br /&gt;
&lt;br /&gt;
Alternatively you could use a standalone version of PHP, compiled to be run on the command line. The advantage with doing this is that your web server logs aren&#039;t filled with constant requests to cron.php. The disadvantage is that you need to have access to a command-line version of php.&lt;br /&gt;
&lt;br /&gt;
 /opt/bin/php /web/moodle/admin/cron.php&lt;br /&gt;
&lt;br /&gt;
==Using the crontab program on Unix==&lt;br /&gt;
&lt;br /&gt;
All that Cpanel does is provide a web interface to a Unix utility known as crontab. If you have a command line, you can set up crontab yourself using the command:&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and then adding one of the above commands like:&lt;br /&gt;
&lt;br /&gt;
 */30 * * * * wget -q -O /dev/null &amp;lt;nowiki&amp;gt;http://example.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first five entries are the times to run values, followed by the command to run. The asterisk is a wildard, indicating any time. The above example means run the command &#039;&#039;wget -q -O /dev/null...&#039;&#039; every 30 minutes (*/30), every hour (*), every day of the month (*), every month (*), every day of the week (*). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;O&amp;quot; of &amp;quot;-O&amp;quot; is the capital letter not zero, and refers the output file destination, in this case &amp;quot;/dev/null&amp;quot; which is a black hole and discards the output. If you want to see the output of your cron.php then enter its url in your browser. &lt;br /&gt;
&lt;br /&gt;
* [http://linuxweblog.com/node/24 A basic crontab tutorial] &lt;br /&gt;
* [http://www.freebsd.org/cgi/man.cgi?query=crontab&amp;amp;apropos=0&amp;amp;sektion=5&amp;amp;manpath=FreeBSD+6.0-RELEASE+and+Ports&amp;amp;format=html Online version of the man page] &lt;br /&gt;
&lt;br /&gt;
For &#039;&#039;&#039;beginners&#039;&#039;&#039;, &amp;quot;EDITOR=nano crontab -e&amp;quot; will allow you to edit the crontab using the [http://www.nano-editor.org/dist/v1.2/faq.html nano] editor. Ubuntu defaults to using the nano editor.&lt;br /&gt;
&lt;br /&gt;
Usually, the &amp;quot;crontab -e&amp;quot; command will put you into the &#039;vi&#039; editor. You enter &amp;quot;insert mode&amp;quot; by pressing &amp;quot;i&amp;quot;, then type in the line as above, then exit insert mode by pressing ESC. You save and exit by typing &amp;quot;:wq&amp;quot;, or quit without saving using &amp;quot;:q!&amp;quot; (without the quotes). Here is an [http://www.unix-manuals.com/tutorials/vi/vi-in-10-1.html intro] to the &#039;vi&#039; editor.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=41827 Cron - can someone give me a quick confirmation of function?] forum discussion&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:Cron]]&lt;br /&gt;
[[fr:Cron]]&lt;br /&gt;
[[nl:Cron]]&lt;/div&gt;</summary>
		<author><name>Timtak</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/36/en/index.php?title=Cron&amp;diff=25681</id>
		<title>Cron</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/36/en/index.php?title=Cron&amp;diff=25681"/>
		<updated>2007-08-06T13:25:42Z</updated>

		<summary type="html">&lt;p&gt;Timtak: /* Using the crontab program on Unix */ explanation of the &amp;quot;-O&amp;quot; in the cron command&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Some of Moodle&#039;s modules require continual checks to perform tasks. For example, Moodle needs to check the discussion forums so it can mail out copies of posts to people who have subscribed.&lt;br /&gt;
&lt;br /&gt;
The script that does all this is located in the admin directory, and is called cron.php. However, it can not run itself, so you need to set up a mechanism where this script is run regularly (eg every five or ten minutes). This provides a &amp;quot;heartbeat&amp;quot; so that the script can perform functions at periods defined by each module. This kind of regular mechanism is known as a &#039;&#039;&#039;cron service&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
The cron.php script looks through all the module directories for function module-name_cron in lib.php files and runs them.  These files can contain cleanup functions, email functions or anything that needs to be run on a regular basis. For example, cron will trigger the system to create the backups of courses at the time specified in the administration settings. It also triggers any messaging module or forum email notifications, but not all functions are called each time the cron runs. Some functions, such as unenrolling students who have not logged in or deleting old copies of log files, are only run occasionally. The cron.php file has a section which will randomly call these core tasks approximately 1 in 5 times the cron runs.&lt;br /&gt;
&lt;br /&gt;
Note that the machine performing the cron &#039;&#039;&#039;does not need to be the same machine that is running Moodle&#039;&#039;&#039;. For example, if you have a limited web hosting service that does not have a cron service, then you might choose to run cron on another server or on your home computer. All that matters is that the cron.php file is called regularly.&lt;br /&gt;
&lt;br /&gt;
The load of this script is not very high, so 5 minutes is usually reasonable, but if you&#039;re worried about it you can reduce the time period to something like 15 minutes or even 30 minutes. It&#039;s best not to make the time period too long, as delaying mail-outs can slow down activity within the course. Remember that mail-outs also wait for the editing time to expire before being queued for sending.&lt;br /&gt;
&lt;br /&gt;
First, test that the script works by running it directly from your browser: &#039;&#039;&amp;lt;nowiki&amp;gt;http://example.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
If cron is called from the command line by any user logged in to your Moodle it will create a temporary admin environment in order to run and then log the user out. You can disable command line running of cron by disabling the appropriate section in the cron.php file.&lt;br /&gt;
&lt;br /&gt;
Now, you need to set up some of way of running the script automatically and regularly.&lt;br /&gt;
&lt;br /&gt;
==On Windows systems==&lt;br /&gt;
&lt;br /&gt;
There are two different ways for setting-up Moodle cron.php on Windows systems:&lt;br /&gt;
&lt;br /&gt;
*Use the &#039;&#039;&#039;Moodle Cron package&#039;&#039;&#039;. The simplest way is to use this little package [http://download.moodle.org/download.php/sourceforge/MoodleCron-Setup.exe MoodleCron-Setup.exe], which makes this whole thing very easy by installing a small Windows service. Run it and forget about it! :-)&lt;br /&gt;
*Use a &#039;&#039;&#039;Scheduled Task&#039;&#039;&#039;. If you prefer to use the built-in Windows Scheduler or are having trouble with moodle-cron-for-windows package, you can use wget for windows or php from the command line and setup a scheduled task. Just follow these steps:&lt;br /&gt;
** Choose either the &#039;&#039;&#039;php.exe/php-win.exe (command line binary)&#039;&#039;&#039; or &#039;&#039;&#039;wget&#039;&#039;&#039;&lt;br /&gt;
::The php.exe or php-win.exe binary (for PHP version 5 or later) is installed in your php folder (e.g. c:\php) will give you better performance when running the cron script.&lt;br /&gt;
::If you want to use wget, download a compiled version of wget for windows from the native GNU Win32 ports (http://unxutils.sourceforge.net/), from Heiko Herold&#039;s wget for windows page (http://xoomer.virgilio.it/hherold/) or Bart Puype&#039;s wget for windows page (http://users.ugent.be/~bpuype/wget/). If you use Heiko Herold&#039;s package, copy all of the .DLL files to your C:\Windows\system32 directory. Copy the wget.exe file to c:\windows (this makes sure wget is always in the search path).&lt;br /&gt;
:* Setup a &#039;&#039;&#039;Scheduled Task&#039;&#039;&#039;. &lt;br /&gt;
:: - Go to Start &amp;gt;&amp;gt; Control Panel &amp;gt;&amp;gt; Scheduled Tasks &amp;gt;&amp;gt; Add Scheduled Task.&lt;br /&gt;
:: - Click &amp;quot;Next&amp;quot; to start the wizard:&lt;br /&gt;
:: - Click in the &amp;quot;Browse...&amp;quot; button and browse to c:\php\php.exe or c:\windows\wget.exe and click &amp;quot;Open&amp;quot;&lt;br /&gt;
:: - Type &amp;quot;Moodle Cron&amp;quot; as the name of the task and select &amp;quot;Daily&amp;quot; as the schedule. Click &amp;quot;Next&amp;quot;.&lt;br /&gt;
:: - Select &amp;quot;12:00 AM&amp;quot; as the start time, perform the task &amp;quot;Every Day&amp;quot; and choose today&#039;s date as the starting date. Click &amp;quot;Next&amp;quot;.&lt;br /&gt;
:: - Enter the username and password of the user the task will run under (it doesn&#039;t have to be a priviledged account at all). Make sure you type the password correctly. Click &amp;quot;Next&amp;quot;.&lt;br /&gt;
:: - Mark the checkbox titled &amp;quot;Open advanced properties for this task when I click Finish&amp;quot; and click &amp;quot;Finish&amp;quot;.&lt;br /&gt;
:: - In the new dialog box, type the following in the &amp;quot;Run:&amp;quot; text box: &amp;lt;pre&amp;gt;c:\windows\wget.exe -q -O NUL http://my.moodle.site/moodle/admin/cron.php&amp;lt;/pre&amp;gt; or &amp;lt;pre&amp;gt;c:\php\php.exe -f c:\moodle\admin\cron.php&amp;lt;/pre&amp;gt; Replace &amp;quot;c:\moodle&amp;quot; with the path to your moodle directory or &amp;quot;my.moode.site&amp;quot; with the name of your site.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
:: - Click on the &amp;quot;Schedule&amp;quot; tab and there in the &amp;quot;Advanced...&amp;quot; button.&lt;br /&gt;
:: - Mark the &amp;quot;Repeat task&amp;quot; checkbox and set &amp;quot;Every:&amp;quot; to 5 minutes, and set &amp;quot;Until:&amp;quot; to &amp;quot;Duration&amp;quot; and type &amp;quot;23&amp;quot; hours and &amp;quot;59&amp;quot; minutes.&lt;br /&gt;
:: - Click &amp;quot;OK&amp;quot; and you are done.&lt;br /&gt;
* &#039;&#039;&#039;Test your scheduled task&#039;&#039;&#039;. You can test that your scheduled task can run successfully by clicking it with the right button and chosing &amp;quot;Run&amp;quot;. If everything is correctly setup, you will briefly see a DOS command window while wget/php executes and fetches the cron page and then it disappears. If you refresh the scheduled tasks folder, you will see the &#039;&#039;Last Run Time column&#039;&#039; (in detailed folder view) reflects the current time, and that the Last Result column displays &amp;quot;0x0&amp;quot; (everything went OK). If either of these is different, then you should recheck your setup.&lt;br /&gt;
* &#039;&#039;&#039;Logging cron output&#039;&#039;&#039;. You may want to log the output of the cron script as it executes, in case you see the job is producing errors, backups are not being completed or users are experiencing delays in receiving forum emails. To do this, adjust the command so that it stores the output in a file called (for example c:\moodle\admin\cron.log). Here is an example of the php-win.exe command:&lt;br /&gt;
&amp;lt;pre&amp;gt;c:\php\php-win.exe -f c:\moodle\admin\cron.php &amp;gt; c:\moodle\admin\cron.log&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==On web hosting services==&lt;br /&gt;
&lt;br /&gt;
Your web-based control panel may have a web page that allows you to set up this cron process. &lt;br /&gt;
&lt;br /&gt;
If you are using CPanel, login then look for the heading &amp;quot;Advanced&amp;quot; on the page. Click on Cron Jobs -&amp;gt; Advanced (unix style). Enter the following for the cron to run every 30 minutes.&lt;br /&gt;
&lt;br /&gt;
 Email address for output: emailaddress@mydomain.con&lt;br /&gt;
 Minute:*/30&lt;br /&gt;
 Hour:*&lt;br /&gt;
 Day:*&lt;br /&gt;
 Month:*&lt;br /&gt;
 Weekday:* &lt;br /&gt;
 Command: wget -q -O /dev/null http://www.mydomain.com/moodle/admin/cron.php&lt;br /&gt;
&lt;br /&gt;
Click Commit Changes. Check your email for the output. An example is shown below:&lt;br /&gt;
&lt;br /&gt;
[[Image:Cpanel-cron-setup.JPG]]&lt;br /&gt;
&lt;br /&gt;
For other systems, look for a button called &amp;quot;Cron jobs&amp;quot;. In there you can put the same sort of Unix commands as listed below.&lt;br /&gt;
&lt;br /&gt;
==Using the command line on Unix==&lt;br /&gt;
&lt;br /&gt;
There are different command line programs you can use to call the page from the command line. Not all of them may be available on a given server.&lt;br /&gt;
&lt;br /&gt;
For example, you can use a Unix utility like &#039;wget&#039;:&lt;br /&gt;
&lt;br /&gt;
 wget -q -O /dev/null &amp;lt;nowiki&amp;gt;http://example.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note in this example that the output is thrown away (to /dev/null).&lt;br /&gt;
&lt;br /&gt;
A number of users of Moodle have found that &#039;wget&#039; sometimes fails. Especially if you have trouble with email digests not being sent on a daily basis to all users, an alternative command that solves the problem is:&lt;br /&gt;
&lt;br /&gt;
 php &amp;lt;nowiki&amp;gt;http://example.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The same thing using lynx:&lt;br /&gt;
&lt;br /&gt;
 lynx -dump &amp;lt;nowiki&amp;gt;http://example.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt; &amp;gt; /dev/null&lt;br /&gt;
&lt;br /&gt;
Note in this example that the output is thrown away (to /dev/null).&lt;br /&gt;
&lt;br /&gt;
Alternatively you could use a standalone version of PHP, compiled to be run on the command line. The advantage with doing this is that your web server logs aren&#039;t filled with constant requests to cron.php. The disadvantage is that you need to have access to a command-line version of php.&lt;br /&gt;
&lt;br /&gt;
 /opt/bin/php /web/moodle/admin/cron.php&lt;br /&gt;
&lt;br /&gt;
==Using the crontab program on Unix==&lt;br /&gt;
&lt;br /&gt;
All that Cpanel does is provide a web interface to a Unix utility known as crontab. If you have a command line, you can set up crontab yourself using the command:&lt;br /&gt;
&lt;br /&gt;
 crontab -e&lt;br /&gt;
&lt;br /&gt;
and then adding one of the above commands like:&lt;br /&gt;
&lt;br /&gt;
 */30 * * * * wget -q -O /dev/null &amp;lt;nowiki&amp;gt;http://example.com/moodle/admin/cron.php&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The first five entries are the times to run values, followed by the command to run. The asterisk is a wildard, indicating any time. The above example means run the command &#039;&#039;wget -q -O /dev/null...&#039;&#039; every 30 minutes (*/30), every hour (*), every day of the month (*), every month (*), every day of the week (*). &lt;br /&gt;
&lt;br /&gt;
The &amp;quot;O&amp;quot; of &amp;quot;-O&amp;quot; is the capital letter not zero, and refers the output file destination, in this case &amp;quot;/dev/null&amp;quot; which is a &amp;quot;black hole&amp;quot; to discard the output. If you want to see the output of your cron.php then enter its url in your browser. &lt;br /&gt;
&lt;br /&gt;
* [http://linuxweblog.com/node/24 A basic crontab tutorial] &lt;br /&gt;
* [http://www.freebsd.org/cgi/man.cgi?query=crontab&amp;amp;apropos=0&amp;amp;sektion=5&amp;amp;manpath=FreeBSD+6.0-RELEASE+and+Ports&amp;amp;format=html Online version of the man page] &lt;br /&gt;
&lt;br /&gt;
For &#039;&#039;&#039;beginners&#039;&#039;&#039;, &amp;quot;EDITOR=nano crontab -e&amp;quot; will allow you to edit the crontab using the [http://www.nano-editor.org/dist/v1.2/faq.html nano] editor. Ubuntu defaults to using the nano editor.&lt;br /&gt;
&lt;br /&gt;
Usually, the &amp;quot;crontab -e&amp;quot; command will put you into the &#039;vi&#039; editor. You enter &amp;quot;insert mode&amp;quot; by pressing &amp;quot;i&amp;quot;, then type in the line as above, then exit insert mode by pressing ESC. You save and exit by typing &amp;quot;:wq&amp;quot;, or quit without saving using &amp;quot;:q!&amp;quot; (without the quotes). Here is an [http://www.unix-manuals.com/tutorials/vi/vi-in-10-1.html intro] to the &#039;vi&#039; editor.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
*Using Moodle [http://moodle.org/mod/forum/discuss.php?d=41827 Cron - can someone give me a quick confirmation of function?] forum discussion&lt;br /&gt;
&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:Cron]]&lt;br /&gt;
[[fr:Cron]]&lt;br /&gt;
[[nl:Cron]]&lt;/div&gt;</summary>
		<author><name>Timtak</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/36/en/index.php?title=Installing_Moodle&amp;diff=17551</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/36/en/index.php?title=Installing_Moodle&amp;diff=17551"/>
		<updated>2006-10-29T04:09:06Z</updated>

		<summary type="html">&lt;p&gt;Timtak: /* Creating a data directory */  Safe mode a no no, for now at least&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Firstly don&#039;t panic! :-)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This guide explains how to install Moodle for the first time. For some of these steps it goes into a lot of detail to try and cover the majority of possible web server setups, so this page may look long and complicated. Don&#039;t panic, once you know how to do it you can install Moodle in minutes!&lt;br /&gt;
&lt;br /&gt;
If you have problems please read this page carefully - most common issues are answered in here. If you still have trouble, you can seek help from the Moodle community via [http://moodle.org/course/view.php?id=5 moodle.org Using Moodle].&lt;br /&gt;
&lt;br /&gt;
Another option is to contact a [http://moodle.com/hosting/ Moodle Partner providing Moodle hosting] who can completely maintain Moodle for you, so that you can ignore all this and get straight into educating!&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
&lt;br /&gt;
Moodle is primarily developed in Linux using [[Apache]], [[MySQL]] and [[PHP]] (also sometimes known as the LAMP platform), but is also regularly tested with PostgreSQL and on Windows XP, Mac OS X and Netware 6 operating systems.&lt;br /&gt;
&lt;br /&gt;
The requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
* Web server software. Most people use [[Apache]], but Moodle should work fine under any web server that supports [[PHP]], such as [[IIS]] on Windows platforms. PHP does impose requirements on versions of web servers, however these are complex and the general advice is to use the newest version possible of your chosen web server. &lt;br /&gt;
* PHP scripting language (version 4.1.0 or later). PHP 5 (version 5.1.0 or later) is supported as of Moodle 1.4. (Please note that there have been issues installing Moodle with [http://www.php-accelerator.co.uk PHP-Accelerator]).  From Moodle version 1.6, the minimum version of PHP will be 4.3.0 (or 5.1.0).&lt;br /&gt;
* a working database server: [[MySQL]] or [[PostgreSQL]] are completely supported and recommended for use with Moodle. MySQL is &#039;&#039;the&#039;&#039; choice for many people because it is very popular, but there are some [[Arguments in favour of PostgreSQL|arguments in favour of PostgreSQL]], especially if you are planning a large deployment. The minimum version of MySql required for Moodle 1.5 is 3.23. Moodle 1.6 requires MySQL 4.1.16 (4.1.12 if you use latin languages only). The minimum version of PostgreSQL is 7.4 and it is widely used with 8.0 and 8.1.&lt;br /&gt;
* That the PHP setting &amp;quot;safe mode&amp;quot; be OFF in the php configuration files (php.ini) and in the apache configuration file (generally httpd.config).&lt;br /&gt;
&lt;br /&gt;
Most web hosts support all of this by default. If you are signed up with one of the few webhosts that does not support these features ask them why, and consider taking your business elsewhere.&lt;br /&gt;
&lt;br /&gt;
If you want to run Moodle on your own computer and all this looks a bit daunting, then please see our guide: [[Installing Apache, MySQL and PHP]]. It provides some step-by-step instructions to install all this on most popular platforms.&lt;br /&gt;
&lt;br /&gt;
Additional requirements:&lt;br /&gt;
&lt;br /&gt;
PHP Extensions:&lt;br /&gt;
* [http://www.boutell.com/gd/ GD library] and the [http://www.freetype.org/ FreeType 2] library on Linux/Unix boxes to be able to look at the dynamic graphs that the logs pages make.&lt;br /&gt;
* mbstring - is required for multi-byte string handling. (iconv is also recommended for Moodle 1.6)&lt;br /&gt;
* the mysql extension is required if you are using the MySql database. Note that in some Linux distributions (notably Red Hat) this is an optional installation.&lt;br /&gt;
* the pgsql extension is required if you are using the PostgreSQL database.&lt;br /&gt;
* the zlib extension is required for zip/unzip functionality&lt;br /&gt;
* other PHP extensions may be required to support optional Moodle functionality, especially external authentication and/or enrolment (e.g., LDAP extension)&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to get Moodle, as a compressed package or via CVS. These compressed packages are on the download page: http://download.moodle.org/ and the instructions for using CVS are at  [[CVS_for_Administrators]].&lt;br /&gt;
&lt;br /&gt;
After downloading and unpacking the archive, or checking out the files via CVS, you will be left with a directory called &amp;quot;moodle&amp;quot;, containing a number of files and folders.&lt;br /&gt;
&lt;br /&gt;
You can either place the whole folder in your web server documents directory, in which case the site will be located at &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com/moodle&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;, or you can copy all the contents straight into the main web server documents directory, in which case the site will be simply &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If you are downloading Moodle to your local computer and then uploading it to your web site, it is usually better to upload the whole archive as one file, and then do the unpacking on the server. Even web hosting interfaces like Cpanel allow you to uncompress archives in the &amp;quot;File Manager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Site structure ==&lt;br /&gt;
&lt;br /&gt;
You can safely skip this section, but here is a quick summary of the contents of the Moodle folder, to help get you oriented:&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;config.php&#039;&#039; - contains basic settings. This file does not come with Moodle - you will create it.&lt;br /&gt;
:&#039;&#039;install.php&#039;&#039; - the script you will run to create config.php&lt;br /&gt;
:&#039;&#039;version.php&#039;&#039; - defines the current version of Moodle code&lt;br /&gt;
:&#039;&#039;index.php&#039;&#039; - the front page of the site&lt;br /&gt;
:&#039;&#039;admin/&#039;&#039; - code to administrate the whole server&lt;br /&gt;
:&#039;&#039;auth/&#039;&#039; - plugin modules to authenticate users&lt;br /&gt;
:&#039;&#039;blocks/&#039;&#039; - plugin modules for the little side blocks on many pages&lt;br /&gt;
:&#039;&#039;calendar/&#039;&#039; - all the code for managing and displaying calendars&lt;br /&gt;
:&#039;&#039;course/&#039;&#039; - code to display and manage courses&lt;br /&gt;
:&#039;&#039;doc/&#039;&#039; - help documentation for Moodle (eg this page)&lt;br /&gt;
:&#039;&#039;files/&#039;&#039; - code to display and manage uploaded files&lt;br /&gt;
:&#039;&#039;lang/&#039;&#039; - texts in different languages, one directory per language&lt;br /&gt;
:&#039;&#039;lib/&#039;&#039; - libraries of core Moodle code&lt;br /&gt;
:&#039;&#039;login/&#039;&#039; - code to handle login and account creation&lt;br /&gt;
:&#039;&#039;mod/&#039;&#039; - all the main Moodle course modules are in here&lt;br /&gt;
:&#039;&#039;pix/&#039;&#039; - generic site graphics&lt;br /&gt;
:&#039;&#039;theme/&#039;&#039; - theme packs/skins to change the look of the site.&lt;br /&gt;
:&#039;&#039;user/&#039;&#039; - code to display and manage users&lt;br /&gt;
&lt;br /&gt;
== Run the installer script to create config.php ==&lt;br /&gt;
&lt;br /&gt;
To run the installer script (install.php), just try to access your Moodle main URL using a web browser, or access &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourserver/install.php&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; directly.&lt;br /&gt;
&lt;br /&gt;
(The Installer will try to set a session cookie. If you get a popup warning in your browser make sure you accept that cookie!)&lt;br /&gt;
&lt;br /&gt;
Moodle will detect that configuration is necessary and will lead you through some screens to help you create a new configuration file called &#039;&#039;&#039;config.php&#039;&#039;&#039;. At the end of the process Moodle will try and write the file into the right location, otherwise you can press a button to download it from the installer and then upload &#039;&#039;&#039;config.php&#039;&#039;&#039; into the main Moodle directory on the server.&lt;br /&gt;
&lt;br /&gt;
Along the way the installer will test your server environment and give you suggestions about how to fix any problems. For most common issues these suggestions should be sufficient, but if you get stuck, look below for more information about some of common things that might be holding you up. &lt;br /&gt;
&lt;br /&gt;
=== Check web server settings ===&lt;br /&gt;
&lt;br /&gt;
Firstly, make sure that your web server is set up to use index.php as a default page (perhaps in addition to index.html, default.htm and so on). In Apache, this is done using a DirectoryIndex parameter in your httpd.conf file. Mine usually looks like this:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DirectoryIndex&#039;&#039;&#039; index.php index.html index.htm&lt;br /&gt;
&lt;br /&gt;
Just make sure index.php is in the list (and preferably towards the start of the list, for efficiency).&lt;br /&gt;
&lt;br /&gt;
Secondly, &#039;&#039;&#039;if you are using Apache 2&#039;&#039;&#039;, then you should turn on the &#039;&#039;AcceptPathInfo&#039;&#039; variable, which allows scripts to be passed arguments like &amp;lt;nowiki&amp;gt;http://server/file.php/arg1/arg2&amp;lt;/nowiki&amp;gt;. This is essential to allow relative links between your resources, and also provides a performance boost for people using your Moodle web site. You can turn this on by adding these lines to your httpd.conf file.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;AcceptPathInfo&#039;&#039;&#039; on&lt;br /&gt;
&lt;br /&gt;
Thirdly, Moodle requires a number of PHP settings to be active for it to work. &#039;&#039;&#039;On most servers these will already be the default settings&#039;&#039;&#039;.  However, some PHP servers (and some of the more recent PHP versions) may have things set differently. These are defined in PHP&#039;s configuration file (usually called &#039;&#039;&#039;php.ini&#039;&#039;&#039;):&lt;br /&gt;
&lt;br /&gt;
 magic_quotes_gpc = 1    (preferred but not necessary)&lt;br /&gt;
 magic_quotes_runtime = 0    (necessary)&lt;br /&gt;
 file_uploads = 1&lt;br /&gt;
 session.auto_start = 0&lt;br /&gt;
 session.bug_compat_warn = 0&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t have access to &#039;&#039;&#039;httpd.conf&#039;&#039;&#039; or &#039;&#039;&#039;php.ini&#039;&#039;&#039; on your server, or you have Moodle on a server with other applications that require different settings, then don&#039;t worry, you can often still OVERRIDE the default settings.&lt;br /&gt;
&lt;br /&gt;
To do this, you need to create a file called &#039;&#039;&#039;.htaccess&#039;&#039;&#039; in Moodle&#039;s main directory that contains lines like the following. This only works on Apache servers and only when Overrides have been allowed in the main configuration.&lt;br /&gt;
&lt;br /&gt;
 DirectoryIndex index.php index.html index.htm&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;IfDefine APACHE2&amp;gt;&lt;br /&gt;
     &#039;&#039;&#039;AcceptPathInfo&#039;&#039;&#039; on&lt;br /&gt;
 &amp;lt;/IfDefine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 php_flag magic_quotes_gpc 1&lt;br /&gt;
 php_flag magic_quotes_runtime 0&lt;br /&gt;
 php_flag file_uploads 1&lt;br /&gt;
 php_flag session.auto_start 0&lt;br /&gt;
 php_flag session.bug_compat_warn 0&lt;br /&gt;
&lt;br /&gt;
You can also do things like define the maximum size for uploaded files:&lt;br /&gt;
&lt;br /&gt;
 LimitRequestBody 0&lt;br /&gt;
 php_value upload_max_filesize 2M&lt;br /&gt;
 php_value post_max_size 2M&lt;br /&gt;
     &lt;br /&gt;
The easiest thing to do is just copy the sample file from lib/htaccess and edit it to suit your needs. It contains further instructions. For example, in a Unix shell:&lt;br /&gt;
&lt;br /&gt;
 cp lib/htaccess .htaccess&lt;br /&gt;
&lt;br /&gt;
=== Creating a database ===&lt;br /&gt;
&lt;br /&gt;
You need to create an empty database (eg &amp;quot;&#039;&#039;moodle&#039;&#039;&amp;quot;) in your database system along with a special user (eg &amp;quot;moodleuser&amp;quot;) that has access to that database (and that database only). You could use the &amp;quot;root&amp;quot; user if you wanted to for a test server, but this is not recommended for a production system: if hackers manage to discover the password then your whole database system would be at risk, rather than just one database.&lt;br /&gt;
&lt;br /&gt;
::Bear in mind that currently (as of 1.5.x) Moodle doesn&#039;t work with MySQL 5.x&#039;s new &amp;quot;STRICT_TRANS_TABLES&amp;quot; setting. So if you are using MySQL 5.x, edit MySQL&#039;s configuration file (called &amp;quot;my.ini&amp;quot; in Windows and &amp;quot;my.cnf&amp;quot; on Unix/Linux) and comment out that option (or simply delete it). You have to restart MySQL after changing this setting.&lt;br /&gt;
&lt;br /&gt;
If you are using a webhost, they will probably have a control panel web interface for you to create your database.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Cpanel&#039;&#039;&#039; system is one of the most popular of these. To create a database in Cpanel,&lt;br /&gt;
&lt;br /&gt;
# Click on the &amp;quot;&#039;&#039;&#039;MySQL Databases&#039;&#039;&#039;&amp;quot; icon.&lt;br /&gt;
# Type &amp;quot;moodle&amp;quot; in the database field and click &amp;quot;&#039;&#039;&#039;Add Database&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
# Type a username and password (not one you use elsewhere) in the respective fields and click &amp;quot;&#039;&#039;&#039;Add User&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
# Now use the &amp;quot;&#039;&#039;&#039;Add User to Database&#039;&#039;&#039;&amp;quot; button to give this new user account &amp;quot;&#039;&#039;&#039;ALL&#039;&#039;&#039;&amp;quot; rights to the new database.&lt;br /&gt;
# Note that the username and database names may be prefixed by your Cpanel account name. When entering this information into the Moodle installer - use the full names.&lt;br /&gt;
&lt;br /&gt;
If you have access to Unix command lines then you can do the same sort of thing by typing commands.&lt;br /&gt;
&lt;br /&gt;
Here are some example Unix command lines for MySQL (the red part is for Moodle 1.6 and later, leave it out for Moodle 1.5.x or earlier):&lt;br /&gt;
&lt;br /&gt;
   # mysql -u root -p&lt;br /&gt;
   &amp;gt; CREATE DATABASE moodle &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci&amp;lt;/font&amp;gt;; &lt;br /&gt;
   &amp;gt; GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,ALTER ON moodle.*&lt;br /&gt;
           TO moodleuser@localhost IDENTIFIED BY &#039;yourpassword&#039;; &lt;br /&gt;
   &amp;gt; quit &lt;br /&gt;
   # mysqladmin -p reload&lt;br /&gt;
&lt;br /&gt;
If you are using MySQL 4.0.2 or later, you need to specify CREATE TEMPORARY TABLES as well in the GRANT statement:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,&lt;br /&gt;
           DROP,INDEX,ALTER ON moodle.* &lt;br /&gt;
           TO moodleuser@localhost IDENTIFIED BY &#039;yourpassword&#039;; &lt;br /&gt;
&lt;br /&gt;
And some example command lines for PostgreSQL:&lt;br /&gt;
&lt;br /&gt;
   # su - postgres&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;create user moodleuser createdb;&amp;quot; template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;create database moodle &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;with encoding &#039;unicode&#039;&amp;lt;/font&amp;gt;;&amp;quot; -U moodleuser template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;alter user moodleuser nocreatedb;&amp;quot; template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;alter user moodleuser with encrypted password &#039;yourpassword&#039;;&amp;quot; template1&lt;br /&gt;
   &amp;gt; su - root&lt;br /&gt;
   # /etc/init.d/postgresql reload&lt;br /&gt;
&lt;br /&gt;
=== Creating a data directory ===&lt;br /&gt;
&lt;br /&gt;
Moodle will also need some space on your server&#039;s hard disk to store uploaded files, such as course documents and user pictures.&lt;br /&gt;
&lt;br /&gt;
The Moodle installer tries hard to create this directory for you but if it fails then you will have to create a directory for this purpose manually.&lt;br /&gt;
&lt;br /&gt;
For security, it&#039;s best that this directory is NOT accessible directly via the web. The easiest way to do this is to simply locate it OUTSIDE the web directory, but if you must have it in the web directory then protect it by creating a file in the data directory called .htaccess, containing this line:&lt;br /&gt;
&lt;br /&gt;
 deny from all&lt;br /&gt;
&lt;br /&gt;
To make sure that Moodle can save uploaded files in this directory, check that the web server software (eg Apache) has permission to read, write and execute in this directory.&lt;br /&gt;
&lt;br /&gt;
On Unix machines, this means setting the owner of the directory to be something like &amp;quot;nobody&amp;quot; or &amp;quot;apache&amp;quot;, and then giving that user read, write and execute permissions.&lt;br /&gt;
&lt;br /&gt;
To do this you could use:&lt;br /&gt;
chown -R nobody:nobody moodledata&lt;br /&gt;
&lt;br /&gt;
Remember by default, mysql won&#039;t accept moodle data directories created under ROOT.&lt;br /&gt;
&lt;br /&gt;
On Cpanel systems you can use the &amp;quot;File Manager&amp;quot; to find the folder, click on it, then choose &amp;quot;Change Permissions&amp;quot;. On many shared hosting servers, you will probably need to restrict all file access to your &amp;quot;group&amp;quot; (to prevent other webhost customers from looking at or changing your files), but provide full read/write access to everyone else (which will allow the web server to access your files).&lt;br /&gt;
&lt;br /&gt;
Speak to your server administrator if you are having trouble setting this up securely. In particular it will not be possible to create a usable data directory on sites that use a PHP feature known as &amp;quot;Safe Mode.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
== Go to the admin page to continue configuration ==&lt;br /&gt;
&lt;br /&gt;
Once the basic config.php has been correctly created in the previous step, trying to access the front page of your site will take you the &amp;quot;admin&amp;quot; page for the rest of the configuration.&lt;br /&gt;
&lt;br /&gt;
The first time you access this admin page, you will be presented with a GPL &amp;quot;shrinkwrap&amp;quot; agreement with which you must agree before you can continue with the setup.&lt;br /&gt;
&lt;br /&gt;
Now Moodle will start setting up your database and creating tables to store data. Firstly, the main database tables are created. You should see a number of SQL statements followed by status messages (in green or red) that look like this:&lt;br /&gt;
&lt;br /&gt;
{| border=1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;CREATE TABLE course ( id int(10) unsigned NOT NULL auto_increment, category int(10) unsigned NOT NULL default &#039;0&#039;, password varchar(50) NOT NULL default &#039;&#039;, fullname varchar(254) NOT NULL default &#039;&#039;, shortname varchar(15) NOT NULL default &#039;&#039;, summary text NOT NULL, format tinyint(4) NOT NULL default &#039;1&#039;, teacher varchar(100) NOT NULL default &#039;Teacher&#039;, startdate int(10) unsigned NOT NULL default &#039;0&#039;, enddate int(10) unsigned NOT NULL default &#039;0&#039;, timemodified int(10) unsigned NOT NULL default &#039;0&#039;, PRIMARY KEY (id)) TYPE=MyISAM&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;SUCCESS&amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
...and so on, followed by: &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Main databases set up successfully.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see these, then there must have been some problem with the database or the configuration settings you defined in config.php. Check that PHP isn&#039;t in a restricted &amp;quot;Safe Mode&amp;quot; (commercial web hosts sometimes have safe mode turned on). You can check PHP variables by creating a little file containing &#039;&#039;&#039;&amp;lt;?php phpinfo() ?&amp;gt;&#039;&#039;&#039; and looking at it through a browser. Check all these and try this page again.&lt;br /&gt;
&lt;br /&gt;
Scroll down the very bottom of the page and press the &amp;quot;Continue&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
You should now see a form where you can define more configuration variables for your installation, such as the default language, SMTP hosts and so on. Don&#039;t worry too much about getting everything right just now - you can always come back and edit these later on using the admin interface. The defaults are designed to be useful and secure for most sites. Scroll down to the bottom and click &amp;quot;Save changes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If (and only if) you find yourself getting stuck on this page, unable to continue, then your server probably has what I call the &amp;quot;buggy referrer&amp;quot; problem. This is easy to fix: just turn off the &amp;quot;secureforms&amp;quot; setting, then try to continue again.&lt;br /&gt;
&lt;br /&gt;
Next you will see more pages that print lots of status messages as they set up all the tables required by the various Moodle module. As before, they should all be &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;green&amp;lt;/font&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Scroll down the very bottom of the page and press the &amp;quot;Continue&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
The next page is a form where you can define parameters for your Moodle site and the front page, such as the name, format, description and so on. Fill this out (you can always come back and change these later) and then press &amp;quot;Save changes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Finally, you will then be asked to create a top-level administration user for future access to the admin pages. Fill out the details with your own name, email etc and then click &amp;quot;Save changes&amp;quot;. Not all the fields are required, but if you miss any important fields you&#039;ll be re-prompted for them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make sure you remember the username and password you chose for the administration user account, as they will be necessary to access the administration page in future.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(If for any reason your install is interrupted, or there is a system error of some kind that prevents you from logging in using the admin account, you can usually log in using the default username of &amp;quot;&#039;&#039;&#039;admin&#039;&#039;&#039;&amp;quot;, with password &amp;quot;&#039;&#039;&#039;admin&#039;&#039;&#039;&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Once successful, you will be returned to the home page of your new site! Note the administration links that appear down the left hand side of the page (these items also appear on a separate Admin page) - these items are only visible to you because you are logged in as the admin user. All your further administration of Moodle can now be done using this menu, such as:&lt;br /&gt;
&lt;br /&gt;
* creating and deleting courses&lt;br /&gt;
* creating and editing user accounts&lt;br /&gt;
* administering teacher accounts&lt;br /&gt;
* changing site-wide settings like themes etc&lt;br /&gt;
&lt;br /&gt;
But you are not done installing yet! There is one very important thing still to do (see the next section on cron).&lt;br /&gt;
&lt;br /&gt;
== Set up cron ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the [[Cron|cron instructions]].&lt;br /&gt;
&lt;br /&gt;
== Create a new course ==&lt;br /&gt;
&lt;br /&gt;
Now that Moodle is running properly, you can try creating a new course to play with.&lt;br /&gt;
&lt;br /&gt;
Select &amp;quot;Create a new course&amp;quot; from the Admin page (or the admin links on the home page).&lt;br /&gt;
&lt;br /&gt;
Fill out the form, paying special attention to the course format. You don&#039;t have to worry about the details too much at this stage, as everything can be changed later by the teacher. Note that the yellow help icons are everywhere to provide contextual help on any aspect.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;Save changes&amp;quot;, and you will be taken to a new form where you can assign teachers to the course. You can only add existing user accounts from this form - if you want to create a new teacher account then either ask the teacher to create one for themselves (see the login page), or create one for them using the &amp;quot;Add a new user&amp;quot; on the Admin page.&lt;br /&gt;
&lt;br /&gt;
Once done, the course is ready to customise, and is accessible via the &amp;quot;Courses&amp;quot; link on the home page.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Installation FAQ]]&lt;br /&gt;
* [[Installing Apache, MySQL and PHP]]&lt;br /&gt;
* [[Upgrading Moodle]]&lt;br /&gt;
* [[Windows installation|Windows installation]]&lt;br /&gt;
* [[RedHat Linux installation|Step by Step Installation Guide for RedHat]]&lt;br /&gt;
* [[Debian GNU/Linux installation|Step by Step Installation Guide for Debian GNU/Linux]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=42688 Selecting a webhost for Moodle] forum discussion&lt;br /&gt;
* [[masquerading]] - Running Moodle behind a masquerading/NAT firewall&lt;br /&gt;
&lt;br /&gt;
[[Category:Core]]&lt;br /&gt;
[[Category:Administrator]]&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:Instalación de moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[nl:Installatiegids]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;br /&gt;
[[zh:安装Moodlezh:]]&lt;/div&gt;</summary>
		<author><name>Timtak</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/36/en/index.php?title=Installing_Moodle&amp;diff=17550</id>
		<title>Installing Moodle</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/36/en/index.php?title=Installing_Moodle&amp;diff=17550"/>
		<updated>2006-10-29T04:05:35Z</updated>

		<summary type="html">&lt;p&gt;Timtak: /* Requirements */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Firstly don&#039;t panic! :-)&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
This guide explains how to install Moodle for the first time. For some of these steps it goes into a lot of detail to try and cover the majority of possible web server setups, so this page may look long and complicated. Don&#039;t panic, once you know how to do it you can install Moodle in minutes!&lt;br /&gt;
&lt;br /&gt;
If you have problems please read this page carefully - most common issues are answered in here. If you still have trouble, you can seek help from the Moodle community via [http://moodle.org/course/view.php?id=5 moodle.org Using Moodle].&lt;br /&gt;
&lt;br /&gt;
Another option is to contact a [http://moodle.com/hosting/ Moodle Partner providing Moodle hosting] who can completely maintain Moodle for you, so that you can ignore all this and get straight into educating!&lt;br /&gt;
&lt;br /&gt;
==Requirements==&lt;br /&gt;
&lt;br /&gt;
Moodle is primarily developed in Linux using [[Apache]], [[MySQL]] and [[PHP]] (also sometimes known as the LAMP platform), but is also regularly tested with PostgreSQL and on Windows XP, Mac OS X and Netware 6 operating systems.&lt;br /&gt;
&lt;br /&gt;
The requirements for Moodle are as follows:&lt;br /&gt;
&lt;br /&gt;
* Web server software. Most people use [[Apache]], but Moodle should work fine under any web server that supports [[PHP]], such as [[IIS]] on Windows platforms. PHP does impose requirements on versions of web servers, however these are complex and the general advice is to use the newest version possible of your chosen web server. &lt;br /&gt;
* PHP scripting language (version 4.1.0 or later). PHP 5 (version 5.1.0 or later) is supported as of Moodle 1.4. (Please note that there have been issues installing Moodle with [http://www.php-accelerator.co.uk PHP-Accelerator]).  From Moodle version 1.6, the minimum version of PHP will be 4.3.0 (or 5.1.0).&lt;br /&gt;
* a working database server: [[MySQL]] or [[PostgreSQL]] are completely supported and recommended for use with Moodle. MySQL is &#039;&#039;the&#039;&#039; choice for many people because it is very popular, but there are some [[Arguments in favour of PostgreSQL|arguments in favour of PostgreSQL]], especially if you are planning a large deployment. The minimum version of MySql required for Moodle 1.5 is 3.23. Moodle 1.6 requires MySQL 4.1.16 (4.1.12 if you use latin languages only). The minimum version of PostgreSQL is 7.4 and it is widely used with 8.0 and 8.1.&lt;br /&gt;
* That the PHP setting &amp;quot;safe mode&amp;quot; be OFF in the php configuration files (php.ini) and in the apache configuration file (generally httpd.config).&lt;br /&gt;
&lt;br /&gt;
Most web hosts support all of this by default. If you are signed up with one of the few webhosts that does not support these features ask them why, and consider taking your business elsewhere.&lt;br /&gt;
&lt;br /&gt;
If you want to run Moodle on your own computer and all this looks a bit daunting, then please see our guide: [[Installing Apache, MySQL and PHP]]. It provides some step-by-step instructions to install all this on most popular platforms.&lt;br /&gt;
&lt;br /&gt;
Additional requirements:&lt;br /&gt;
&lt;br /&gt;
PHP Extensions:&lt;br /&gt;
* [http://www.boutell.com/gd/ GD library] and the [http://www.freetype.org/ FreeType 2] library on Linux/Unix boxes to be able to look at the dynamic graphs that the logs pages make.&lt;br /&gt;
* mbstring - is required for multi-byte string handling. (iconv is also recommended for Moodle 1.6)&lt;br /&gt;
* the mysql extension is required if you are using the MySql database. Note that in some Linux distributions (notably Red Hat) this is an optional installation.&lt;br /&gt;
* the pgsql extension is required if you are using the PostgreSQL database.&lt;br /&gt;
* the zlib extension is required for zip/unzip functionality&lt;br /&gt;
* other PHP extensions may be required to support optional Moodle functionality, especially external authentication and/or enrolment (e.g., LDAP extension)&lt;br /&gt;
&lt;br /&gt;
== Download and copy files into place ==&lt;br /&gt;
&lt;br /&gt;
There are two ways to get Moodle, as a compressed package or via CVS. These compressed packages are on the download page: http://download.moodle.org/ and the instructions for using CVS are at  [[CVS_for_Administrators]].&lt;br /&gt;
&lt;br /&gt;
After downloading and unpacking the archive, or checking out the files via CVS, you will be left with a directory called &amp;quot;moodle&amp;quot;, containing a number of files and folders.&lt;br /&gt;
&lt;br /&gt;
You can either place the whole folder in your web server documents directory, in which case the site will be located at &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com/moodle&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;, or you can copy all the contents straight into the main web server documents directory, in which case the site will be simply &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourwebserver.com&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
If you are downloading Moodle to your local computer and then uploading it to your web site, it is usually better to upload the whole archive as one file, and then do the unpacking on the server. Even web hosting interfaces like Cpanel allow you to uncompress archives in the &amp;quot;File Manager&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== Site structure ==&lt;br /&gt;
&lt;br /&gt;
You can safely skip this section, but here is a quick summary of the contents of the Moodle folder, to help get you oriented:&lt;br /&gt;
&lt;br /&gt;
:&#039;&#039;config.php&#039;&#039; - contains basic settings. This file does not come with Moodle - you will create it.&lt;br /&gt;
:&#039;&#039;install.php&#039;&#039; - the script you will run to create config.php&lt;br /&gt;
:&#039;&#039;version.php&#039;&#039; - defines the current version of Moodle code&lt;br /&gt;
:&#039;&#039;index.php&#039;&#039; - the front page of the site&lt;br /&gt;
:&#039;&#039;admin/&#039;&#039; - code to administrate the whole server&lt;br /&gt;
:&#039;&#039;auth/&#039;&#039; - plugin modules to authenticate users&lt;br /&gt;
:&#039;&#039;blocks/&#039;&#039; - plugin modules for the little side blocks on many pages&lt;br /&gt;
:&#039;&#039;calendar/&#039;&#039; - all the code for managing and displaying calendars&lt;br /&gt;
:&#039;&#039;course/&#039;&#039; - code to display and manage courses&lt;br /&gt;
:&#039;&#039;doc/&#039;&#039; - help documentation for Moodle (eg this page)&lt;br /&gt;
:&#039;&#039;files/&#039;&#039; - code to display and manage uploaded files&lt;br /&gt;
:&#039;&#039;lang/&#039;&#039; - texts in different languages, one directory per language&lt;br /&gt;
:&#039;&#039;lib/&#039;&#039; - libraries of core Moodle code&lt;br /&gt;
:&#039;&#039;login/&#039;&#039; - code to handle login and account creation&lt;br /&gt;
:&#039;&#039;mod/&#039;&#039; - all the main Moodle course modules are in here&lt;br /&gt;
:&#039;&#039;pix/&#039;&#039; - generic site graphics&lt;br /&gt;
:&#039;&#039;theme/&#039;&#039; - theme packs/skins to change the look of the site.&lt;br /&gt;
:&#039;&#039;user/&#039;&#039; - code to display and manage users&lt;br /&gt;
&lt;br /&gt;
== Run the installer script to create config.php ==&lt;br /&gt;
&lt;br /&gt;
To run the installer script (install.php), just try to access your Moodle main URL using a web browser, or access &#039;&#039;&#039;&amp;lt;nowiki&amp;gt;http://yourserver/install.php&amp;lt;/nowiki&amp;gt;&#039;&#039;&#039; directly.&lt;br /&gt;
&lt;br /&gt;
(The Installer will try to set a session cookie. If you get a popup warning in your browser make sure you accept that cookie!)&lt;br /&gt;
&lt;br /&gt;
Moodle will detect that configuration is necessary and will lead you through some screens to help you create a new configuration file called &#039;&#039;&#039;config.php&#039;&#039;&#039;. At the end of the process Moodle will try and write the file into the right location, otherwise you can press a button to download it from the installer and then upload &#039;&#039;&#039;config.php&#039;&#039;&#039; into the main Moodle directory on the server.&lt;br /&gt;
&lt;br /&gt;
Along the way the installer will test your server environment and give you suggestions about how to fix any problems. For most common issues these suggestions should be sufficient, but if you get stuck, look below for more information about some of common things that might be holding you up. &lt;br /&gt;
&lt;br /&gt;
=== Check web server settings ===&lt;br /&gt;
&lt;br /&gt;
Firstly, make sure that your web server is set up to use index.php as a default page (perhaps in addition to index.html, default.htm and so on). In Apache, this is done using a DirectoryIndex parameter in your httpd.conf file. Mine usually looks like this:&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;DirectoryIndex&#039;&#039;&#039; index.php index.html index.htm&lt;br /&gt;
&lt;br /&gt;
Just make sure index.php is in the list (and preferably towards the start of the list, for efficiency).&lt;br /&gt;
&lt;br /&gt;
Secondly, &#039;&#039;&#039;if you are using Apache 2&#039;&#039;&#039;, then you should turn on the &#039;&#039;AcceptPathInfo&#039;&#039; variable, which allows scripts to be passed arguments like &amp;lt;nowiki&amp;gt;http://server/file.php/arg1/arg2&amp;lt;/nowiki&amp;gt;. This is essential to allow relative links between your resources, and also provides a performance boost for people using your Moodle web site. You can turn this on by adding these lines to your httpd.conf file.&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;AcceptPathInfo&#039;&#039;&#039; on&lt;br /&gt;
&lt;br /&gt;
Thirdly, Moodle requires a number of PHP settings to be active for it to work. &#039;&#039;&#039;On most servers these will already be the default settings&#039;&#039;&#039;.  However, some PHP servers (and some of the more recent PHP versions) may have things set differently. These are defined in PHP&#039;s configuration file (usually called &#039;&#039;&#039;php.ini&#039;&#039;&#039;):&lt;br /&gt;
&lt;br /&gt;
 magic_quotes_gpc = 1    (preferred but not necessary)&lt;br /&gt;
 magic_quotes_runtime = 0    (necessary)&lt;br /&gt;
 file_uploads = 1&lt;br /&gt;
 session.auto_start = 0&lt;br /&gt;
 session.bug_compat_warn = 0&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t have access to &#039;&#039;&#039;httpd.conf&#039;&#039;&#039; or &#039;&#039;&#039;php.ini&#039;&#039;&#039; on your server, or you have Moodle on a server with other applications that require different settings, then don&#039;t worry, you can often still OVERRIDE the default settings.&lt;br /&gt;
&lt;br /&gt;
To do this, you need to create a file called &#039;&#039;&#039;.htaccess&#039;&#039;&#039; in Moodle&#039;s main directory that contains lines like the following. This only works on Apache servers and only when Overrides have been allowed in the main configuration.&lt;br /&gt;
&lt;br /&gt;
 DirectoryIndex index.php index.html index.htm&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;IfDefine APACHE2&amp;gt;&lt;br /&gt;
     &#039;&#039;&#039;AcceptPathInfo&#039;&#039;&#039; on&lt;br /&gt;
 &amp;lt;/IfDefine&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 php_flag magic_quotes_gpc 1&lt;br /&gt;
 php_flag magic_quotes_runtime 0&lt;br /&gt;
 php_flag file_uploads 1&lt;br /&gt;
 php_flag session.auto_start 0&lt;br /&gt;
 php_flag session.bug_compat_warn 0&lt;br /&gt;
&lt;br /&gt;
You can also do things like define the maximum size for uploaded files:&lt;br /&gt;
&lt;br /&gt;
 LimitRequestBody 0&lt;br /&gt;
 php_value upload_max_filesize 2M&lt;br /&gt;
 php_value post_max_size 2M&lt;br /&gt;
     &lt;br /&gt;
The easiest thing to do is just copy the sample file from lib/htaccess and edit it to suit your needs. It contains further instructions. For example, in a Unix shell:&lt;br /&gt;
&lt;br /&gt;
 cp lib/htaccess .htaccess&lt;br /&gt;
&lt;br /&gt;
=== Creating a database ===&lt;br /&gt;
&lt;br /&gt;
You need to create an empty database (eg &amp;quot;&#039;&#039;moodle&#039;&#039;&amp;quot;) in your database system along with a special user (eg &amp;quot;moodleuser&amp;quot;) that has access to that database (and that database only). You could use the &amp;quot;root&amp;quot; user if you wanted to for a test server, but this is not recommended for a production system: if hackers manage to discover the password then your whole database system would be at risk, rather than just one database.&lt;br /&gt;
&lt;br /&gt;
::Bear in mind that currently (as of 1.5.x) Moodle doesn&#039;t work with MySQL 5.x&#039;s new &amp;quot;STRICT_TRANS_TABLES&amp;quot; setting. So if you are using MySQL 5.x, edit MySQL&#039;s configuration file (called &amp;quot;my.ini&amp;quot; in Windows and &amp;quot;my.cnf&amp;quot; on Unix/Linux) and comment out that option (or simply delete it). You have to restart MySQL after changing this setting.&lt;br /&gt;
&lt;br /&gt;
If you are using a webhost, they will probably have a control panel web interface for you to create your database.&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;Cpanel&#039;&#039;&#039; system is one of the most popular of these. To create a database in Cpanel,&lt;br /&gt;
&lt;br /&gt;
# Click on the &amp;quot;&#039;&#039;&#039;MySQL Databases&#039;&#039;&#039;&amp;quot; icon.&lt;br /&gt;
# Type &amp;quot;moodle&amp;quot; in the database field and click &amp;quot;&#039;&#039;&#039;Add Database&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
# Type a username and password (not one you use elsewhere) in the respective fields and click &amp;quot;&#039;&#039;&#039;Add User&#039;&#039;&#039;&amp;quot;.&lt;br /&gt;
# Now use the &amp;quot;&#039;&#039;&#039;Add User to Database&#039;&#039;&#039;&amp;quot; button to give this new user account &amp;quot;&#039;&#039;&#039;ALL&#039;&#039;&#039;&amp;quot; rights to the new database.&lt;br /&gt;
# Note that the username and database names may be prefixed by your Cpanel account name. When entering this information into the Moodle installer - use the full names.&lt;br /&gt;
&lt;br /&gt;
If you have access to Unix command lines then you can do the same sort of thing by typing commands.&lt;br /&gt;
&lt;br /&gt;
Here are some example Unix command lines for MySQL (the red part is for Moodle 1.6 and later, leave it out for Moodle 1.5.x or earlier):&lt;br /&gt;
&lt;br /&gt;
   # mysql -u root -p&lt;br /&gt;
   &amp;gt; CREATE DATABASE moodle &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci&amp;lt;/font&amp;gt;; &lt;br /&gt;
   &amp;gt; GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,INDEX,ALTER ON moodle.*&lt;br /&gt;
           TO moodleuser@localhost IDENTIFIED BY &#039;yourpassword&#039;; &lt;br /&gt;
   &amp;gt; quit &lt;br /&gt;
   # mysqladmin -p reload&lt;br /&gt;
&lt;br /&gt;
If you are using MySQL 4.0.2 or later, you need to specify CREATE TEMPORARY TABLES as well in the GRANT statement:&lt;br /&gt;
&lt;br /&gt;
   &amp;gt; GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,CREATE TEMPORARY TABLES,&lt;br /&gt;
           DROP,INDEX,ALTER ON moodle.* &lt;br /&gt;
           TO moodleuser@localhost IDENTIFIED BY &#039;yourpassword&#039;; &lt;br /&gt;
&lt;br /&gt;
And some example command lines for PostgreSQL:&lt;br /&gt;
&lt;br /&gt;
   # su - postgres&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;create user moodleuser createdb;&amp;quot; template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;create database moodle &amp;lt;font color=&amp;quot;red&amp;quot;&amp;gt;with encoding &#039;unicode&#039;&amp;lt;/font&amp;gt;;&amp;quot; -U moodleuser template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;alter user moodleuser nocreatedb;&amp;quot; template1&lt;br /&gt;
   &amp;gt; psql -c &amp;quot;alter user moodleuser with encrypted password &#039;yourpassword&#039;;&amp;quot; template1&lt;br /&gt;
   &amp;gt; su - root&lt;br /&gt;
   # /etc/init.d/postgresql reload&lt;br /&gt;
&lt;br /&gt;
=== Creating a data directory ===&lt;br /&gt;
&lt;br /&gt;
Moodle will also need some space on your server&#039;s hard disk to store uploaded files, such as course documents and user pictures.&lt;br /&gt;
&lt;br /&gt;
The Moodle installer tries hard to create this directory for you but if it fails then you will have to create a directory for this purpose manually.&lt;br /&gt;
&lt;br /&gt;
For security, it&#039;s best that this directory is NOT accessible directly via the web. The easiest way to do this is to simply locate it OUTSIDE the web directory, but if you must have it in the web directory then protect it by creating a file in the data directory called .htaccess, containing this line:&lt;br /&gt;
&lt;br /&gt;
 deny from all&lt;br /&gt;
&lt;br /&gt;
To make sure that Moodle can save uploaded files in this directory, check that the web server software (eg Apache) has permission to read, write and execute in this directory.&lt;br /&gt;
&lt;br /&gt;
On Unix machines, this means setting the owner of the directory to be something like &amp;quot;nobody&amp;quot; or &amp;quot;apache&amp;quot;, and then giving that user read, write and execute permissions.&lt;br /&gt;
&lt;br /&gt;
To do this you could use:&lt;br /&gt;
chown -R nobody:nobody moodledata&lt;br /&gt;
&lt;br /&gt;
Remember by default, mysql won&#039;t accept moodle data directories created under ROOT.&lt;br /&gt;
&lt;br /&gt;
On Cpanel systems you can use the &amp;quot;File Manager&amp;quot; to find the folder, click on it, then choose &amp;quot;Change Permissions&amp;quot;. On many shared hosting servers, you will probably need to restrict all file access to your &amp;quot;group&amp;quot; (to prevent other webhost customers from looking at or changing your files), but provide full read/write access to everyone else (which will allow the web server to access your files).&lt;br /&gt;
&lt;br /&gt;
Speak to your server administrator if you are having trouble setting this up securely. In particular some sites that use a PHP feature known as &amp;quot;Safe Mode&amp;quot; may &#039;&#039;require&#039;&#039; the administrator to create this directory properly for you.&lt;br /&gt;
&lt;br /&gt;
== Go to the admin page to continue configuration ==&lt;br /&gt;
&lt;br /&gt;
Once the basic config.php has been correctly created in the previous step, trying to access the front page of your site will take you the &amp;quot;admin&amp;quot; page for the rest of the configuration.&lt;br /&gt;
&lt;br /&gt;
The first time you access this admin page, you will be presented with a GPL &amp;quot;shrinkwrap&amp;quot; agreement with which you must agree before you can continue with the setup.&lt;br /&gt;
&lt;br /&gt;
Now Moodle will start setting up your database and creating tables to store data. Firstly, the main database tables are created. You should see a number of SQL statements followed by status messages (in green or red) that look like this:&lt;br /&gt;
&lt;br /&gt;
{| border=1&lt;br /&gt;
|&amp;lt;nowiki&amp;gt;CREATE TABLE course ( id int(10) unsigned NOT NULL auto_increment, category int(10) unsigned NOT NULL default &#039;0&#039;, password varchar(50) NOT NULL default &#039;&#039;, fullname varchar(254) NOT NULL default &#039;&#039;, shortname varchar(15) NOT NULL default &#039;&#039;, summary text NOT NULL, format tinyint(4) NOT NULL default &#039;1&#039;, teacher varchar(100) NOT NULL default &#039;Teacher&#039;, startdate int(10) unsigned NOT NULL default &#039;0&#039;, enddate int(10) unsigned NOT NULL default &#039;0&#039;, timemodified int(10) unsigned NOT NULL default &#039;0&#039;, PRIMARY KEY (id)) TYPE=MyISAM&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;SUCCESS&amp;lt;/font&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
...and so on, followed by: &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;Main databases set up successfully.&amp;lt;/font&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see these, then there must have been some problem with the database or the configuration settings you defined in config.php. Check that PHP isn&#039;t in a restricted &amp;quot;Safe Mode&amp;quot; (commercial web hosts sometimes have safe mode turned on). You can check PHP variables by creating a little file containing &#039;&#039;&#039;&amp;lt;?php phpinfo() ?&amp;gt;&#039;&#039;&#039; and looking at it through a browser. Check all these and try this page again.&lt;br /&gt;
&lt;br /&gt;
Scroll down the very bottom of the page and press the &amp;quot;Continue&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
You should now see a form where you can define more configuration variables for your installation, such as the default language, SMTP hosts and so on. Don&#039;t worry too much about getting everything right just now - you can always come back and edit these later on using the admin interface. The defaults are designed to be useful and secure for most sites. Scroll down to the bottom and click &amp;quot;Save changes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
If (and only if) you find yourself getting stuck on this page, unable to continue, then your server probably has what I call the &amp;quot;buggy referrer&amp;quot; problem. This is easy to fix: just turn off the &amp;quot;secureforms&amp;quot; setting, then try to continue again.&lt;br /&gt;
&lt;br /&gt;
Next you will see more pages that print lots of status messages as they set up all the tables required by the various Moodle module. As before, they should all be &amp;lt;font color=&amp;quot;green&amp;quot;&amp;gt;green&amp;lt;/font&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Scroll down the very bottom of the page and press the &amp;quot;Continue&amp;quot; link.&lt;br /&gt;
&lt;br /&gt;
The next page is a form where you can define parameters for your Moodle site and the front page, such as the name, format, description and so on. Fill this out (you can always come back and change these later) and then press &amp;quot;Save changes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Finally, you will then be asked to create a top-level administration user for future access to the admin pages. Fill out the details with your own name, email etc and then click &amp;quot;Save changes&amp;quot;. Not all the fields are required, but if you miss any important fields you&#039;ll be re-prompted for them.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Make sure you remember the username and password you chose for the administration user account, as they will be necessary to access the administration page in future.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
(If for any reason your install is interrupted, or there is a system error of some kind that prevents you from logging in using the admin account, you can usually log in using the default username of &amp;quot;&#039;&#039;&#039;admin&#039;&#039;&#039;&amp;quot;, with password &amp;quot;&#039;&#039;&#039;admin&#039;&#039;&#039;&amp;quot;.)&lt;br /&gt;
&lt;br /&gt;
Once successful, you will be returned to the home page of your new site! Note the administration links that appear down the left hand side of the page (these items also appear on a separate Admin page) - these items are only visible to you because you are logged in as the admin user. All your further administration of Moodle can now be done using this menu, such as:&lt;br /&gt;
&lt;br /&gt;
* creating and deleting courses&lt;br /&gt;
* creating and editing user accounts&lt;br /&gt;
* administering teacher accounts&lt;br /&gt;
* changing site-wide settings like themes etc&lt;br /&gt;
&lt;br /&gt;
But you are not done installing yet! There is one very important thing still to do (see the next section on cron).&lt;br /&gt;
&lt;br /&gt;
== Set up cron ==&lt;br /&gt;
&lt;br /&gt;
Please refer to the [[Cron|cron instructions]].&lt;br /&gt;
&lt;br /&gt;
== Create a new course ==&lt;br /&gt;
&lt;br /&gt;
Now that Moodle is running properly, you can try creating a new course to play with.&lt;br /&gt;
&lt;br /&gt;
Select &amp;quot;Create a new course&amp;quot; from the Admin page (or the admin links on the home page).&lt;br /&gt;
&lt;br /&gt;
Fill out the form, paying special attention to the course format. You don&#039;t have to worry about the details too much at this stage, as everything can be changed later by the teacher. Note that the yellow help icons are everywhere to provide contextual help on any aspect.&lt;br /&gt;
&lt;br /&gt;
Press &amp;quot;Save changes&amp;quot;, and you will be taken to a new form where you can assign teachers to the course. You can only add existing user accounts from this form - if you want to create a new teacher account then either ask the teacher to create one for themselves (see the login page), or create one for them using the &amp;quot;Add a new user&amp;quot; on the Admin page.&lt;br /&gt;
&lt;br /&gt;
Once done, the course is ready to customise, and is accessible via the &amp;quot;Courses&amp;quot; link on the home page.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
&lt;br /&gt;
* [[Installation FAQ]]&lt;br /&gt;
* [[Installing Apache, MySQL and PHP]]&lt;br /&gt;
* [[Upgrading Moodle]]&lt;br /&gt;
* [[Windows installation|Windows installation]]&lt;br /&gt;
* [[RedHat Linux installation|Step by Step Installation Guide for RedHat]]&lt;br /&gt;
* [[Debian GNU/Linux installation|Step by Step Installation Guide for Debian GNU/Linux]]&lt;br /&gt;
* Using Moodle [http://moodle.org/mod/forum/discuss.php?d=42688 Selecting a webhost for Moodle] forum discussion&lt;br /&gt;
* [[masquerading]] - Running Moodle behind a masquerading/NAT firewall&lt;br /&gt;
&lt;br /&gt;
[[Category:Core]]&lt;br /&gt;
[[Category:Administrator]]&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:Instalación de moodle]]&lt;br /&gt;
[[fr:Installation de Moodle]]&lt;br /&gt;
[[nl:Installatiegids]]&lt;br /&gt;
[[ja:Moodleのインストール]]&lt;br /&gt;
[[zh:安装Moodlezh:]]&lt;/div&gt;</summary>
		<author><name>Timtak</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/36/en/index.php?title=Installation_FAQ&amp;diff=16839</id>
		<title>Installation FAQ</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/36/en/index.php?title=Installation_FAQ&amp;diff=16839"/>
		<updated>2006-10-09T07:44:58Z</updated>

		<summary type="html">&lt;p&gt;Timtak: gave a link to the summary I made of session path problems and solutions&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{FAQ}}&lt;br /&gt;
&lt;br /&gt;
==Any text I add with an apostrophe (&#039;) or a quote (&amp;quot;) causes errors or comes up with a slash added==&lt;br /&gt;
&lt;br /&gt;
Problems caused by apostrophes are caused by incorrect &amp;quot;magic quotes&amp;quot; settings. Moodle requires the following settings (which are usually the default):&lt;br /&gt;
&lt;br /&gt;
 magic_quotes_gpc = On&lt;br /&gt;
 magic_quotes_runtime = Off&lt;br /&gt;
&lt;br /&gt;
Please see [[Installing Moodle]] for more details.&lt;br /&gt;
&lt;br /&gt;
==Email copies are not being sent from my forums==&lt;br /&gt;
&lt;br /&gt;
You &#039;&#039;must&#039;&#039; set up cron properly if you want Moodle to send out automatic email from forums, assignments etc. This same process also performs a number of clean-up tasks such as deleting old unconfirmed users, unenrolling old students and so on.&lt;br /&gt;
&lt;br /&gt;
Basically, you need to set up a process to regularly call the script &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;http://yoursite/admin/cron.php&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;. Please refer to the [[Cron|cron instructions]].&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Tip:&#039;&#039;&#039; Try the default setting in Moodle variables page. Leave the smtphost blank. This will be acceptable for the majority of users.&lt;br /&gt;
&lt;br /&gt;
==Error: database connection failed==&lt;br /&gt;
&lt;br /&gt;
If you get errors like &amp;quot;database connection failed&amp;quot; or &amp;quot;could not connect to the database you specified&amp;quot;, here are some possible reasons and some possible solutions.&lt;br /&gt;
&lt;br /&gt;
# Your database server isn&#039;t installed or running. To check this for MySQL try typing the following command line &amp;lt;code&amp;gt;telnet database_host_name 3306&amp;lt;/code&amp;gt;. You should get a cryptic response which includes the version number of the MySQL server.&lt;br /&gt;
# You don&#039;t have the PHP mysql or postgresql extensions installed (please refer to FAQ re. whether PHP is installed).&lt;br /&gt;
# You haven&#039;t created a database for Moodle and assigned a user with the correct privileges to access it. Or the database name, database user or database user password in your Moodle configuration file &#039;&#039;config.php&#039;&#039; are incorrect. Use phpMyAdmin to set up and check your MySQL installation.&lt;br /&gt;
# You are using MySQL version 4.1 or higher, whose default password hashing algorithm is incompatible with that available in PHP versions 4.x.x. See http://dev.mysql.com/doc/mysql/en/old-client.html for further information on how to deal with this.&lt;br /&gt;
# You are using Fedora core 3 or some other Linux system with SELinux installed and enabled. See the following URL for information on how to disable SELinux: http://fedora.redhat.com/projects/selinux/&lt;br /&gt;
&lt;br /&gt;
==I can&#039;t log in - I just stay stuck on the login screen==&lt;br /&gt;
&lt;br /&gt;
The most common cause for this is that your own computer (not your Moodle server) has a firewall that is stripping referrer information from the browser. Here are some instructions for fixing [http://service1.symantec.com/SUPPORT/nip.nsf/46f26a2d6dafb0a788256bc7005c3fa3/b9b47ad7eddd343b88256c6b006a85a8?OpenDocument&amp;amp;src=bar_sch_nam Norton firewall products].&lt;br /&gt;
&lt;br /&gt;
The server admin can also fix this for everyone by changing the &#039;&#039;secureforms&#039;&#039; variable to &#039;No&#039; in the security section of Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[admin/config|Variables]].&lt;br /&gt;
&lt;br /&gt;
Another possible cause of this problem is that sessions are not configured properly on the server. You can test this by calling the script &amp;lt;nowiki&amp;gt;http://yourserver/moodle/lib/session-test.php&amp;lt;/nowiki&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==I keep getting this error: Failed opening required &#039;/web/moodle/lib/setup.php&#039;==&lt;br /&gt;
&lt;br /&gt;
In your &#039;&#039;config.php&#039;&#039;, the setting that you use for the dirroot variable must be the complete path from the root of your server&#039;s hard drive.&lt;br /&gt;
&lt;br /&gt;
Sometimes people only use the path from their home directory, or relative to the root of the web server directory.&lt;br /&gt;
&lt;br /&gt;
==I login but the login link doesn&#039;t change. I am logged in and can navigate freely.==&lt;br /&gt;
&lt;br /&gt;
Make sure the URL in your &amp;lt;code&amp;gt;$CFG-&amp;gt;wwwroot&amp;lt;/code&amp;gt; setting is exactly the same as the one you are actually using to access the site.&lt;br /&gt;
&lt;br /&gt;
==My pages show fatal errors such as : Parse error, call to undefined function: get_string()==&lt;br /&gt;
&lt;br /&gt;
If you see errors like:&lt;br /&gt;
&lt;br /&gt;
 Parse error: parse error, unexpected T_VARIABLE in c:\program files\easyphp\www\moodle\config.php on line 94 Fatal error: Call to undefined function: get_string() in c:\program files\easyphp\www\moodle\mod\resource\lib.php on line 11&lt;br /&gt;
&lt;br /&gt;
then you have probably left out a semi-colon or closing quote from a line in &#039;&#039;config.php&#039;&#039; (previous to line 94).&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another possibility is that you edited &#039;&#039;config.php&#039;&#039; in a program like Word and saved it as a HTML web page, instead of using a plain text editor like Notepad.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another thing to check, particularly if you are using 3rd party modules or plugins, is whether any of the php scripts use short open tags (&amp;lt;? ?&amp;gt;) instead of proper ones (&amp;lt;?php ?&amp;gt;). Short tags are bad for various reasons, so first contact the author of that extension to tell them about the problem. Then either replace short tags with conventional ones, or set this line in php.ini:&lt;br /&gt;
&lt;br /&gt;
 short_open_tag = On&lt;br /&gt;
&lt;br /&gt;
You should never find short tags in core moodle code. If you do, please file a bug in the bug tracker.&lt;br /&gt;
&lt;br /&gt;
==PHP - is it installed and what version do I have?==&lt;br /&gt;
&lt;br /&gt;
Make a new file on your web site called &#039;&#039;info.php&#039;&#039;, containing the following text, and call it from your browser:&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;?PHP phpinfo() ?&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If nothing happens then you don&#039;t have PHP installed. See the installation docs for some information about where to download it for your computer.&lt;br /&gt;
&lt;br /&gt;
==Serious Error! Could not set up the site!==&lt;br /&gt;
&lt;br /&gt;
Please refer to the Using Moodle forum discussion [http://moodle.org/mod/forum/discuss.php?d=32071 Serious Error! Could not set up the site!].&lt;br /&gt;
&lt;br /&gt;
==Uploaded files give &amp;quot;File not found&amp;quot;==&lt;br /&gt;
&lt;br /&gt;
For example: Not Found: The requested URL /moodle/file.php/2/myfile.jpg was not found on this server.&lt;br /&gt;
&lt;br /&gt;
Your web server needs to be configured to allow the part of the URL after a script name to be passed directly to the script. This is usually enabled in Apache 1, but is usually disabled by default in Apache 2. To turn it on, add this line to your &#039;&#039;httpd.conf&#039;&#039;, or to a &#039;&#039;.htaccess&#039;&#039; file in your local directory (see [[Installing Moodle]] for more details):&lt;br /&gt;
&lt;br /&gt;
 &#039;&#039;&#039;AcceptPathInfo&#039;&#039;&#039; on&lt;br /&gt;
&lt;br /&gt;
Note, this will ONLY work for Apache versions 2.x.&lt;br /&gt;
&lt;br /&gt;
If you are not using Apache 2 and you still have this problem (unlikely) then you can switch Moodle to use an alternative method. The disadvantages are a slight loss of performance for your users and you won&#039;t be able to use relative links within HTML resources.&lt;br /&gt;
&lt;br /&gt;
To use this alternative method, you should change the &#039;&#039;slasharguments&#039;&#039; variable in the Operating System section of Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[admin/config|Variables]]. You should now be able to access your uploaded files.&lt;br /&gt;
&lt;br /&gt;
==When I go to the admin page, I get told to make dirroot blank!==&lt;br /&gt;
&lt;br /&gt;
If you see errors like this:&lt;br /&gt;
&lt;br /&gt;
 Please fix your settings in config.php: You have: $CFG-&amp;gt;dirroot = &amp;quot;/home/users/fred/public_html/moodle&amp;quot;; but it should be: $CFG-&amp;gt;dirroot = &amp;quot;&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
then you have encountered a small bug that occurs on some servers. The problem is with the error-checking mechanism, not with your actual path. To fix it, find this line (line 66) in the file &#039;&#039;admin/index.php&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
 if ($dirroot != $CFG-&amp;gt;dirroot) {&lt;br /&gt;
&lt;br /&gt;
and change it to this:&lt;br /&gt;
&lt;br /&gt;
 if (!empty($dirroot) and $dirroot != $CFG-&amp;gt;dirroot) {&lt;br /&gt;
&lt;br /&gt;
==When trying to add a resource I receive error messages==&lt;br /&gt;
&lt;br /&gt;
Assuming you are using Apache, then it&#039;s quite likely that your setting in &#039;&#039;config.php&#039;&#039; for &amp;lt;code&amp;gt;$CFG-&amp;gt;wwwroot&amp;lt;/code&amp;gt; is different from the actual URL you are using to access the site. Also try turning off the &#039;&#039;secureforms&#039;&#039; variable in the security section of Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[admin/config|Variables]].&lt;br /&gt;
&lt;br /&gt;
==Why are all my pages blank?==&lt;br /&gt;
&lt;br /&gt;
Check the dirroot variable in &#039;&#039;config.php&#039;&#039;. You must use complete, absolute pathnames e.g.&lt;br /&gt;
&lt;br /&gt;
 $CFG-&amp;gt;dirroot = &amp;quot;d:\inetpub\sites\www.yoursite.com\web\moodle&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
Another reason might be that PHP has not been configured to support MySQL. This is common on Redhat and OpenBSD installations. In this case, an error is generated, but since error displays are often disabled by default, all that is seen on the browser is a blank screen. To enable PHP error displays, set these lines in your &#039;&#039;php.ini&#039;&#039; file and reload the web page.&lt;br /&gt;
&lt;br /&gt;
 display_errors = On&lt;br /&gt;
 display_startup_errors = On&lt;br /&gt;
&lt;br /&gt;
To determine if MySQL support is your problem, insert this as the second line in your &#039;&#039;config.php&#039;&#039; file&lt;br /&gt;
&lt;br /&gt;
 phpinfo();&lt;br /&gt;
&lt;br /&gt;
then reload the web page. Examine the output closely to see if MySQL is supported. If not look for a package you are missing.&lt;br /&gt;
&lt;br /&gt;
== Why is a particular page blank or incomplete? ==&lt;br /&gt;
&lt;br /&gt;
Check your web server log files!!&lt;br /&gt;
&lt;br /&gt;
If a particular page is blank or incomplete (it doesn&#039;t display the footer), before you do anything else check your error logs.&lt;br /&gt;
&lt;br /&gt;
PHP can be set up to log errors in a variety of different ways. These settings are contained in the php.ini file on the server. If you don&#039;t know were that is, edit your Moodle &#039;&#039;config.php&#039;&#039; and add the following as the second line&lt;br /&gt;
&lt;br /&gt;
  phpinfo();&lt;br /&gt;
&lt;br /&gt;
then reload the web page. Look for the entry &#039;&#039;&#039;Configuration File (php.ini) Path&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
When you have located php.ini open it in your favorite text editor. Find the &#039;&#039;&#039;Error handling and logging&#039;&#039;&#039; section of the php.ini file. Make sure that both &#039;&#039;&#039;display_errors = On&#039;&#039;&#039; and &#039;&#039;&#039;log_errors = On&#039;&#039;&#039; are present and uncommented. Check the value of &#039;&#039;&#039;error_log&#039;&#039;&#039; - this tells you the location of the file errors are logged to. If it is commented out then errors will be sent to the web server error log file. Remember, if you make any changes to this file you will need to restart the web server (or just reboot the server).&lt;br /&gt;
&lt;br /&gt;
Having established that logging is working, reproduce the error. Immediately check the error log file right at the end. Hopefully you will see a PHP error message at or very near the end of the file. This may solve your problem directly or makes it a lot easier to diagnose the problem in the Moodle forums.&lt;br /&gt;
&lt;br /&gt;
==Why can&#039;t I upload a new image into my profile?==&lt;br /&gt;
&lt;br /&gt;
If you don&#039;t see anything on your user profile pages to let you upload user images then it&#039;s usually because GD is not enabled on your server. GD is a library that allows image processing.&lt;br /&gt;
&lt;br /&gt;
1. Make sure GD has been included in your PHP installation. You can check this by going into Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[Variables]] and looking for the gdversion setting. This setting is chosen automatically every time you visit that page. If it shows GD version 1 or version 2 then everything should be fine. Save that configuration page and go back to your user profile.&lt;br /&gt;
&lt;br /&gt;
2. If Moodle thinks GD is not installed, then you will need to install it. On Windows this is usually a matter of &amp;quot;turning on&amp;quot; the module in PHP (see the [[Installing AMP|installation instructions]] for help). On Unix you may need to re-compile PHP with arguments something like this:&lt;br /&gt;
&lt;br /&gt;
 ./configure --with-apxs=/usr/local/apache/bin/apxs --with-xml --with-gd --with-jpeg-dir=/usr/local --with-png-dir=/usr --with-ttf --enable-gd-native-ttf --enable-magic-quotes --with-mysql --enable-sockets --enable-track-vars --enable-versioning --with-zlib&lt;br /&gt;
3. Remember to re-visit the Moodle configuration page after making any changes to PHP so it can pick up the correct version of GD.&lt;br /&gt;
&lt;br /&gt;
Please see the Using Moodle forum discussion [http://moodle.org/mod/forum/discuss.php?d=44271 Profile pictures] for additional information.&lt;br /&gt;
&lt;br /&gt;
==Why do I keep getting error messages about &amp;quot;headers already sent&amp;quot;?==&lt;br /&gt;
&lt;br /&gt;
If you see errors like this:&lt;br /&gt;
&lt;br /&gt;
 Warning: Cannot add header information - headers already sent by (output started at /webs/moodle/config.php:87) in /webs/moodle/lib/moodlelib.php on line 1322 Warning: Cannot add header information - headers already sent by (output started at /webs/moodle/config.php:87) in /webs/moodle/lib/moodlelib.php on line 1323 Warning: Cannot add header information - headers already sent by (output started at /webs/moodle/config.php:87) in /webs/moodle/login/index.php on line 54&lt;br /&gt;
&lt;br /&gt;
you have blank lines or spaces after the final &amp;lt;code&amp;gt;?&amp;gt;&amp;lt;/code&amp;gt; in your &#039;&#039;config.php&#039;&#039; file. Sometimes text editors add these - for example Notepad on Windows - so you may have to try a different text editor to remove these spaces or blank lines completely.&lt;br /&gt;
&lt;br /&gt;
== Why doesn&#039;t my Moodle site display the time and date correctly? ==&lt;br /&gt;
&lt;br /&gt;
Each language requires a specific language code (called a &#039;&#039;&#039;locale&#039;&#039;&#039; code) to allow dates to be displayed correctly. The language packs contain default standard codes, but sometimes these don&#039;t work on Windows servers.&lt;br /&gt;
&lt;br /&gt;
You can find the correct locale codes for Windows on these two pages: [http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_language_strings.asp Language codes] and [http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_country_strings.asp Country/region] codes (e.g. &amp;quot;esp_esp&amp;quot; for spanish)&lt;br /&gt;
&lt;br /&gt;
These new locale codes can be entered on the Administration &amp;gt;&amp;gt; Configuration &amp;gt;&amp;gt; [[admin/config|Variables]] page, where they override the ones in the currently chosen language pack.&lt;br /&gt;
&lt;br /&gt;
==I can&#039;t Login with message &amp;quot;Please verify that the current setting of session.save_path is correct&amp;quot; ==&lt;br /&gt;
[http://moodle.org/mod/forum/discuss.php?d=55925#254596 See this Using Moodle Forum Summary]&lt;br /&gt;
&lt;br /&gt;
[[Category:Core]]&lt;br /&gt;
[[Category:Administrator]]&lt;br /&gt;
[[Category:FAQ]]&lt;br /&gt;
[[Category:Installation]]&lt;br /&gt;
&lt;br /&gt;
[[es:FAQ Instalación]]&lt;br /&gt;
[[fr:FAQ d&#039;installation]]&lt;br /&gt;
[[nl:Installatie FAQ]]&lt;br /&gt;
[[ja:インストールFAQ]]&lt;/div&gt;</summary>
		<author><name>Timtak</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/36/en/index.php?title=Building_Quiz&amp;diff=9573</id>
		<title>Building Quiz</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/36/en/index.php?title=Building_Quiz&amp;diff=9573"/>
		<updated>2006-05-13T17:36:13Z</updated>

		<summary type="html">&lt;p&gt;Timtak: /* Adding questions to a quiz */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Quizzes}}&lt;br /&gt;
&lt;br /&gt;
On the quiz editing screen you’ll create and categorize your quiz questions and then add them to the quiz. What you will see on this screen depends on whether students have already started attempts at the quiz. &lt;br /&gt;
&lt;br /&gt;
==Before quiz has been attempted==&lt;br /&gt;
On the left side of the screen you’ll see a block where the questions you’ve added to the current quiz are displayed.  If this is a new quiz you will not have any questions there and Moodle tells you this.&lt;br /&gt;
&lt;br /&gt;
On the right side of the screen, you’ll see the question editing block. This is where you can add new questions, edit existing questions, or move questions between categories. This is explained on the page [[Questions]].&lt;br /&gt;
&lt;br /&gt;
===Adding questions to a quiz===&lt;br /&gt;
Once you’ve created your questions, you’ll need to add them to the quiz. There are many different [[Question types]] that you can use. The quiz editing page will now look something like that displayed in Figure 5-12.&lt;br /&gt;
&lt;br /&gt;
The chevrons (&amp;lt;&amp;lt; icons) to the left of the questions are used to add individual questions to the quiz (Fig 5-12:4a). You can also select several questions using the checkboxes on the left of the question list and then click the “Add to quiz” button at the bottom of the list to add then all at once (Fig 5-12:4b). If you want to add all the displayed questions then use the &#039;Select all&#039; link (Fig 5-12:4c).&lt;br /&gt;
[[Image:Quiz.gif|frame|left|This shows four methods of adding questions including adding random questions dealt with in more detail below]]&amp;lt;br style=&amp;quot;clear:both;&amp;quot;&amp;gt;&lt;br /&gt;
Figure 5-12.  Quiz Editing Screen&lt;br /&gt;
&lt;br /&gt;
Once you’ve added a question to the quiz, it appears on the left side of the screen in the quiz question list. The question is still selectable on the right, but you can only add it to the quiz once. If you select the question in the category list again and add it to the quiz, nothing will happen.&lt;br /&gt;
&lt;br /&gt;
Once you’ve added the questions to the quiz, you can change the order of the questions by clicking the arrow buttons on the left side of the list of quiz questions (see Figure 5-13).&lt;br /&gt;
 &lt;br /&gt;
Figure 5-13. Editing Quiz with Questions&lt;br /&gt;
&lt;br /&gt;
You will also need to set the grade for each question. You can set the number of points for each question in the Grade column. This allows you to set the relative weight of each question in the quiz. You may want to make certain questions or question types worth more than others. You should also set the &#039;Maximum grade&#039; for the whole quiz. This does not have to be equal to the sum of the grades for the individual questions. The grades achieved by the students will be rescaled to be out of this maximum grade. After adjusting the grades for the individual questions you should click on the &#039;Save grades&#039; button.&lt;br /&gt;
&lt;br /&gt;
===Adding random questions===&lt;br /&gt;
&lt;br /&gt;
When you add a random question to a quiz, then it will be replaced with a randomly-chosen question from the currently selected category - for each attempt.&lt;br /&gt;
&lt;br /&gt;
This means that different students are likely to get a different selection of questions when they attempt this quiz. When a quiz allows multiple attempts for each student then each attempt will also contain a new selection of questions.&lt;br /&gt;
&lt;br /&gt;
The same question will never appear twice in a quiz. If you include several random questions then different questions will always be chosen for each of them. If you mix random questions with non-random questions then the random questions will be chosen so that they do not duplicate one of the non-random questions.&lt;br /&gt;
&lt;br /&gt;
The grade for the randomly chosen question will be rescaled so that the maximum grade is what you have chosen as the grade for the random question.&lt;br /&gt;
&lt;br /&gt;
[[Image:Random.gif|frame|left|note that the menu for adding random questions is found below the questions on the right-hand side of the screen]]&amp;lt;br style=&amp;quot;clear:both;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Previewing questions===&lt;br /&gt;
Clicking on the magnifying glass next to a question will open a preview window in which you can test the question. ....&lt;br /&gt;
&lt;br /&gt;
When you’re done, you will probably also want to preview your entire quiz by clicking on the &#039;&#039;&#039;Preview&#039;&#039;&#039; tab. This will bring you to the [[mod/quiz/attempt|Quiz attempt]] page but in teacher preview mode.&lt;br /&gt;
&lt;br /&gt;
==After quiz has been attempted==&lt;br /&gt;
If the quiz has already been attempted you will see a notice saying that you cannot add or remove questions. You can, however, delete the quiz attempts (you access them clicking &#039;&#039;View x quiz attempts (y Students)&#039;&#039;, where &#039;x&#039; stands for the number of attempts by &#039;y&#039; students) and will then again be able to add or delete questions as explained above. The reason you can not do this when there are already attempts is that this would lead to confusion, both on the part of the student and on the part of Moodle itself which would not be able to interpret the student responses that have already been saved.&lt;br /&gt;
&lt;br /&gt;
You can still edit questions and you can change the grade for questions. So instead of deleting a bad question you can edit it to explain the situation to the student and then you can set the grade for the question to zero. After you make such changes you should regrade the quiz by clicking on the &#039;&#039;&#039;Results&#039;&#039;&#039; tab and then the &#039;&#039;&#039;Regrade&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{excerpted from Jason Cole}}&lt;br /&gt;
[[Category:Teacher]]&lt;br /&gt;
[[Category:Quiz]]&lt;/div&gt;</summary>
		<author><name>Timtak</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/36/en/index.php?title=Building_Quiz&amp;diff=9572</id>
		<title>Building Quiz</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/36/en/index.php?title=Building_Quiz&amp;diff=9572"/>
		<updated>2006-05-13T17:19:07Z</updated>

		<summary type="html">&lt;p&gt;Timtak: /* Adding questions to a quiz */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Quizzes}}&lt;br /&gt;
&lt;br /&gt;
On the quiz editing screen you’ll create and categorize your quiz questions and then add them to the quiz. What you will see on this screen depends on whether students have already started attempts at the quiz. &lt;br /&gt;
&lt;br /&gt;
==Before quiz has been attempted==&lt;br /&gt;
On the left side of the screen you’ll see a block where the questions you’ve added to the current quiz are displayed.  If this is a new quiz you will not have any questions there and Moodle tells you this.&lt;br /&gt;
&lt;br /&gt;
On the right side of the screen, you’ll see the question editing block. This is where you can add new questions, edit existing questions, or move questions between categories. This is explained on the page [[Questions]].&lt;br /&gt;
&lt;br /&gt;
===Adding questions to a quiz===&lt;br /&gt;
Once you’ve created your questions, you’ll need to add them to the quiz. There are many different [[Question types]] that you can use. The quiz editing page will now look something like that displayed in Figure 5-12.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;&amp;lt; icons to the left of the questions are used to add individual questions to the quiz. You can also select several questions using the checkboxes on the left of the question list and then click the “Add to quiz” button at the bottom of the list to add then all at once. If you want to add all the displayed questions then use the &#039;Select all&#039; link.&lt;br /&gt;
[[Image:Quiz.gif|frame|left|This shows four methods of adding questions including adding random questions dealt with in more detail below]]&amp;lt;br style=&amp;quot;clear:both;&amp;quot;&amp;gt;&lt;br /&gt;
Figure 5-12.  Quiz Editing Screen&lt;br /&gt;
&lt;br /&gt;
Once you’ve added a question to the quiz, it appears on the left side of the screen in the quiz question list. The question is still selectable on the right, but you can only add it to the quiz once. If you select the question in the category list again and add it to the quiz, nothing will happen.&lt;br /&gt;
&lt;br /&gt;
Once you’ve added the questions to the quiz, you can change the order of the questions by clicking the arrow buttons on the left side of the list of quiz questions (see Figure 5-13).&lt;br /&gt;
 &lt;br /&gt;
Figure 5-13. Editing Quiz with Questions&lt;br /&gt;
&lt;br /&gt;
You will also need to set the grade for each question. You can set the number of points for each question in the Grade column. This allows you to set the relative weight of each question in the quiz. You may want to make certain questions or question types worth more than others. You should also set the &#039;Maximum grade&#039; for the whole quiz. This does not have to be equal to the sum of the grades for the individual questions. The grades achieved by the students will be rescaled to be out of this maximum grade. After adjusting the grades for the individual questions you should click on the &#039;Save grades&#039; button.&lt;br /&gt;
&lt;br /&gt;
===Adding random questions===&lt;br /&gt;
&lt;br /&gt;
When you add a random question to a quiz, then it will be replaced with a randomly-chosen question from the currently selected category - for each attempt.&lt;br /&gt;
&lt;br /&gt;
This means that different students are likely to get a different selection of questions when they attempt this quiz. When a quiz allows multiple attempts for each student then each attempt will also contain a new selection of questions.&lt;br /&gt;
&lt;br /&gt;
The same question will never appear twice in a quiz. If you include several random questions then different questions will always be chosen for each of them. If you mix random questions with non-random questions then the random questions will be chosen so that they do not duplicate one of the non-random questions.&lt;br /&gt;
&lt;br /&gt;
The grade for the randomly chosen question will be rescaled so that the maximum grade is what you have chosen as the grade for the random question.&lt;br /&gt;
&lt;br /&gt;
[[Image:Random.gif|frame|left|note that the menu for adding random questions is found below the questions on the right-hand side of the screen]]&amp;lt;br style=&amp;quot;clear:both;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Previewing questions===&lt;br /&gt;
Clicking on the magnifying glass next to a question will open a preview window in which you can test the question. ....&lt;br /&gt;
&lt;br /&gt;
When you’re done, you will probably also want to preview your entire quiz by clicking on the &#039;&#039;&#039;Preview&#039;&#039;&#039; tab. This will bring you to the [[mod/quiz/attempt|Quiz attempt]] page but in teacher preview mode.&lt;br /&gt;
&lt;br /&gt;
==After quiz has been attempted==&lt;br /&gt;
If the quiz has already been attempted you will see a notice saying that you cannot add or remove questions. You can, however, delete the quiz attempts (you access them clicking &#039;&#039;View x quiz attempts (y Students)&#039;&#039;, where &#039;x&#039; stands for the number of attempts by &#039;y&#039; students) and will then again be able to add or delete questions as explained above. The reason you can not do this when there are already attempts is that this would lead to confusion, both on the part of the student and on the part of Moodle itself which would not be able to interpret the student responses that have already been saved.&lt;br /&gt;
&lt;br /&gt;
You can still edit questions and you can change the grade for questions. So instead of deleting a bad question you can edit it to explain the situation to the student and then you can set the grade for the question to zero. After you make such changes you should regrade the quiz by clicking on the &#039;&#039;&#039;Results&#039;&#039;&#039; tab and then the &#039;&#039;&#039;Regrade&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{excerpted from Jason Cole}}&lt;br /&gt;
[[Category:Teacher]]&lt;br /&gt;
[[Category:Quiz]]&lt;/div&gt;</summary>
		<author><name>Timtak</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/36/en/index.php?title=Building_Quiz&amp;diff=9571</id>
		<title>Building Quiz</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/36/en/index.php?title=Building_Quiz&amp;diff=9571"/>
		<updated>2006-05-13T17:18:26Z</updated>

		<summary type="html">&lt;p&gt;Timtak: /* Adding questions to a quiz */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Quizzes}}&lt;br /&gt;
&lt;br /&gt;
On the quiz editing screen you’ll create and categorize your quiz questions and then add them to the quiz. What you will see on this screen depends on whether students have already started attempts at the quiz. &lt;br /&gt;
&lt;br /&gt;
==Before quiz has been attempted==&lt;br /&gt;
On the left side of the screen you’ll see a block where the questions you’ve added to the current quiz are displayed.  If this is a new quiz you will not have any questions there and Moodle tells you this.&lt;br /&gt;
&lt;br /&gt;
On the right side of the screen, you’ll see the question editing block. This is where you can add new questions, edit existing questions, or move questions between categories. This is explained on the page [[Questions]].&lt;br /&gt;
&lt;br /&gt;
===Adding questions to a quiz===&lt;br /&gt;
Once you’ve created your questions, you’ll need to add them to the quiz. There are many different [[Question types]] that you can use. The quiz editing page will now look something like that displayed in Figure 5-12.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;&amp;lt; icons to the left of the questions are used to add individual questions to the quiz. You can also select several questions using the checkboxes on the left of the question list and then click the “Add to quiz” button at the bottom of the list to add then all at once. If you want to add all the displayed questions then use the &#039;Select all&#039; link.&lt;br /&gt;
[[Image:Quiz.gif|frame|left|This shows four methods of adding questions including adding random questions dealt with in more detail below]]&amp;lt;br /&amp;gt;&lt;br /&gt;
Figure 5-12.  Quiz Editing Screen&lt;br /&gt;
&lt;br /&gt;
Once you’ve added a question to the quiz, it appears on the left side of the screen in the quiz question list. The question is still selectable on the right, but you can only add it to the quiz once. If you select the question in the category list again and add it to the quiz, nothing will happen.&lt;br /&gt;
&lt;br /&gt;
Once you’ve added the questions to the quiz, you can change the order of the questions by clicking the arrow buttons on the left side of the list of quiz questions (see Figure 5-13).&lt;br /&gt;
 &lt;br /&gt;
Figure 5-13. Editing Quiz with Questions&lt;br /&gt;
&lt;br /&gt;
You will also need to set the grade for each question. You can set the number of points for each question in the Grade column. This allows you to set the relative weight of each question in the quiz. You may want to make certain questions or question types worth more than others. You should also set the &#039;Maximum grade&#039; for the whole quiz. This does not have to be equal to the sum of the grades for the individual questions. The grades achieved by the students will be rescaled to be out of this maximum grade. After adjusting the grades for the individual questions you should click on the &#039;Save grades&#039; button.&lt;br /&gt;
&lt;br /&gt;
===Adding random questions===&lt;br /&gt;
&lt;br /&gt;
When you add a random question to a quiz, then it will be replaced with a randomly-chosen question from the currently selected category - for each attempt.&lt;br /&gt;
&lt;br /&gt;
This means that different students are likely to get a different selection of questions when they attempt this quiz. When a quiz allows multiple attempts for each student then each attempt will also contain a new selection of questions.&lt;br /&gt;
&lt;br /&gt;
The same question will never appear twice in a quiz. If you include several random questions then different questions will always be chosen for each of them. If you mix random questions with non-random questions then the random questions will be chosen so that they do not duplicate one of the non-random questions.&lt;br /&gt;
&lt;br /&gt;
The grade for the randomly chosen question will be rescaled so that the maximum grade is what you have chosen as the grade for the random question.&lt;br /&gt;
&lt;br /&gt;
[[Image:Random.gif|frame|left|note that the menu for adding random questions is found below the questions on the right-hand side of the screen]]&amp;lt;br style=&amp;quot;clear:both;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Previewing questions===&lt;br /&gt;
Clicking on the magnifying glass next to a question will open a preview window in which you can test the question. ....&lt;br /&gt;
&lt;br /&gt;
When you’re done, you will probably also want to preview your entire quiz by clicking on the &#039;&#039;&#039;Preview&#039;&#039;&#039; tab. This will bring you to the [[mod/quiz/attempt|Quiz attempt]] page but in teacher preview mode.&lt;br /&gt;
&lt;br /&gt;
==After quiz has been attempted==&lt;br /&gt;
If the quiz has already been attempted you will see a notice saying that you cannot add or remove questions. You can, however, delete the quiz attempts (you access them clicking &#039;&#039;View x quiz attempts (y Students)&#039;&#039;, where &#039;x&#039; stands for the number of attempts by &#039;y&#039; students) and will then again be able to add or delete questions as explained above. The reason you can not do this when there are already attempts is that this would lead to confusion, both on the part of the student and on the part of Moodle itself which would not be able to interpret the student responses that have already been saved.&lt;br /&gt;
&lt;br /&gt;
You can still edit questions and you can change the grade for questions. So instead of deleting a bad question you can edit it to explain the situation to the student and then you can set the grade for the question to zero. After you make such changes you should regrade the quiz by clicking on the &#039;&#039;&#039;Results&#039;&#039;&#039; tab and then the &#039;&#039;&#039;Regrade&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{excerpted from Jason Cole}}&lt;br /&gt;
[[Category:Teacher]]&lt;br /&gt;
[[Category:Quiz]]&lt;/div&gt;</summary>
		<author><name>Timtak</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/36/en/index.php?title=Building_Quiz&amp;diff=9570</id>
		<title>Building Quiz</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/36/en/index.php?title=Building_Quiz&amp;diff=9570"/>
		<updated>2006-05-13T17:18:00Z</updated>

		<summary type="html">&lt;p&gt;Timtak: /* Adding questions to a quiz */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Quizzes}}&lt;br /&gt;
&lt;br /&gt;
On the quiz editing screen you’ll create and categorize your quiz questions and then add them to the quiz. What you will see on this screen depends on whether students have already started attempts at the quiz. &lt;br /&gt;
&lt;br /&gt;
==Before quiz has been attempted==&lt;br /&gt;
On the left side of the screen you’ll see a block where the questions you’ve added to the current quiz are displayed.  If this is a new quiz you will not have any questions there and Moodle tells you this.&lt;br /&gt;
&lt;br /&gt;
On the right side of the screen, you’ll see the question editing block. This is where you can add new questions, edit existing questions, or move questions between categories. This is explained on the page [[Questions]].&lt;br /&gt;
&lt;br /&gt;
===Adding questions to a quiz===&lt;br /&gt;
Once you’ve created your questions, you’ll need to add them to the quiz. There are many different [[Question types]] that you can use. The quiz editing page will now look something like that displayed in Figure 5-12.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;&amp;lt; icons to the left of the questions are used to add individual questions to the quiz. You can also select several questions using the checkboxes on the left of the question list and then click the “Add to quiz” button at the bottom of the list to add then all at once. If you want to add all the displayed questions then use the &#039;Select all&#039; link.&lt;br /&gt;
[[Image:Quiz.gif|frame|bottom|This shows four methods of adding questions including adding random questions dealt with in more detail below]]&amp;lt;br /&amp;gt;&lt;br /&gt;
Figure 5-12.  Quiz Editing Screen&lt;br /&gt;
&lt;br /&gt;
Once you’ve added a question to the quiz, it appears on the left side of the screen in the quiz question list. The question is still selectable on the right, but you can only add it to the quiz once. If you select the question in the category list again and add it to the quiz, nothing will happen.&lt;br /&gt;
&lt;br /&gt;
Once you’ve added the questions to the quiz, you can change the order of the questions by clicking the arrow buttons on the left side of the list of quiz questions (see Figure 5-13).&lt;br /&gt;
 &lt;br /&gt;
Figure 5-13. Editing Quiz with Questions&lt;br /&gt;
&lt;br /&gt;
You will also need to set the grade for each question. You can set the number of points for each question in the Grade column. This allows you to set the relative weight of each question in the quiz. You may want to make certain questions or question types worth more than others. You should also set the &#039;Maximum grade&#039; for the whole quiz. This does not have to be equal to the sum of the grades for the individual questions. The grades achieved by the students will be rescaled to be out of this maximum grade. After adjusting the grades for the individual questions you should click on the &#039;Save grades&#039; button.&lt;br /&gt;
&lt;br /&gt;
===Adding random questions===&lt;br /&gt;
&lt;br /&gt;
When you add a random question to a quiz, then it will be replaced with a randomly-chosen question from the currently selected category - for each attempt.&lt;br /&gt;
&lt;br /&gt;
This means that different students are likely to get a different selection of questions when they attempt this quiz. When a quiz allows multiple attempts for each student then each attempt will also contain a new selection of questions.&lt;br /&gt;
&lt;br /&gt;
The same question will never appear twice in a quiz. If you include several random questions then different questions will always be chosen for each of them. If you mix random questions with non-random questions then the random questions will be chosen so that they do not duplicate one of the non-random questions.&lt;br /&gt;
&lt;br /&gt;
The grade for the randomly chosen question will be rescaled so that the maximum grade is what you have chosen as the grade for the random question.&lt;br /&gt;
&lt;br /&gt;
[[Image:Random.gif|frame|left|note that the menu for adding random questions is found below the questions on the right-hand side of the screen]]&amp;lt;br style=&amp;quot;clear:both;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Previewing questions===&lt;br /&gt;
Clicking on the magnifying glass next to a question will open a preview window in which you can test the question. ....&lt;br /&gt;
&lt;br /&gt;
When you’re done, you will probably also want to preview your entire quiz by clicking on the &#039;&#039;&#039;Preview&#039;&#039;&#039; tab. This will bring you to the [[mod/quiz/attempt|Quiz attempt]] page but in teacher preview mode.&lt;br /&gt;
&lt;br /&gt;
==After quiz has been attempted==&lt;br /&gt;
If the quiz has already been attempted you will see a notice saying that you cannot add or remove questions. You can, however, delete the quiz attempts (you access them clicking &#039;&#039;View x quiz attempts (y Students)&#039;&#039;, where &#039;x&#039; stands for the number of attempts by &#039;y&#039; students) and will then again be able to add or delete questions as explained above. The reason you can not do this when there are already attempts is that this would lead to confusion, both on the part of the student and on the part of Moodle itself which would not be able to interpret the student responses that have already been saved.&lt;br /&gt;
&lt;br /&gt;
You can still edit questions and you can change the grade for questions. So instead of deleting a bad question you can edit it to explain the situation to the student and then you can set the grade for the question to zero. After you make such changes you should regrade the quiz by clicking on the &#039;&#039;&#039;Results&#039;&#039;&#039; tab and then the &#039;&#039;&#039;Regrade&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{excerpted from Jason Cole}}&lt;br /&gt;
[[Category:Teacher]]&lt;br /&gt;
[[Category:Quiz]]&lt;/div&gt;</summary>
		<author><name>Timtak</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/36/en/index.php?title=Building_Quiz&amp;diff=9569</id>
		<title>Building Quiz</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/36/en/index.php?title=Building_Quiz&amp;diff=9569"/>
		<updated>2006-05-13T17:17:43Z</updated>

		<summary type="html">&lt;p&gt;Timtak: /* Adding questions to a quiz */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Quizzes}}&lt;br /&gt;
&lt;br /&gt;
On the quiz editing screen you’ll create and categorize your quiz questions and then add them to the quiz. What you will see on this screen depends on whether students have already started attempts at the quiz. &lt;br /&gt;
&lt;br /&gt;
==Before quiz has been attempted==&lt;br /&gt;
On the left side of the screen you’ll see a block where the questions you’ve added to the current quiz are displayed.  If this is a new quiz you will not have any questions there and Moodle tells you this.&lt;br /&gt;
&lt;br /&gt;
On the right side of the screen, you’ll see the question editing block. This is where you can add new questions, edit existing questions, or move questions between categories. This is explained on the page [[Questions]].&lt;br /&gt;
&lt;br /&gt;
===Adding questions to a quiz===&lt;br /&gt;
Once you’ve created your questions, you’ll need to add them to the quiz. There are many different [[Question types]] that you can use. The quiz editing page will now look something like that displayed in Figure 5-12.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;&amp;lt; icons to the left of the questions are used to add individual questions to the quiz. You can also select several questions using the checkboxes on the left of the question list and then click the “Add to quiz” button at the bottom of the list to add then all at once. If you want to add all the displayed questions then use the &#039;Select all&#039; link.&lt;br /&gt;
[[Image:Quiz.gif|frame|top|This shows four methods of adding questions including adding random questions dealt with in more detail below]]&amp;lt;br /&amp;gt;&lt;br /&gt;
Figure 5-12.  Quiz Editing Screen&lt;br /&gt;
&lt;br /&gt;
Once you’ve added a question to the quiz, it appears on the left side of the screen in the quiz question list. The question is still selectable on the right, but you can only add it to the quiz once. If you select the question in the category list again and add it to the quiz, nothing will happen.&lt;br /&gt;
&lt;br /&gt;
Once you’ve added the questions to the quiz, you can change the order of the questions by clicking the arrow buttons on the left side of the list of quiz questions (see Figure 5-13).&lt;br /&gt;
 &lt;br /&gt;
Figure 5-13. Editing Quiz with Questions&lt;br /&gt;
&lt;br /&gt;
You will also need to set the grade for each question. You can set the number of points for each question in the Grade column. This allows you to set the relative weight of each question in the quiz. You may want to make certain questions or question types worth more than others. You should also set the &#039;Maximum grade&#039; for the whole quiz. This does not have to be equal to the sum of the grades for the individual questions. The grades achieved by the students will be rescaled to be out of this maximum grade. After adjusting the grades for the individual questions you should click on the &#039;Save grades&#039; button.&lt;br /&gt;
&lt;br /&gt;
===Adding random questions===&lt;br /&gt;
&lt;br /&gt;
When you add a random question to a quiz, then it will be replaced with a randomly-chosen question from the currently selected category - for each attempt.&lt;br /&gt;
&lt;br /&gt;
This means that different students are likely to get a different selection of questions when they attempt this quiz. When a quiz allows multiple attempts for each student then each attempt will also contain a new selection of questions.&lt;br /&gt;
&lt;br /&gt;
The same question will never appear twice in a quiz. If you include several random questions then different questions will always be chosen for each of them. If you mix random questions with non-random questions then the random questions will be chosen so that they do not duplicate one of the non-random questions.&lt;br /&gt;
&lt;br /&gt;
The grade for the randomly chosen question will be rescaled so that the maximum grade is what you have chosen as the grade for the random question.&lt;br /&gt;
&lt;br /&gt;
[[Image:Random.gif|frame|left|note that the menu for adding random questions is found below the questions on the right-hand side of the screen]]&amp;lt;br style=&amp;quot;clear:both;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Previewing questions===&lt;br /&gt;
Clicking on the magnifying glass next to a question will open a preview window in which you can test the question. ....&lt;br /&gt;
&lt;br /&gt;
When you’re done, you will probably also want to preview your entire quiz by clicking on the &#039;&#039;&#039;Preview&#039;&#039;&#039; tab. This will bring you to the [[mod/quiz/attempt|Quiz attempt]] page but in teacher preview mode.&lt;br /&gt;
&lt;br /&gt;
==After quiz has been attempted==&lt;br /&gt;
If the quiz has already been attempted you will see a notice saying that you cannot add or remove questions. You can, however, delete the quiz attempts (you access them clicking &#039;&#039;View x quiz attempts (y Students)&#039;&#039;, where &#039;x&#039; stands for the number of attempts by &#039;y&#039; students) and will then again be able to add or delete questions as explained above. The reason you can not do this when there are already attempts is that this would lead to confusion, both on the part of the student and on the part of Moodle itself which would not be able to interpret the student responses that have already been saved.&lt;br /&gt;
&lt;br /&gt;
You can still edit questions and you can change the grade for questions. So instead of deleting a bad question you can edit it to explain the situation to the student and then you can set the grade for the question to zero. After you make such changes you should regrade the quiz by clicking on the &#039;&#039;&#039;Results&#039;&#039;&#039; tab and then the &#039;&#039;&#039;Regrade&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{excerpted from Jason Cole}}&lt;br /&gt;
[[Category:Teacher]]&lt;br /&gt;
[[Category:Quiz]]&lt;/div&gt;</summary>
		<author><name>Timtak</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/36/en/index.php?title=Building_Quiz&amp;diff=9568</id>
		<title>Building Quiz</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/36/en/index.php?title=Building_Quiz&amp;diff=9568"/>
		<updated>2006-05-13T17:17:19Z</updated>

		<summary type="html">&lt;p&gt;Timtak: /* Adding questions to a quiz */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Quizzes}}&lt;br /&gt;
&lt;br /&gt;
On the quiz editing screen you’ll create and categorize your quiz questions and then add them to the quiz. What you will see on this screen depends on whether students have already started attempts at the quiz. &lt;br /&gt;
&lt;br /&gt;
==Before quiz has been attempted==&lt;br /&gt;
On the left side of the screen you’ll see a block where the questions you’ve added to the current quiz are displayed.  If this is a new quiz you will not have any questions there and Moodle tells you this.&lt;br /&gt;
&lt;br /&gt;
On the right side of the screen, you’ll see the question editing block. This is where you can add new questions, edit existing questions, or move questions between categories. This is explained on the page [[Questions]].&lt;br /&gt;
&lt;br /&gt;
===Adding questions to a quiz===&lt;br /&gt;
Once you’ve created your questions, you’ll need to add them to the quiz. There are many different [[Question types]] that you can use. The quiz editing page will now look something like that displayed in Figure 5-12.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;&amp;lt; icons to the left of the questions are used to add individual questions to the quiz. You can also select several questions using the checkboxes on the left of the question list and then click the “Add to quiz” button at the bottom of the list to add then all at once. If you want to add all the displayed questions then use the &#039;Select all&#039; link.&lt;br /&gt;
[[Image:Quiz.gif|frame|top|This shows four methods of adding questions including adding random questions dealt with in more detail below]]&lt;br /&gt;
Figure 5-12.  Quiz Editing Screen&lt;br /&gt;
&lt;br /&gt;
Once you’ve added a question to the quiz, it appears on the left side of the screen in the quiz question list. The question is still selectable on the right, but you can only add it to the quiz once. If you select the question in the category list again and add it to the quiz, nothing will happen.&lt;br /&gt;
&lt;br /&gt;
Once you’ve added the questions to the quiz, you can change the order of the questions by clicking the arrow buttons on the left side of the list of quiz questions (see Figure 5-13).&lt;br /&gt;
 &lt;br /&gt;
Figure 5-13. Editing Quiz with Questions&lt;br /&gt;
&lt;br /&gt;
You will also need to set the grade for each question. You can set the number of points for each question in the Grade column. This allows you to set the relative weight of each question in the quiz. You may want to make certain questions or question types worth more than others. You should also set the &#039;Maximum grade&#039; for the whole quiz. This does not have to be equal to the sum of the grades for the individual questions. The grades achieved by the students will be rescaled to be out of this maximum grade. After adjusting the grades for the individual questions you should click on the &#039;Save grades&#039; button.&lt;br /&gt;
&lt;br /&gt;
===Adding random questions===&lt;br /&gt;
&lt;br /&gt;
When you add a random question to a quiz, then it will be replaced with a randomly-chosen question from the currently selected category - for each attempt.&lt;br /&gt;
&lt;br /&gt;
This means that different students are likely to get a different selection of questions when they attempt this quiz. When a quiz allows multiple attempts for each student then each attempt will also contain a new selection of questions.&lt;br /&gt;
&lt;br /&gt;
The same question will never appear twice in a quiz. If you include several random questions then different questions will always be chosen for each of them. If you mix random questions with non-random questions then the random questions will be chosen so that they do not duplicate one of the non-random questions.&lt;br /&gt;
&lt;br /&gt;
The grade for the randomly chosen question will be rescaled so that the maximum grade is what you have chosen as the grade for the random question.&lt;br /&gt;
&lt;br /&gt;
[[Image:Random.gif|frame|left|note that the menu for adding random questions is found below the questions on the right-hand side of the screen]]&amp;lt;br style=&amp;quot;clear:both;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Previewing questions===&lt;br /&gt;
Clicking on the magnifying glass next to a question will open a preview window in which you can test the question. ....&lt;br /&gt;
&lt;br /&gt;
When you’re done, you will probably also want to preview your entire quiz by clicking on the &#039;&#039;&#039;Preview&#039;&#039;&#039; tab. This will bring you to the [[mod/quiz/attempt|Quiz attempt]] page but in teacher preview mode.&lt;br /&gt;
&lt;br /&gt;
==After quiz has been attempted==&lt;br /&gt;
If the quiz has already been attempted you will see a notice saying that you cannot add or remove questions. You can, however, delete the quiz attempts (you access them clicking &#039;&#039;View x quiz attempts (y Students)&#039;&#039;, where &#039;x&#039; stands for the number of attempts by &#039;y&#039; students) and will then again be able to add or delete questions as explained above. The reason you can not do this when there are already attempts is that this would lead to confusion, both on the part of the student and on the part of Moodle itself which would not be able to interpret the student responses that have already been saved.&lt;br /&gt;
&lt;br /&gt;
You can still edit questions and you can change the grade for questions. So instead of deleting a bad question you can edit it to explain the situation to the student and then you can set the grade for the question to zero. After you make such changes you should regrade the quiz by clicking on the &#039;&#039;&#039;Results&#039;&#039;&#039; tab and then the &#039;&#039;&#039;Regrade&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{excerpted from Jason Cole}}&lt;br /&gt;
[[Category:Teacher]]&lt;br /&gt;
[[Category:Quiz]]&lt;/div&gt;</summary>
		<author><name>Timtak</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/36/en/index.php?title=Building_Quiz&amp;diff=9567</id>
		<title>Building Quiz</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/36/en/index.php?title=Building_Quiz&amp;diff=9567"/>
		<updated>2006-05-13T17:16:30Z</updated>

		<summary type="html">&lt;p&gt;Timtak: /* Adding questions to a quiz */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Quizzes}}&lt;br /&gt;
&lt;br /&gt;
On the quiz editing screen you’ll create and categorize your quiz questions and then add them to the quiz. What you will see on this screen depends on whether students have already started attempts at the quiz. &lt;br /&gt;
&lt;br /&gt;
==Before quiz has been attempted==&lt;br /&gt;
On the left side of the screen you’ll see a block where the questions you’ve added to the current quiz are displayed.  If this is a new quiz you will not have any questions there and Moodle tells you this.&lt;br /&gt;
&lt;br /&gt;
On the right side of the screen, you’ll see the question editing block. This is where you can add new questions, edit existing questions, or move questions between categories. This is explained on the page [[Questions]].&lt;br /&gt;
&lt;br /&gt;
===Adding questions to a quiz===&lt;br /&gt;
Once you’ve created your questions, you’ll need to add them to the quiz. There are many different [[Question types]] that you can use. The quiz editing page will now look something like that displayed in Figure 5-12.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;&amp;lt; icons to the left of the questions are used to add individual questions to the quiz. You can also select several questions using the checkboxes on the left of the question list and then click the “Add to quiz” button at the bottom of the list to add then all at once. If you want to add all the displayed questions then use the &#039;Select all&#039; link.&lt;br /&gt;
[[Image:Quiz.gif|frame|left|This shows four methods of adding questions including adding random questions dealt with in more detail below]]&lt;br /&gt;
Figure 5-12.  Quiz Editing Screen&lt;br /&gt;
&lt;br /&gt;
Once you’ve added a question to the quiz, it appears on the left side of the screen in the quiz question list. The question is still selectable on the right, but you can only add it to the quiz once. If you select the question in the category list again and add it to the quiz, nothing will happen.&lt;br /&gt;
&lt;br /&gt;
Once you’ve added the questions to the quiz, you can change the order of the questions by clicking the arrow buttons on the left side of the list of quiz questions (see Figure 5-13).&lt;br /&gt;
 &lt;br /&gt;
Figure 5-13. Editing Quiz with Questions&lt;br /&gt;
&lt;br /&gt;
You will also need to set the grade for each question. You can set the number of points for each question in the Grade column. This allows you to set the relative weight of each question in the quiz. You may want to make certain questions or question types worth more than others. You should also set the &#039;Maximum grade&#039; for the whole quiz. This does not have to be equal to the sum of the grades for the individual questions. The grades achieved by the students will be rescaled to be out of this maximum grade. After adjusting the grades for the individual questions you should click on the &#039;Save grades&#039; button.&lt;br /&gt;
&lt;br /&gt;
===Adding random questions===&lt;br /&gt;
&lt;br /&gt;
When you add a random question to a quiz, then it will be replaced with a randomly-chosen question from the currently selected category - for each attempt.&lt;br /&gt;
&lt;br /&gt;
This means that different students are likely to get a different selection of questions when they attempt this quiz. When a quiz allows multiple attempts for each student then each attempt will also contain a new selection of questions.&lt;br /&gt;
&lt;br /&gt;
The same question will never appear twice in a quiz. If you include several random questions then different questions will always be chosen for each of them. If you mix random questions with non-random questions then the random questions will be chosen so that they do not duplicate one of the non-random questions.&lt;br /&gt;
&lt;br /&gt;
The grade for the randomly chosen question will be rescaled so that the maximum grade is what you have chosen as the grade for the random question.&lt;br /&gt;
&lt;br /&gt;
[[Image:Random.gif|frame|left|note that the menu for adding random questions is found below the questions on the right-hand side of the screen]]&amp;lt;br style=&amp;quot;clear:both;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Previewing questions===&lt;br /&gt;
Clicking on the magnifying glass next to a question will open a preview window in which you can test the question. ....&lt;br /&gt;
&lt;br /&gt;
When you’re done, you will probably also want to preview your entire quiz by clicking on the &#039;&#039;&#039;Preview&#039;&#039;&#039; tab. This will bring you to the [[mod/quiz/attempt|Quiz attempt]] page but in teacher preview mode.&lt;br /&gt;
&lt;br /&gt;
==After quiz has been attempted==&lt;br /&gt;
If the quiz has already been attempted you will see a notice saying that you cannot add or remove questions. You can, however, delete the quiz attempts (you access them clicking &#039;&#039;View x quiz attempts (y Students)&#039;&#039;, where &#039;x&#039; stands for the number of attempts by &#039;y&#039; students) and will then again be able to add or delete questions as explained above. The reason you can not do this when there are already attempts is that this would lead to confusion, both on the part of the student and on the part of Moodle itself which would not be able to interpret the student responses that have already been saved.&lt;br /&gt;
&lt;br /&gt;
You can still edit questions and you can change the grade for questions. So instead of deleting a bad question you can edit it to explain the situation to the student and then you can set the grade for the question to zero. After you make such changes you should regrade the quiz by clicking on the &#039;&#039;&#039;Results&#039;&#039;&#039; tab and then the &#039;&#039;&#039;Regrade&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{excerpted from Jason Cole}}&lt;br /&gt;
[[Category:Teacher]]&lt;br /&gt;
[[Category:Quiz]]&lt;/div&gt;</summary>
		<author><name>Timtak</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/36/en/index.php?title=Building_Quiz&amp;diff=9566</id>
		<title>Building Quiz</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/36/en/index.php?title=Building_Quiz&amp;diff=9566"/>
		<updated>2006-05-13T17:15:33Z</updated>

		<summary type="html">&lt;p&gt;Timtak: /* Adding questions to a quiz */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Quizzes}}&lt;br /&gt;
&lt;br /&gt;
On the quiz editing screen you’ll create and categorize your quiz questions and then add them to the quiz. What you will see on this screen depends on whether students have already started attempts at the quiz. &lt;br /&gt;
&lt;br /&gt;
==Before quiz has been attempted==&lt;br /&gt;
On the left side of the screen you’ll see a block where the questions you’ve added to the current quiz are displayed.  If this is a new quiz you will not have any questions there and Moodle tells you this.&lt;br /&gt;
&lt;br /&gt;
On the right side of the screen, you’ll see the question editing block. This is where you can add new questions, edit existing questions, or move questions between categories. This is explained on the page [[Questions]].&lt;br /&gt;
&lt;br /&gt;
===Adding questions to a quiz===&lt;br /&gt;
Once you’ve created your questions, you’ll need to add them to the quiz. There are many different [[Question types]] that you can use. The quiz editing page will now look something like that displayed in Figure 5-12.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;&amp;lt; icons to the left of the questions are used to add individual questions to the quiz. You can also select several questions using the checkboxes on the left of the question list and then click the “Add to quiz” button at the bottom of the list to add then all at once. If you want to add all the displayed questions then use the &#039;Select all&#039; link.&lt;br /&gt;
[[Image:quiz.gif|frame|left|This shows four methods of adding questions including adding random questions dealt with in more detail below]]&lt;br /&gt;
Figure 5-12.  Quiz Editing Screen&lt;br /&gt;
&lt;br /&gt;
Once you’ve added a question to the quiz, it appears on the left side of the screen in the quiz question list. The question is still selectable on the right, but you can only add it to the quiz once. If you select the question in the category list again and add it to the quiz, nothing will happen.&lt;br /&gt;
&lt;br /&gt;
Once you’ve added the questions to the quiz, you can change the order of the questions by clicking the arrow buttons on the left side of the list of quiz questions (see Figure 5-13).&lt;br /&gt;
 &lt;br /&gt;
Figure 5-13. Editing Quiz with Questions&lt;br /&gt;
&lt;br /&gt;
You will also need to set the grade for each question. You can set the number of points for each question in the Grade column. This allows you to set the relative weight of each question in the quiz. You may want to make certain questions or question types worth more than others. You should also set the &#039;Maximum grade&#039; for the whole quiz. This does not have to be equal to the sum of the grades for the individual questions. The grades achieved by the students will be rescaled to be out of this maximum grade. After adjusting the grades for the individual questions you should click on the &#039;Save grades&#039; button.&lt;br /&gt;
&lt;br /&gt;
===Adding random questions===&lt;br /&gt;
&lt;br /&gt;
When you add a random question to a quiz, then it will be replaced with a randomly-chosen question from the currently selected category - for each attempt.&lt;br /&gt;
&lt;br /&gt;
This means that different students are likely to get a different selection of questions when they attempt this quiz. When a quiz allows multiple attempts for each student then each attempt will also contain a new selection of questions.&lt;br /&gt;
&lt;br /&gt;
The same question will never appear twice in a quiz. If you include several random questions then different questions will always be chosen for each of them. If you mix random questions with non-random questions then the random questions will be chosen so that they do not duplicate one of the non-random questions.&lt;br /&gt;
&lt;br /&gt;
The grade for the randomly chosen question will be rescaled so that the maximum grade is what you have chosen as the grade for the random question.&lt;br /&gt;
&lt;br /&gt;
[[Image:Random.gif|frame|left|note that the menu for adding random questions is found below the questions on the right-hand side of the screen]]&amp;lt;br style=&amp;quot;clear:both;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Previewing questions===&lt;br /&gt;
Clicking on the magnifying glass next to a question will open a preview window in which you can test the question. ....&lt;br /&gt;
&lt;br /&gt;
When you’re done, you will probably also want to preview your entire quiz by clicking on the &#039;&#039;&#039;Preview&#039;&#039;&#039; tab. This will bring you to the [[mod/quiz/attempt|Quiz attempt]] page but in teacher preview mode.&lt;br /&gt;
&lt;br /&gt;
==After quiz has been attempted==&lt;br /&gt;
If the quiz has already been attempted you will see a notice saying that you cannot add or remove questions. You can, however, delete the quiz attempts (you access them clicking &#039;&#039;View x quiz attempts (y Students)&#039;&#039;, where &#039;x&#039; stands for the number of attempts by &#039;y&#039; students) and will then again be able to add or delete questions as explained above. The reason you can not do this when there are already attempts is that this would lead to confusion, both on the part of the student and on the part of Moodle itself which would not be able to interpret the student responses that have already been saved.&lt;br /&gt;
&lt;br /&gt;
You can still edit questions and you can change the grade for questions. So instead of deleting a bad question you can edit it to explain the situation to the student and then you can set the grade for the question to zero. After you make such changes you should regrade the quiz by clicking on the &#039;&#039;&#039;Results&#039;&#039;&#039; tab and then the &#039;&#039;&#039;Regrade&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{excerpted from Jason Cole}}&lt;br /&gt;
[[Category:Teacher]]&lt;br /&gt;
[[Category:Quiz]]&lt;/div&gt;</summary>
		<author><name>Timtak</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/36/en/index.php?title=Building_Quiz&amp;diff=9565</id>
		<title>Building Quiz</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/36/en/index.php?title=Building_Quiz&amp;diff=9565"/>
		<updated>2006-05-13T17:14:27Z</updated>

		<summary type="html">&lt;p&gt;Timtak: /* Adding questions to a quiz */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{Quizzes}}&lt;br /&gt;
&lt;br /&gt;
On the quiz editing screen you’ll create and categorize your quiz questions and then add them to the quiz. What you will see on this screen depends on whether students have already started attempts at the quiz. &lt;br /&gt;
&lt;br /&gt;
==Before quiz has been attempted==&lt;br /&gt;
On the left side of the screen you’ll see a block where the questions you’ve added to the current quiz are displayed.  If this is a new quiz you will not have any questions there and Moodle tells you this.&lt;br /&gt;
&lt;br /&gt;
On the right side of the screen, you’ll see the question editing block. This is where you can add new questions, edit existing questions, or move questions between categories. This is explained on the page [[Questions]].&lt;br /&gt;
&lt;br /&gt;
===Adding questions to a quiz===&lt;br /&gt;
Once you’ve created your questions, you’ll need to add them to the quiz. There are many different [[Question types]] that you can use. The quiz editing page will now look something like that displayed in Figure 5-12.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;&amp;lt; icons to the left of the questions are used to add individual questions to the quiz. You can also select several questions using the checkboxes on the left of the question list and then click the “Add to quiz” button at the bottom of the list to add then all at once. If you want to add all the displayed questions then use the &#039;Select all&#039; link.&lt;br /&gt;
[[Image:quiz.gif|frame|left|This shows four methods of adding questions including adding random questions, dealt with in more detail below]]&amp;lt;br style=&amp;quot;clear:both;&amp;quot;&amp;gt;&lt;br /&gt;
Figure 5-12.  Quiz Editing Screen&lt;br /&gt;
&lt;br /&gt;
Once you’ve added a question to the quiz, it appears on the left side of the screen in the quiz question list. The question is still selectable on the right, but you can only add it to the quiz once. If you select the question in the category list again and add it to the quiz, nothing will happen.&lt;br /&gt;
&lt;br /&gt;
Once you’ve added the questions to the quiz, you can change the order of the questions by clicking the arrow buttons on the left side of the list of quiz questions (see Figure 5-13).&lt;br /&gt;
 &lt;br /&gt;
Figure 5-13. Editing Quiz with Questions&lt;br /&gt;
&lt;br /&gt;
You will also need to set the grade for each question. You can set the number of points for each question in the Grade column. This allows you to set the relative weight of each question in the quiz. You may want to make certain questions or question types worth more than others. You should also set the &#039;Maximum grade&#039; for the whole quiz. This does not have to be equal to the sum of the grades for the individual questions. The grades achieved by the students will be rescaled to be out of this maximum grade. After adjusting the grades for the individual questions you should click on the &#039;Save grades&#039; button.&lt;br /&gt;
&lt;br /&gt;
===Adding random questions===&lt;br /&gt;
&lt;br /&gt;
When you add a random question to a quiz, then it will be replaced with a randomly-chosen question from the currently selected category - for each attempt.&lt;br /&gt;
&lt;br /&gt;
This means that different students are likely to get a different selection of questions when they attempt this quiz. When a quiz allows multiple attempts for each student then each attempt will also contain a new selection of questions.&lt;br /&gt;
&lt;br /&gt;
The same question will never appear twice in a quiz. If you include several random questions then different questions will always be chosen for each of them. If you mix random questions with non-random questions then the random questions will be chosen so that they do not duplicate one of the non-random questions.&lt;br /&gt;
&lt;br /&gt;
The grade for the randomly chosen question will be rescaled so that the maximum grade is what you have chosen as the grade for the random question.&lt;br /&gt;
&lt;br /&gt;
[[Image:Random.gif|frame|left|note that the menu for adding random questions is found below the questions on the right-hand side of the screen]]&amp;lt;br style=&amp;quot;clear:both;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===Previewing questions===&lt;br /&gt;
Clicking on the magnifying glass next to a question will open a preview window in which you can test the question. ....&lt;br /&gt;
&lt;br /&gt;
When you’re done, you will probably also want to preview your entire quiz by clicking on the &#039;&#039;&#039;Preview&#039;&#039;&#039; tab. This will bring you to the [[mod/quiz/attempt|Quiz attempt]] page but in teacher preview mode.&lt;br /&gt;
&lt;br /&gt;
==After quiz has been attempted==&lt;br /&gt;
If the quiz has already been attempted you will see a notice saying that you cannot add or remove questions. You can, however, delete the quiz attempts (you access them clicking &#039;&#039;View x quiz attempts (y Students)&#039;&#039;, where &#039;x&#039; stands for the number of attempts by &#039;y&#039; students) and will then again be able to add or delete questions as explained above. The reason you can not do this when there are already attempts is that this would lead to confusion, both on the part of the student and on the part of Moodle itself which would not be able to interpret the student responses that have already been saved.&lt;br /&gt;
&lt;br /&gt;
You can still edit questions and you can change the grade for questions. So instead of deleting a bad question you can edit it to explain the situation to the student and then you can set the grade for the question to zero. After you make such changes you should regrade the quiz by clicking on the &#039;&#039;&#039;Results&#039;&#039;&#039; tab and then the &#039;&#039;&#039;Regrade&#039;&#039;&#039; tab.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{excerpted from Jason Cole}}&lt;br /&gt;
[[Category:Teacher]]&lt;br /&gt;
[[Category:Quiz]]&lt;/div&gt;</summary>
		<author><name>Timtak</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/36/en/index.php?title=File:Quiz.gif&amp;diff=9564</id>
		<title>File:Quiz.gif</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/36/en/index.php?title=File:Quiz.gif&amp;diff=9564"/>
		<updated>2006-05-13T17:11:04Z</updated>

		<summary type="html">&lt;p&gt;Timtak: adding question to quiz&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;adding question to quiz&lt;/div&gt;</summary>
		<author><name>Timtak</name></author>
	</entry>
	<entry>
		<id>https://docs.moodle.org/36/en/index.php?title=User:Timothy_Takemoto&amp;diff=8304</id>
		<title>User:Timothy Takemoto</title>
		<link rel="alternate" type="text/html" href="https://docs.moodle.org/36/en/index.php?title=User:Timothy_Takemoto&amp;diff=8304"/>
		<updated>2006-04-11T03:34:41Z</updated>

		<summary type="html">&lt;p&gt;Timtak: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I have been using Moodle for three years. --[[User:Timothy Takemoto|Timothy Takemoto]] 11:34, 11 April 2006 (WST)&lt;/div&gt;</summary>
		<author><name>Timtak</name></author>
	</entry>
</feed>