Bloque Subir relaciones de tutor

De MoodleDocs

Este bloque permite que las relaciones entre usuarios (esto es, un usuario es asignado un rol adentro del contexto de otro usuario) sean creadas/conservadas actualizadas mediante archivos CSV. Fue escrito para tutores personales, pero podría funcionar igualmente bien para padres.

Puede ser operado de dos modos:

Subida Manual - cualquier usuario con la capacidad block/tutorlink:use capability (por defecto solamente administradore) puede subir un archivo para procesarlo bajo demanda.

Automático - se configura una localización de archivo, después el bloque revisa automáticamente esta localización. Si un archivo es encontrado, es procesado y los resultados son enviados por Email al administrador.


Nota: Pendiente de Traducir. ¡Anímese a traducir esta página!.     ( y otras páginas pendientes)

The block has several configuration options, found in Site Administration/Plugins/Blocks/Upload Tutor Relationships.

  • Tutor Role is the role that will be assigned by the block. As of 2.0, a role must be allowed to be assigned at the User context level before it can be selected here. This is configured on the role's Define Role page.
  • Location of File for Automatic Processing is the location of the file on the server's local file system to be processed by the block's cron job, allowing periodic updates of role assignments. Leaving this blank will disable the cron job.
  • Keep processed files allows files processed by cron jobs to be kept for future reference.
  • Processed file location is the folder that processed files will be placed in, if Keep processed files is ticked.
  • Days to keep processed files for is self-explanatory. After this many days, processed files will be deleted.


Correct File Format

The files to be processed should be in CSV format (hopefully no surprises there).

They may consist of any number of rows, each with three fields: tutor idnumber,tutee idnumber, action; it is important to note that the idnumbers are expected to be populated from an external database, they are not the id field in the user table. Action can be add or del, with add creating relationships and del deleting relationships. None of the fields should be delimited.

As of Moodle 2.0, the order of the fields changed slightly to make them more consistent with the Flatfile Enrolements plugin. The format for each row is now: action, tutor idnumber, tutee idnumber. For example, a file with this contents:

add, 1234, 4321
add, 1234, 4322
del, 2232, 3223

Will assign the user with the idnumber 1234 to users with idnumbers 4321 and 4321, then remove the user with idnumber 2232 from the user 3223.

Trying to add relationships that already exist in Moodle or remove those that dont will not cause problems, as this block will skip over those records.

Manual upload

After the CSV file is created, navigate to the page containing the block, and upload the file. It will be processed and a report will appear showing you the operations that were successful, along with any errors.

Automatic processing

A file placed at the path specified in Location of file for automatic processing will be processed automatically when the block's cron job runs. A report will then be emailed to the Moodle Administrator.