version 1.8, 2010/08/22 21:14:54
|
version 1.10, 2010/12/24 07:58:09
|
Line 61 use LONCAPA qw(:DEFAULT :match);
|
Line 61 use LONCAPA qw(:DEFAULT :match);
|
|
|
exit if ($Apache::lonnet::perlvar{'lonRole'} ne 'library'); |
exit if ($Apache::lonnet::perlvar{'lonRole'} ne 'library'); |
|
|
use vars qw( %checkparms %checkresponsetypes %checkcrstypes %anonsurvey ); |
use vars qw( %checkparms %checkresponsetypes %checkcrstypes %anonsurvey %randomizetry ); |
|
|
# Make sure this process is running from user=www |
# Make sure this process is running from user=www |
my $wwwid=getpwnam('www'); |
my $wwwid=getpwnam('www'); |
Line 80 print $fh "==== refresh_courseids_db.pl
|
Line 80 print $fh "==== refresh_courseids_db.pl
|
my @domains = sort(&Apache::lonnet::current_machine_domains()); |
my @domains = sort(&Apache::lonnet::current_machine_domains()); |
my @ids=&Apache::lonnet::current_machine_ids(); |
my @ids=&Apache::lonnet::current_machine_ids(); |
|
|
&build_release_hashes(); |
&Apache::loncommon::build_release_hashes(\%checkparms,\%checkresponsetypes, |
|
\%checkcrstypes,\%anonsurvey,\%randomizetry); |
$env{'allowed.bre'} = 'F'; |
$env{'allowed.bre'} = 'F'; |
|
|
foreach my $dom (@domains) { |
foreach my $dom (@domains) { |
Line 382 sub coursecontent_constraints {
|
Line 383 sub coursecontent_constraints {
|
if (defined($navmap)) { |
if (defined($navmap)) { |
my %anonsubmissions = &Apache::lonnet::dump('nohist_anonsurveys', |
my %anonsubmissions = &Apache::lonnet::dump('nohist_anonsurveys', |
$cdom,$cnum); |
$cdom,$cnum); |
|
my %randomizetrysubm = &Apache::lonnet::dump('nohist_randomizetry', |
|
$cdom,$cnum); |
my %allresponses; |
my %allresponses; |
my $anonsurv_subm; |
my ($anonsurv_subm,$randbytry_subm); |
foreach my $res ($navmap->retrieveResources(undef,sub { $_[0]->is_problem() },1,0)) { |
foreach my $res ($navmap->retrieveResources(undef,sub { $_[0]->is_problem() },1,0)) { |
my %responses = $res->responseTypes(); |
my %responses = $res->responseTypes(); |
foreach my $key (keys(%responses)) { |
foreach my $key (keys(%responses)) { |
Line 396 sub coursecontent_constraints {
|
Line 399 sub coursecontent_constraints {
|
if (exists($anonsubmissions{$symb."\0".$part})) { |
if (exists($anonsubmissions{$symb."\0".$part})) { |
$anonsurv_subm = 1; |
$anonsurv_subm = 1; |
} |
} |
|
if (exists($randomizetrysubm{$symb."\0".$part})) { |
|
$randbytry_subm = 1; |
|
} |
} |
} |
} |
} |
foreach my $key (keys(%allresponses)) { |
foreach my $key (keys(%allresponses)) { |
Line 406 sub coursecontent_constraints {
|
Line 412 sub coursecontent_constraints {
|
($reqdmajor,$reqdminor) = &update_reqd_loncaparev($anonsurvey{major}, |
($reqdmajor,$reqdminor) = &update_reqd_loncaparev($anonsurvey{major}, |
$anonsurvey{minor},$reqdmajor,$reqdminor); |
$anonsurvey{minor},$reqdmajor,$reqdminor); |
} |
} |
|
if ($randbytry_subm) { |
|
($reqdmajor,$reqdminor) = &update_reqd_loncaparev($randomizetry{major}, |
|
$randomizetry{minor},$reqdmajor,$reqdminor); |
|
} |
} |
} |
return ($reqdmajor,$reqdminor); |
return ($reqdmajor,$reqdminor); |
} |
} |
Line 445 sub read_paramdata {
|
Line 455 sub read_paramdata {
|
return $resourcedata; |
return $resourcedata; |
} |
} |
|
|
sub build_release_hashes { |
|
foreach my $key (keys(%Apache::lonnet::needsrelease)) { |
|
my ($item,$name,$value) = split(/:/,$key); |
|
if ($item eq 'parameter') { |
|
if (ref($checkparms{$name}) eq 'ARRAY') { |
|
unless(grep(/^\Q$name\E$/,@{$checkparms{$name}})) { |
|
push(@{$checkparms{$name}},$value); |
|
} |
|
} else { |
|
push(@{$checkparms{$name}},$value); |
|
} |
|
} elsif ($item eq 'resourcetag') { |
|
if ($name eq 'responsetype') { |
|
$checkresponsetypes{$value} = $Apache::lonnet::needsrelease{$key} |
|
} |
|
} elsif ($item eq 'course') { |
|
if ($name eq 'crstype') { |
|
$checkcrstypes{$value} = $Apache::lonnet::needsrelease{$key}; |
|
} |
|
} |
|
} |
|
($anonsurvey{major},$anonsurvey{minor}) = split(/\./,$Apache::lonnet::needsrelease{'parameter:type:anonsurvey'}); |
|
return; |
|
} |
|
|
|