version 1.266, 2016/05/30 02:45:32
|
version 1.269, 2018/01/18 05:09:28
|
Line 97 sub proctor_check_auth {
|
Line 97 sub proctor_check_auth {
|
sub check_in { |
sub check_in { |
my ($type,$user,$domain,$slot_name,$needsiptied) = @_; |
my ($type,$user,$domain,$slot_name,$needsiptied) = @_; |
my $useslots = &Apache::lonnet::EXT("resource.0.useslots"); |
my $useslots = &Apache::lonnet::EXT("resource.0.useslots"); |
my $ip=$env{'request.host'} || $ENV{'REMOTE_ADDR'}; |
my $ip=$ENV{'REMOTE_ADDR'} || $env{'request.host'}; |
if ( $useslots eq 'map_map') { |
if ( $useslots eq 'map_map') { |
my $result = &check_in_sequence($user,$domain,$slot_name,$ip,$needsiptied); |
my $result = &check_in_sequence($user,$domain,$slot_name,$ip,$needsiptied); |
if ($result =~ /^error: /) { |
if ($result =~ /^error: /) { |
Line 123 sub check_in_sequence {
|
Line 123 sub check_in_sequence {
|
my ($symb) = &Apache::lonnet::whichuser(); |
my ($symb) = &Apache::lonnet::whichuser(); |
my ($map) = &Apache::lonnet::decode_symb($symb); |
my ($map) = &Apache::lonnet::decode_symb($symb); |
my @resources = |
my @resources = |
$navmap->retrieveResources($map, sub { $_[0]->is_problem() },0,0); |
$navmap->retrieveResources($map, sub { $_[0]->is_problem() || $_[0]->is_gradable() },0,0); |
my %old_history = %Apache::lonhomework::history; |
my %old_history = %Apache::lonhomework::history; |
my %old_results = %Apache::lonhomework::results; |
my %old_results = %Apache::lonhomework::results; |
|
|
Line 131 sub check_in_sequence {
|
Line 131 sub check_in_sequence {
|
foreach my $res (@resources) { |
foreach my $res (@resources) { |
&Apache::lonxml::debug("doing ".$res->src); |
&Apache::lonxml::debug("doing ".$res->src); |
&Apache::structuretags::initialize_storage($res->symb); |
&Apache::structuretags::initialize_storage($res->symb); |
my $type = ($res->is_task()) ? 'Task' : 'problem'; |
my $type; |
|
if ($res->is_task()) { |
|
$type = 'Task'; |
|
} elsif ($res->is_tool) { |
|
$type = 'tool'; |
|
} else { |
|
$type = 'problem'; |
|
} |
my $result = &create_new_version($type,$user,$domain,$slot_name,$res->symb,$ip,$needsiptied); |
my $result = &create_new_version($type,$user,$domain,$slot_name,$res->symb,$ip,$needsiptied); |
if ($result eq 'ok') { |
if ($result eq 'ok') { |
&Apache::structuretags::finalize_storage($res->symb); |
&Apache::structuretags::finalize_storage($res->symb); |
Line 187 sub create_new_version {
|
Line 194 sub create_new_version {
|
$domain = $env{'user.domain'}; |
$domain = $env{'user.domain'}; |
} |
} |
|
|
} elsif ($type eq 'problem') { |
} elsif (($type eq 'problem') || ($type eq 'tool')) { |
&Apache::lonxml::debug("authed $slot_name"); |
&Apache::lonxml::debug("authed $slot_name"); |
} |
} |
if (!defined($user) || !defined($domain)) { |
if (!defined($user) || !defined($domain)) { |