private NegotiationTutorialModel CreateTutorialModel(string id) { NegotiationEngine engine = NegotiationManager.OnGoingNegotiations[id]; SideConfig config = engine.HumanConfig; NegotiationSideDescription desc = engine.Domain.OwnerVariantDict[config.Side][config.Variant]; int optoutend = engine.Domain.CalculateOptoutScore(config, NegotiationManager.TotalRounds); return(new NegotiationTutorialModel { TutorialId = id, Questions = new List <QuestionModel> { new QuestionModel { Question = "Whose side are you playing in the negotiation?", Options = engine.Domain.OwnerVariantDict.Keys.ToList(), ActualAnswer = config.Side }, new QuestionModel { Question = "If the same agreement was reached in round 3 or in round 6, which of the following is correct?", Options = new List <string> { "They have the same score.", "Round 3 will have a higher score.", "Round 6 will have a higher score" }, ActualAnswer = "Round 3 will have a higher score." }, new QuestionModel { Question = "What is your score if no agreement had been reached by the end of the last round?", Options = new List <string> { "0", "No score - you have lost the negotiation", optoutend.ToString() }, ActualAnswer = optoutend.ToString() }, new QuestionModel { Question = "What is the meaning of \"opting out\"?", Options = new List <string> { "It means that the other side won the negotiation.", "It means you get a predetermined amount of points minus the time decrease." }, ActualAnswer = "It means you get a predetermined amount of points minus the time decrease." } } }); }
private NegotiationSideDescription ExtractVariant(XmlNode node) { NegotiationSideDescription desc = new NegotiationSideDescription(); XmlDocument doc = new XmlDocument(); doc.LoadXml(NegotiationManager.GameDomain.DomainVariant.First(x => x.Name == node.Attributes["utility_space"].Value).VariantXML); desc.Extract(doc); desc.Name = node.Attributes["personality"].Value; return desc; }