--- loncom/homework/bridgetask.pm 2006/02/21 18:36:30 1.113 +++ loncom/homework/bridgetask.pm 2006/03/29 13:24:43 1.128 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: bridgetask.pm,v 1.113 2006/02/21 18:36:30 albertel Exp $ +# $Id: bridgetask.pm,v 1.128 2006/03/29 13:24:43 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -155,7 +155,7 @@ sub add_previous_version_button { join("\n\n"; $list.=''; - $result.='
'. @@ -176,10 +176,10 @@ sub add_grading_button { if (scalar(keys(%sections)) < 3) { $size=scalar(keys(%sections))+2; } - my $sec_select = ''."\n"; $sec_select .= "\n"; foreach my $sec (sort {lc($a) cmp lc($b)} (keys(%sections))) { - $sec_select .= "\n"; + $sec_select .= "\n"; } $sec_select .= "\n"; @@ -213,6 +213,7 @@ sub add_grading_button { 'gradinguser', 'gradingdomain'); $result.=&Apache::loncommon::studentbrowser_javascript(); + $result.= '

'; } return $result; } @@ -236,7 +237,7 @@ STUFF if ($env{'request.enc'}) { $symb=&Apache::lonenc::encrypted($symb); } $symb=&Apache::lonnet::escape($symb); - $result.=''. + $result.=''. ''. ''. ' -.fail, .pass, .neutral { - position: relative; - margin : 5px; - margin-bottom :10px; - padding : 4px; - padding-left : 75px; - border : thin solid; - font-weight : bolder; - font-size: smaller; - font-family: Arial; - background-color : rgb(255,240,225); -} - -.fail h4, .pass h4 { - position:absolute; - left: -4px; - top: -8px; - padding:2px; - margin:0; - background-color : rgb(255,240,225); - border : thin solid; -} - -.fail { - color: red; -} - -.pass { - color : green; -} - -.neutral { - color : blue; -} - -.question { - border : thin solid black; - padding : 4px; - margin-bottom : 1em; -} - -.grade { - font-size: x-large; - font-family: Arial; - position:absolute; - left: 5px; - top: -5px; - width: 70px; -} - -div#feedback h1 { - color : inherit; -} - + my ($target) = @_; + if ($target eq 'web' + || $target eq 'webgrade') { + return (< STYLE - + } + return; } sub show_task { @@ -371,12 +322,15 @@ sub submission_time_stamp { return $result; } -sub webgrade_standard_info { - my ($version)=&get_version(); - my (undef,undef,$udom,$uname) = &Apache::lonxml::whichuser(); +sub file_list { + my ($files,$uname,$udom) = @_; + if (!defined($uname) || !defined($udom)) { + (undef,undef,$udom,$uname) = &Apache::lonxml::whichuser(); + } my $file_url = '/uploaded/'.$udom.'/'.$uname.'/portfolio/'; - my $file_list="'; + $result.=<$title

Files submitted: $files

