');
}
}
@@ -354,12 +374,10 @@ sub select_files {
# eventually, have to handle removing those not checked, but . . .
my @items=&Apache::loncommon::get_env_multiple('form.checkfile');
if (scalar(@items)){
- &Apache::lonnet::logthis("one of the items is $items[0]");
- &Apache::lonnet::save_selected_files($env{'user.name'}, $env{'form.currentpath'}, @items);
+ &Apache::lonnet::save_selected_files($env{'user.name'}, $env{'form.currentpath'}, @items);
}
} else {
#empty the file for a fresh start
- &Apache::lonnet::logthis("Clearing saved files");
&Apache::lonnet::clear_selected_files($env{'user.name'});
}
my @files = &Apache::lonnet::files_not_in_path($env{'user.name'}, $env{'form.currentpath'});
@@ -389,10 +407,13 @@ ENDSMP
ENDSMP
$r->print($javascript);
$r->print("
Select portfolio files
- Check as many as you wish in response to the essay problem. ");
- $r->print("Files selected from other directories: ");
- foreach (&Apache::lonnet::files_not_in_path($env{'user.name'}, $env{'form.currentpath'})) {
- $r->print($_." ");
+ Check as many as you wish in response to the problem. ");
+ my @otherfiles=&Apache::lonnet::files_not_in_path($env{'user.name'}, $env{'form.currentpath'});
+ if (@otherfiles) {
+ $r->print("Files selected from other directories: ");
+ foreach my $file (@otherfiles) {
+ $r->print($file." ");
+ }
}
}
sub upload {
@@ -420,8 +441,8 @@ sub upload {
}
}
my $current_disk_usage = &Apache::lonnet::diskusage($env{'user.domain'}, $env{'user.name'},$portfolio_root);
- if ((($current_disk_usage/1000) + $filesize) > $disk_quota){
- $r->print('Unable to upload '.$fname.' (size = '.$filesize.' kilobytes. Disk quota will be exceeded.'.
+ if (($current_disk_usage + $filesize) > $disk_quota){
+ $r->print('Unable to upload '.$fname.' (size = '.$filesize.' kilobytes). Disk quota will be exceeded.'.
' Disk quota is '.$disk_quota.' kilobytes. Your current disk usage is '.$current_disk_usage.' kilobytes.');
$r->print(&done('Back'));
}
@@ -451,21 +472,21 @@ sub lock_info {
my ($r) = @_;
my %current_permissions = &Apache::lonnet::dump('file_permissions',$env{'user.domain'},$env{'user.name'});
my $file_name = $env{'form.lockinfo'};
- #my %locked_files = &Apache::lonnet::get_marked_as_readonly_hash ($env{'user.domain'},$env{'user.name'});
- foreach my $key (keys(%current_permissions)) {
+ foreach my $key(keys(%current_permissions)) {
if ($file_name eq $key) {
- $r->print("$key = ");
- foreach my $array_item (@{$current_permissions{$key}}) {
- if (ref($array_item)) {
- $r->print(&Apache::lonnet::gettitle($$array_item[0]).' is the problem ');
- $r->print(&Apache::lonnet::coursedescription($$array_item[1]).' is the course ');
- # $r->print('the third is '.$$array_item[2].' ');
- # $r->print("item is $$array_item[0] and $$array_item[0]");
- }
- }
+ foreach my $array_item (@{$current_permissions{$key}}) {
+ if (ref($array_item)) {
+ $r->print(''.$key.' was submitted in response to problem: '.
+ &Apache::lonnet::gettitle($$array_item[0]).' ');
+ my %course_description = &Apache::lonnet::coursedescription($$array_item[1]);
+ $r->print('In the course: '.$course_description{'description'}.' ');
+ # $r->print('the third is '.$$array_item[2].' ');
+ # $r->print("item is $$array_item[0] and $$array_item[0]");
+ }
+ }
}
}
- #$r->print("lock info here");
+ $r->print(&done('Back'));
return 'ok';
}
sub createdir {
@@ -531,7 +552,7 @@ sub handler {
$r->print(&Apache::loncommon::bodytag('Portfolio Manager'));
}
$r->rflush();
- if (($env{'form.storeupl'} eq 'Upload') & (!$env{'form.uploaddoc.filename'})){
+ if (($env{'form.storeupl'}) & (!$env{'form.uploaddoc.filename'})){
$r->print(' No file was selected to upload.'.
'To upload a file, click Browse...'.
', select a file, then click Upload,');
@@ -597,8 +618,8 @@ sub handler {
&display_common($r,$current_path,$is_empty,\@dir_list);
&display_directory($r,$current_path,$is_empty,\@dir_list);
$r->print("