6 Replies Latest reply on Jun 3, 2013 1:10 PM by jauquinholmes

    Adding multiple students to a teacher

    jauquinholmes

      Title

      Adding multiple students to a teacher

      Post

           after much searching on the forums and youtube, i cant completely understand how to do this task still. In the filemaker templates i found a "Add Contacts" button that runs the script "Add contacts as reicipants" (in the Email Campaign Managment template)

           I dont fully understand the script and need help in fully understanding it to use in my database to track students, mentors, and sessions...

           Currently i have 5 tables, those tables are:

           students, mentors, sessions, mentor_student, session_student

           The student, mentor, and session tables are holding uniquie values of students and mentors. Each student and mentor(teacher) can have multiple sessions, also a mentor can have multiple students, but only one student can be assigned to a mentor.

           I would like any pointers on using this "Add Contacts" script so i'll be able to add multiple student to a mentor list over IWP.

           so my contraints are:

              all student, mentors, and sessions are unique

              each mentor can have multiple students that are unique

              one student can have many sessions (with any mentor)

              adding many students in one session(i.e. if a lesson is taught to a class of students, the information needs to be tracked)

              must be compatible over IWP to validate students and mentors unquieness

           i'd really appreatiate any and all help on this database especially understanding the "Add Contacts" script...

            

      Screen_Shot_2013-05-29_at_12.06.13_AM.png

        • 1. Re: Adding multiple students to a teacher
          philmodjunk

               This appears to be a contradictory statement:

               

                    also a mentor can have multiple students, but only one student can be assigned to a mentor.

               Do you mean that a student can only have one mentor?

               If so, then you do not need Mentor_Student to serve as a join table between Mentors and Students as you would then have a one to many relationshiop between Mentor and Students, not the Many to Many relationship that requires a join table.

          • 2. Re: Adding multiple students to a teacher
            jauquinholmes
            thank you  for responding,  yes I  need to have the student  and mentors to have a  many to one relationship  but I  also need to have the capability to reassign  students to different mentors...  thinking about it right now  after seeing this post I  would just have to keep that information in the sessions table  instead...  to trace the students  history and which mentor/ teacher they  have/ had... if this is the case I  would use the session table as the   many-to-many relationship.... the  mentor_student  table is a  table to  hold the info to select the mentor then  add  multi ple  students to that mentor,  I'm try ing to use that table as the basis  for the layout  to make the pop up window over iwp...
            • 3. Re: Adding multiple students to a teacher
              philmodjunk

                   Then this is not an accurate description of your relationships:

                   

                        ...but only one student can be assigned to a mentor.

                   In fact, many students may be assigned to a mentor and, from what I understand, a student can have more than one mentor.

                   I needed clarification on that before proceeding with any suggestions that I might make.

                   Won't there be many records in Sessions for a given pairing of Mentor to Student? (Won't a "Session" be one meeting out of many for a given mentor and assigned student?)

                   If so, I would not put that data in Sessions and I'd link Sessions directly to Mentor_Student via a Primary Key field defined in Mentor_Student.

              • 4. Re: Adding multiple students to a teacher
                jauquinholmes

                     Ok, as it stands now many sessions would pair mentors and students to track what they did in that session, so yes. I do like linking the mentor student table to the session table. so the session table can only hold the session notes and type of session.

                     now about the mentor and student situation, let me be clear in that one mentor can have many student this is assured. i guess it would be better to say that many unique students can be assigned to one unique mentor. i am trying to make sure that unique students get assigned to a mentor.

                      

                     to design the database. i would like to have the many-to-many relationship for two reasons: first to validate that each student is not assigned to the same mentor (like a one to many wouldnt allow) so the student can be reassigned to a mentor and the date and time of change is recored, second (the main reason) to use as my popup window to assign those students to any of the mentors.

                     the many- to many is harder since the many to many doesn't care about unique values concerning multiple entries, like choosing the same student over and over to enter in the assigned student of the mentor. the many to many relationship would be to "move" a student to the selected mentors caseload (assigned student) i.e. my popup window since IWP is needed

                     so my screen shot is staring with that aspect and i thought that i could take advantage to the E-R method of designing the database. or else i would have the mentor table linked to the student table then add the student from the student table in the mentor table. or have a student detail(holding the mentor the student is assigned) and the mentor detail(holding the mentors students).

                     i hope this clears up my intensions thanks

                • 5. Re: Adding multiple students to a teacher
                  philmodjunk

                       i am trying to make sure that unique students get assigned to a mentor.

                       Which means that you don't want to assign the same student to the same mentor more than once.

                       You definitely need a many to many relationship here, it's a matter of correctly managing the details of that to avoid possible user errors.

                       See this demo file, which both illustrates a many to many relationship and also several different ways to prevent a user from selecting the same two records to link as you have described here.

                  https://www.dropbox.com/s/oyir7cs0yxmbn6i/ManyToManywDemoWExtras.fp7

                  • 6. Re: Adding multiple students to a teacher
                    jauquinholmes

                         Thank you Phil, greatly appreciated i'll look through all the relationships and ask you more questions from there... thank you for simplfing the scripts the apple basic coding is something to get used too... i'll probally will ask you why you did what you did as well...