"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getQuizById = exports.getActiveQuizCaluclatorType = exports.getActiveQuizId = void 0;

var _quizSessions = require("./quizSessions");

var path = 'quizzes';

var getActiveQuizId = function getActiveQuizId(state) {
  // For some reason this could be defined in one or the other of these, or neither.
  return state.getIn([path, 'activeQuizId']) || (0, _quizSessions.getActiveQuizSession)(state) && (0, _quizSessions.getActiveQuizSession)(state).get('quiz');
};

exports.getActiveQuizId = getActiveQuizId;

var getActiveQuizCaluclatorType = function getActiveQuizCaluclatorType(state) {
  return state.getIn([path, getActiveQuizId(state), 'calculatorType']);
};

exports.getActiveQuizCaluclatorType = getActiveQuizCaluclatorType;

var getQuizById = function getQuizById(state, id) {
  return state.getIn([path, id]);
};

exports.getQuizById = getQuizById;