public ActionResult Negotiation(String negotiationId)
        {
            if (negotiationId == null) return RedirectToAction("Index");

            NegotiationEngine engine;
            if (negotiationId == null || !NegotiationManager.OnGoingNegotiations.TryGetValue(negotiationId, out engine))
                return new HttpStatusCodeResult(System.Net.HttpStatusCode.BadRequest);

            if (!engine.NegotiationActive)
            {
                return View("NegotiationEndView",
                    engine.GetEndModel());
            }

            NegotiationViewModel model = new NegotiationViewModel
            {
                Id = negotiationId,
                AiSide = engine.AiConfig.Side,
                HumanConfig = engine.HumanConfig,
                RemainingTime = engine.Status.RemainingTime,
                Domain = engine.Domain,
                Actions = engine.Actions,
                OpponentOffer = engine.Status.AiStatus.Offer,
                Offer = engine.Status.HumanStatus.Offer,
                LastAcceptedOffer = engine.Status.LastAcceptedOffer
            };

            return View(model);
        }
        public ActionResult SubmitTutorialAnswers(NegotiationTutorialModel model)
        {
            if (model == null || model.TutorialId == null)
            {
                return RedirectToAction("Negotiation");
            }

            if (!model.Questions.Select(x => x.Answer).SequenceEqual(NegotiationManager.TutorialModels[model.TutorialId].Questions.Select(x => x.ActualAnswer)))
            {
                ModelState.AddModelError("Wrong answer", "One or more answers was wrong.");
                return View("NegotiationTutorial", NegotiationManager.TutorialModels[model.TutorialId]);
            }

            NegotiationTutorialModel temp;
            NegotiationManager.TutorialModels.TryRemove(model.TutorialId, out temp);

            NegotiationEngine engine = NegotiationManager.OnGoingNegotiations[model.TutorialId];

            NegotiationViewModel newModel = new NegotiationViewModel
            {
                Id = model.TutorialId,
                AiSide = engine.AiConfig.Side,
                HumanConfig = engine.HumanConfig,
                RemainingTime = TimeSpan.FromSeconds(engine.Domain.NumberOfRounds * engine.Domain.RoundLength.TotalSeconds),
                Domain = engine.Domain,
                Actions = new List<NegotiationActionModel>()

            };

            engine.BeginNegotiation();

            return RedirectToAction("Negotiation", new { negotiationId = model.TutorialId });
        }