public override Response CreateDefaultResponse() { LikertResponse r = new LikertResponse(this); foreach (LikertItem i in this.Children) { r.ItemResponses.Add(new LikertItemResponse { LikertItem = i, Choice = this.Choices[0] }); } return(r); }
public override Response CreateResponse(params object[] responses) { LikertResponse r = new LikertResponse(this); int choiceCount = this.Choices.Count; int i = -1; foreach (LikertItem li in this.Children) { int choiceNo = (int)responses[++i]; if (choiceNo < 0 || choiceNo > choiceCount) { throw new Exception(String.Format("", choiceNo, choiceCount)); } r.ItemResponses.Add(new LikertItemResponse(li, this.Choices[choiceNo])); } return(base.CreateResponse(responses)); }