--- loncom/interface/slotrequest.pm 2016/10/27 21:02:02 1.134 +++ loncom/interface/slotrequest.pm 2017/12/22 02:00:46 1.136 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler for requesting to have slots added to a students record # -# $Id: slotrequest.pm,v 1.134 2016/10/27 21:02:02 raeburn Exp $ +# $Id: slotrequest.pm,v 1.136 2017/12/22 02:00:46 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -465,7 +465,7 @@ sub get_consumed_uniqueperiods { return 'error: Unable to determine current status'; } my @problems = $navmap->retrieveResources(undef, - sub { $_[0]->is_problem() },1,0); + sub { $_[0]->is_gradable() },1,0); my %used_slots; foreach my $problem (@problems) { my $symb = $problem->symb(); @@ -805,7 +805,7 @@ sub release_reservation { if ($passed_resource->is_map()) { my ($a_resource) = $navmap->retrieveResources($passed_resource, - sub {$_[0]->is_problem()},0,1); + sub {$_[0]->is_gradable()},0,1); $symb = $a_resource->symb(); } } else { @@ -2028,7 +2028,7 @@ sub manage_reservations { if (ref($resource)) { my $symb = $resource->symb(); $contents{$lastcontainer} ++; - next if (!$resource->is_problem() && !$resource->is_sequence() && + next if (!$resource->is_gradable() && !$resource->is_sequence() && !$resource->is_page()); $count ++; if (($resource->is_sequence()) || ($resource->is_page())) { @@ -2036,7 +2036,7 @@ sub manage_reservations { $container{$lastcontainer} = $resource; $container_title{$lastcontainer} = $resource->compTitle(); } - if ($resource->is_problem()) { + if ($resource->is_gradable()) { my ($useslots) = $resource->slot_control(); next if (($useslots eq '') || ($useslots =~ /^\s*no\s*$/i)); push(@ordered,$symb); @@ -2945,8 +2945,10 @@ sub csv_upload_map { if (!$env{'form.datatoken'}) { $datatoken=&Apache::loncommon::upfile_store($r); } else { - $datatoken=$env{'form.datatoken'}; - &Apache::loncommon::load_tmp_file($r); + $datatoken=&Apache::loncommon::valid_datatoken($env{'form.datatoken'}); + if ($datatoken ne '') { + &Apache::loncommon::load_tmp_file($r,$datatoken); + } } my @records=&Apache::loncommon::upfile_record_sep(); if ($env{'form.noFirstLine'}) { shift(@records); } @@ -2997,7 +2999,10 @@ sub csvupload_fields { sub csv_upload_assign { my ($r,$mgr)= @_; - &Apache::loncommon::load_tmp_file($r); + my $datatoken = &Apache::loncommon::valid_datatoken($env{'form.datatoken'}); + if ($datatoken ne '') { + &Apache::loncommon::load_tmp_file($r,$datatoken); + } my @slotdata = &Apache::loncommon::upfile_record_sep(); if ($env{'form.noFirstLine'}) { shift(@slotdata); } my %fields=&Apache::grades::get_fields();