Importing and exporting a CSV question file

Comma-separated value (CSV) files are delimited text files containing questions that have been exported from spreadsheets like Microsoft Excel®, Microsoft Access® and Google Sheets®.

You can import and export the following questions types within CSV files:

The format is similar for each question type:

For the question text, choices and feedback, keep these rules in mind:

Complete each field in the records as follows:

Field (* = required) Description
NAME* Name to be used for the question. This will also be used for the page name and the variable name.
TYPE*

Abbreviation representing the question type as either:

TF True or false
MC Multiple choice
MR Multiple response
FI Fill in the blank
NE Number entry
MT Matching
RS Rank/sequence
SA Short answer
ES Essay
QUESTION TEXT* Text of the question.
QUESTION OPTIONS

Options for questions depending on the question type. Leave empty to use the default options for the question:

GE Grade each choice. The default is no. Applies to multiple response, matching, and rank/sequence questions.
PT:#. Points, where # represents the point value of the question. The default is 1. Applies to all question types, except for short answer and essay.
AT:# The number of attempts allowed for the question. The default is unlimited. If feedback is enabled for the question, default attempts feedback will be issued.
FEEDBACK OPTIONS

Options for feedback. Leave empty for no feedback:

Y Enable correct/incorrect feedback. Applies to all questions types.
B Individual feedback by choice. Applies to multiple choice questions.
P Issue feedback when the question is processed; otherwise, issue immediate feedback. Applies to all questions types.
You can use B P to indicate a multiple choice question will have individual feedback by choice, issued when the question is processed (not immediately).
CORRECT FEEDBACK Custom correct feedback (if feedback is set in FEEDBACK OPTIONS). If this field is empty, the default correct feedback will be used (see Specifying publish strings preferences).
INCORRECT FEEDBACK Custom incorrect feedback (if feedback is set in FEEDBACK OPTIONS. If this field is empty, the default incorrect feedback will be used (see Specifying publish strings preferences).
CHOICE OPTIONS

Options for choices depending on the question type:

CC:#* Correct choice, where # represents the number of the correct choice. If no choice is entered, the default is CC:1. For multiple response questions, # should contain the multiple correct choices (for example CC:1 CC:3 CC:4). Applies to true or false, multiple choice, and multiple response question types.
ALL The correct answer requires all of the choices/rules. Applies to fill in the blank and number entry questions. When not used, the default (ANY) will apply for the question.
ML Create a multi-line entry field for the question. Applies to fill in the blank questions.
CS Choices are case sensitive. Applies to fill in the blank questions.
TL:# Text limit where # represents the maximum length of the answer. The default is 4 (TL:4) for number entry questions, 50 (TL:50) for fill in the blank questions, 40 (TL:40) for short answer questions, and 1024 (TL:1024) for essay questions.
DL Show choices in a drop-list. Applies to multiple choice and rank/sequence questions.
LB Show choices in a list box. Applies to multiple response questions.
CHOICE TEXT*

The text for each answer choice:

  • True or false questions will only use the first two choices entered. If CHOICE TEXT is left blank, the default localized strings for True and False are used (see Specifying publish strings preferences).

  • For number entry questions, the CHOICE TEXT field contains a single value to evaluate against the following relationships:

    - Equal

    - Not Equal

    - Less Than

    - Less Than or Equal

    - Greater Than

    - Greater Than or Equal

  • For number entry questions, the CHOICE TEXT field contains the two values to evaluate against the relationships of BETWEEN INCLUDING or BETWEEN EXCLUDING.

  • For matching questions, the CHOICE TEXT field contains the left-column text to match the CHOICE INFO text (right-column).

  • For matching questions, a choice that contains CHOICE TEXT only will be treated as a left-column distractor.

CHOICE INFO

Extra data used based on the question type:

  • For multiple choice questions, the CHOICE INFOfield contains the text for any customized feedback by choice. (Feedback option B must be entered.)

  • For number entry questions, the CHOICE INFO field contains one of the following relationship indicators used to evaluate the CHOICE TEXT value(s):

    EQ Equal (default if left blank)
    NE Not Equal
    LT Less Than
    LE Less Than or Equal
    GT Greater Than
    GE Greater Than or Equal
    BI Between Including
    BE Between Excluding
    For number entry and fill in the blank questions, you can evaluate combinations of choices. Use the ALL choice option to indicate the correct answer requires all of the choices/rules. (For example: ALL,1,GE,3,LT would mean: all of the following; greater than or equal to 1 and less than 3.) When not used, the default (ANY) will apply for the question.
  • For matching questions, the CHOICE INFO field contains the right-column text to match the CHOICE TEXT (left-column).

  • For matching questions, a choice that contains CHOICE INFO only will be treated as a right-column distractor.

    For matching questions, at least one choice with both the CHOICE TEXT and CHOICE INFO is required.

The pair of CHOICE TEXT and CHOICE INFO is repeated for each answer choice.

To view and download a sample CSV import file, visit the discussion Working with CSV Question Files in Lectora in our Trivantis Community.

Although a spreadsheet application is recommended, CSV files can also be created in text format using a program such as Notepad or Notepad ++. Where columns are indicated in the sample above, instead insert a comma between each field. If you are using a text-file version of CSV, text that contains a comma must be enclosed within quotes. “For example, this sentence contains a comma.”

To import a CSV file:

  1. In the Title Explorer, highlight the page after which you want to insert the questions from the CSV file.

  2. From the Test & Survey ribbon, click Import CSV from the CSV Question File group. The Import CSV Question File window opens.

  3. Use the File to Import field to specify the file to import or click the Browse button to navigate and select the CSV file.

  4. Enable the Create as Test check box to create a test and import the question file within the test.

  5. To offset the question on the page, enable the Offset question on page check box. This enables the X offset and Y offset fields. The X offset is the pixel distance from the left edge of the page. The Y offset is the pixel distance from the top edge of the page.

  6. In the Font and Color box, use the controls to select the appropriate text style, font, font size, highlighting, and text color for the questions being imported. For details, see Working with text.

  7. Click OK.

The questions are imported, one per page.

You can also export individual questions from within the title or all of the questions within a test, test section, or survey.

The total number of questions successfully exported will be reported, along with any errors or questions unable to be exported.

To export individual questions:

  1. In the Title Explorer, double-click the graphic of the question. The Properties tab opens. To select multiple questions, click the first question, then press and hold the CTRL key while you click the other questions.

  2. On the Properties tab, click the graphic below the Variable field in the first group. The Export to CSV window opens.

  3. Navigate to the appropriate location.

  4. Name the CSV file and click Save.

The question export file is saved.

Alternatively, in the Title Explorer, highlight the test, test section, or survey to export all of the questions contained within to a CSV file. Double-click on the object to view the Properties ribbon.

To export all the questions within a test, test section, or survey:

  1. In the Title Explorer, double-click the graphic of the test, test section, or survey. The Properties tab opens. To select multiple tests, test sections, or surveys, click the first test, test section, or survey, then press and hold the CTRL key while you click the other tests, test sections, or surveys.

  2. On the Properties tab, click the Export to CSV graphic in the Test group. The Export to CSV window opens.

  3. Navigate to the appropriate location.

  4. Name the CSV file and click Save.

The question export file is saved.

Open the CSV file using your spreadsheet application (recommended) or a text editor.

Additional resources: Private: Bulk Import Questions Using CSV Files

Knowledge Base | Training | Support
© Copyright eLearning Brothers 2021