Subject: [LON-CAPA-dev] chat rooms

From: "Matthew Brian Hall" <[email-masked]>
Date: Sun, 4 Aug 2002 12:32:40 -0400 (EDT)

Ideas for lonchat.pm.

   I ran across an example online where a MySQL based chat is created,
http://www.devarticles.com/content.php?articleId=31.  The example is for
a php-driven solution, but it got me thinking.

   Using MySQL would be nice because it would deal with a good deal of the
concurrency problems.  We can create a table in MySQL for each class.  Each
message needs: a unique id, username, userdomain, screenname, date, color,
and message contents.  MySQL will take care of the unique id (using an
AUTOINCRMENT INT) and the date.  We would need to unescape the rest of the
data.

   We could allow the <m> tag and watch for other html tags.

   We need to be able to ban individuals from chatting.  A reminder that all
chats are logged might be in order.  I think looking for 'banned' words
would be a bit draconian.  It would also be a feature I'd run into a lot :)

   We can dump the databases to files each night/week to keep their size
down.  Providing instructors with logfiles should be doable.  Fun things,
like tracking when students were online, which chat messages they saw, and
correlating these things to success on problems could eventually be
attempted.  Of course, such invasions of privacy make me shudder...

Questions & musings:

   Do we allow lonchat to connect connect directly to MySQL on the course's
home server?  Currently we do not allow ANY MySQL connections from hosts
other than localhost.  This is a security concern.  Connecting directly might
lead to a large number of connections being made to MySQL, which could impact
performance on database queries.

   If we send the data through lond/lonsql we can use our current connections
without trouble.  I can add a new function to lonsql to deal specifically with
these chat requests.  Would the traffic be a problem?  200 students having
their sessions updated once per second and posting at a rate of 1 per 10
seconds.

Any comments/suggestions?

Matthew
--
------------------------------------------------------------------
Matthew Hall           LON-CAPA developer         [email-masked]
123 North Kedzie Hall                    Michigan State University
------------------------------------------------------------------