Note: You are currently viewing documentation for Moodle 2.5. Up-to-date documentation for the latest stable version of Moodle may be available here: Beginning Moodle 2.x Administration 2 FAQ.

Beginning Moodle 2.x Administration 2 FAQ: Difference between revisions

From MoodleDocs
 
Line 77: Line 77:


If you do not wish to use a script, then you can try this:  
If you do not wish to use a script, then you can try this:  
Using phpMyAdmin, enter the database and look for the mdl_users table. The first line of that table's data should be the Guest, and the password for Guest is "guest", without the quote marks. Copy that password and then look for your identity. Paste the "guest" password over the top of yours when you locate it. You should then be able to get into your Moodle then, as an Admin.
Using phpMyAdmin, enter the database and look for the mdl_users table. The first line of that table's data should be the Guest, and the password for Guest is "guest", without the quote marks. Copy that password and then look for your identity. Paste the "guest" password over the top of yours when you locate it. You should be able to access your Moodle as an Admin.
It has been reported this does not work in every circumstance, but most. To get around that problem you might want to try commenting out the line  
It has been reported this does not work in every circumstance, but most. To get around that problem you might want to try commenting out the line  
   $CFG->passwordsaltmain =
   $CFG->passwordsaltmain =
That should then work.
That should then work.


===How can I extract original files from a Moodle backup file?===
===How can I extract original files from a Moodle backup file?===

Latest revision as of 21:09, 17 October 2012

This page is a follow on from the Beginning Moodle 2.0 Administration page.

How do I create a repository?

To setup and use a repository in Moodle 2.x, is not complex, just detailed. What follows will set up a site wide repository, that is the contents of this repository will be available to the entire site - so make sure this is really what you want. This is for the kind of resources you may want to use across a number of courses.

1. In the moodledata folder there is a folder called Repository. Create whatever folders you want in there, but it is suggested you use a consistent naming convention, so everyone knows what type of materials reside there, e.g. CalculusPDFs, EnglishCivilWarDocs, and so on. You can copy the required materials into each folder as you create them or add to it at any time thereafter.

2. In your Moodle 2.0 there are a couple of things you need to do, but first you have to activate the user repository system by going to Site Administration > Plugins >Repositories > Manage Repositories and you will see in the list contained in the right-hand panel an item named "File System". Select the dropdown list box and change the value to "Enabled and visible"

Setting the File System Repository in Moodle 2.0

3. Click the "Settings" link and that will take you to the "Setup repository on file system" page. Click the "Create a Repository Instance" button and this will take you to the next page. On that page you have two text boxes and two buttons. Add the name of the repository you created in the Repository folder and click "Save".

Saving the new Repository in Moodle 2.0

When you return to the "Setup repository on file system" page, you will now see that a list of repositories is available. When you access any course file or image picker, the repository will be available to you under the name you have given it. Any file inside the repository will be available for uploading to your course.

How do I set up a course repository?

Setting up the Course repository is almost exactly the same, but the major difference is that is should only be accessible to that one course.

Create a folder in your moodledata/Repository folder, naming it whatever is relevant. Add the files you want in that repository as you create the folder, or you can add them later.

In the Course Administration menu, click the Repository item which takes you to the "Course Repositories" page. You will see a list of all available Repositories so you can access one of them if you chose, or you can select the Create A Repository Instance, Create a "FileSystem" instance link. This takes you to the same page as shown above.

Creating a new Course Repository in Moodle 2.0

Create your repository instance in the same manner as described above and when you return to the Course Repositories page, you will see your repository listed there.

When you are adding a file to your course from the repository, you can access the stored file from the image or file picker via your repository. The repository is not available outside the course you create it for.

How do I set the maximum upload file size limit?

This is probably the most frequently asked question, and the answer is not that straightforward. The changes that need be made are the same in all versions of Moodle, just in different OS' they need be made in different places. Upload file sizes are restricted in a number of ways and each one in this list restricts the following ones:

 Server level
 Moodle site level
 Course level
 Activity level

Perhaps the best place to find this information is at File upload size There is a full explanation for a number of different OSs but there are a few missing.

This is a contentious issue, mainly because you might think that it should be set inside the Moodle. Unfortunately, this is not so, these are environment issues that need to be set in the server and PHP folders, Moodle cannot work outside itself.

The previous answer is OK if you control the server, but I am hosted, what can I do to override limitations set by my Host?

Before doing this, consult with your host, they may have very different ideas about what your Moodle should be permitted - try not to tread on their toes - they may get annoyed at you breaching your user conditions. In an Apache server, you can create a file called .htaccess which can allow you to override some of the limitations set by PHP on your Moodle. Be aware that this file only applies to your Moodle, and nothing else. Your host will often place a .htaccess file into your root folder which will usually read something like:

 deny from all
 AllowOverride None

These are security related, so there is no need to delete them or otherwise edit them. To overwrite set values in the hosts php.ini file, you may want to use:

 php_value upload_max_filesize 512M
 php_value post_max_size 512M 
 php_value memory_limit 128M

To overwrite boolean or logical settings use:

 php_flag register_globals off

or

 php_flag register_globals 0

Something similar can be done in IIS, but it is a lot more complex.

Thanks Muano

Can I still use the TeX Notation filter in Moodle 2 like I did in Moodle 1.9?

