< Back to Code Samples
# File: survey_questions.py
# Derived from Greg's sample

from survey import *
from QAserver import start_server

SURVEY = Survey("Computer Preferences",
                "survey_results.data",
                [Question(1,
                          "Which OS do you use most often?",
                          [Answer("windows", "Windows (Vista, XP, 2000, 95/98 etc.)"),
                           Answer("mac", "Mac"),
                           Answer("linux", "Linux (Fedora, Ubuntu, Debian, etc.)"),
                           Answer("other", "Other")]),
                 Question(2,
                          "Which browser do you prefer? (any version)",
                          [Answer("ie", "Internet Explorer"),
                           Answer("ff", "Firefox"),
                           Answer("safari", "Safari"),
                           Answer("opera", "Opera"),
                           Answer("konqueror", "Konqueror"),
                           Answer("lynx", "Lynx or another text-based browser"),
                           Answer("other", "Other")]),
                 Question(3,
                          "Which office suite do you prefer? (any version)",
                          [Answer("msoffice", "Microsoft Office"),
                           Answer("openoffice", "Open Office"),
                           Answer("appleworks", "Appleworks"),
                           Answer("staroffice", "Star Office"),
                           Answer("texteditor", "Text editor only (Notepad, VI, eMacs, etc.)"),
                           Answer("other", "Other")]),
                 Question(4,
                          "Which music player do you prefer? (any version)",
                          [Answer("wmp", "Windows Media Player"),
                           Answer("itunes", "iTunes"),
                           Answer("real", "Real Player"),
                           Answer("totem", "Totem Music Player"),
                           Answer("other", "Other")]),
                 Question(5,
                          "Which music codec do you prefer? (any version)",
                          [Answer("wma", "Windows Media Audio (wma)"),
                           Answer("aac", "Apple Lossless Codec (aac)"),
                           Answer("mp3", "Mpeg Layer-3 (mp3)"),
                           Answer("ogg", "Ogg/Vorbis (ogg)"),
                           Answer("flac", "Free Lossless Audio Codec (flac)"),
                           Answer("other", "Other")]),
                 Question(6,
                          "Which movie player do you prefer? (any version)",
                          [Answer("wmp", "Windows Media Player"),
                           Answer("itunes", "iTunes"),
                           Answer("real", "Real Player"),
                           Answer("totem", "Totem / Xine Movie Player"),
                           Answer("vlc", "VLC Media Player"),
                           Answer("divx", "Div-X player"),
                           Answer("other", "Other")]),
                 Question(7,
                          "Which movie codec do you prefer? (any version)",
                          [Answer("wmv", "Windows Media Video (wmv)"),
                           Answer("mp4", "MPEG-4 (mp4)"),
                           Answer("mpg/mp2", "MPEG / MPEG-2 (mpg)"),
                           Answer("divx", "Div-X codec (avi)"),
                           Answer("rm", "Real Media (rm)"),
                           Answer("other", "Other")]),
                 Question(8,
                          "Which photo editor do you prefer to use? (any version)",
                          [Answer("ms_photoeditor", "Microsoft Photo Editor"),
                           Answer("photoshop", "Adobe Photoshop"),
                           Answer("paintshop", "Paintshop Pro"),
                           Answer("gimp", "The GIMP (Gnu Image Manipulation Project)"),
                           Answer("other", "Other")]),
                 Question(9,
                          "Which graphics format do you prefer to use?",
                          [Answer("jpg", "JPEG (jpg)"),
                           Answer("gif", "Graphics Interchange Format (gif)"),
                           Answer("bmp", "BitMaP (bmp)"),
                           Answer("png", "Portable Network Graphics (png)"),
                           Answer("tif", "Tagged Image File (tif)"),
                           Answer("svg", "Scalable Vector Graphics (svg)"),
                           Answer("other", "Other")]),
                Question(10,
                          "In which programming language do you most often code?",
                          [Answer("c", "C or C++ (NOT Visual C++)"),
                           Answer("vc", "Visual C++ (Specifically using the MS libraries)"),
                           Answer("java", "Java / J2EE"),
                           Answer("python", "Python"),
                           Answer("c#", "C# (Mono or .NET flavors)"),
                           Answer("pascal", "Pascal / Ada"),
                           Answer("cobol", "Cobol / Fortran / Fortran-77"),
                           Answer("other", "Some other language"),
                           Answer("n/a", "I don't program")]),
                 ])

start_server(SURVEY)