Ok, so I have figured out how to do a lot of the survey creation, but am still having a few problems. Here is what i have so far:
//create the response template
ResponseTemplate rt = ResponseTemplateManager.CreateResponseTemplate(Use rManager.AuthenticateUser(un,pw));
rt.Name = txtname.Text;
rt.IsActive = true;
rt.EditLanguage = "EN-us";
rt.Title = txtname.Text;
rt.SupportedLanguages = new string[] { "en-US" };
rt.DefaultLanguage = "en-US";
rt.EnableDynamicItemNumbers = true;
rt.EnableDynamicPageNumbers = true;
rt.CompletionType = 1;
rt.ShowTitle = true;
rt.ShowProgressBar = true;
rt.StyleTemplateID = 1015;
rt.AllowContinue = true;
rt.ShowPageNumbers = true;
rt.Save();
//add a template page for the hidden items
TemplatePage page = rt.NewPage(0);
//for each hidden item do the following
//create the hidden item
HiddenItemData hid = (HiddenItemData)ItemConfigurationManager.CreateCon figurationData(12);
hid.VariableName = VariableName;
hid.VariableSource = HiddenVariableSource.QueryString;
hid.Alias = Alias;
hid.Save();
//add the item to the page:
rt.AddItemToPage(page, hid);
So all this seems to be working, but i have found two steps i cannot figure out how to do using the API. I have gotten them to work if I call stored procedures I found in the DB, and I would rather not do it that way.
1. How do i move the response template to a currently existing folder in our DB?
2. How do I set the text of the hidden item, so it appears when viewing results for the survey in the checkboxweb app?
Thanks for the help on this so far.
|