Fire up your applications with Jetfire
RSS
Jetfire Wiki


Quick Search
»
Advanced Search »

Table of Contents [Hide/Show]


Jetfire Code: Quiz Sample

The Jetfire Code Class for Quiz Sample is shown below in the box. This class is used to demonstrate how to build a Quiz using Form Maker.

// Q U I Z    S A M P L E    W O R K F L O W
//===================================================================================
// QuizSample.txt
//===================================================================================
// Copyright (C) 2008 TrackerRealm Corporation
// This file is part of Jetfire.
// 
// Jetfire is open software: you can redistribute it and/or modify it under the terms of the 
// GNU General Public License as published by the Free Software Foundation, version 3 of the License.
// 
// Jetfire is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 
// without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
// See the GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License along with Jetfire.  
// If not, see http://www.gnu.org/licenses.
// REMOVAL OF THIS NOTICE IS VIOLATION OF THE COPYRIGHT.
//===================================================================================

namespace DemoFormApps
{
   // This workflow is a sample quiz.
   public workflow QuizSample : Quiz
   {
        public QuizSample()
        {
			// Declare variables used at top
			List selection = new List();
			string empty = "";
			// Add Questions
			QnA qna = new QnA("What is your name?", empty);
			// Add the question to the QnAList (from base class)
			this.QnAList.Add(qna);
			qna = new QnA("Are you over 18?", false);
			this.QnAList.Add(qna);
			selection.Add("18 - 25");
			selection.Add("26 - 35");
			selection.Add("36 - 45");
			selection.Add("over 45");
			qna = new QnA("Select an age category", selection, QnAInput.Selection);
			this.QnAList.Add(qna);
			qna = new QnA("How often do you go dancing in a year?", 0.0);
			this.QnAList.Add(qna);
			// Name of the quiz
			this.Subject = "Quiz Sample";
        }
    }
}

See Also

Jetfire Code Library
Jetfire Code Application Library

ScrewTurn Wiki version 3.0.4.560. Some of the icons created by FamFamFam.