'use strict';

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

var _react = require('react');

var _react2 = _interopRequireDefault(_react);

var _Quiz = require('../../../../common/records/Quiz');

var _Quiz2 = _interopRequireDefault(_Quiz);

var _QuizSession = require('../../../../common/records/QuizSession');

var _QuizSession2 = _interopRequireDefault(_QuizSession);

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

var quiz = {};
var quizSession = { id: 1 };
var attemptHistory = [{
  authoritative: true,
  displayName: 'Attempt 1',
  percentage: 0.711
}, {
  authoritative: false,
  displayName: 'Attempt 2',
  percentage: 120
}];

exports.default = {
  permutations: [{
    scenarios: [{ quiz: quiz, quizSession: quizSession }, {
      quiz: quiz, quizSession: quizSession, additionalProps: {
        shouldShowLinkButton: false
      }
    }, {
      quiz: { requireStudentAccessCode: true },
      quizSession: quizSession
    }, {
      quiz: { requireStudentAccessCode: true },
      quizSession: quizSession,
      additionalProps: {
        accessCodePromptPermitted: false
      }
    }, {
      quiz: { requireStudentAccessCode: true },
      quizSession: { id: 1, acceptedStudentAccessCode: true }
    }, {
      quiz: quiz, quizSession: { id: 1, status: 'pending' }
    }, {
      quiz: quiz, quizSession: quizSession, additionalProps: {
        isOneAtATime: true
      }
    }, {
      quiz: quiz, quizSession: quizSession, additionalProps: {
        allowBacktracking: true,
        isOneAtATime: true
      }
    }, {
      quiz: quiz, quizSession: quizSession, additionalProps: {
        accessCodeStatus: true
      }
    }, {
      quiz: { requireStudentAccessCode: true },
      quizSession: quizSession,
      additionalProps: {
        accessCodeStatus: false
      }
    }, {
      quiz: quiz, quizSession: quizSession, additionalProps: {
        children: _react2.default.createElement(
          'div',
          null,
          'Once upon a time...'
        )
      }
    }, {
      quiz: { filterIpAddress: true },
      quizSession: { id: 1, ipIsAllowed: true }
    }, {
      quiz: { filterIpAddress: true },
      quizSession: quizSession
    }, {
      quiz: { valid: false },
      quizSession: quizSession
    }, {
      quiz: quiz, quizSession: quizSession, additionalProps: {
        extraInfoBoxes: [{ mainText: 'Rain', subText: 'Mainly on the plain' }]
      }
    }, {
      quiz: quiz, quizSession: quizSession, additionalProps: {
        attemptHistory: attemptHistory
      }
    },
    // kitchen sink example
    {
      quiz: { requireStudentAccessCode: true, hasTimeLimit: true, sessionTimeLimitInSeconds: 12345 },
      quizSession: { id: '1', status: 'pending' },
      additionalProps: {
        accessCodeStatus: false,
        allowBacktracking: false,
        attemptHistory: attemptHistory,
        extraInfoBoxes: [{ mainText: 'A', subText: 'Bbbbbbb' }],
        isOneAtATime: true,
        children: _react2.default.createElement(
          'div',
          null,
          'Kitchen sinks are surprisingly heavy'
        )
      }
    }]
  }],
  renderProps: function renderProps(props) {
    return {
      componentProps: Object.assign({
        accessCode: "foo",
        accessCodePromptPermitted: true,
        accessCodeStatus: null,
        allowBacktracking: false,
        attemptHistory: null,
        children: [],
        clearAccessCodeStatus: Function.prototype,
        confirmSessionStartPage: Function.prototype,
        extraInfoBoxes: [],
        isOneAtATime: false,
        onAttemptClick: Function.prototype,
        onInProgress: Function.prototype,
        onIsGraded: Function.prototype,
        onIsPending: Function.prototype,
        onNeedsGrading: Function.prototype,
        quiz: new _Quiz2.default(props.scenarios.quiz),
        quizSessionId: "1",
        quizSession: new _QuizSession2.default(props.scenarios.quizSession),
        scoreToKeep: "latest",
        shouldShowLinkButton: true,
        submitStudentAccessCode: Function.prototype,
        updateAccessCodeUi: Function.prototype
      }, props.scenarios.additionalProps || {})
    };
  }
};