Mubshir

Mubshir

  • NA
  • 2
  • 3.3k

Divide students in groups based on preferences

Sep 28 2013 7:27 AM

I am writing an application using C#/Asp.Net. In the database i have three tables. (Students, Groups and Preference).

Students

Student Name---------Group ID(Not Data for now)
Student A
Student B
Student C
Student D
Student E
Student F
Student G
Student H
Student I
Student J
Student K
Student L

Preferences Tables

Student Name--------Preference 1--------Preference 2--------Preference 3
Student A------------Student G-----------Student F
Student B------------Student H-----------Student K------------Student L
Student C------------Student I
Student D
Student E
Student F
Student G
Student H
Student I
Student J
Student K
Student L

Groups Table
Group ID
1
2
3

I want to create students groups for Labs based on preferences. Each group will have min 3 and max 4 students. If some students are left without group, that can be adjusted manually. Each student will enter max 3 preferences (optional), who he/she want's to group with. How can i implement this. Any Examples etc? Any help will be much appreciated.