Instalando plugins

From MoodleDocs
Revision as of 14:59, 22 February 2017 by Maurício Prado Figueirôa (talk | contribs) (tradução em progresso)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Por que instalar plugins adicionais?

Plugins permitem que você inclua recursos e funcionalidades adicionais ao Moodle, como novas atividades, novos tipos de questionário, novos relatórios, integrações com outros sistemas e muito mais.

Nota: Certos serviços de hospedagem como o MoodleCloud, impedem a instalação de plugins por intermédio do Moodle.


Escolhendo os melhores plugins para seu site

Nota: Seja cauteloso e sempre procure instalar nesses plugins em um servidor local experimental antes de instalá-los em um servidor de produção.


Ensino de escolas primárias

Você pode pensar em alguns plugins para gamificação, como o Quizventure (em inglês).

Nota: Se seu site Moodle atenderá crianças, leve em consideração instalar um pacote de idiomas para crianças (se disponível). Pacotes de idioma não são plugins.


Plugins para educação primária e secundária (K-12)

Para aulas e ambientes de aprendizagem para ensino médio e fundamental (Brasil), é recomendável instalar os plugins incluildos no Moodle para Escola no MoodleCloud (em inglês):

Plugins para Ensino Universitário

Para universidades, há uma lista de plugins de/para Universidades, e um link to plugins específicos para certas disciplinas, que podem valer a pena.

Considerações para sites de produção (pule se você está só "moodling")

AVISO MUITO IMPORTANTE: Por favor, seja consciente que alguns plugins não foram avaliados e a qualidade e a adequação ao seu site Moodle não foram conferidas. Por favor tenha cuidado. Pode não ser o que você espera, pode ter questões de segurança sérias ou pode até mesmo nem funcionar. Isto no entanto está melhorando com o tempo com a evolução do novo sistema de diretórios de plugin.

  • Se você tem um site grande, considerando a produção, considere se você realmente precisa do plugin. Mais funcionalidade significa mais coisas a dar suporte, mais coisas para (potencialmente) dar errado e mais coisas para se preocupar no momento do upgrade.
  • O plugin é compatível e mantido com atualizações? Se algo der errado você consegue suporte? Os bugs são consertados?
  • Se o plugin não funciona em uma futura versão do Moodle, o que você vai fazer?
  • Cuidado com os patches (Plugins do Moodle Outra categoria) ! Se um plugin modifica ou repõe arquivos principais então tenha muito cuidado. Pode ser que só funcione com a versão exata do Moodle para a qual foi criado e é bem provável que não sobreviva a um upgrade do Moodle.
  • Veja estes (em inglês) e (em inglês) tópicos do fórum de usuários preocupados com a instalação de plugins.

Instalando um plugin

Para instalar um plugin, seu código-fonte deve ser colocado (instalado) no local certo dentro do diretório de instalação do Moodle e a página de administração principal Administração > Administração do site > Notificações deve ser visitado. Estas são as três maneiras de como um plugin pode ser instalado no Moodle.

O código do plugin pode ser instalado de dentro do Moodle, diretamente do diretório de plugins do Moodle ou por envio de arquivo ZIP. O servidor web deve ter acesso de escrita e leitura na pasta de plugin onde o novo plugin será instalado para usar quaisquer desses métodos.

Ainda assim, um plugin pode ser instalado manualmente no servidor.

Instalando diretamente do diretório de plugins do Moodle

  1. Entre no site como admin e vá para Administração do site > Plugins > Instalar plugins. (Se não conseguir encontrar essa página, então a instalação de plugins é proibida no seu site.)
  2. Clique no botão 'instalar plugins do diretório de plugins do Moodle'.
  3. Procure por um plugin com um botão de 'instalar', clique no botão e então clique em Continuar.
  4. Confirme o pedido de instalação.
  5. Confira o relatório de validação do plugin.

Instalando por envio de arquivo ZIP

  1. Go to the Moodle plugins directory, select your current Moodle version, then choose a plugin with a Download button and download the ZIP file.
  2. Login to your Moodle site as an admin and go to Administration > Site administration > Plugins > Install plugins.
  3. Upload the ZIP file. You should only be prompted to add extra details (in the Show more section) if your plugin is not automatically detected.
  4. If your target directory is not writeable, you will see a warning message.
  5. Check the plugin validation report
Install plugins
Plugin package validation

Installing manually at the server

If you can't deploy the plugin code via the administration web interface, you have to copy it to the server file system manually (e.g. if the web server process does not have write access to the Moodle installation tree to do this for you).

First, establish the correct place in the Moodle code tree for the plugin type. Common locations are:

  • /path/to/moodle/theme/ - themes
  • /path/to/moodle/mod/ - activity modules and resources
  • /path/to/moodle/blocks/ - sidebar blocks
  • /path/to/moodle/question/type/ - question types
  • /path/to/moodle/course/format/ - course formats
  • /path/to/moodle/admin/report/ - admin reports

