--- loncom/homework/lonhomework.pm 2010/08/20 03:48:29 1.310.4.1 +++ loncom/homework/lonhomework.pm 2010/03/10 21:25:36 1.318 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Homework handler # -# $Id: lonhomework.pm,v 1.310.4.1 2010/08/20 03:48:29 raeburn Exp $ +# $Id: lonhomework.pm,v 1.318 2010/03/10 21:25:36 droeschl Exp $ # # Copyright Michigan State University Board of Trustees # @@ -111,11 +111,7 @@ sub get_target { } elsif ( $env{'form.grade_target'} eq 'webgrade' && ($Apache::lonhomework::queuegrade eq 'F' )) { return ($env{'form.grade_target'}); - } elsif ($env{'form.grade_target'} eq 'answer') { - if ($env{'form.answer_output_mode'} eq 'tex') { - return ($env{'form.grade_target'}); - } - } + } if ($env{'form.webgrade'} && ($Apache::lonhomework::modifygrades eq 'F' || $Apache::lonhomework::queuegrade eq 'F' )) { @@ -692,9 +688,21 @@ sub handle_save_or_undo { sub analyze_header { my ($request) = @_; my $js = &Apache::structuretags::setmode_javascript(); - my $result = - &Apache::loncommon::start_page('Analyzing a problem',$js); + # Breadcrumbs + my $brcrum = [{'href' => &Apache::loncommon::authorspace(), + 'text' => 'Construction Space'}, + {'href' => '', + 'text' => 'Problem Testing'}, + {'href' => '', + 'text' => 'Analyzing a problem'}]; + + my $result = + &Apache::loncommon::start_page('Analyzing a problem', + $js, + {'bread_crumbs' => $brcrum,}) + .&Apache::loncommon::head_subbox( + &Apache::loncommon::CSTR_pageheader()); $result .= &Apache::lonxml::message_location().'
-
+
-
+
'; &Apache::lonxml::add_messages(\$result); @@ -784,7 +792,7 @@ sub analyze { } &Apache::lonhtmlcommon::Update_PrgWin($request,\%prog_state, &mt('Analyzing Results')); - $request->print('
' + $request->print('
' .'

' .&mt('List of possible answers') .'

' @@ -915,25 +923,36 @@ sub editxmlmode { &Apache::loncommon::resize_textarea_js(). &Apache::structuretags::setmode_javascript(). &Apache::lonhtmlcommon::dragmath_js("EditMathPopup"); - my $only_body = ($env{'environment.remote'} eq 'off')? 0 : 1; my $dragmath_button = &Apache::lonhtmlcommon::dragmath_button("LC_editxmltext",1); + + # Breadcrumbs + my $brcrum = [{'href' => &Apache::loncommon::authorspace(), + 'text' => 'Construction Space'}, + {'href' => '', + 'text' => 'Problem Editing'}]; + my $start_page = &Apache::loncommon::start_page(&mt("EditXML [_1]",$file),$js, {'no_auto_mt_title' => 1, - 'only_body' => $only_body, + 'only_body' => 0, 'add_entries' => { 'onresize' => q[resize_textarea('LC_editxmltext','LC_aftertextarea')], 'onload' => q[resize_textarea('LC_editxmltext','LC_aftertextarea')], - }}); - $result.=$start_page. - &renderpage($request,$file,['no_output_web'],1). + }, + 'bread_crumbs' => $brcrum, +}); + + $result=$start_page + .&Apache::loncommon::head_subbox( + &Apache::loncommon::CSTR_pageheader()); + $result.=&renderpage($request,$file,['no_output_web'],1). '
'. &Apache::structuretags::remember_problem_state().'
@@ -951,7 +970,7 @@ sub editxmlmode { -
+
'.&Apache::lonxml::message_location().' ' . ' @@ -1081,15 +1100,21 @@ sub get_template_list { } my $count = 0; my $currentcategory=''; + my $first = 1; foreach my $file (@files) { next if ($file->[1] !~ /\S/); if ($file->[2] ne $currentcategory) { $currentcategory=$file->[2]; if ((!$seconddiv) && ($count >= $midpoint)) { - $result .= ''."\n".'
'."\n"; + $result .= '
'."\n".'
'."\n"; $seconddiv = 1; + } elsif (!$first) { + $result.='
'."\n"; + } else { + $first = 0; } - $result.='

'.$currentcategory.'

'; + $result.= '
'."\n" + .'

'.$currentcategory.'

'."\n"; $count++; } $result .= @@ -1100,11 +1125,13 @@ sub get_template_list { } my $filename=$file->[0]; $filename=~s/^\/home\/httpd\/html//; - $result.=' '.&mt('Example').'
'."\n"; + $result.=' ' + .''.&mt('Example').'' + .'
'."\n"; $count ++; } if ($numfiles > 0) { - $result .= '
'."\n".''."\n"; + $result .= ''."\n".''."\n"; } return $result; } @@ -1138,26 +1165,33 @@ sub newproblem { my $dest = &Apache::lonnet::filelocation("",$request->uri); my $errormsg; my $instructions; + my $brcrum = [{'href' => &Apache::loncommon::authorspace(), + 'text' => 'Construction Space'}, + {'href' => '', + 'text' => "Create New $extension"}]; my $start_page = - &Apache::loncommon::start_page("Create New $extension"); - $request->print(" -$start_page -

".&mt("Creating a new $extension resource.")."

+ &Apache::loncommon::start_page("Create New $extension", + undef, + {'bread_crumbs' => $brcrum,}); + $request->print( + $start_page + .&Apache::loncommon::head_subbox( + &Apache::loncommon::CSTR_pageheader()) + .'

'.&mt("Creating a new $extension resource.")."

$errormsg ".&mt("The requested file [_1] currently does not exist.", - ''.$shownurl.'')." -

- -".&mt("To create a new $extension, select a template from the". - " list below. Then click on the \"Create $extension\" button.").' -

'); + ''.$shownurl.'').' +

+'.&mt("To create a new $extension, select a template from the". + " list below. Then click on the \"Create $extension\" button.").' +

'); if (defined($templatelist)) { $request->print($templatelist); } $request->print('
'); - $request->print("

".&Apache::loncommon::end_page()); + $request->print('
'.&Apache::loncommon::end_page()); } return; }
- '.&mt('Problem Editing').&Apache::loncommon::help_open_topic('Problem_Editor_XML_Index').' +

'.&mt('Problem Editing').' '.&Apache::loncommon::help_open_topic('Problem_Editor_XML_Index').'

'.&Apache::loncommon::helpLatexCheatsheet('Problem_LON-CAPA_Functions','Script Functions').'