[LON-CAPA-dev] Discussion

Guy Albertelli II lon-capa-dev@mail.lon-capa.org
Thu, 27 Jun 2002 13:18:50 -0400 (EDT)


Hi Behrouz,

> I found that fuction xmlend() in lonxml brings all discussion about a
> particular problem in the end of it.

Yep.


> Is there anybody knows any function to find the discussion of a particular
> student about a particular problem.

The function that is grabbing the data is:


%contrib=&Apache::lonnet::restore($symb,$ENV{'request.course.id'},
                    $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},
		    $ENV{'course.'.$ENV{'request.course.id'}.'.num'});


Which means all class contributions are being stored in a hash by symbs
with the name of the cource id in the course's home directory.

For example the PHY 183 course, has an internal name of
2964385f9033c63msul1

Thus it's 'request.course.id' is msu_2964385f9033c63msul1

So all of the discussion data is stored in the 
msu_2964385f9033c63msul1.db in the
lonUsers/msu/2/9/6/2964385f9033c63msul1
directory.

You can dump this data with 

&Apache::lonnet::dump('msu_2964385f9033c63msul1','msu','2964385f9033c63msul1')


> When we dump the student data in a big hash with dump function is the
> discussion data are inculded in this data?

There will be timestamp information like with homework data commits,
as it uses the store/restore mechanism for generating the information,
and store automatically adds a commit timestamp.
(Notice that xmlend uses the time stamp to add the time information to
the page:

$discussion.='<p><b>'.$sender.'</b> ('.
	     localtime($contrib{$idx.':timestamp'}).
	     '):<blockquote>'.$message.
             '</blockquote></p>';
)

-- 
guy@albertelli.com          BM: n^20 t20 z20 qS 
Guy Albertelli -7-8-4-  O-
    I would love to but . . . I'm building a pig from a kit.