AnsweredAssumed Answered

How to get few records (random selection after previous filtering) from one big DB to another small...

Question asked by MarcosOkamura on Feb 13, 2013
Latest reply on Feb 13, 2013 by philmodjunk


How to get few records (random selection after previous filtering) from one big DB to another small DB? (educational purpose)


     Dear all,

     I am new to FM and this forum. I need a support to solve a simple thing:

     Situation: I created three tables with fields:

     Table Questions: Discipline / Questions / Grade / Level  / IDQuestion_pk / SolvedfromStudent (10000 records)

     Table Studentes: Name / Grade / Level / IDName_pk

     Table Quizz: NumberofQuestions / Discipline /IDName_fk / IDQuestion_fk


     Table Quizz is related to Table Students (via IDName_fk and IDName_pk) and it is also related to Table Questions (via IDQuestion_fk and IDQuestion_pk).

     So, in a layout called QUIZZSELECTION, two fields will get some values:

     - NumberofQuestions will get a max number of questions

     - Dsicipline will get a required source matter


     As soon as NumberofQuestions will be less than the amount that I have recorded at Table Questions, once I have this amount, I want to select this total number of questions but:

     - Filtering from Table Questions with right Grade, right Level

     - Only Unsolved questions from the Table Questions (that's why I have a field named SolvedfromStudent)



     When a student is logging in, I need to display a quizz. The student will give desired number of questions and a discipline. I have to generate those questions choosing them in a randomic selection (checking if they match all filters and if they are unsolved). 

     I am not familiar to all tricks with script and functions, so I need a step-by-step of what to do (Script, function, Display as a portal or not, etc) .

     Besides, how can I create a specific table of Solved/Unsolved Questions for a certain student after this student has his quizz prepared?

     I kindly ask someone to help me.

     Thanks in advance.