def saveAnswers(questions, series_id, complete_id, rvars):
 text = ''
 table = current.s3db.survey_complete
 for question in questions:
  code = question['code']
  if ((code in rvars) and (rvars[code] != '')):
   line = ('"%s","%s"\n' % (code, rvars[code]))
   text += line
 if (complete_id is None):
  record_id = table.insert(series_id=series_id, answer_list=text)
  S3SurveyCompleteModel.completeOnAccept(record_id)
  return record_id
 else:
  current.db((table.id == complete_id)).update(answer_list=text)
  S3SurveyCompleteModel.completeOnAccept(complete_id)
  return complete_id

def saveAnswers ( questions , series_id , complete_id , rvars ) : text = '' table = current . s3db . survey_complete for question in questions : code = question [ 'code' ] if ( ( code in rvars ) and ( rvars [ code ] != '' ) ) : line = ( '"%s","%s"\n' % ( code , rvars [ code ] ) ) text += line if ( complete_id is None ) : record_id = table . insert ( series_id = series_id , answer_list = text ) S3SurveyCompleteModel . completeOnAccept ( record_id ) return record_id else : current . db ( ( table . id == complete_id ) ) . update ( answer_list = text ) S3SurveyCompleteModel . completeOnAccept ( complete_id ) return complete_id
insert/update a record in survey_complete .