private void GetContentSample(int id) { var contentTemplate = new AnswerContent { ID = new ID() { id = id, idSpecified = true } }; var securityOptions = new ContentSecurityOptions(); var viewOrigin = new ContentViewOrigin { ID = new ID() { id = id, idSpecified = true } }; var answerContent = (AnswerContent)client.GetContent(header, knowledgeInteractionId, contentTemplate, securityOptions, viewOrigin); Console.WriteLine("---------Answer Details------------"); Console.WriteLine("Answer Type Name: " + answerContent.AnswerType.Name); Console.WriteLine("Answer Question: " + answerContent.Question); Console.WriteLine("Answer Solution: " + answerContent.Solution); Console.WriteLine("Answer Keywords: " + answerContent.Keywords); Console.WriteLine("--------End Answer Details---------"); }
private void RateContentSample(int id) { var contentTemplate = new AnswerContent { ID = new ID() { id = id, idSpecified = true } }; var contentRate = new ContentRate { ID = new ID() { id = id, idSpecified = true } }; var contentRateScale = new ContentRate { ID = new ID() { id = id, idSpecified = true } }; var status = client.RateContent(header, knowledgeInteractionId, contentTemplate, contentRate, contentRateScale); //Request status information //Description will only be set if there is a problem with the request Console.WriteLine("Content Request Status Information:"); Console.WriteLine("Description: " + status.Description); Console.WriteLine("Elapsed Time(ms): " + status.ElapsedTimeInMilliSeconds); Console.WriteLine("Status Name: " + status.Status.Name); }
public void ShuffleOptions() { for (int i = 0; i < options.Length; i++) { AnswerContent temp = options[i]; int r = Random.Range(i, options.Length); options[i] = options[r]; options[r] = temp; } }