See dev:Plugins for the full list of all plugin types and their locations within the Moodle tree.

  1. Go to the Moodle plugins directory; select your current Moodle version, then choose a plugin with a Download button and download the ZIP file.
  2. Upload or copy it to your Moodle server.
  3. Unzip it in the right place for the plugin type (or follow the plugin instructions).
  4. In your Moodle site (as admin) go to Settings > Site administration > Notifications (you should, for most plugin types, get a message saying the plugin is installed).

Note: The plugin may contain language files. They'll be found by your Moodle automatically. These language strings can be customized using the standard Settings > Site administration > Language editing interface. If you get a "Database error" when you try to edit your language files, there is a strong chance that the language files included within the downloaded ZIP file of this plugin have a coding problem. If you delete the plugin_name/lang/other_language_different_to_English/ folder with the new language strings and the database error disappears, this is indeed the case. Please notify the plugin maintainer, so that it can be fixed in future releases.

Troubleshooting

Errors

If you obtain an error, please turn debugging on to obtain additional information about the cause of the error.

Database error while doing a language customization
May not be related to the Language customization, but rather a problem with a recently installed plugin.
tool_installaddon/err_curl_exec - cURL error 60
This suggests problems with the validation of the SSL certificate of the remote (moodle.org) site. This is also a known problem in Moodle Windows 7 servers running the Moodle package for Windows. See SSL certificate for moodle.org for more info and possible solutions.

A file permissions error has occurred

On certain 3.0.x versions, when installing plugins via the administration interface, the Moodle uses the configuration settings $CFG->directorypermissions and $CFG->filepermissions. If these are not defined explicitly in your config.php, the default value is set automatically to 777 (rwxrwxrwx) for directories and 666 (rw-rw-rw-) for files (see lib/setup.php).

If this default behaviour does not fit your needs and hosting environment, you may wish to specify more strict setting such as

$CFG->directorypermissions = 02750;

A common error after installing plugins is that when you create an instance of the module and then save and display it, it reports the error, "A file permissions error has occurred. Please check the permissions on the script and the directory it is in and try again." If you get this, the file permissions of the package are mostl likely set to 711 preventing them from running correctly. With your preferred FTP client or via your web hosts control panel, set the file permissions of all the files and directories in the installed module, e.g. /moodle/mod/[myplugin]/ to 755 and then see if you can successfully view the module instance.

Default exception handler: Error writing to database Debug: Duplicate entry 'en_us-...

  • These errors are usually caused by a third party plugin.
  • To find the involved plugin, go to http://lang.moodle.org and use the AMOS tool to find all the strings with the given string identifier.
  • Remove the suspected plugin and check if the error has disappeared. If so, please contact the plugin maintainer and report this issue.
  • Please see this forum thread for known causes and fixes.

When installing manually

  • Check the file permissions. The web server needs to be able to read the plugin files. If the the rest of Moodle works then try to make the plugin permissions and ownership match.
  • Did you definitely unzip or install the plugin in the correct place?
  • Because Moodle scans plugin folders for new plugins you cannot have any other files or folders there. Make sure you deleted the zip file and don't try to rename (for example) an old version of the plugin to some other name - it will break.
  • Make sure the directory name for the plugin is correct. All the names have to match. If you change the name, then it won't work.

Obtaining help

Ask in a forum in Moodle in English. Make sure you describe your system (including versions of MySQL, PHP etc.), what you tried and what happened. Copy and paste error messages exactly. Provide the link to the version of the plugin you downloaded (some have very similar names).

Uninstalling a plugin

To uninstall a plugin

  1. Go to Administration> Site Administration > Plugins > Plugins overview and click the Uninstall link opposite the plugin you wish to remove
  2. Use a file manager to remove/delete the actual plugin directory as instructed, otherwise Moodle will reinstall it next time you access the site administration

Plugins overview

Plugins overview highlighting available check button

The Plugins overview page in Administration > Site Administration > Plugins > Plugins overview lists all installed plugins, together with the version number,release, availability (enabled or disabled) and settings link (if applicable).

A 'Check for available updates' button enables admins to quickly check for any updates available for plugins installed on the site (from the plugins directory). Any updates available are highlighted, with further information and a download link in the notes column opposite the plugin.

Plugin updating from within Moodle

An administrator can enable updates deployment in Administration > Site Administration > Server > Update notifications. Then when updates are available, 'Install this update' buttons are shown on the Plugins overview page. See Automatic updates deployment for more details.

Preventing installing plugins from within Moodle

If required, installing and updating from within Moodle can be prevented by copying the following lines of code from config-dist.php and pasting them in config.php.

// Use the following flag to completely disable the installation of plugins // (new plugins, available updates and missing dependencies) and related // features (such as cancelling the plugin installation or upgrade) via the // server administration web interface. $CFG->disableupdateautodeploy = true;

See also

For developers: