--- loncom/homework/bridgetask.pm 2006/11/09 20:42:43 1.199 +++ loncom/homework/bridgetask.pm 2006/11/09 21:31:11 1.200 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: bridgetask.pm,v 1.199 2006/11/09 20:42:43 albertel Exp $ +# $Id: bridgetask.pm,v 1.200 2006/11/09 21:31:11 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -234,36 +234,43 @@ sub add_grading_button { if (scalar(keys(%sections)) < 3) { $size=scalar(keys(%sections))+2; } - my $sec_select = ''."\n"; + $sec_select .= "\t\n"; foreach my $sec (sort {lc($a) cmp lc($b)} (keys(%sections))) { - $sec_select .= "\n"; + $sec_select .= "\t\n"; } - $sec_select .= "\n"; + $sec_select .= "\t\n\n"; - my $result=' '; - $result.=''; + $result.="\n\t".''; if (&Apache::lonnet::allowed('mgq',$env{'request.course.id'})) { my ($entries,$ready,$locks)=&get_queue_counts('gradingqueue'); - $result.=''; - $result.=''; - $result.=''; + $result.="\n\t\t\t".''. + "\n\t\t\t".''; + $result.="\n\t\t\t".''."\n"; + $result.= "\n\t\t\t\t".&mt("[_1] entries, [_2] ready, [_3] being graded",$entries,$ready,$locks).''."\n\t\t".''."\n"; ($entries,$ready,$locks)=&get_queue_counts('reviewqueue'); - $result.=''."\n"; - $result.='
Specify a section: '.$sec_select.''.' '."\n\t\t".'
Specify a section: '.$sec_select."\n\t\t\t".''.' '; - $result.= &mt("[_1] entries, [_2] ready, [_3] being graded",$entries,$ready,$locks).'
'. - ' '. + "\n\t\t\t".''. + "\n\t\t\t\t".' '; $result.=&mt("[_1] entries, [_2] ready, [_3] being graded", - $entries,$ready,$locks).'
'."\n"; - $result.='

'."\n"; - $result.=''; + $entries,$ready,$locks).''."\n\t\t".''."\n"; + $result.="\n\t\t".''. + "\n\t\t\t".''. + "\n\t\t\t\t".' ' + ."\n\t\t".'' + ."\n\t".''."\n"; + $result.="\n\t".'

'. + "\n\t\t".''; + $result.= "\n\t\t".''; $result.=&Apache::loncommon::select_dom_form($env{'user.domain'}, 'gradingdomain'); $result.=' '. @@ -271,7 +278,7 @@ sub add_grading_button { 'gradinguser', 'gradingdomain'); $result.=&Apache::loncommon::studentbrowser_javascript(); - $result.= '

'; + $result.= '

'."\n"; } return $result; } @@ -295,18 +302,19 @@ sub add_request_another_attempt_button { my $description=&Apache::slotrequest::get_description($slot_name, $slot); $result.=(< Will be next available: $description

+

Will be next available: $description

STUFF } if ($env{'request.enc'}) { $symb=&Apache::lonenc::encrypted($symb); } $symb=&escape($symb); - $result.='
'. - ''. - ''. + $result.= + "\n\t".''."\n\t\t". + ''."\n\t\t". + ''."\n\t\t". ''. - '
'; + &mt($text).'" />'."\n\t". + ''."\n"; return $result; } @@ -584,7 +592,7 @@ sub start_Task { $result.='
'.&add_grading_button()."
"; + $result.=$uri.'">'.&add_grading_button()."\n"; my $symb=&Apache::lonnet::symbread(); if (&Apache::lonnet::allowed('mgq',$env{'request.course.id'})) { $result.='
'. @@ -683,7 +691,7 @@ sub start_Task { $result.=&preserve_grade_info(); $result.=&internal_location(); - $result.=$form_tag_start. + $result.=$form_tag_start."\t". ''; &Apache::lonxml::startredirection(); } @@ -1042,7 +1050,8 @@ DONEBUTTON } $start_time=&Apache::lonlocal::locallocaltime($start_time); - my $status = "\n
\n"; + my $status = + "\n
\n\t"; if ($bt_status eq 'pass') { $status.='

