I am doing a test solution module at Laravel. Users solve the test. And properly solved tests will not be returned to users.
Questions are always mixed. Obtained by random method.
My code:
$test_status= DB::table('test_status')->where('status', '=', 'check')-select('id')->get();
$test= DB::table('test')->whereNotIn('id', $test_status)->inRandomOrder()->first();
In this case, I will not show the user back the tests that he has previously solved.
The problem is that if the user has found the answer to 10,000 tests, will it be too late for me to get a query from the database? If there is a better way, please share