';
+ '';
}
sub problem_edit_footer {
return ' |
'.
@@ -418,10 +433,10 @@ sub problem_web_to_edit_header {
'';
}
- my $show_all_foils_text =
- ($Apache::lonhomework::parsing_a_task) ?
- &mt('Show All Instances')
- : &mt('Show All Foils');
+ my $show_all_foils_text =
+ ($Apache::lonhomework::parsing_a_task) ?
+ &mt('Show All Instances')
+ : &mt('Show All Foils');
my $show_all= '
@@ -500,7 +518,7 @@ $show_all
-
+
@@ -524,7 +542,8 @@ $show_all
$result.='
- ';
return $result;
@@ -609,9 +629,7 @@ sub finalize_storage {
$result=&Apache::lonnet::cstore(\%Apache::lonhomework::results,
$symb,$courseid,$domain,$name);
&Apache::lonxml::debug('Store return message:'.$result);
- if ($env{'request.role'} =~/^st/) {
- &store_aggregates($symb,$courseid);
- }
+ &store_aggregates($symb,$courseid);
}
} else {
&Apache::lonxml::debug('Nothing to store');
@@ -631,7 +649,7 @@ item store_aggregates()
sub store_aggregates {
my ($symb,$courseid) = @_;
- my %aggregate;
+ my (%aggregate,%anoncounter);
my @parts;
my $cdomain = $env{'course.'.$env{'request.course.id'}.'.domain'};
my $cname = $env{'course.'.$env{'request.course.id'}.'.num'};
@@ -641,28 +659,51 @@ sub store_aggregates {
}
}
foreach my $part (@parts) {
- if ($Apache::lonhomework::results{'resource.'.$part.'.award'}
- eq 'APPROX_ANS' ||
- $Apache::lonhomework::results{'resource.'.$part.'.award'}
- eq 'EXACT_ANS') {
- $aggregate{$symb."\0".$part."\0correct"} = 1;
+ if ($env{'request.role'} =~/^st/) {
+ if ($Apache::lonhomework::results{'resource.'.$part.'.award'}
+ eq 'APPROX_ANS' ||
+ $Apache::lonhomework::results{'resource.'.$part.'.award'}
+ eq 'EXACT_ANS') {
+ $aggregate{$symb."\0".$part."\0correct"} = 1;
+ }
+ if ($Apache::lonhomework::results{'resource.'.$part.'.tries'} == 1) {
+ $aggregate{$symb."\0".$part."\0users"} = 1;
+ } else {
+ my (undef,$last_reset) = &Apache::grades::get_last_resets($symb,$env{'request.course.id'},[$part]);
+ if ($last_reset) {
+ if (&Apache::grades::get_num_tries(\%Apache::lonhomework::history,$last_reset,$part) == 0) {
+ $aggregate{$symb."\0".$part."\0users"} = 1;
+ }
+ }
+ }
+ $aggregate{$symb."\0".$part."\0attempts"} = 1;
}
- if ($Apache::lonhomework::results{'resource.'.$part.'.tries'} == 1) {
- $aggregate{$symb."\0".$part."\0users"} = 1;
- } else {
- my (undef,$last_reset) = &Apache::grades::get_last_resets($symb,$env{'request.course.id'},[$part]);
- if ($last_reset) {
- if (&Apache::grades::get_num_tries(\%Apache::lonhomework::history,$last_reset,$part) == 0) {
- $aggregate{$symb."\0".$part."\0users"} = 1;
+ if (($Apache::lonhomework::results{'resource.'.$part.'.type'} eq 'anonsurvey') ||
+ ($Apache::lonhomework::results{'resource.'.$part.'.type'} eq 'anonsurveycred')) {
+ $anoncounter{$symb."\0".$part} = 1;
+ my $needsrelease = $Apache::lonnet::needsrelease{'parameter:type:'.$Apache::lonhomework::results{'resource.'.$part.'.type'}};
+ if ($needsrelease) {
+ my $curr_required = $env{'course.'.$env{'request.course.id'}.'.internal.releaserequired'};
+ if ($curr_required eq '') {
+ &Apache::lonnet::update_released_required($needsrelease);
+ } else {
+ my ($currmajor,$currminor) = split(/\./,$curr_required);
+ my ($needsmajor,$needsminor) = split(/\./,$needsrelease);
+ if (($currmajor < $needsmajor) || ($currmajor == $needsmajor && $currminor < $needsminor)) {
+ &Apache::lonnet::update_released_required($needsrelease);
+ }
}
}
}
- $aggregate{$symb."\0".$part."\0attempts"} = 1;
}
if (keys (%aggregate) > 0) {
&Apache::lonnet::cinc('nohist_resourcetracker',\%aggregate,
$cdomain,$cname);
}
+ if (keys(%anoncounter) > 0) {
+ &Apache::lonnet::cinc('nohist_anonsurveys',\%anoncounter,
+ $cdomain,$cname);
+ }
}
sub checkout_msg {
@@ -873,17 +914,6 @@ sub start_problem {
if ($target eq 'analyze') { my $rndseed=&setup_rndseed($safeeval); }
if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
$target eq 'tex') {
- #handle exam checkout
- if ($Apache::lonhomework::type eq 'exam') {
- my $token=
- $Apache::lonhomework::history{"resource.0.outtoken"};
- if (($env{'form.doescheckout'}) && (!$token)) {
- $token=&Apache::lonxml::maketoken();
- $Apache::lonhomework::history{"resource.0.outtoken"}=
- $token;
- }
- $result.=&Apache::lonxml::printtokenheader($target,$token);
- }
if ($env{'form.markaccess'}) {
my @interval=&Apache::lonnet::EXT("resource.0.interval");
&Apache::lonnet::set_first_access($interval[1]);
@@ -902,16 +932,15 @@ sub start_problem {
'';
}
- if ($env{'request.role.adv'}) {
- $form_tag_start.= ' |
';
+ $result.=&Apache::edit::end_table();
+
+ }
+ return $result;
+}
+
+sub end_startpartmarker {
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
+ my @result;
+ if ($target eq 'edit') { $result[1]='no'; }
+ return @result;
+}
+
+sub start_endpartmarker {
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
+ my $result='';
+ if ($target eq 'edit') {
+ $result=&Apache::edit::tag_start($target,$token);
+ $result.=&mt('Marker for the end of a part. Place start marker above to wrap in-between tags into a new part.').'';
+ $result.=&Apache::edit::end_table();
+
+ }
+ return $result;
+}
+
+sub end_endpartmarker {
+ my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_;
+ my @result;
+ if ($target eq 'edit') { $result[1]='no'; }
+ return @result;
+}
+
+
+
+
+
sub start_part {
my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
if (!$Apache::lonxml::metamode) {
@@ -1760,9 +1832,10 @@ sub start_part {
'.disableexampointprint'}) eq 'yes') {
$allow_print_points=0;
}
- if (($Apache::lonhomework::type eq 'exam') && ($allow_print_points)) {
- $result .= '\vskip 10mm\fbox{\textit{'.$weight.' pt}}';
- }
+ if (($Apache::lonhomework::type eq 'exam') && ($allow_print_points)) {
+ $result .= '\vskip 10mm\fbox{\textit{'.$weight.' pt}}';
+
+ }
} elsif ($target eq 'web') {
$result.=''
# .&mt('Note: it can take up to 10 minutes for changes to take effect for all users.')
# .&Apache::loncommon::help_open_topic('Caching')
# .'
';
- $result .= '