'Private function used to save the answer_list stored in
survey_complete into answer records held in survey_answer'

@staticmethod
def importAnswers(complete_id, question_list):

    import csv
    import os
    strio = StringIO()
    strio.write(question_list)
    strio.seek(0)
    answer = []
    append = answer.append
    reader = csv.reader(strio)
    for row in reader:
        if (row != None):
            row.insert(0, complete_id)
            append(row)
    from tempfile import TemporaryFile
    csvfile = TemporaryFile()
    writer = csv.writer(csvfile)
    writerow = writer.writerow
    writerow(['complete_id', 'question_code', 'value'])
    for row in answer:
        writerow(row)
    csvfile.seek(0)
    xsl = os.path.join('applications', current.request.application, 'static', 'formats', 's3csv', 'survey', 'answer.xsl')
    resource = current.s3db.resource('survey_answer')
    resource.import_xml(csvfile, stylesheet=xsl, format='csv')
