';
+ $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.='';
+ &mt($text).'" />'."\n\t".
+ ''."\n";
return $result;
}
@@ -584,7 +592,7 @@ sub start_Task {
$result.='";
+ $result.=$uri.'">'.&add_grading_button()."\n";
my $symb=&Apache::lonnet::symbread();
if (&Apache::lonnet::allowed('mgq',$env{'request.course.id'})) {
$result.='';
+ }
+
+ $result.='';
+
+ if (!$previous && $status ne 'SHOW_ANSWER' &&
+ &show_task($status,$previous)) {
my $action = &Apache::lonenc::check_encrypt($env{'request.uri'});
$result.=<
@@ -1037,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 '.
@@ -1050,33 +1064,14 @@ DONEBUTTON
$status.=&add_request_another_attempt_button();
}
}
- $status.='
';
- my $man_count=0;
- my $man_passed=0;
- my $opt_count=0;
- my $opt_passed=0;
+ $status.="\n".'
'."\n";
my $dim = $top;
- foreach my $id (@{$dimension{$dim}{'criterias'}}) {
- my $status = &get_criteria('status',$version,$dim,$id);
- if ($dimension{$dim}{'criteria.'.$id.'.mandatory'}
- eq 'N') {
- $opt_count++;
- if ($status eq 'pass') {
- $opt_passed++;
- }
- } else {
- $man_count++;
- if ($status eq 'pass') { $man_passed++; }
- }
- }
- if ($man_passed eq $man_count) { $man_passed='all'; }
-
- my $opt_req=&Apache::lonxml::get_param('OptionalRequired',
- $parstack,$safeeval);
- if ($opt_req !~ /\S/) { $opt_req='0'; }
-
- $status.="\n
".&mt('You needed to pass all of the [_1] mandatory components and [_2] of the [_3] optional components, of which you passed [_4].',$man_count,$opt_req,$opt_count,$opt_passed)."
\n";
+
foreach my $id (@{$dimension{$dim}{'criterias'}}) {
my $type = $dimension{$dim}{'criteria.'.$id.'.type'};
@@ -2097,8 +2092,11 @@ sub start_Dimension {
&Apache::lonxml::get_param('Mandatory',$parstack,$safeeval);
push(@{$dimension{$previous_dim}{'criterias'}},$dim);
$dimension{$dim}{'nested'}=$previous_dim;
+ $dimension{$dim}{'depth'} = 1 + $dimension{$previous_dim}{'depth'};
+
&Apache::lonxml::debug("adding $dim as criteria to $previous_dim");
} else {
+ $dimension{$top}{'depth'}=0;
$dimension{$top}{'criteria.'.$dim.'.type'}='dimension';
$dimension{$top}{'criteria.'.$dim.'.mandatory'}=
&Apache::lonxml::get_param('Mandatory',$parstack,$safeeval);
@@ -2106,8 +2104,10 @@ sub start_Dimension {
}
push(@Apache::bridgetask::dimension,$dim);
&Apache::lonxml::startredirection();
- &enable_dimension_parsing($dim);
- return &internal_location($dim);
+ if (!&skip_dimension_parsing($dim)) {
+ &enable_dimension_parsing($dim);
+ }
+ return;# &internal_location($dim);
}
sub start_QuestionText {
@@ -2226,57 +2226,55 @@ 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') {
- $dim_info.='
Question : you passed this '.$mandatory.' question
';
+ $dim_info.='
'.$question.' : you passed the above '.$mandatory.' question
';
}
if ($dim_status eq 'fail') {
- $dim_info.='
Question : you did not pass this '.$mandatory.' question
';
- }
- my $man_count=0;
- my $man_passed=0;
- my $opt_count=0;
- my $opt_passed=0;
- foreach my $id ( @{$dimension{$dim}{$instance.'.criterias'}},
- @{$dimension{$dim}{'criterias'}} ) {
- my $status = &get_criteria('status',$version,$dim,$id);
- if ($dimension{$dim}{'criteria.'.$id.'.mandatory'}
- eq 'N') {
- $opt_count++;
- if ($status eq 'pass') { $opt_passed++; }
- } else {
- $man_count++;
- if ($status eq 'pass') { $man_passed++; }
- }
- }
- if ($man_passed eq $man_count) { $man_passed='all'; }
-
- my $opt_req=$dimension{$dim}{$instance.'.optionalrequired'};
- if ($opt_req !~ /\S/) {
- $opt_req=
- &Apache::lonxml::get_param('OptionalRequired',
- $parstack,$safeeval);
- if ($opt_req !~ /\S/) { $opt_req = 0; }
+ $dim_info.='
'.$question.' : you did not pass the above '.$mandatory.' question
';
}
- $dim_info.="\n
".&mt('You passed [_1] of the [_2] mandatory components and [_3] of the [_4] optional components, of which you were required to pass [_5].',$man_passed,$man_count,$opt_passed,$opt_count,$opt_req)."