Quiz/Survey Implementation for Website

Our company is engaged in the development, support and maintenance of sites of any complexity. From simple one-page sites to large-scale cluster systems built on micro services. Experience of developers is confirmed by certificates from vendors.
Development and maintenance of all types of websites:
Informational websites or web applications
Business card websites, landing pages, corporate websites, online catalogs, quizzes, promo websites, blogs, news resources, informational portals, forums, aggregators
E-commerce websites or web applications
Online stores, B2B portals, marketplaces, online exchanges, cashback websites, exchanges, dropshipping platforms, product parsers
Business process management web applications
CRM systems, ERP systems, corporate portals, production management systems, information parsers
Electronic service websites or web applications
Classified ads platforms, online schools, online cinemas, website builders, portals for electronic services, video hosting platforms, thematic portals

These are just some of the technical types of websites we work with, and each of them can have its own specific features and functionality, as well as be customized to meet the specific needs and goals of the client.

Our competencies:
Development stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1221
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1163
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    855
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1058
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    828
  • image_bitrix-bitrix-24-1c_fixper_448_0.png
    Website development for FIXPER company
    825

Implementing Quizzes and Surveys

Quizzes and surveys gather feedback, run tests, help users choose products. Key requirements: flexible question structure, support different answer types, display results.

Database Structure

CREATE TABLE quizzes (
    id          SERIAL PRIMARY KEY,
    title       VARCHAR(255) NOT NULL,
    description TEXT,
    type        VARCHAR(50)  NOT NULL DEFAULT 'survey',  -- survey|quiz|poll
    settings    JSONB        NOT NULL DEFAULT '{}',      -- show_results, randomize, time_limit
    is_active   BOOLEAN      NOT NULL DEFAULT true,
    created_at  TIMESTAMPTZ  NOT NULL DEFAULT NOW()
);

CREATE TABLE questions (
    id          SERIAL PRIMARY KEY,
    quiz_id     INTEGER REFERENCES quizzes(id) ON DELETE CASCADE,
    type        VARCHAR(50)  NOT NULL,  -- text|choice|multiple|rating|nps
    title       TEXT NOT NULL,
    required    BOOLEAN DEFAULT true,
    order_index INTEGER NOT NULL,
    metadata    JSONB DEFAULT '{}'
);

CREATE TABLE answers (
    id          SERIAL PRIMARY KEY,
    question_id INTEGER REFERENCES questions(id),
    text        TEXT NOT NULL,
    order_index INTEGER
);

CREATE TABLE responses (
    id          SERIAL PRIMARY KEY,
    quiz_id     INTEGER REFERENCES quizzes(id),
    user_id     INTEGER REFERENCES users(id),
    ip_address  INET,
    data        JSONB NOT NULL,  -- {question_id: answer_value, ...}
    completed_at TIMESTAMPTZ
);

React Component

function QuizForm({ quiz }: { quiz: Quiz }) {
  const [responses, setResponses] = useState<Record<string, any>>({});

  const handleSubmit = async () => {
    const res = await fetch(`/api/quizzes/${quiz.id}/responses`, {
      method: 'POST',
      headers: { 'Content-Type': 'application/json' },
      body: JSON.stringify(responses),
    });
    if (res.ok) alert('Thank you for your response!');
  };

  return (
    <form onSubmit={handleSubmit}>
      {quiz.questions.map(q => (
        <QuestionField
          key={q.id}
          question={q}
          onChange={(val) => setResponses(prev => ({...prev, [q.id]: val}))}
        />
      ))}
      <button type="submit">Submit</button>
    </form>
  );
}

Timeline

Basic quiz setup with 3-4 question types and result display: 2-3 days. Advanced features (logic branching, A/B testing): 5-7 days.