' + $output .= '
' .&mt('Co-Author [_1]',$uname.':'.$udom) .'
'; } @@ -1796,9 +1827,8 @@ sub handler { $env{'form.filename'}; } ($uname,$udom)= - &Apache::loncacc::constructaccess($env{'form.filename'}, - $r->dir_config('lonDefDomain')); - unless (($uname) && ($udom)) { + &Apache::loncacc::constructaccess($env{'form.filename'}); + unless (($uname ne '') && ($udom ne '')) { $r->log_reason($uname.':'.$udom.' trying to convert testbank file '. $env{'form.filename'}.' - not authorized',$r->filename); return HTTP_NOT_ACCEPTABLE; @@ -1822,14 +1852,19 @@ sub handler { $r->send_http_header; my ($filename,$pathname) = &File::Basename::fileparse($fn); - my $webpath = '/priv/'.$uname.$pathname; - my $urlpath = '/~'.$uname.$pathname; - my $dirpath = '/home/'.$uname.'/public_html'.$pathname; - my ($res,$subdir,$badfile,$textref,$header,$css,$js,%loadentries); + my $webpath = '/priv/'.$udom.'/'.$uname.$pathname; + my $dirpath = $r->dir_config('lonDocRoot').$webpath; + my ($res,$subdir,$badfile,$textref,$header,$css,$js,%loadentries,@pages,%names); if ($env{'form.phase'} eq 'three') { $current_page = &display_control(); - my @pages = ('Welcome','Blocks','Format','Target','Confirmation'); + @pages = ('Welcome','Blocks','Format','Target','Confirmation'); + %names = ( + Welcome => 'Testbank Format', + Blocks => 'Classification', + Format => 'Selection', + Target => 'Result' + ); $page_name = $pages[$current_page]; if ($env{'form.timestamp'} eq '') { $env{'form.timestamp'} = time; @@ -1840,7 +1875,7 @@ sub handler { } } ($res,$badfile,$textref,$header,$css,$js) = - &parse_datafile($r,$uname,$filename,$pathname,$dirpath,$urlpath, + &parse_datafile($r,$uname,$filename,$pathname,$dirpath,$webpath, $page_name,$subdir,$env{'form.timestamp'}); if ($page_name eq 'Welcome') { &jscript_zero($webpath,\$javascript); @@ -1872,19 +1907,37 @@ sub handler { } } - $r->print(&print_header($uname,$udom,$javascript,\%loadentries,$title)); + $r->print(&print_header($uname,$udom,$javascript,\%loadentries,$title, + $current_page,\@pages,\%names)); - if ($env{'form.phase'} eq 'three') { - if ($env{'form.action'} eq 'upload_embedded') { - $r->print(&Apache::lonupload::phasethree($r,$fn,$uname,$udom,'testbank')); + if (($env{'form.phase'} eq 'four') || ($env{'form.phase'} eq 'three')) { + if ($env{'form.phase'} eq 'four') { + $r->print(&Apache::lonupload::phasefour($r,$fn,$uname,$udom,'testbank')); + my $current_page = 0; + my $js; + &jscript_zero($webpath,\$js); + $js = ''; + $r->print($js); + &display_zero($r,$uname,$fn,$current_page,$webpath); + } elsif ($env{'form.phase'} eq 'three') { + if ($env{'form.action'} eq 'upload_embedded') { + my ($result,$flag) = + &Apache::lonupload::phasethree($r,$fn,$uname,$udom,'testbank'); + $r->print($result); + if ($flag eq 'modify_orightml') { + undef($page_name); + $r->print(''); + } + } } if ($badfile) { &file_error($r,$uname,$fn,$current_page,$webpath,$res); - } else { + } else { &display_zero ($r,$uname,$fn,$current_page,$webpath) if $page_name eq 'Welcome'; &display_one ($r,$uname,$fn,$current_page,$textref,$header) if $page_name eq 'Blocks'; &display_two ($r,$uname,$fn,$current_page,$textref,$header,$qcount) if $page_name eq 'Format'; - &display_three ($r,$uname,$fn,$current_page,$textref,$res,$header,$urlpath,$qcount) if $page_name eq 'Target'; + &display_three ($r,$uname,$fn,$current_page,$textref,$res,$header,$webpath,$qcount) if $page_name eq 'Target'; &final_display ($r,$uname,$fn,$current_page,$textref,$res,$header,$css,$js,$webpath,$dirpath,$subdir) if $page_name eq 'Confirmation'; } } elsif ($env{'form.phase'} eq 'two') {