Subject: [LON-CAPA-dev] mod_perl 2.0

From: Guy Albertelli II <[email-masked]>
Date: Tue, 18 Feb 2003 00:47:57 -0500 (EST)

Hi All,

Some fun stuff:

1) current shipping version is 1.99_08

With such fun commits as:
'fix delete $ENV{$key} bug'

2) Apache:DBI Change Log:
0.90_02 January 10, 2003

        - Changes to make Apache::DBI load and function under mod_perl
          2.0.  A few important notes: connect_on_init does not work
	  yet and there's no automatic RollBack cleanup handler when
	  autocommit is turned

3) Another random comment:
>> > Can't locate Apache/Constants.pm in @INC ....
>> >
>> > I've learned in mod_perl 2 that Apache::Constants was replaced by
>> > 3 new classes (Apache::Const,APR::Const,Modperl::Const).

Looks like it isn't going to be a simple change. 

I think we will first need to generate an 8.0 install script that
removes apache 2.0, and mod_perl1.99 and installs a 1.3 apache + 1.X
mod_perl

-- 
[email-masked]  LON-CAPA Developer  0-7-7-4-

---

From: "H. K. Ng" <[email-masked]>
Date: Tue, 18 Feb 2003 11:03:19 -0500

Hi,

Is there a function that allows me to extract just the answer plus tol etc 
for a problem? If so how is it called?

Thanks,
hkn

---

From: Guy Albertelli II <[email-masked]>
Date: Tue, 18 Feb 2003 11:15:55 -0500 (EST)

Hi Hon-Kie,

> for a problem? If so how is it called?

If you want a funtion that gets the answers in a web displayable format:
&Apache::loncommon::get_student_answers($symb,$username,$domain,$courseid);
will do that (and it supports all currently used types).

If you want a datastructure version that you can use to do something
with, you can use the analyze target to get it:

my $subresult=&Apache::lonnet::ssi($request->uri,
				   ('grade_target' => 'analyze'),
				   ('grade_domain' => $domain),
				   ('grade_user' => $user),
				   ('grade_symb' => $symb),
				   ('grade_courseid' => $courseid));
(undef,$subresult)=split(/_HASH_REF__/,$subresult,2);
my %analyze=&Apache::lonnet::str2hash($subresult);

And %analyze is a hash containg the structure of the problem.

This currently only works for some problem types
option/numericalresponse are known to work
string/formularesponse might work
rank/match/radio/essay/externalresponse won't work

If you need the second version to work more let me know and I can get
it working for a greater variety.