Note: You are currently viewing documentation for Moodle 3.9. Up-to-date documentation for the latest stable version of Moodle may be available here: qformat/dcsimplecsv.

qformat/dcsimplecsv

From MoodleDocs

The Simple CSV format is for importing questions to be used with the Quiz module. The format has been developed within the Moodle Community but this particular version has been enhanced by Dual Code to better support True and False questions as well as the 'All or Nothing' multiple choice question type.

Overall structure of CSV file

The file must be a CSV file. The general format looks like this:

"category","question text", "correct answer 1", "correct answer 2",..."correct answer N","","wrong answer 1","wrong answer 1",..."wrong answer N",

Where:

  • You add one question per row
  • An empty cell separates the correct answer(s) from the wrong answer(s)
  • The number of correct answers and wrong answers may differ from each other inside the row and between rows
  • The "category" column is optional. You may leave it empty and select a category via the user interface when importing your questions instead. But the column must be present in the CSV. In other words, if you decide not to specify the category, you must add an empty column (e.g. "")
  • If you use the words 'True" and "False", the import will generate a True/False question type. Otherwise, it will use the "All or Nothing" multiple choice question type


The multiple choice questions automatically have "shuffled" enabled. If your choice include options like "All of the above" or "A and C above", you will need to manually go back to edit the question after you've imported it and manually to disable shuffling and re-order the options such that "All of the above" appears as the last option in the list.

All or Nothing Multiple Choice

An example of an "All or Nothing multiple choice" with 1 right answer and 6 wrong answers that would go in a question category called "Managing Users" would be written like this:

Managing Users,Which of the following can a username NOT contain?,A question mark,,Alphabetical letters in lowercase,Numbers,Hyphens,Underscores,A Period,The At character (@)

An example of an "All or Nothing multiple choice" with 3 right answers and 1 wrong answer that would go in a question category called "Managing Users" would be written like this:

Managing Users,Which of the following can a username contain?,Alphabetical letters in lowercase,Numbers,Hyphens,,A question mark

An example of an "All or Nothing multiple choice" with the "All of the above" option that would go in a question category called "Managing Users" would be written like this:

Managing Users,Which of the following can a username NOT contain?,All of the above,,A question mark,,Alphabetical letters in lowercase,Numbers,Hyphens,Underscores,A Period,The At character (@)

Note that for this last example, you will need to manually go back to edit the question after you've imported it and manually to disable shuffling and re-order the options such that "All of the above" appears as the last option in the list.

True or False

An example of a "True or False" question where the right answer is true in a question category called "Managing Users" would be written like this:

Managing Users,The At character (@) is allowed in usernames,true,,false

An example of a "True or False" question where the right answer is false in a question category called "Managing Users" would be written like this:

Managing Users,A question mark is allowed in usernames,false,,true

See also