🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
Turnkey sample InstantPoll
This page was created by Hans.karlsen on 2017-09-07. Last edited by Wikiadmin on 2026-07-29.

You can use this MDriven Turnkey sample to build and study a live audience poll where participants answer questions on their phones while an administrator controls the current question and follows results on a shared display.

What the sample demonstrates

InstantPoll is a MDriven Turnkey sample for local, interactive polling. It is intended for situations such as a meeting, presentation, or workshop where attendees join a poll from a mobile device and answer questions as they are shown.

The sample demonstrates these user-facing flows:

  • Participants open the poll from their phones, for example after scanning a QR code shown to the audience.
  • Participants answer multiple-choice questions by selecting one of the available alternatives.
  • Participants can answer free-text questions.
  • The display view updates as answers arrive. In the demonstrated free-text result view, repeated words grow in a word cloud.
  • An administrator creates a poll, adds its questions and, for multiple-choice questions, adds answer alternatives.
  • The administrator selects which question is currently active and moves the poll forward to the next question.

For a walkthrough of the participant, display, and administration views, watch the InstantPoll walkthrough.

Download the sample

Download the InstantPoll DatabaseCompact archive:

File:DatabaseCompact ForInstantPoll.zip

The archive is provided as the sample download for this page. Use it as a starting point when evaluating or adapting the InstantPoll model for a Turnkey site.

Explore the sample

  1. Start with a Turnkey site. For the available sample-application workflow, see Documentation:Example Gist.
  2. Obtain the InstantPoll DatabaseCompact archive from the download above.
  3. Open the sample and inspect the poll setup flow before changing the model.
  4. Create a poll.
  5. Add one or more questions to that poll.
  6. For a multiple-choice question, add the answer alternatives that participants can select.
  7. Set a current question for the poll and verify the participant and display views.
  8. Add a free-text question and submit repeated words from different participants to observe how the result view represents repeated answers.

Model structure

The sample is based on a compact polling domain model. A poll contains the questions posed to an audience. Each question identifies whether it is multiple choice.

Concept Purpose in InstantPoll Example
Poll Groups the questions for one audience session and identifies the question currently being asked. A “Team kickoff” poll contains three questions.
Question Represents one prompt in a poll. A question can be multiple choice or free text. “Which topic should we discuss first?” is a multiple-choice question.
Possible answer Represents an alternative available for a multiple-choice question. “Planning”, “Quality”, and “Delivery” are possible answers to the question.
Participant answer Records one participant's answer to one question. A participant selects “Quality”; the participant answer is linked to that possible answer.
Free-text answer Holds the textual response when the question is not multiple choice. A participant answers “collaboration” to “What should we improve?”

Each participant who answers a question receives an answer object for that question. For a multiple-choice response, that answer is linked to the selected possible answer. For a free-text response, the answer text is retained instead.

Administration ViewModel

The administration user interface is driven by a Turnkey ViewModel. It presents the polls and actions needed to manage them, together with the questions, possible answers, and lists used to manage the current question.

When you adapt this ViewModel, scope every selectable list to its context. In particular, the list used to choose a poll's current question must contain only questions belonging to that poll.

Incorrect selection scope Correct selection scope Why it matters
All Question instances The selected Poll's Questions An administrator must not be able to make a question from another poll the current question.

For example, if Poll A has questions “One”, “Two”, and “Three”, and Poll B has its own questions, the current-question selector for Poll A must show only “One”, “Two”, and “Three”. The walkthrough demonstrates correcting a selector that initially listed questions from every poll.

Design notes

  • Treat the administrator's current-question selection as the control point for the audience flow. Participants should answer the question that the poll currently exposes.
  • Model multiple-choice and free-text questions explicitly. Multiple-choice questions need possible answers; free-text questions need a place to store the participant's text.
  • Test the administration flow with more than one poll. This exposes context errors, such as a current-question selector that shows all questions instead of only the selected poll's questions.
  • Use the sample as a focused reference for an interactive Turnkey application. For a broader starting model, see Documentation:Turnkey sample Empty start model.

Related Turnkey samples

Documentation:Turnkey sample Board Map Balls Gantt focuses on HTML5 component development in Turnkey. Documentation:Turnkey sample ProjectPlanner demonstrates HTML5 components and advanced features. Documentation:Turnkey sample SoftConflict is another compact Turnkey application sample.

See also