Click here to Skip to main content
11,639,508 members (68,417 online)
Click here to Skip to main content
Add your own
alternative version

Generic web based survey system using XML, XSL, HTML, and JavaScript

, 17 Oct 2006 CPOL 25K 563 12
A generic web based survey system.
GenericWebSurveySystem_src.zip
<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="generate-surveyform.xslt"?>
<survey>
	<surveytypes>
		<surveytype>
			<surveyname> Demo Survey </surveyname>
			<questions>
				<question qid="1" >
					<qid>1</qid>
					<questiondesc>Q1) Enter some free text</questiondesc>
					<typeid>2</typeid>
					<subjectid>1</subjectid>
					<required>1</required>
					<parentquestion></parentquestion>
				</question>			
				<question qid="2" >
					<qid>2</qid>
					<questiondesc>Q2) Select any of the choices</questiondesc>
					<typeid>6</typeid>
					<subjectid>1</subjectid>
					<required>1</required>
					<parentquestion></parentquestion>
					<choices>
						<choice>Choice1</choice>
						<choice>Choice2</choice>
						<choice>Choice3</choice>
					</choices>
				</question>
				<question qid="3" >
					<qid>3</qid>
					<questiondesc>Q3) Do you want to branch ?</questiondesc>
					<typeid>6</typeid>
					<subjectid>1</subjectid>
					<required>1</required>
					<parentquestion></parentquestion>
					<choices>
						<choice>Yes</choice>
						<choice>No</choice>
					</choices>
				</question>
				<question qid="4" parentquestion="3" valuecondition="Yes">
					<qid>4</qid>
					<questiondesc>Q4) Select one of the following types</questiondesc>
					<typeid>7</typeid>
					<subjectid>1</subjectid>
					<required>1</required>
					<parentquestion>3</parentquestion>
					<choices>
						<choice>Type1</choice>
						<choice>Type2</choice>
						<choice>Type3</choice>
						<choice>Type4</choice>
						<choice>Type5</choice>
						<choice>Type6</choice>
						<choice>Other</choice>
					</choices>
				</question>
				<question qid="5" parentquestion="4" valuecondition="Type1">
					<qid>5</qid>
					<questiondesc>Q5) Type1, why ?</questiondesc>
					<typeid>7</typeid>
					<subjectid>1</subjectid>
					<required>1</required>
					<parentquestion>4</parentquestion>
					<choices>
						<choice>Choice1</choice>
						<choice>Choice2</choice>
						<choice>Other</choice>
					</choices>
				</question>
				<question qid="6" parentquestion="4" valuecondition="Type2">
					<qid>6</qid>
					<questiondesc>Q6) Type2, why ?</questiondesc>
					<typeid>7</typeid>
					<subjectid>1</subjectid>
					<required>1</required>
					<parentquestion>4</parentquestion>
					<choices>
						<choice>Choice1</choice>
						<choice>Choice2</choice>
						<choice>Choice3</choice>
						<choice>Other</choice>
					</choices>
				</question>
				<question qid="7" parentquestion="4" valuecondition="Type3">
					<qid>7</qid>
					<questiondesc>Q7) Give some more details</questiondesc>
					<typeid>7</typeid>
					<subjectid>1</subjectid>
					<required>1</required>
					<parentquestion>4</parentquestion>
					<choices>
						<choice>Option1</choice>
						<choice>Option2</choice>
						<choice>Option3</choice>
						<choice>Other</choice>
					</choices>
				</question>
				<question qid="8" parentquestion="4" valuecondition="Type3">
					<qid>8</qid>
					<questiondesc>Q8) Here is one more question ?</questiondesc>
					<typeid>6</typeid>
					<subjectid>1</subjectid>
					<required>1</required>
					<parentquestion>4</parentquestion>
					<choices>
						<choice>Yes</choice>
						<choice>No</choice>
					</choices>
				</question>
				<question qid="9" parentquestion="8" valuecondition="Yes" >
					<qid>9</qid>
					<questiondesc>Q9) Select all that apply</questiondesc>
					<typeid>4</typeid>
					<subjectid>1</subjectid>
					<required>1</required>
					<parentquestion>8</parentquestion>
					<choices>
						<choice>Package1</choice>
						<choice>Package2</choice>
						<choice>Package3</choice>
						<choice>Package4</choice>
						<choice>Package5</choice>
					</choices>
				</question>
				<question qid="10" parentquestion="8" valuecondition="Yes" >
					<qid>10</qid>
					<questiondesc>Q10) Explain some more details?</questiondesc>
					<typeid>3</typeid>
					<subjectid>1</subjectid>
					<required>1</required>
					<parentquestion>8</parentquestion>
				</question>
				<question qid="11" parentquestion="4" valuecondition="Type4" >
					<qid>11</qid>
					<questiondesc>Q11) Type4, Other</questiondesc>
					<typeid>2</typeid>
					<subjectid>1</subjectid>
					<required>1</required>
					<parentquestion>4</parentquestion>
				</question>
				<question qid="12" parentquestion="3" valuecondition="No" >
					<qid>12</qid>
					<questiondesc>End of Survey</questiondesc>
					<typeid>8</typeid>
					<subjectid>1</subjectid>
					<required>1</required>
					<parentquestion>3</parentquestion>
				</question>				
				<question qid="13" parentquestion="4" valuecondition="Type5" >
					<qid>13</qid>
					<questiondesc>End of Survey</questiondesc>
					<typeid>8</typeid>
					<subjectid>1</subjectid>
					<required>1</required>
					<parentquestion>4</parentquestion>
				</question>					
				<question qid="14" parentquestion="4" valuecondition="Type6" >
					<qid>14</qid>
					<questiondesc>End of Survey</questiondesc>
					<typeid>8</typeid>
					<subjectid>1</subjectid>
					<required>1</required>
					<parentquestion>4</parentquestion>
				</question>					
				<question qid="15" parentquestion="4" valuecondition="Other" >
					<qid>15</qid>
					<questiondesc>End of Survey</questiondesc>
					<typeid>8</typeid>
					<subjectid>1</subjectid>
					<required>1</required>
					<parentquestion>4</parentquestion>
				</question>					
				<question qid="16" parentquestion="8" valuecondition="No" >
					<qid>16</qid>
					<questiondesc>End of Survey</questiondesc>
					<typeid>8</typeid>
					<subjectid>1</subjectid>
					<required>1</required>
					<parentquestion>8</parentquestion>
				</question>					
			</questions>
		</surveytype>
	</surveytypes>

	<surveyconfig>
		<questiontypes>
			<questiontype>
				<typeid>1</typeid>
				<typedesc>Numeric Open Ended</typedesc>
			</questiontype>
			<questiontype>
				<typeid>2</typeid>
				<typedesc>Text Open Ended</typedesc>
			</questiontype>
			<questiontype>
				<typeid>3</typeid>
				<typedesc>Text Open Ended Multiline</typedesc>
			</questiontype>
			<questiontype>
				<typeid>4</typeid>
				<typedesc>Multiple Choice</typedesc>
			</questiontype>
			<questiontype>
				<typeid>5</typeid>
				<typedesc>Multiple Choice with Other Option</typedesc>
			</questiontype>
			<questiontype>
				<typeid>6</typeid>
				<typedesc>Multiple Choice Single Selection</typedesc>
			</questiontype>
			<questiontype>
				<typeid>7</typeid>
				<typedesc>Multiple Choice Single Selection with Other Option</typedesc>
			</questiontype>
			<questiontype>
				<typeid>8</typeid>
				<typedesc>No answer, just label</typedesc>
			</questiontype>
		</questiontypes>
	</surveyconfig>
</survey>

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

venkrm
Web Developer
United States United States
No Biography provided

You may also be interested in...

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150731.1 | Last Updated 17 Oct 2006
Article Copyright 2006 by venkrm
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid