'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = undefined;

var _classCallCheck2 = require('babel-runtime/helpers/classCallCheck');

var _classCallCheck3 = _interopRequireDefault(_classCallCheck2);

var _createClass2 = require('babel-runtime/helpers/createClass');

var _createClass3 = _interopRequireDefault(_createClass2);

var _possibleConstructorReturn2 = require('babel-runtime/helpers/possibleConstructorReturn');

var _possibleConstructorReturn3 = _interopRequireDefault(_possibleConstructorReturn2);

var _inherits2 = require('babel-runtime/helpers/inherits');

var _inherits3 = _interopRequireDefault(_inherits2);

var _reduxRecord = require('./reduxRecord');

var _reduxRecord2 = _interopRequireDefault(_reduxRecord);

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var QtiImport = function (_ReduxRecord) {
  (0, _inherits3.default)(QtiImport, _ReduxRecord);

  function QtiImport() {
    (0, _classCallCheck3.default)(this, QtiImport);
    return (0, _possibleConstructorReturn3.default)(this, (QtiImport.__proto__ || Object.getPrototypeOf(QtiImport)).apply(this, arguments));
  }

  (0, _createClass3.default)(QtiImport, [{
    key: 'progressNumber',
    value: function progressNumber() {
      switch (this.status) {
        case 'importing':
          return this.progress;
        case 'completed':
          return 1.0;
        default:
          // Scheduled, failed
          return 0.0;
      }
    }
  }, {
    key: 'isImporting',
    value: function isImporting() {
      return this.status === 'importing';
    }
  }]);
  return QtiImport;
}((0, _reduxRecord2.default)({
  id: 0,
  quizId: null,
  status: null,
  url: null,
  message: null,
  progress: 0.0
}));

exports.default = QtiImport;