Importing outcomes

Importing outcomes

by John Savage -
Number of replies: 2

Just started working in 2.4.4. Excited about the prospect of using outcomes and tracking completion of outcomes via online assignments.

I can create outcomes OK but I'm having difficulty importing them via a CSV file.

Interestingly I followed the recommendation of following format of existing outcomes viewed as an exported .CSV. I wasn't able to import (an unedited) previously exported .CSV file.  In this case I would expect the format to be perfect but obviously not.

I am a non technical member of staff, but the perfect candidate to trial this, as I will be expecting all teaching staff to import their own lists of outcomes for each course as term starts in the coming weeks.

The failed import message is listed below, and the test outcome file is attached. The scale has been set up as a standard scale inour Moodle.

 

"The uploaded file is empty or corrupted. Please verify this is a valid file. The problem was detected at line 2; this is triggered by the data lines not having as many columns as the first line (the header line) or if the imported file is missing expected headers. Look at the exported file for an example of a file with valid header."

Average of ratings: -
In reply to John Savage

Re: Importing outcomes

by John Savage -

I have even tried to upload the specific example used in the Moodle Docs.

outcome_name;outcome_shortname;outcome_description;scale_name;scale_items;scale_description

Participation;participation;;Participation scale;"Little or no participation, Satisfactory participation, Full participation";

 

and that still wont import without the error message:-

The uploaded file is empty or corrupted. Please verify this is a valid file. The problem was detected at line 2; this is triggered by the data lines not having as many columns as the first line (the header line) or if the imported file is missing expected headers. Look at the exported file for an example of a file with valid header.

 

I really need some help here.

In reply to John Savage

Re: Importing outcomes

by Guillermo Madero -

Hi John,

It is as the message says: The problem was detected at line 2; this is triggered by the data lines not having as many columns as the header line.

A CSV (Comma Separated Values) file is a text file in which you have a header line followed by one or more data lines. Each line consists of "fields" (column titles, in the header line; and data, in the data line) separated by a special character (usually a comma, but others can be used, like a tabulation character).

Text fields are usually delimited by a starting and ending double quote, like so: "Title 1" or "this is a short description field". Numeric fields just have numbers (or number related characters, like dash, dot).

From the data you posted, you have six header fields:

"outcome_name"
"outcome_shortname"
"outcome_description"
"scale_name"
"scale_items"
"scale_description"

You should then also have six data fields. If I interpreted correctly, this is what you should have:

"Unit 1: Criteria 1"
"1.1"
"<div class='text_to_html'>Understand requirements for a specific media production</div>"
"BTEC"
"Referred,Pass,Merit,Distinction"
""

Then, your csv file should have the following two lines:

"outcome_name","outcome_shortname","outcome_description","scale_name","scale_items","scale_description"
"Unit 1: Criteria 1","1.1","<div class='text_to_html'>Understand requirements for a specific media production</div>","BTEC","Referred,Pass,Merit,Distinction",""

An empty field can just be left out, but to make things clearer I decided to use an opening and a closing double quote.

Take into consideration, if you use accented or special characters, that Excel does not save CSV files in UTF8.

You might want to try and use a CSV editor like: http://csved.sjfrancke.nl/

Finally, take into account that in Moodle you need to specify what was the delimiting character you used in the CSV file you are uploading.

Cheers!

Average of ratings: Useful (1)