version 1.291, 2004/04/19 15:39:35
|
version 1.292, 2004/04/20 06:11:49
|
Line 1002 ENDPART
|
Line 1002 ENDPART
|
$result .= $print_array[0].' \end{document}'; |
$result .= $print_array[0].' \end{document}'; |
} elsif (($helper->{'VARS'}->{'PRINT_TYPE'} eq 'problems_for_anon') || |
} elsif (($helper->{'VARS'}->{'PRINT_TYPE'} eq 'problems_for_anon') || |
($helper->{'VARS'}->{'PRINT_TYPE'} eq 'resources_for_anon') ) { |
($helper->{'VARS'}->{'PRINT_TYPE'} eq 'resources_for_anon') ) { |
|
my $cdom =$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}; |
|
my $cnum =$ENV{'course.'.$ENV{'request.course.id'}.'.num'}; |
my $num_todo=$helper->{'VARS'}->{'NUMBER_TO_PRINT_TOTAL'}; |
my $num_todo=$helper->{'VARS'}->{'NUMBER_TO_PRINT_TOTAL'}; |
my $code_name=$helper->{'VARS'}->{'ANON_CODE_STORAGE_NAME'}; |
my $code_name=$helper->{'VARS'}->{'ANON_CODE_STORAGE_NAME'}; |
if ($helper->{'VARS'}->{'REMEBER_ANON_CODES'} != 1) { |
my $old_name=$helper->{'VARS'}->{'REUSE_OLD_CODES'}; |
$code_name=undef; |
|
} |
|
my @master_seq=split /\|\|\|/, $helper->{'VARS'}->{'RESOURCES'}; |
my @master_seq=split /\|\|\|/, $helper->{'VARS'}->{'RESOURCES'}; |
my ($type) = split(/_/,$helper->{'VARS'}->{'PRINT_TYPE'}); |
my ($type) = split(/_/,$helper->{'VARS'}->{'PRINT_TYPE'}); |
my $flag_latex_header_remove = 'NO'; |
my $flag_latex_header_remove = 'NO'; |
my %moreenv = ('textwidth' => &get_textwidth($helper,$LaTeXwidth)); |
my %moreenv = ('textwidth' => &get_textwidth($helper,$LaTeXwidth)); |
my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,'Print Status','Class Print Status',$num_todo,'inline'); |
my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r,'Print Status','Class Print Status',$num_todo,'inline'); |
my $seed=time+($$<<16)+($$); |
my $seed=time+($$<<16)+($$); |
my %allcodes; |
my @allcodes; |
for (my $i=0;$i<$num_todo;$i++) { |
if ($old_name) { |
$moreenv{'CODE'}=&get_CODE(\%allcodes,$i,$seed,'6'); |
my %result=&Apache::lonnet::get('CODEs',[$old_name],$cdom,$cnum); |
|
@allcodes=split(',',$result{$old_name}); |
|
} else { |
|
my %allcodes; |
|
for (my $i=0;$i<$num_todo;$i++) { |
|
$moreenv{'CODE'}=&get_CODE(\%allcodes,$i,$seed,'6'); |
|
} |
|
if ($code_name) { |
|
&Apache::lonnet::put('CODEs', |
|
{$code_name =>join(',',keys(%allcodes))}, |
|
$cdom,$cnum); |
|
} |
|
@allcodes=keys(%allcodes); |
|
} |
|
my $i=0; |
|
foreach my $code (sort(@allcodes)) { |
|
$moreenv{'CODE'}=&num_to_letters($code); |
my ($output,$fullname)= |
my ($output,$fullname)= |
&print_resources($r,$helper,'anonymous',$type,\%moreenv, |
&print_resources($r,$helper,'anonymous',$type,\%moreenv, |
\@master_seq,$flag_latex_header_remove); |
\@master_seq,$flag_latex_header_remove); |
Line 1023 ENDPART
|
Line 1039 ENDPART
|
&Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state, |
&Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state, |
&mt('last assignment').' '.$fullname); |
&mt('last assignment').' '.$fullname); |
$flag_latex_header_remove = 'YES'; |
$flag_latex_header_remove = 'YES'; |
} |
$i++; |
if ($code_name) { |
|
my $cdom = $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}; |
|
my $cnum = $ENV{'course.'.$ENV{'request.course.id'}.'.num'}; |
|
&Apache::lonnet::put('CODEs', |
|
{ $code_name => join(',',keys(%allcodes)) }, |
|
$cdom,$cnum); |
|
} |
} |
&Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); |
&Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); |
$result .= $print_array[0].' \end{document}'; |
$result .= $print_array[0].' \end{document}'; |
Line 1567 RESOURCE_SELECTOR
|
Line 1577 RESOURCE_SELECTOR
|
$resource_selector |
$resource_selector |
</state> |
</state> |
CHOOSE_STUDENTS |
CHOOSE_STUDENTS |
|
|
|
my $cdom = $ENV{'course.'.$ENV{'request.course.id'}.'.domain'}; |
|
my $cnum = $ENV{'course.'.$ENV{'request.course.id'}.'.num'}; |
|
my @names=&Apache::lonnet::getkeys('CODEs',$cdom,$cnum); |
|
my $namechoice='<choice></choice>'; |
|
foreach my $name (@names) { |
|
$namechoice.='<choice computer="'.$name.'">'.$name.'</choice>'; |
|
} |
&Apache::lonxml::xmlparse($r, 'helper', <<CHOOSE_ANON1); |
&Apache::lonxml::xmlparse($r, 'helper', <<CHOOSE_ANON1); |
<state name="CHOOSE_ANON1" title="Select Students and Resources"> |
<state name="CHOOSE_ANON1" title="Select Students and Resources"> |
<nextstate>PAGESIZE</nextstate> |
<nextstate>PAGESIZE</nextstate> |
<message><hr width='33%' /><b>Number of anonymous assignments to print?</b></message> |
<message><hr width='33%' /><b>Number of anonymous assignments to print?</b></message> |
<string variable="NUMBER_TO_PRINT_TOTAL" maxlength="5" size="5"></string> |
<string variable="NUMBER_TO_PRINT_TOTAL" maxlength="5" size="5"></string> |
<choices variable="REMEBER_ANON_CODES" allowempty="1" multichoice="1"> |
<message><br /><b>Names to store the CODEs under for later:</b></message> |
<choice computer="1"> |
|
Should the CODEs used on this printing be remebered for later? |
|
</choice> |
|
</choices> |
|
<message><b>Names to store the CODEs under for later:</b></message> |
|
<string variable="ANON_CODE_STORAGE_NAME" maxlength="50" size="20" /> |
<string variable="ANON_CODE_STORAGE_NAME" maxlength="50" size="20" /> |
<message><hr width='33%' /></message> |
<message><hr width='33%' /></message> |
|
<message><b>Reprint a set of saved CODEs:</b></message> |
|
<dropdown variable="REUSE_OLD_CODES"> |
|
$namechoice |
|
</dropdown> |
|
<message><hr width='33%' /></message> |
$resource_selector |
$resource_selector |
</state> |
</state> |
CHOOSE_ANON1 |
CHOOSE_ANON1 |