// json to array
export const json2Array = function (data: any, isValueToNumber = true) {
  return Object.keys(data).map(value => ({ label: data[value], value: isValueToNumber ? parseInt(value) : value }))
}

// 试题类型
export const questionType = {
  1: '单选题',
  2: '多选题',
  3: '问答题',
  5: '案例题',
  6: '判断题',
  7: '实操题',
  8: '情景题'
}
// 试题类型列表
export const questionTypeList = json2Array(questionType, false)

// 直播状态
export const liveStatus = {
  0: '未知',
  1: '直播未开始',
  2: '直播中',
  3: '直播已结束'
}
// 试题类型列表
export const liveStatusList = json2Array(liveStatus, false)