You passed the '.$title.' given on '. @@ -1055,13 +1064,13 @@ DONEBUTTON $status.=&add_request_another_attempt_button(); } } - $status.='

'; + $status.="\n".'
'."\n"; my $dim = $top; my %counts = &get_counts($dim,undef,$parstack, $safeeval); - $status.="\n

". + $status.="\n

\n\t

". &question_status_message(\%counts,-1). - "

\n"; + "

\n
\n"; foreach my $id (@{$dimension{$dim}{'criterias'}}) { @@ -2215,7 +2224,8 @@ sub end_Dimension { if (&Apache::lonxml::get_param('Mandatory',$parstack,$safeeval) eq 'N') { $mandatory='Optional'; } - my $dim_info="
\n"; + my $dim_info= + "\n
\n\t"; my $question = ('sub' x $dimension{$dim}{'depth'}).'question'; $question =~ s/^(.)/uc($1)/e; if ($dim_status eq 'pass') { @@ -2227,10 +2237,10 @@ sub end_Dimension { my %counts = &get_counts($dim,$instance,$parstack, $safeeval); - $dim_info.="\n

" + $dim_info.="\n\t

" .&question_status_message(\%counts, $dimension{$dim}{'depth'}) - ."

\n
"; + ."

\n
\n"; foreach my $id (@{$dimension{$dim}{$instance.'.criterias'}}, @{$dimension{$dim}{'criterias'}}) { @@ -2504,11 +2514,12 @@ sub grading_history { $entry.=' comment: "'.$Apache::lonhomework::history{"$t:$scope.comment"}.'"'; } if ($entry) { - $result.= "
  • $grader : $entry
  • "; + $result.= "\n\t\t
  • \n\t\t\t$grader :\n\t\t\t $entry \n\t\t
  • "; } } if ($result) { - return ''; + return "\n\t".''."\n"; } return ''; } @@ -2621,15 +2632,18 @@ sub layout_web_Criteria { my $status_display=$status; $status_display=~s/^([a-z])/uc($1)/e; my $criteria_info.= - '

    ' - .$mandatory.' Criteria

    '; + '

    '."\n\t".'

    ' + .$mandatory.' Criteria

    '."\n\t".'

    '."\n"; $criteria_info.= $criteria; - $criteria_info.='

    '.$status_display.'

    '; + $criteria_info.="\n\t".'

    '. + "\n\t".'

    '.$status_display.'

    '; if ($comment =~ /\w/) { - $criteria_info.='

    '. - &mt('Comment: [_1]',$comment).'

    '; + $criteria_info.= + "\n\t". + '

    '.&mt('Comment: [_1]',$comment).'

    '; } - $criteria_info.='
    '; + $criteria_info.="\n".'
    '."\n"; + return $criteria_info; } @@ -2638,34 +2652,51 @@ sub layout_webgrade_Criteria { my $link=&link($id); my $version = &get_version(); my $status = &get_criteria('status',$version,$dim,$id); - my $result = - '
    '."\n". - '
    '."\n". - $criteria. - '
    '."\n". - '
    '."\n". - ''."\n". - ''."\n". - ''."\n". - ''."\n". - '
    '."\n". - ''."\n". - '
    '."\n". - &grading_history($version,$dim,$id); + my %lt = ( 'ungraded' => 'Ungraded', + 'fail' => 'Fail', + 'pass' => 'Pass', + 'review' => 'Review', + 'comment' => 'Additional Comment for Student', + ); + %lt = &Apache::lonlocal::texthash(%lt); + my $comment = &get_criteria('comment',$version,$dim,$id); + $comment = &HTML::Entities::encode($comment,'<>"&'); + my %checked; + foreach my $which ('ungraded','fail','pass','review') { + if ($status eq $which) { $checked{$which} = 'checked="checked"'; } + } + if (!%checked) { $checked{'ungraded'} = 'checked="checked"'; } + + my $result = < +
    + $criteria +
    +
    + + + + +
    + + +END_CRITERIA + $result .= &grading_history($version,$dim,$id); return $result; }