Predifined data

Predifined data

by Stephan Tedesco -
Number of replies: 2

I need to have the ability to add predifined user data from .xml or .csv files (upload one file for all attendancees) into the face-to-face, i.e we have in the data same fields, as if the user is filling alone the sign-up for face-to-face, just in my case it will be done for all users from the admin/trainer of the course. 

Is there any suitable solution?

Thank you in advance for the help. 


Stephan

Average of ratings: -
In reply to Stephan Tedesco

Re: Predifined data

by Stephan Tedesco -

Here is the progress so far: 

I managed to make new face-to-face activity in Moodle and to add upload function for administrator purposes under mod/newf2f/mod_form.php 


The upload function is based on the Import Grades functionality, sofar I did't changed anything in it, as it accepts Excel and cvs fiels.

The question here is, how to manage the communication between the Import of the file and the data for the face-to-face, this way the data for the face-to-face will be filled from the excel file at the time of the import, not manually from the administrator.

Any idea?

It should be like reverse function of "Export attendance" in the sessions page of F2F, where we get all the data for the sessions (start data, finish date, room, status, first name, surname, etc.)

It sounds very complicated, or it is just to me this way, as I am new in developing custom functionality to Moodle. 

Any help/advice will be appreciated. 

S.

In reply to Stephan Tedesco

Re: Predifined data

by Stephan Tedesco -

The progress so far:


In mod/facetoface/notifications/edit.php 

We add fields from the csv-file to be processed with:

 $fields=fgetcsv($filehandle,0,$this->config->delimiter);

    var_dump($fields)

    $data=array();

    while($row=fgetcsv($filehandle,0,$this->config->delimiter))

    {

The data ist still uploading, but notting is added to the activity, any suggestions why?