> For the complete documentation index, see [llms.txt](https://ajuda.rnp.br/conferenciaweb/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ajuda.rnp.br/conferenciaweb/manuais-de-uso-do-servico/manual-do-administrador/setup-de-grupos-moodle.md).

# Setup de grupos Moodle

Sendo admin do Moodle:

* Criar um novo serviço externo (`Administração do site` → `Servidor` → `Web services` → `Serviços externos` → `Adicionar`) conforme abaixo:
  1. Nome: `confweb-lti-external-service`
  2. Nome breve: `ConferênciaWeb`

<figure><img src="https://4071737184-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M7hXYp2PZ9COGqQOKpE%2Fuploads%2F7dT2g8rnSuzaGr1sW4od%2FUntitled.png?alt=media&amp;token=a499e431-e186-4f59-9a49-ecac9d50440a" alt=""><figcaption></figcaption></figure>

No Moodle 3.8 o caminho é Administração do site → Plugins → Web services → Serviços externos → Adicionar

* Na tela seguinte, clique em Adicionar funções

<figure><img src="https://4071737184-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M7hXYp2PZ9COGqQOKpE%2Fuploads%2FYnUKnba3boSnGiGl8HfW%2FUntitled%20(1).png?alt=media&amp;token=86888f69-3e91-4e37-8562-9778c8aed09b" alt=""><figcaption></figcaption></figure>

3. Selecione as seguintes funções
   * `core_group_get_activity_groupmode`
   * `core_group_get_course_user_groups`
   * `core_course_get_course_module_by_instance`
   * `core_group_get_course_groups`
   * `core_webservice_get_site_info`
   * `core_calendar_create_calendar_events`
   * `core_calendar_delete_calendar_events`
   * `core_calendar_update_event_start_day`

<figure><img src="https://4071737184-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M7hXYp2PZ9COGqQOKpE%2Fuploads%2F4BetSLQV52d8pRzsKqD6%2FUntitled%20(4).png?alt=media&amp;token=b30f5478-c39e-4f0a-87cf-c43e69998056" alt=""><figcaption></figcaption></figure>

Clique em Adicionar funções

<figure><img src="https://4071737184-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M7hXYp2PZ9COGqQOKpE%2Fuploads%2F4knSs49mNE6LRp13phoN%2FUntitled%20(5).png?alt=media&amp;token=7546d709-2381-4441-ac6e-7caaf5e17db5" alt=""><figcaption></figcaption></figure>

Criar um novo token (Administração do site → Servidor → Web services → Gerenciar tokens) conforme abaixo:

<figure><img src="https://4071737184-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M7hXYp2PZ9COGqQOKpE%2Fuploads%2FCmERBC55qYsOCnArhBin%2FUntitled%20(6).png?alt=media&amp;token=5516544b-2ae3-4481-8b14-abd030c5d5d8" alt=""><figcaption></figcaption></figure>

{% hint style="danger" %}
É importante notar que:

* O nome do usuário é o nome de quem está criando o token;

* O serviço precisa ser o recém-criado (confweb-lti-external-service);

* O checkbox do Válido até está DESMARCADO. Caso queira posteriormente invalidar o token, o mesmo pode ser excluído na página Gerenciar tokens.
  {% endhint %}

* Ao clicar em Salvar mudanças, a seguinte página mostrará o token uma única vez, então anote em algum lugar seguro.

<figure><img src="https://4071737184-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M7hXYp2PZ9COGqQOKpE%2Fuploads%2Fa6LDetaV4wUTmmSGqLi3%2FUntitled%20(7).png?alt=media&amp;token=9e90861e-c265-4f2b-b1db-a6191194548f" alt=""><figcaption></figcaption></figure>

* Caso exista um papel específico atribuído a web services, garanta que as seguintes permissões foram atribuídas:

* `mod/lti:view`

* `moodle/course:view`

* `webservice/rest:use`

* Na página de configuração do curso (Página inicial do curso → Configurações), na aba de Grupos é necessário que o campo Modalidade grupo seja Grupos separados ou Grupos visíveis e o campo Forçar modalidade grupo, seja Sim, conforme abaixo:

<figure><img src="https://4071737184-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M7hXYp2PZ9COGqQOKpE%2Fuploads%2FjA041wjCukDV83cFW0fZ%2FUntitled%20(8).png?alt=media&amp;token=69feb825-9660-4cb0-9254-d82122d175c9" alt=""><figcaption></figcaption></figure>

* Enviar para o Service Desk da RNP (<atendimento@rnp.br>):
  * Identificar-se como instituição que utiliza o ConferênciaWeb via Moodle
  * Informar a chave LTI configurada (ex: Moodle-ESR-LTI-1). Caso o Moodle ainda não tenha credencial LTI configurada, informar que ainda não faz uso do ConferênciaWeb e que precisa de uma credencial LTI
  * Informar o token criado através do passo a passo acima (ex: 4d107ac7a4612d3f142da4884f2a17fa)
  * Informar a URL de webservices da instância do Moodle onde o token foi criado (ex: <https://moodle.h.elos.dev/webservice/rest/server.php>)

{% hint style="info" %}
Dica 1: ao acessar a URL, uma mensagem de “token inválido” será apresentada, o que significa que é a URL correta.
{% endhint %}

{% hint style="info" %}
Dica 2: a URL pode ou não ter o path /moodle antes do /webservice, vai depender das configurações do Moodle.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ajuda.rnp.br/conferenciaweb/manuais-de-uso-do-servico/manual-do-administrador/setup-de-grupos-moodle.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
