[LON-CAPA-cvs] cvs: loncom(bz2851) /interface lonprintout.pm
foxr
foxr@source.lon-capa.org
Mon, 12 Oct 2009 10:59:48 -0000
foxr Mon Oct 12 10:59:48 2009 EDT
Modified files: (Branch: bz2851)
/loncom/interface lonprintout.pm
Log:
BZ 2851 - Got problems from page for selected students to work. Now
on to testing other print selectors.
Index: loncom/interface/lonprintout.pm
diff -u loncom/interface/lonprintout.pm:1.560.2.4 loncom/interface/lonprintout.pm:1.560.2.5
--- loncom/interface/lonprintout.pm:1.560.2.4 Tue Oct 6 11:02:12 2009
+++ loncom/interface/lonprintout.pm Mon Oct 12 10:59:48 2009
@@ -1,17 +1,10 @@
#
-# Issues:
-# - Need to get the state flow for selected problems/resources for students
-# correct
-# - Need to do the CODEd stuff.
-# - Need to regularize and figure out for each case who puts on the latex
-# front matter and make sure it gets done.
-#
-#
+
# The LearningOnline Network
# Printout
#
-# $Id: lonprintout.pm,v 1.560.2.4 2009/10/06 11:02:12 foxr Exp $
+# $Id: lonprintout.pm,v 1.560.2.5 2009/10/12 10:59:48 foxr Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -99,7 +92,7 @@
$sort_choice,
$variable,
$next_state) = @_;
-
+ &Apache::lonnet::logthis("Student chooser next state: $next_state, this state: $this_state");
my $result = <<CHOOSE_STUDENTS;
<state name="$this_state" title="Select Students and Resources">
<message><b>Select sorting order of printout</b> </message>
@@ -155,7 +148,7 @@
$value_func,
$start_new_option) = @_;
-
+ &Apache::lonnet::logthis("Top URL = $top_url");
my $result = <<CHOOSE_RESOURCES;
<state name="$this_state" title="$prompt_text">
<resource variable="$variable" $resource_options
@@ -2282,6 +2275,7 @@
}
$result .= '\end{document}';
} elsif (($helper->{'VARS'}->{'PRINT_TYPE'} eq 'problems_for_students') ||
+ ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'problems_for_students_from_page') ||
($helper->{'VARS'}->{'PRINT_TYPE'} eq 'all_problems_students') ||
($helper->{'VARS'}->{'PRINT_TYPE'} eq 'resources_for_students')){
@@ -2289,6 +2283,7 @@
#-- prints assignments for whole class or for selected students
my $type;
if (($helper->{'VARS'}->{'PRINT_TYPE'} eq 'problems_for_students') ||
+ ($helper->{'VARS'}->{'PRINT_TYPE'} eq 'problems_for_students_from_page') ||
($helper->{'VARS'}->{'PRINT_TYPE'} eq 'all_problems_students') ) {
$selectionmade=5;
$type='problems';
@@ -3281,10 +3276,10 @@
if ($page_ispage) {
push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from page [_3] for [_4]selected people[_5]',
'<b>', '</b>', '<b><i>'.$page_title.'</i></b>', '<b>', '</b>'),
- 'problems_for_students', 'CHOOSE_STUDENTS'];
+ 'problems_for_students_from_page', 'CHOOSE_TGT_STUDENTS_PAGE'];
push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from page [_3] for [_4]CODEd assignments[_5]',
'<b>', '</b>', '<b><i>'.$page_title.'</i></b>', '<b>', '</b>'),
- 'problems_for_anon', 'CHOOSE_ANON1'];
+ 'problems_for_anon', 'CHOOSE_ANON1_PAGE'];
}
push @{$printChoices}, [&mt('Selected [_1]Problems[_2] from folder [_3] for [_4]selected people[_5]',
'<b>','</b>','<b><i>'.$sequenceTitle.'</i></b>','<b>','</b>'),
@@ -3334,12 +3329,25 @@
</choices>
</state>
RESOURCE_SELECTOR
+ $resource_selector .= &generate_resource_chooser('CHOOSE_STUDENTS_PAGE',
+ 'Select Problem(s) to print',
+ "multichoice='1' addstatus='1' closeallpages ='1'",
+ 'RESOURCES',
+ 'PRINT_FORMATTING',
+ $url,
+ $isProblem, '', $symbFilter,
+ $start_new_option);
-# Generate student choosers.
+# Generate student choosers.
+ &Apache::lonxml::xmlparse($r, 'helper',
+ &generate_student_chooser('CHOOSE_TGT_STUDENTS_PAGE',
+ 'student_sort',
+ 'STUDENTS',
+ 'CHOOSE_STUDENTS_PAGE'));
&Apache::lonxml::xmlparse($r, 'helper',
&generate_student_chooser('CHOOSE_STUDENTS',
'student_sort',