--- loncom/homework/structuretags.pm 2006/06/26 22:33:22 1.359 +++ loncom/homework/structuretags.pm 2006/09/29 20:55:33 1.366 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.359 2006/06/26 22:33:22 albertel Exp $ +# $Id: structuretags.pm,v 1.366 2006/09/29 20:55:33 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -134,7 +134,7 @@ sub page_start { $body_args{'force_register'} = 1; $body_args{'add_entries'} = \%add_entries; } - + $body_args{'no_auto_mt_title'} = 1; my $page_start = &Apache::loncommon::start_page($name,$extra_head, \%body_args); @@ -528,7 +528,6 @@ sub init_problem_globals { undef($Apache::lonhomework::name); undef($Apache::lonhomework::default_type); undef($Apache::lonhomework::type); - undef($Apache::lonhomework::problemstatus); } sub reset_problem_globals { @@ -594,11 +593,7 @@ sub start_problem { $Apache::lonhomework::scantronmode=1; } - &initialize_storage(); if ($target ne 'analyze') { - if ($target eq 'web') { - &Apache::lonhomework::showhash(%Apache::lonhomework::history); - } if ($env{'request.state'} eq 'construct') { &set_problem_state('0'); } $Apache::lonhomework::type=&Apache::lonnet::EXT('resource.0.type'); if (($env{'request.state'} eq 'construct') && @@ -619,6 +614,12 @@ sub start_problem { } $Apache::lonhomework::default_type = $Apache::lonhomework::type; + &initialize_storage(); + if ($target eq 'web') { + &Apache::lonxml::debug(" grading history "); + &Apache::lonhomework::showhash(%Apache::lonhomework::history); + } + #added vars to the scripting enviroment my $expression='$external::part=\''.$Apache::inputtags::part.'\';'; $expression.='$external::type=\''.$Apache::lonhomework::type.'\';'; @@ -736,6 +737,13 @@ sub start_problem { 'problem'); } } elsif ($target eq 'web') { + if ($status eq 'CAN_ANSWER' + && $slot_name ne '' + && $Apache::lonhomework::history{'resource.0.checkedin'} eq '') { + # unproctored slot access, self checkin + &Apache::bridgetask::check_in('problem',undef,undef, + $slot_name); + } $result.="\n $form_tag_start". ''; # create a page header and exit @@ -1592,9 +1600,10 @@ sub end_startouttext { ." ". &Apache::edit::insertlist($target,$token). + '' . + &Apache::loncommon::helpLatexCheatsheet(). &Apache::edit::end_row(). - &Apache::edit::start_spanning_row()."\n" - . &Apache::loncommon::helpLatexCheatsheet () . + &Apache::edit::start_spanning_row()."\n". &Apache::edit::editfield($token->[1],$text,"",80,8,1); } if ($target eq 'modified') {