--- loncom/interface/loncommon.pm 2013/12/30 01:56:41 1.1169 +++ loncom/interface/loncommon.pm 2014/01/27 02:21:30 1.1172 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.1169 2013/12/30 01:56:41 raeburn Exp $ +# $Id: loncommon.pm,v 1.1172 2014/01/27 02:21:30 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3846,7 +3846,7 @@ sub get_previous_attempt { if (($data eq 'award') || ($data eq 'awarddetail')) { my $value = &format_previous_attempt_value($key, $returnhash{$version.':'.$key}); - $prevattempts.=''.$value.' '; + $prevattempts.=''.&HTML::Entities::encode($value, '"<>&').' '; } else { $prevattempts.=' '; } @@ -3854,7 +3854,7 @@ sub get_previous_attempt { if ($key =~ /\./) { my $value = &format_previous_attempt_value($key, $returnhash{$version.':'.$key}); - $prevattempts.=''.$value.' '; + $prevattempts.=''.&HTML::Entities::encode($value, '"<>&').' '; } else { $prevattempts.=' '; } @@ -3865,7 +3865,7 @@ sub get_previous_attempt { next if ($key =~ /\.foilorder$/); my $value = &format_previous_attempt_value($key, $returnhash{$version.':'.$key}); - $prevattempts.=''.$value.' '; + $prevattempts.=''.&HTML::Entities::encode($value, '"<>&').' '; } } $prevattempts.=&end_data_table_row(); @@ -3890,7 +3890,7 @@ sub get_previous_attempt { if ($key =~/$regexp$/ && (defined &$gradesub)) { $value = &$gradesub($value); } - $prevattempts.=''.$value.' '; + $prevattempts.=''. &HTML::Entities::encode($value, '"<>&').' '; } else { $prevattempts.=' '; } @@ -3899,14 +3899,14 @@ sub get_previous_attempt { if ($key =~/$regexp$/ && (defined &$gradesub)) { $value = &$gradesub($value); } - $prevattempts.=''.$value.' '; + $prevattempts.=''.&HTML::Entities::encode($value, '"<>&').' '; } } else { my $value = &format_previous_attempt_value($key,$lasthash{$key}); if ($key =~/$regexp$/ && (defined &$gradesub)) { $value = &$gradesub($value); } - $prevattempts.=''.$value.' '; + $prevattempts.=''.&HTML::Entities::encode($value, '"<>&').' '; } } $prevattempts.= &end_data_table_row().&end_data_table(); @@ -14006,6 +14006,9 @@ sub construct_course { 'categories', 'internal.uniquecode'], $$crsudom,$$crsunum); + if ($args->{'textbook'}) { + $cenv{'internal.textbook'} = $args->{'textbook'}; + } } # @@ -14885,12 +14888,12 @@ sub captcha_display { if ($captcha eq 'original') { $output = &create_captcha(); unless ($output) { - $error = 'captcha'; + $error = 'captcha'; } } elsif ($captcha eq 'recaptcha') { $output = &create_recaptcha($pubkey); unless ($output) { - $error = 'recaptcha'; + $error = 'recaptcha'; } } return ($output,$error); @@ -14970,7 +14973,7 @@ sub create_captcha { $output = ''."\n". &mt('Type in the letters/numbers shown below').' '. '
'. - ''; + 'captcha'; last; } }