--- loncom/homework/bridgetask.pm 2006/06/20 03:56:30 1.176 +++ loncom/homework/bridgetask.pm 2006/06/24 01:28:17 1.179 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: bridgetask.pm,v 1.176 2006/06/20 03:56:30 albertel Exp $ +# $Id: bridgetask.pm,v 1.179 2006/06/24 01:28:17 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -50,7 +50,7 @@ my %dimension; sub initialize_bridgetask { # id of current Dimension, 0 means that no dimension is current # (inside only) - %Apache::bridgetask::dimension=(); + @Apache::bridgetask::dimension=(); # list of all Dimension ids seen %Apache::bridgetask::top_dimensionlist=(); # list of all current Instance ids @@ -144,7 +144,7 @@ sub create_new_version { #setup new version and who did it $Apache::lonhomework::results{'resource.0.version'}=$version; $id = "$version.0"; - if (!defined($user) || defined($domain)) { + if (!defined($user) || !defined($domain)) { $user = $env{'user.name'}; $domain = $env{'user.domain'}; } @@ -530,8 +530,8 @@ sub start_Task { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; my ($status,$accessmsg,$slot); + &Apache::structuretags::init_problem_globals('Task'); if ($target ne 'webgrade') { - &Apache::structuretags::init_problem_globals('Task'); &Apache::structuretags::initialize_storage(); &Apache::lonhomework::showhash(%Apache::lonhomework::history); if ($env{'request.state'} eq 'construct') { @@ -594,9 +594,9 @@ sub start_Task { ($status,$accessmsg,my $slot_name,$slot) = &Apache::lonhomework::check_slot_access('0','Task'); if ($status eq 'CAN_ANSWER' && $version eq '') { - # CAN_ANSWR mode, and no current version, unproctored access + # CAN_ANSWER mode, and no current version, unproctored access # thus self-checkedin - &check_in('Task',undef,undef,$slot_name) + &check_in('Task',undef,undef,$slot_name); &add_to_queue('gradingqueue',{'type' => 'Task', 'time' => time, 'slot' => $slot_name}); @@ -1221,6 +1221,7 @@ DONEBUTTON $result.=&Apache::response::meta_stores_write('status','string', 'Bridge Task Status'); } + &Apache::structuretags::reset_problem_globals('Task'); undef($Apache::lonhomework::parsing_a_task); return $result; }