import {
  displayList,
  serialNumberTypeList,
  serialNumberPositionList,
  arrangeTypeList,
} from '@/views/book/courseware/data/common';
import { getRandomNumber } from '@/utils';

export { arrangeTypeList };

/**
 * 获取选择题属性
 */
export function getSelectProperty() {
  return {
    serial_number: 1,
    sn_type: serialNumberTypeList[0].value,
    sn_position: serialNumberPositionList[0].value,
    sn_display_mode: displayList[0].value,
    arrange_type: arrangeTypeList[0].value,
  };
}

export function getOption() {
  return {
    content: '',
    mark: getRandomNumber(),
  };
}

/**
 * 获取选择题数据
 */
export function getSelectData() {
  return {
    type: 'select',
    title: '选择',
    option_list: [getOption(), getOption(), getOption()],
    answer: {
      answer_list: [],
    },
    min_height: 200,
    min_width: 280,
    property: getSelectProperty(),
  };
}
