--- loncom/publisher/testbankimport.pm 2013/07/15 14:32:59 1.42 +++ loncom/publisher/testbankimport.pm 2023/07/23 01:09:04 1.46 @@ -1,5 +1,5 @@ # Handler for parsing text upload problem descriptions into .problems -# $Id: testbankimport.pm,v 1.42 2013/07/15 14:32:59 bisitz Exp $ +# $Id: testbankimport.pm,v 1.46 2023/07/23 01:09:04 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -289,18 +289,20 @@ function colSet(caller) { else { if ((poolForm.elements[caller*5+3].options[poolForm.elements[caller*5+3].selectedIndex].value == "MC") || (poolForm.elements[caller*5+3].options[poolForm.elements[caller*5+3].selectedIndex].value == "MA") || (poolForm.elements[caller*5+3].options[poolForm.elements[caller*5+3].selectedIndex].value == "Ord")) { poolForm.elements[caller*5+4].options[0] = new Option("Select","-1",true,true) - poolForm.elements[caller*5+4].options[1] = new Option("a.","lcperiod",false,false) - poolForm.elements[caller*5+4].options[2] = new Option("A.","ucperiod",false,false) - poolForm.elements[caller*5+4].options[3] = new Option("(a)","lcparen",false,false) - poolForm.elements[caller*5+4].options[4] = new Option("(A)","ucparen",false,false) - poolForm.elements[caller*5+4].options[5] = new Option("a)","lconeparen",false,false) - poolForm.elements[caller*5+4].options[6] = new Option("A)","uconeparen",false,false) - poolForm.elements[caller*5+4].options[7] = new Option("a.)","lcdotparen",false,false) - poolForm.elements[caller*5+4].options[8] = new Option("A.)","ucdotparen",false,false) - poolForm.elements[caller*5+4].options[9] = new Option("(i)","romparen",false,false) - poolForm.elements[caller*5+4].options[10] = new Option("i)","romoneparen",false,false) - poolForm.elements[caller*5+4].options[11] = new Option("i.)","romdotparen",false,false) - poolForm.elements[caller*5+4].options[12] = new Option("i.","romperiod",false,false) + poolForm.elements[caller*5+4].options[1] = new Option("a ","lcspace",false,false) + poolForm.elements[caller*5+4].options[2] = new Option("A ","ucspace",false,false) + poolForm.elements[caller*5+4].options[3] = new Option("a.","lcperiod",false,false) + poolForm.elements[caller*5+4].options[4] = new Option("A.","ucperiod",false,false) + poolForm.elements[caller*5+4].options[5] = new Option("(a)","lcparen",false,false) + poolForm.elements[caller*5+4].options[6] = new Option("(A)","ucparen",false,false) + poolForm.elements[caller*5+4].options[7] = new Option("a)","lconeparen",false,false) + poolForm.elements[caller*5+4].options[8] = new Option("A)","uconeparen",false,false) + poolForm.elements[caller*5+4].options[9] = new Option("a.)","lcdotparen",false,false) + poolForm.elements[caller*5+4].options[10] = new Option("A.)","ucdotparen",false,false) + poolForm.elements[caller*5+4].options[11] = new Option("(i)","romparen",false,false) + poolForm.elements[caller*5+4].options[12] = new Option("i)","romoneparen",false,false) + poolForm.elements[caller*5+4].options[13] = new Option("i.)","romdotparen",false,false) + poolForm.elements[caller*5+4].options[14] = new Option("i.","romperiod",false,false) poolForm.elements[caller*5+4].selectedIndex = 0 } else { @@ -577,7 +579,7 @@ sub display_two { my $blocks = $env{'form.blocks'}; my $qnumformat = $env{'form.qnumformat'}; my @types = ("MC","MA","TF","Ess","FIB","Ord"); - my %typenames = ( + my %typenames = &Apache::lonlocal::texthash( MC => "Multiple Choice", TF => "True/False", MA => "Multiple Answer", @@ -774,7 +776,12 @@ sub display_three { '
' - .&mt('Co-Author [_1]',$uname.':'.$udom) - .'
'; + unless ($crsauthor) { + if (($uname ne $env{'user.name'}) || ($udom ne $env{'user.domain'})) { + $output .= '' + .&mt('Co-Author [_1]',$uname.':'.$udom) + .'
'; + } } return $output; } @@ -1838,7 +1854,19 @@ sub handler { my $page_name = ''; my $current_page = ''; my $qcount = ''; + my $crsauthor; my $title = 'Upload testbank questions to Authoring Space'; + my $crumbtext = 'Authoring Space'; + my $crumbhref = &Apache::loncommon::authorspace($fn); + if ($env{'request.course.id'}) { + my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; + my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; + if ($crumbhref eq "/priv/$cdom/$cnum/") { + $title = 'Upload testbank questions to Course Authoring Space'; + $crumbtext = 'Course Authoring Space'; + $crsauthor = 1; + } + } # ----------------------------------------------------------- Start page output &Apache::loncommon::content_type($r,'text/html'); @@ -1851,7 +1879,7 @@ sub handler { if ($env{'form.phase'} eq 'three') { $current_page = &display_control(); @pages = ('Welcome','Blocks','Format','Target','Confirmation'); - %names = ( + %names = &Apache::lonlocal::texthash( Welcome => 'Testbank Format', Blocks => 'Classification', Format => 'Selection', @@ -1900,7 +1928,8 @@ sub handler { } $r->print(&print_header($uname,$udom,$javascript,\%loadentries,$title, - $current_page,\@pages,\%names)); + $crumbtext,$crumbhref,$crsauthor,$current_page, + \@pages,\%names)); if (($env{'form.phase'} eq 'four') || ($env{'form.phase'} eq 'three')) { if ($env{'form.phase'} eq 'four') {