I've had a bit of time to myself, so I've quickly written the basic structure of what you might need it loads in data from a (local) csv and turns it into text in photoshop. It's enough to get you started, even if it just one question.
CSV is as follows:
1 What's Gwen Stefani's real name? Bob Gwendoline Stefani Gwen Renée Stefani Gwen Stacey C
photoshop_script is as follows:
var wordData = "pop_quiz.csv";
var dataPath = "C:\\temp";
var myStr = readIt(dataPath, wordData);
var quizArr = myStr.split("\t");
var question = "Question " + quizArr[0] + "\n" + quizArr[1];
var choice = "A: " + quizArr[2] + "\nB: " + quizArr[3] + "\nC: " + quizArr[4] + "\nD: " + quizArr[5];
var answer = "Answer: " + quizArr[6];
// create a document to work with
var docRef = app.documents.add(300, 150, 72, "Quiz Question");
var srcDoc = app.activeDocument;
// adjust text because photoshop dones
// old school new lines
question = replaceNewLine(question);
choice = replaceNewLine(choice);
// write question as photoshop text
createText("Arial-BoldMT", 12.0, 0,0,0, question, 25, 15);
createText("Arial-BoldMT", 10.0, 0,0,0, choice, 25, 50);
createText("Arial-BoldMT", 8.0, 128,128,128, answer, 25, 140);
//alert(question);
//alert(choice);
//alert("Answer: " + answer);
// function REPLACE NEWLINE (str) :replaces "\n" with "\r"
// ----------------------------------------------------------------
function replaceNewLine(str)
{
return str.replace(/(\n)/gm,"\r"); //replace newline
}
// function READ IT (path, filename) :returns string
// ----------------------------------------------------------------
function readIt(inPath, inFile)
{
var theFile = new File(inPath + "/" + inFile);
//read in file
var words = "";
var textFile = new File(theFile);
textFile.open('r');
while(!textFile.eof)
{
var line = textFile.readln();
if (line != null && line.length >0)
//if (line != null) // reads it as is
{
words += line + "\n";
}
}
textFile.close();
// return string
return words
}
// function CREATE TEXT(typeface, size, R, G, B, text content, text X pos, text Y pos)
// --------------------------------------------------------
function createText(fface, size, colR, colG, colB, content, tX, tY)
{
// Add a new layer in the new document
var artLayerRef = srcDoc.artLayers.add()
// Specify that the layer is a text layer
artLayerRef.kind = LayerKind.TEXT
//This section defines the color of the hello world text
textColor = new SolidColor();
textColor.rgb.red = colR;
textColor.rgb.green = colG;
textColor.rgb.blue = colB;
//Get a reference to the text item so that we can add the text and format it a bit
textItemRef = artLayerRef.textItem
textItemRef.font = fface;
textItemRef.contents = content;
textItemRef.color = textColor;
textItemRef.size = size
textItemRef.position = new Array(tX, tY) //pixels from the left, pixels from the top
}