local QNManager = BaseClass("QNManager")
local __init = function(self)
  self.questionnaires = {}
  self.curIndex = 1
  self.questionList = {}
end
local __delete = function(self)
  self.questionnaires = nil
  self.curIndex = nil
  self.questionList = nil
end
local InitData = function(self)
  SFSNetwork.SendMessage(MsgDefines.UserGetQuestionnaireList)
end
local InitQNData = function(self, message)
  if message.questionnaires ~= nil then
    if message.questionnaires[1] then
      self.questionnaires = message.questionnaires[1]
    else
      self.questionnaires = nil
    end
    EventManager:GetInstance():Broadcast(EventId.QuestionnaireRefresh)
  end
end
local GetQuestionList = function(self)
  if self.questionnaires then
    return self.questionnaires
  end
end
local SetCurIndex = function(self, index)
  self.curIndex = index
end
local GetCurIndex = function(self)
  return self.curIndex
end
local SetQuestion = function(self, question, answer)
  self.questionList[question] = answer
end
local GetQuestion = function(self)
  return self.questionList
end
local GetRewardData = function(self)
  return self.questionnaires.reward
end
QNManager.__init = __init
QNManager.__delete = __delete
QNManager.SetCurIndex = SetCurIndex
QNManager.GetCurIndex = GetCurIndex
QNManager.SetQuestion = SetQuestion
QNManager.GetQuestion = GetQuestion
QNManager.DoWhenQAResultBack = DoWhenQAResultBack
QNManager.InitQNData = InitQNData
QNManager.GetRewardData = GetRewardData
QNManager.InitData = InitData
QNManager.GetQuestionList = GetQuestionList
return QNManager