Yes, you can. In fact there is very little that has changed in the changing version. Not that the TeX filter has not be changed, it certainly has, but it does not affect how you will use TeX Notation. It is supposed to be easier to add a third party plugin for TeX, but the relationship between Moodle and such tools as MathJax or Geogebra, or similar tools, is still to be determined.

UPDATE: Mauno Korpelainen has successfully integrated a number of Maths tools onto Moodle. These tools include Geogebra, JSXGraph, Math, MathML, MathTran, tex, DragMath, Geonext, JSQuery, MathJax and if that were not enough, Mauno had also included a version of TinyMCE that has, as native, a Maths editing toolbar. Further information can be found on the Moodle 2 Advanced Maths Tools page.

I want to change our logo and some other images but there seems no clear way of doing it.

Moodle 2 has done things very differently here. Logos and other images are all controlled by the theme. Each theme folder is constructed the same way so it makes it easy to edit. Native Moodle themes use the moodle/pix folder to store common images. Look in there to find the logo for any native theme and that can be replaced by a new logo. Third party themes often use the moodle/theme/pix folder to store images, including logos.

Go and look at the theme folder and in it you will find the name of the theme you are using. In it you will also find the sub-folders for different elements and you should find your layout folder contains most of the instructions for controlling the layout, the Styles folder controls the appearance and so on. Images used in the theme can all be located there as well, in the pix folder.

If you want to use a theme that does not have an image or a logo, just the default icons, then you are talking a serious revamp. For that, you need to look at the Themes 2.0 page.

What about other elements of the Front Page?

In some ways, Moodle 2 has made it easier to setup a front page the way you want it. Different themes will use different defaults, many moving away from the traditional three collumn, blocks, categories/courses, blocks, structure that pervaded Moodle 1.9. The Moodle 2 documentation has a more complete look at the Front page settings than can be viewed here. Also, for a better overview of how this can all be done at a site level, look at the Customising appearance pages.

My Password is not being accepted as valid. How can I login as an Admin?

There are a couple of causes for this problem, but the main one seems to be we forget the jumble of passwords we are required to remember. There are also a number of ways of getting around it, as well.

This discussion covers just about all of them. There are a couple of scripts so be careful and use the right one if you need to.

If you do not wish to use a script, then you can try this: Using phpMyAdmin, enter the database and look for the mdl_users table. The first line of that table's data should be the Guest, and the password for Guest is "guest", without the quote marks. Copy that password and then look for your identity. Paste the "guest" password over the top of yours when you locate it. You should be able to access your Moodle as an Admin. It has been reported this does not work in every circumstance, but most. To get around that problem you might want to try commenting out the line

 $CFG->passwordsaltmain =

That should then work.

How can I extract original files from a Moodle backup file?

If you really want to get original files from the backup file (an ".mbz" file) you downloaded (using the backup and restore feature), here it goes...

The backup file can actually be opened with any zip/unzip program you can download. Once you open the file, you need to extract:

   The files.xml file.
   The files directory (folder).

Next step would be to open the "files.xml" file in a text editor, and:

   Search for the name of each file you want to get.
   Take note of the value of the corresponding contenthash tag.
   In the "files" folder you extracted, locate the file whose name is the same as the value of the contenthash and which will always be located in a folder whose name corresponds to the two first characters of the file name.

For example, let's assume there is a "backup_courses-120730.mbz" file of which the "files.xml" file and the "files" folder have been extracted. There is a PDF file named "Leadership.pdf" that is required for another purpose.

Open the files.xml file and:

1. Search for the string "Leadership.pdf", which in this case is found under the following <file id...> group tag:

 <file id="12345">
 <contenthash>fb6cf43a9b2d432403c70a2cb4c340dbb6225631</contenthash>
               :
 <filename>Leadership.pdf</filename>
               :
 <license>allrightsreserved</license>
 <sortorder>1</sortorder>
 </file>

2. Take note of the corresponding contenthash value: fb6cf43a9b2d432403c70a2cb4c340dbb6225631.

3. As the first two characters of the contenthash are "fb", open the "fb" folder inside the "files" directory (which was previously extracted), and there is a file named "fb6cf43a9b...". Rename that file as "Leadership.pdf", and then move it to another location. Repeat this for all the files required, using the correct contenthash value of course.

Thanks to Guillermo Madero S for this answer.

How can I have two installations of Moodle on my server?

There is always a number of reasons why you may require several different versions of Moodle on your server, or your localhost on a standalone computer. You may want to run two completely different Moodles for different purposes, so they may be the same versions. The answers are the same for all of them, and you may want to use different techniques depending on your circumstances.

First, in all versions of Moodle you are able to set the cookie prefix. Whenever you install a Moodle, it is a good idea to not just accept the default for the cookie prefix. Go to Administration menu > Server > Session Handling and you will see there is a text box that allows you to add a prefix for the Moodle. If you do this for every installation, you can have any number of installations - the problem is going to be the database.

At installation, you can create two different databases. again in some circumstances, there may be any number of valid reasons to do this, but fact is, you may not, in v2.x have to worry about it too much. Each installation will generate its own tables so, at installation, you may not have to worry too much apart from giving the databases different names.

How can I deny Guest Access to my site altogether?

Look at Site administration ► Plugins ► Authentication ► Manage authentication and there is a switch there that allows you to turn the Guest Access button off altogether.

See Also