--- loncom/interface/lonspeller.pm 2006/03/23 23:43:13 1.15
+++ loncom/interface/lonspeller.pm 2006/03/24 21:40:11 1.16
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Interface routines for Aspell
#
-# $Id: lonspeller.pm,v 1.15 2006/03/23 23:43:13 albertel Exp $
+# $Id: lonspeller.pm,v 1.16 2006/03/24 21:40:11 albertel Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -54,6 +54,13 @@ sub set_language {
$speller->set_option('lang',$lang);
}
+{
+ my $uniq;
+ sub get_uniq {
+ return ++$uniq;
+ }
+}
+
sub textsection {
my $input=shift;
my $output='';
@@ -64,22 +71,29 @@ sub textsection {
$output.=$word;
} else {
my $suggestions=join(' ',$speller->suggest($word));
- $suggestions=~s/\'/\\\'/gs;
+ $suggestions = "".$suggestions;
+ $suggestions = &Apache::loncommon::js_ready($suggestions);
if (($suggestions) && (!$insidelink)) {
my $start_page=
&Apache::loncommon::start_page('Speller Suggestions',undef,
{'only_body' => 1,
'js_ready' => 1,
- 'html_encode' => 1,
'bgcolor' => '#FFFFFF'});
my $end_page=
- &Apache::loncommon::end_page({'js_ready' => 1,
- 'html_encode' => 1,});
- $output.='';
+ &Apache::loncommon::end_page({'js_ready' => 1,});
+ my $num = &get_uniq();
+ my $info =''.$word.'
'.$suggestions;
+ $output .= "";
}
$output.=''.$word.'';
if (($suggestions) && (!$insidelink)) { $output.=''; }