@@ -514,9 +497,8 @@ DONESCREEN } } } elsif ($target eq 'web') { - my $name= &Apache::structuretags::get_resource_name($parstack,$safeeval); - $result.="$head_tag_start$name - $body_tag_start \n".&style(); + $result.="$head_tag_start + $body_tag_start \n"; $result.=&preserve_grade_info(); $result.=&internal_location(); @@ -528,7 +510,11 @@ DONESCREEN $target eq 'webgrade') { my $webgrade='yes'; if ($target eq 'webgrade') { - $result.=$head_tag_start.''.$body_tag_start; + $result.=$head_tag_start. + ''.$body_tag_start. + "\n".'
'."\n". + ''; #$result.='
Review'.&show_queue('reviewqueue'); #$result.='
Grade'.&show_queue('gradingqueue'); } @@ -607,7 +593,7 @@ DONESCREEN if ($webgrade eq 'yes') { $result.=&webgrade_standard_info(); } } if ($target eq 'webgrade') { - $result.="\n".'
'; + $result.="\n".'
'; } } elsif ($target eq 'edit') { $result.=$head_tag_start."".$body_tag_start.$form_tag_start. @@ -802,8 +788,9 @@ sub end_Task { &show_task($status,$previous)) { $result.=&Apache::inputtags::gradestatus('0'); $result.=''; + my $action = &Apache::lonenc::check_encrypt($env{'request.uri'}); $result.=< +
@@ -820,7 +807,7 @@ DONEBUTTON my $start_time= &Apache::lonlocal::locallocaltime($slot{'starttime'}); - my $status = "\n
\n"; + my $status = "\n
\n"; if ($bt_status eq 'pass') { $status.='

You passed the '.$title.' given on '. @@ -856,8 +843,8 @@ DONEBUTTON $result=~s/\Q$internal_location\E/$status/; } } - if ($target eq 'web' || $target eq 'webgrade') { - $result.=&Apache::lonxml::xmlend().''; + if ($target eq 'web') { + $result.="\n

\n".&Apache::lonxml::xmlend().''; } } if ($target eq 'grade' && !$env{'form.webgrade'} && !$previous) { @@ -996,7 +983,8 @@ DONEBUTTON # &mt('Throw Away & Stop Grading').'" /> '; #$result.=' '; - $result.=''.&Apache::loncommon::endbodytag().''; + $result.=''."\n
\n
\n". + &Apache::loncommon::endbodytag().''; } elsif ($target eq 'meta') { $result.=&Apache::response::meta_package_write('Task'); $result.=&Apache::response::meta_stores_write('solved','string', @@ -1213,7 +1201,7 @@ sub show_queue { $result.=(<$status -
+ @@ -1521,7 +1509,7 @@ sub select_user { $result.=< - + @@ -1675,6 +1663,10 @@ sub get_instance { { my $last_link; + sub link { + my ($instance,$id) = @_; + return 'LC_GRADING_criteria_'.$instance.'_'.$id; + } sub end_Dimension { my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; my $result=&Apache::lonxml::endredirection(); @@ -1699,7 +1691,7 @@ sub get_instance { if ($Apache::bridgetask::dimensionmandatory{$dim} eq 'N') { $mandatory='Optional'; } - my $dim_info="
\n"; + my $dim_info="
\n"; if ($dim_status eq 'pass') { $dim_info.='

Question : you passed this '.$mandatory.' question

'; } @@ -1749,13 +1741,14 @@ sub get_instance { my $status_display=$status; $status_display=~s/^([a-z])/uc($1)/e; @Apache::scripttag::parser_env = @_; - $result.='

'.$mandatory. - ' Criteria

'; + $result.= + '

' + .$mandatory.' Criteria

'; @Apache::scripttag::parser_env = @_; $result.=&Apache::scripttag::xmlparse($dimension{$instance.'.criteria.'.$id}); - $result.='

'.$status_display.'

'; + $result.='

'.$status_display.'

'; if ($Apache::lonhomework::history{"resource.$version.0.$dim.$instance.$id.comment"}) { - $result.='

'.&mt('Comment: [_1]',$Apache::lonhomework::history{"resource.$version.0.$dim.$instance.$id.comment"}).'

'; + $result.='

'.&mt('Comment: [_1]',$Apache::lonhomework::history{"resource.$version.0.$dim.$instance.$id.comment"}).'

'; } $result.='
'; } @@ -1768,26 +1761,26 @@ sub get_instance { @Apache::scripttag::parser_env = @_; &Apache::scripttag::xmlparse($dimension{$instance.'.text'}); foreach my $id (@{$dimension{$instance.'.criterias'}}) { - my $link='criteria_'.$instance.'_'.$id; + my $link=&link($instance,$id); my $status=$Apache::lonhomework::history{"resource.$version.0.$dim.$instance.$id.status"}; - $result.='
'."\n". + $result.='
'."\n". ''."\n". ''."\n". - '
'."\n"; + '
'."\n"; @Apache::scripttag::parser_env = @_; $result.=&Apache::scripttag::xmlparse($dimension{$instance.'.criteria.'.$id}); $result.='
'."\n". #$dimension{$instance.'.criteria.'.$id}. - '
'."\n". - ''."\n". - ''."\n". - ''."\n". - ''."\n". + '
'."\n". + ''."\n". + ''."\n". + ''."\n". + ''."\n". '
'."\n". - '