I would create a temporary table for each user. Use the date/time for
the table name.
That gives you a unique name and also allows maintenance to remove old
tables.
You could store a cookie on the users computer that can get them into
the correct session.
But with people using multiple devices you need to consider someone
going partway and then resuming on a different device. Allow midway logins.
On 2019-07-02 2:41 p.m., Alan Mead wrote:
Thanks. I have a Perl simulation of the CAT working (which has all the
technical algorithms). What I need to do is build the user interface and
I/O (and translate the Perl algorithms to PHP) to allow real people to
take a CAT online for a research project. I agree that nailing down the
data structures, and understanding how a PHP app is constructed, have
been the two main issues.
I'm working on a v1 that will store a hidden/cookie session ID that will
be tied to a serialized object stored in a database to maintain state,
possibly like this: https://www.w3schools.com/php/php_sessions.asp ,
although it's not immediately apparent how I extend this model to store
sessions in a database.
If I use PHP sessions to maintain state in MySQL (as suggested on the
w3schools page above) does PHP delete old state? That might be a good
security measure and necessary for some applications, but (as you say)
I'll have all the data I want in that structure.
-Alan
On 7/2/2019 6:18 AM, Stephen wrote:
I see storing data between page views as your big challenge.
Maintaining a "state" for the user session.
I am guessing that you have many questions, and that means lots of
data. Using a database makes sense. PHP has fine interfaces to databases.
And since the application will be used by others, they need a place to
install their questions.
If I was tasked with this project, I would start by documenting data
structures and the algorithms. (Nicholas Worth)
If I understand correctly, the user navigation through the test is the
tricky part.
Only when this is done, would I consider the PHP programming.
--
Alan D. Mead, Ph.D.
President, Talent Algorithms Inc.
science + technology = better workers
http://www.alanmead.org
"You're an interesting species. An interesting mix.
You're capable of such beautiful dreams, and such
horrible nightmares. You feel so lost, so cut off,
so alone, only you're not. See, in all our
searching, the only thing we've found that makes
the emptiness bearable, is each other."
-- Carl Sagan, Contact
--
Stephen