--- loncom/homework/structuretags.pm 2006/05/23 19:05:42 1.355 +++ loncom/homework/structuretags.pm 2006/06/20 03:33:55 1.357 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.355 2006/05/23 19:05:42 albertel Exp $ +# $Id: structuretags.pm,v 1.357 2006/06/20 03:33:55 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -38,6 +38,9 @@ use Apache::lonlocal; use Apache::lonxml; use Apache::lonenc(); use Time::HiRes qw( gettimeofday tv_interval ); +use lib '/home/httpd/lib/perl/'; +use LONCAPA; + BEGIN { &Apache::lonxml::register('Apache::structuretags',('block','languageblock','instructorcomment','while','randomlist','problem','library','web','tex','part','preduedate','postanswerdate','solved','notsolved','problemtype','startouttext','endouttext','simpleeditbutton','definetag')); } @@ -339,9 +342,11 @@ Feedback Mode: } sub initialize_storage { + my ($given_symb) = @_; undef(%Apache::lonhomework::results); undef(%Apache::lonhomework::history); - my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser(); + my ($symb,$courseid,$domain,$name) = + &Apache::lonxml::whichuser($given_symb); # anonymous users (CODEd exams) have no data if ($name eq 'anonymous' @@ -381,11 +386,13 @@ sub initialize_storage { # Will increment totals for attempts, students, and corrects # if running user has student role. sub finalize_storage { + my ($given_symb) = @_; my $result; if (%Apache::lonhomework::results) { my @remove = grep(/^INTERNAL_/,keys(%Apache::lonhomework::results)); delete(@Apache::lonhomework::results{@remove}); - my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser(); + my ($symb,$courseid,$domain,$name) = + &Apache::lonxml::whichuser($given_symb); if ($env{'request.state'} eq 'construct' || $symb eq '' || $Apache::lonhomework::type eq 'practice') { @@ -1380,7 +1387,7 @@ sub start_part { } if (($Apache::lonhomework::type eq 'exam') && ($allow_print_points)) { $result .= '\fbox{\textit{'.$weight.' pt}}';} } elsif ($target eq 'web') { - $result.=''; + $result.=''; } } } @@ -1633,7 +1640,7 @@ sub start_simpleeditbutton { $url=~s/\?.*$//; my ($symb) = &Apache::lonxml::whichuser(); $result='
'. - ''.&mt('Edit').' - '.&mt('Note: it can take up to 10 minutes for changes to take effect for all users.'). + ''.&mt('Edit').' - '.&mt('Note: it can take up to 10 minutes for changes to take effect for all users.'). &Apache::loncommon::help_open_topic('Caching').'

'; } return $result;