Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Using Survey webpart for Quiz

  Asked By: Krista    Date: Jun 29    Category: Sharepoint    Views: 3351

We have a requirement in SPS 2003.
We have to use survey webpart as Quiz. Now we are writing a webpart.

The problem is how to retrieve the survey questions, answer type using SPS Object model/SQL Database/ or anything..

It would be a gr8 help to us if anybody give a solution..



3 Answers Found

Answer #1    Answered By: Jaime Weaver     Answered On: Jun 29

I would use OM to retrieve survey  questions.

Answer #2    Answered By: Damon Garner     Answered On: Jun 29

I tried it ..can you please help with code. u used to retrieve survey  questions..

Answer #3    Answered By: Karla Morrison     Answered On: Jun 29

I tried today and I was able to retrieve survey  answers.

protected override void RenderWebPart(HtmlTextWriter output)
SPWeb myWeb = SPControl.GetContextWeb(Context);
SPListCollection allSurvey = myWeb.GetListsOfType(SPBaseType.Survey );
foreach ( SPList spc in allSurvey)
if (spc.Title == "My Survey")
SPListItemCollection spcal = spc.Items;
foreach( SPListItem spl in spcal)
output.Write(" "+spl["Question One"]); //Survey question 1
output.Write(" "+spl["Question Two?"]); //question 2
catch (Exception ex)

Didn't find what you were looking for? Find more on Using Survey webpart for Quiz Or get search suggestion and latest updates.