/// <summary> /// возвращает варианты ответов /// </summary> /// <param name="ordNumb">номер вопроса</param> /// <returns>варианты ответов</returns> internal InlineKeyboardMarkup CreateAnsInlineKeyboard(int ordNumb, Guid guid) { BotLinq.Ask ask = BotLnq.GetAskByOrd(ordNumb); IEnumerable <InlineKeyboardButton[]> ikm = BotLnq .GetRandomizedAnsByAsk(ask) .Select(x => new[] { InlineKeyboardButton.WithCallbackData( x.Ind.ToString() + ") " + x.AnsTxt, (x.TrueInd.ToString().ToUpper() == "Y" ? BotForm.YesCmd : BotForm.NoCmd) + ":" + guid.ToString() + ":" + x.Ind.ToString() ) } ); List <InlineKeyboardButton[]> ikmL = ikm.ToList(); ikmL.Add(new[] { InlineKeyboardButton.WithCallbackData(SkipCommand.Key, SkipCommand.Value + ":" + guid.ToString()) }); InlineKeyboardMarkup inlineKeyboard = new InlineKeyboardMarkup(ikmL.ToArray()); return(inlineKeyboard); }
/// <summary> /// возвращает текст вопроса /// </summary> /// <param name="ordNumb">номер вопроса</param> /// <returns>текст вопроса</returns> internal string CreateHeader(int ordNumb) { BotLinq.Ask ask = BotLnq.GetAskByOrd(ordNumb); return(ask.AskTxt); }