You could use the "data" parameter of the plugin to add information to the saved data. Since I'm not sure exactly how your experiment is set up, I don't know the best way for you to do this, but here is an example to hopefully get you headed in the right direction:
var questions = [
{question_id: 1, prompt: 'This is the text of question 1.'},
{question_id: 2, prompt: 'This is the text of question 2.'},
{question_id: 3, prompt: 'This is the text of question 3.'}
];
var random_question = jsPsych.randomization.sample(questions, 1); // pick one question at random from the questions array
var trial = {
type: 'survey-likert',
questions: [[random_question.prompt]],
// other parameters for the plugin...
data: [{question_id: random_question.question_id}]
};
What the above code will do is record a field called 'question_id' with the data file. This would let you know exactly which question was asked.
--Josh