--- loncom/homework/lonhomework.pm 2007/10/08 09:22:50 1.276 +++ loncom/homework/lonhomework.pm 2007/11/10 01:38:21 1.283 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Homework handler # -# $Id: lonhomework.pm,v 1.276 2007/10/08 09:22:50 foxr Exp $ +# $Id: lonhomework.pm,v 1.283 2007/11/10 01:38:21 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -49,11 +49,11 @@ use Apache::matchresponse(); use Apache::chemresponse(); use Apache::drawimage(); use Apache::Constants qw(:common); -use HTML::Entities(); use Apache::loncommon(); use Apache::lonlocal; use Time::HiRes qw( gettimeofday tv_interval ); -use Apache::lonnet(); +use HTML::Entities(); +use File::Copy(); # FIXME - improve commenting @@ -149,7 +149,7 @@ sub get_target { } elsif ( $env{'form.problemmode'} eq &mt('Edit') || $env{'form.problemmode'} eq 'Edit') { if ( $env{'form.submitted'} eq 'edit' ) { - if ( $env{'form.submit'} eq &mt('Submit Changes and View') ) { + if ( $env{'form.submit'} eq &mt('Save and View') ) { return ('modified','web','answer'); } else { return ('modified','no_output_web','edit'); @@ -398,8 +398,8 @@ sub check_access { if ($env{'request.state'} eq "construct") { if ($env{'form.problemstate'}) { if ($env{'form.problemstate'} =~ /^CANNOT_ANSWER/) { - if ( ! ($env{'form.problemstate'} eq 'CANNOT_ANSWER_correct' && - lc($Apache::lonhomework::problemstatus) eq 'no')) { + if ( ! ($env{'form.problemstate'} eq 'CANNOT_ANSWER_correct' + && &hide_problem_status())) { return ('CANNOT_ANSWER', &mt('is in this state due to author settings.')); } @@ -489,7 +489,7 @@ sub check_access { # if (correct and show prob status) or excused then CANNOT_ANSWER if(($Apache::lonhomework::history{"resource.$id.solved"}=~/^correct/ && - lc($Apache::lonhomework::problemstatus) ne 'no') + &show_problem_status()) || $Apache::lonhomework::history{"resource.$id.solved"}=~/^excused/) { $status = 'CANNOT_ANSWER'; @@ -543,7 +543,8 @@ sub due_date { &Apache::lonxml::debug("looking for first_access $first_access"); if (defined($first_access)) { $interval = $first_access+$interval; - $date = ($interval < $due_date)? $interval : $due_date; + $date = (!$due_date || $interval < $due_date) ? $interval + : $due_date; } else { $date = $due_date; } @@ -746,11 +747,14 @@ sub analyze_header {
'; &Apache::lonxml::add_messages(\$result); $request->print($result); @@ -823,7 +827,7 @@ sub analyze { } &Apache::lonhtmlcommon::Update_PrgWin($request,\%prog_state, &mt('Analyzing Results')); - $request->print('+ '.&mt('Problem Editing').&Apache::loncommon::help_open_topic('Problem_Editor_XML_Index').' + | + '.&Apache::loncommon::helpLatexCheatsheet().' + |
'.&mt('You did not select a template.').'
'."\n"; - } my $instructions; my $start_page = &Apache::loncommon::start_page("Create New $extension"); @@ -1085,16 +1122,17 @@ $errormsg".&mt("To create a new $extension, select a template from the". - "pull-down menu below. Then click on the \"Create $extension\" button.")." + " list below. Then click on the \"Create $extension\" button.")."
".&Apache::loncommon::end_page()); } - return ''; + return; } sub update_construct_style {