--- loncom/homework/bridgetask.pm 2006/02/20 22:57:41 1.112 +++ loncom/homework/bridgetask.pm 2006/03/06 19:46:59 1.118 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: bridgetask.pm,v 1.112 2006/02/20 22:57:41 albertel Exp $ +# $Id: bridgetask.pm,v 1.118 2006/03/06 19:46:59 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -155,7 +155,7 @@ sub add_previous_version_button { join("\n\n"; $list.=''; - $result.='
'. @@ -236,7 +236,7 @@ STUFF if ($env{'request.enc'}) { $symb=&Apache::lonenc::encrypted($symb); } $symb=&Apache::lonnet::escape($symb); - $result.=''. + $result.=''. ''. ''. ' -.fail, .pass, .neutral { +.LC_fail, .LC_pass, .LC_neutral { position: relative; margin : 5px; margin-bottom :10px; @@ -273,7 +273,7 @@ sub style { background-color : rgb(255,240,225); } -.fail h4, .pass h4 { +.LC_fail h4, .LC_pass h4 { position:absolute; left: -4px; top: -8px; @@ -283,25 +283,25 @@ sub style { border : thin solid; } -.fail { +.LC_fail { color: red; } -.pass { +.LC_pass { color : green; } -.neutral { +.LC_neutral { color : blue; } -.question { +.LC_question { border : thin solid black; padding : 4px; margin-bottom : 1em; } -.grade { +.LC_grade { font-size: x-large; font-family: Arial; position:absolute; @@ -375,7 +375,7 @@ sub webgrade_standard_info { my ($version)=&get_version(); my (undef,undef,$udom,$uname) = &Apache::lonxml::whichuser(); my $file_url = '/uploaded/'.$udom.'/'.$uname.'/portfolio/'; - my $file_list="
'; + $result.=<$title

Files submitted: $files

@@ -607,7 +621,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 +816,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 +835,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 +871,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 +1011,8 @@ DONEBUTTON # &mt('Throw Away & Stop Grading').'" /> '; #$result.=' '; - $result.=''.&Apache::loncommon::endbodytag().''; + $result.=''."\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 +1229,7 @@ sub show_queue { $result.=(<$status -
+ @@ -1521,7 +1537,7 @@ sub select_user { $result.=< - + @@ -1699,7 +1715,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 +1765,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,30 +1785,31 @@ 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='LC_GRADE_criteria_'.$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"; + $result.=&grading_history($version,$dim,$instance,$id); $last_link=$link; } } elsif ($target eq 'grade' && $env{'form.webgrade'}) { @@ -1840,6 +1858,38 @@ sub get_instance { } } +sub grading_history { + my ($version,$dim,$instance,$criteria) = @_; + if (!&Apache::lonnet::allowed('mgq',$env{'request.course.id'})) { + return ''; + } + my ($result,$grader); + my $scope="resource.$version.0.$dim.$instance.$criteria"; + foreach my $t (1..$Apache::lonhomework::history{'version'}) { + if (exists($Apache::lonhomework::history{$t.':resource.0.regrader'})) { + my ($gname,$gdom) = + split('@',$Apache::lonhomework::history{$t.':resource.0.regrader'}); + my $fullname = &Apache::loncommon::plainname($gname,$gdom); + $grader = &Apache::loncommon::aboutmewrapper($fullname, + $gname,$gdom); + } + my $entry; + if (exists($Apache::lonhomework::history{"$t:$scope.status"})) { + $entry.="".$Apache::lonhomework::history{"$t:$scope.status"}.''; + } + if (exists($Apache::lonhomework::history{"$t:$scope.comment"})) { + $entry.=' comment: "'.$Apache::lonhomework::history{"$t:$scope.comment"}.'"'; + } + if ($entry) { + $result.= "
  • $grader : $entry
  • "; + } + } + if ($result) { + return '
      '.$result.'
    '; + } + return ''; +} + sub start_IntroParagraph { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; my $result; @@ -1923,7 +1973,7 @@ sub proctor_validation_screen {

    Proctor Validation

    Your room's proctor needs to validate your access to this resource.

    $msg - +