--- loncom/homework/structuretags.pm 2006/04/20 19:07:09 1.352 +++ loncom/homework/structuretags.pm 2006/04/28 18:33:10 1.353 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.352 2006/04/20 19:07:09 albertel Exp $ +# $Id: structuretags.pm,v 1.353 2006/04/28 18:33:10 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -331,9 +331,16 @@ Feedback Mode: } sub initialize_storage { - %Apache::lonhomework::results=(); - %Apache::lonhomework::history=(); + undef(%Apache::lonhomework::results); + undef(%Apache::lonhomework::history); my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser(); + + # anonymous users (CODEd exams) have no data + if ($name eq 'anonymous' + && !defined($domain)) { + return; + } + if ($env{'request.state'} eq 'construct' || $symb eq '' || $Apache::lonhomework::type eq 'practice') { @@ -353,6 +360,7 @@ sub initialize_storage { %Apache::lonhomework::history= &Apache::lonnet::restore($symb,$courseid,$domain,$name); } + #ignore error conditions my ($temp)=keys %Apache::lonhomework::history ; if ($temp =~ m/^error:.*/) { %Apache::lonhomework::history=(); }