.CSV Course upload error

.CSV Course upload error

by R Ali -
Number of replies: 7
Good day,

I am using  Moodle 3.0
mysql (5.5.44-0ubuntu0.14.04.1)
 
I have uploaded courses with from .CSV files. I have the course variables as "fullname, shortname, idnumber". I successfully uploaded a few of the files with no problem but soon I start having error messages that prevent the courses from being loaded but just one row from the file of many rows.

I will appreciate any help to solve this problem.

Thank you.


Attachment Kazam_screenshot_00027.png
Average of ratings: -
In reply to R Ali

Course upload error:

by R Ali -
I am still not able to solve this problem.

could someone help ?

The Error message:

Upload courses results

Coding error detected, it must be fixed by a programmer: Failed to unserialise data from file. Either failed to read, or failed to write.


Further information links says:

error/debug/codingerror

Coding errors (or coding_exceptions) are problems that are probably caused by incorrect code. For example a plugin that does not communicate correctly with Moodle core.

These errors are normally not caused by incorrect user input or temporary problems like the connection to the database server being down.

As with all error messages, it's a good idea to search moodle.org and the tracker to see if anyone else has reported the problem.


Thank you.....




In reply to R Ali

Re: Course upload error:

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

One thing... be careful what you create the files with. I always use LibreOffice (save in native format, *then* save in CSV for every export). In particular, I have found Microsoft Excel to be particularly good at creating broken files.

Average of ratings: Useful (2)
In reply to Howard Miller

Re: Course upload error:

by Chris Collman -
Picture of Documentation writers

How delicately put Howardsmile  Excel has been known to do funny things when logically it should know better.

When I have some time, I will be checking this feature  in more detail as described in MoodleDocs, then do some editing on the simpler stuff.

Chris

In reply to R Ali

Re: .CSV Course upload error

by Chris Collman -
Picture of Documentation writers

Hi,

I think more information would be helpful.  Can you attach an example of your csv file showing the first two lines: your field names and data for one course.

I notice you said one of the fields was idnumber did you mean this?   MoodleDocs says  you must have one of these three fields: category, category_idnumber, category_path.  

I created a course category called Testing and gave it an id of 1001.  Here is a bulk course upload csv file I uploaded.

 shortname,fullname,category_idnumber,summary,format,enrolment_1,enrolment_1_role
 TestLesson,Test Lesson,1001,For basic lesson testing,topics,manual,student

Did have a few issues. 1) I put "topic" as the format.  The preview screen had a red x and told me I had an invalid course format.  I changed that to "topics" and the next issue appeared. 2) I initially used the "category" field and put "Miscellaneous" in my record.   This did not work. When I edited the category Miscellaneous, I noticed it did not have an id number. Further it said it was not needed except for external programs (I conclude that a bulk course upload uses an external program called a csv file and is necessary).   I decided to create a new category and put in an id.  You can see in my example I used the category_idnumber field.  

The preview of my successful upload showed several columns that were blank: ID, ID_number and Status.  My guess is that these are mySQL fields in the course table and will be assigned once I clicked on the next button to process the file.

Hope some of this helps.

Chris




In reply to Chris Collman

Re: .CSV Course upload error

by R Ali -

Thank you for your response.


I am not too sure if the order matters I have used "fullname, shortname, idnumber" The idnumber here is the course ID, but I don't seem to see it in your list  here. I have been using this format all along till now. However I did not use any of these "category, category_idnumber, category_path". But I tried including the "category_idnumber" to see, but it does not make any difference to the error.


I have included a copy of the course file I am trying to upload here.


 

In reply to R Ali

Re: .CSV Course upload error

by R Ali -

Hello,

Thank you. I have resolved the problem, like you suggested, I included the "category_idnumber" in the field. Initially it did not work but when I tried few times after the first try it worked and subsequent upload was done without anymore error.

Before I tried uploading with the "category_idnumber" after the first try, I purged all cache by going (site Administration>Development>Purge all chache) and I think that helps. 


My new file upload after adding the "category_idnumber" looks like the attachment..

In reply to Chris Collman

Re: .CSV Course upload error

by Gus Hagelberg -

I have a similar issue.

I would like to bulk upload courses using a .csv file and add the enrolment method "course meta link" and to define which meta course is linked to which newly uploaded course. Like this:

fullname,shortname,category,enrolment_1,enrolment_1_link_course

Spanish-3,Spanish,1,meta,meta-link-course

Does anyone know if it is only possible to use the enrolment methods "self" and "manual" with the csv course upload?