Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 265289
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T22:45:24+00:00 2026-05-11T22:45:24+00:00

Scenario : There is this online questionaire that will be filled in by various

  • 0

Scenario:
There is this online questionaire that will be filled in by various departments in a company. The questions are data driven and are different for each department.
But for some of the questions, the way the input is taken is also different; for some departments the same question is asked to be replied to, by selecting values from a drop down, for the others its free text entry; again, for some departments you change the caption against the area for entry. This caption is not part of the question. its also not coming from the database as of now and Id rather not put it all in the database and increase the joins for each select. Out of the twenty odd questions which have such captions, there are just 3 such captions which change.

for eg.

Department A.)

Q.) How would you like to get here?
{caption:”Enter your prefered transport method”} [Free Text Box]

Department B.)

Q.) How would you like to get here?
{caption:”Select option”} [Drop Down]

What would be the best way to design and code such web based questionairre of the ways below?

  • Implement it using if-else conditions for each department and show and hide input controls as per department
  • Abstract all common inputs into a parent class and have multiple child classes for each department which contain their own specific behavior for data input

Any other better way?

Thanks for your time. 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T22:45:24+00:00Added an answer on May 11, 2026 at 10:45 pm

    I would recommend using if/else statements to show and hide the various questions.

    The reason why I say if/else instead of sub-classing is that you’ll come across a case where a question which used to be “common” to all Departments becomes specific to a few, and you’ll have to refactor that question to the sub-classes and delete it where it’s not applicable. The if/else code may get tedious, but not more tedious than the refactor I mention above.

    In addition, I would also urge you to strongly consider normalizing the questions of your survey. In other words, in the example you provided above, I would make the free text and option two different questions. This doesn’t change how the answers are input, it just changes how you consider the different questions.

    The reason why I’m saying this is that any analysis you will be doing on the answers is dependent on comparing apples to apples — when you restrict or free the list of available choices, you’re comparing apples to oranges.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Are there any security exploits that could occur in this scenario: eval(repr(unsanitized_user_input), {__builtins__: None},
This is the scenario: There's an intranet website that stores a set of macros
I need to set up this scenario: A SQL Server 2005 database will create
I am developing a light-weight online shop. This shop integrates with various sources. It
Image this scenario: There is a picture locally in my server, where a sketch
I have the following scenario: there are a database that generates a new logTable
The Scenario There are certain SQL Agent Jobs that are scheduled to run every
Scenario: If there is an array of integers and I want to get array
I have a ASP.NET MVC 3 app with a common scenario where there is
There is a scenario where an application tells a device on a network to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.