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 8285657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T11:31:30+00:00 2026-06-08T11:31:30+00:00

Few words about my idea Working on some web based, education project. Creating question-answer

  • 0

Few words about my idea

Working on some web based, education project. Creating question-answer system for this project. There is some logical difficulties that I can’t figure out:

There are teachers and students between users. Every student selects some course during signup.

I have 5 tables: users, courses, lessons, questions, answers.

There might be 2 types of questions:

  1. User based. For ex, when teacher wants to send questions to specific users and vise-versa (users may post question to teachers too).

  2. Course-lesson combination based. For ex, teacher wants to post questions to all course listeners based on lesson, they are currently in.

What I’ve done

I’ve created questions from-to (qft) table

CREATE TABLE `questions from-to` (
  `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
  `qid` int(11) unsigned NOT NULL,
  `from_uid` int(11) unsigned NOT NULL,
  `to_uid` int(11) unsigned NOT NULL,
  PRIMARY KEY (`id`),
  KEY `qft.from_uid_users.id` (`from_uid`),
  KEY `qft.to_uid_users.id` (`to_uid`),
  KEY `qft.qid_qe.id` (`qid`),
  CONSTRAINT `qft.from_uid_users.id` FOREIGN KEY (`from_uid`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `qft.qid_qe.id` FOREIGN KEY (`qid`) REFERENCES `questions_and_exercises` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `qft.to_uid_users.id` FOREIGN KEY (`to_uid`) REFERENCES `users` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8

Which looks like that

  • qid – is question id, connects this table with questions, based
    on id
  • from_uid – from user id (question sender id), connects this table with users, based
    on id
  • to_uid – to user id (question receiver id), connects this table with users, based
    on id

So I tried to create some universal solution for both:

  • students and teacher so they can post questions to each others. ok

  • teacher can post to some users specific questions. ok

BUT there is a problem

The problem is

What if, teacher wants to post question for all course listeners? I already have user-course relationship table, but, currently I need to add one-by-one user id’s into questions from-to table so they can receive questions. I have no idea, how can I design this table for both situations: for "mass questioning" based on course-lesson combination and for "user-user" type question posting (teacher sends questions to specific students and vise-versa)

Any suggestions?

  • 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-06-08T11:31:31+00:00Added an answer on June 8, 2026 at 11:31 am

    One possibility would be to have a special code in to_uid that your application knows to interpret as “show to all users.” When it encounters a to_uid of -1 (or whatever you chose) then it does a select for all students listening to that course, and displays the question just as if their IDs had all been separately listed in to_uid. Depending on how your application is organized, you should only have to implement this special check in a small number of places.

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

Sidebar

Related Questions

For example: S1: some filename contains few words.txt S2: some filename contains few words
It is not a programming question, but need your views in few words. When
I'm working with a closed community site (PHP-based) of about 100 users, and one
For some part of my project I need a process-local scheduling system that will
This is an edit of a question I asked about a week ago. I'm
I read a few documents about Mutex and still the only Idea I have
I recently asked a question about using XSL/t for creating a site layout and
In few words, is it correct way to call keydown and keyup events, that
I want to pass a string that contains few words to jQuery when click
I have a few hundred words in arrays in a plist, somewhat like below:

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.