--- loncom/interface/lonsearchcat.pm 2004/05/07 18:50:14 1.224
+++ loncom/interface/lonsearchcat.pm 2004/05/10 13:06:29 1.226
@@ -1,7 +1,7 @@
# The LearningOnline Network with CAPA
# Search Catalog
#
-# $Id: lonsearchcat.pm,v 1.224 2004/05/07 18:50:14 matthew Exp $
+# $Id: lonsearchcat.pm,v 1.226 2004/05/10 13:06:29 matthew Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -1400,7 +1400,7 @@ sub parse_advanced_search {
$pretty_search_string .= $pretty_domains_string."
\n";
#
if (@queries) {
- $query="SELET * FROM metadata WHERE ".join(" AND ",@queries);
+ $query="SELECT * FROM metadata WHERE ".join(" AND ",@queries);
} elsif ($customquery) {
$query = '';
}
@@ -1490,8 +1490,9 @@ sub parse_basic_search {
('title', 'author', 'subject', 'notes', 'abstract',
'keywords'));
foreach my $search (&process_phrase_input($search_string)){
- $pretty_search_string .= '
'.''.$search.'';
if ($ENV{'form.related'}) {
+ $pretty_search_string .= ' and
' if ($pretty_search_string ne '');
+ $pretty_search_string .= ''.$search.'';
my @New_Words;
($search,@New_Words) = &related_version($search);
next if (! $search);
@@ -1499,6 +1500,9 @@ sub parse_basic_search {
$pretty_search_string .=
" with related words: @New_Words";
}
+ } else {
+ $pretty_search_string .= ' and ' if ($pretty_search_string ne '');
+ $pretty_search_string .= ''.$search.'';
}
#
# Build SQL query string based on form page
@@ -1511,7 +1515,7 @@ sub parse_basic_search {
$pretty_search_string .= ' '.$pretty_domains_string;
}
$pretty_search_string .= "
\n";
- $pretty_search_string =~ s:^
::;
+ $pretty_search_string =~ s:^
and ::;
# &Apache::lonnet::logthis($final_query);
return ($final_query,$pretty_search_string,
$libraries_to_query);
@@ -1596,9 +1600,7 @@ sub build_SQL_query {
-build => 'Text::Query::Build');
$q->prepare($logic_statement);
my $matchexp=${$q}{'matchexp'}; chomp $matchexp;
- &Apache::lonnet::logthis('matchexp = '.$matchexp);
my $sql_query=&recursive_SQL_query_build($field_name,$matchexp);
- &Apache::lonnet::logthis('sql_query = '.$sql_query);
return $sql_query;
}
@@ -2933,41 +2935,73 @@ sub detailed_citation_view {
{ name=>'copyrighttag',
translate => 'Copyright/Distribution: [_1]',},
{ name=>'count',
+ format => "%d",
translate => 'Access Count: [_1]',},
{ name=>'stdno',
+ format => "%d",
translate => 'Number of Students: [_1]',},
{ name=>'avetries',
+ format => "%.2f",
translate => 'Average Tries: [_1]',},
{ name=>'disc',
+ format => "%.2f",
translate => 'Degree of Discrimination: [_1]',},
{ name=>'difficulty',
+ format => "%.2f",
translate => 'Degree of Difficulty: [_1]',},
{ name=>'clear',
+ format => "%.2f",
translate => 'Clear: [_1]',},
{ name=>'depth',
+ format => "%.2f",
translate => 'Depth: [_1]',},
{ name=>'helpful',
+ format => "%.2f",
translate => 'Helpful: [_1]',},
{ name=>'correct',
+ format => "%.2f",
translate => 'Correct: [_1]',},
{ name=>'technical',
+ format => "%.2f",
translate => 'Technical: [_1]',},
+ { name=>'comefrom_list',
+ type => 'list',
+ translate => 'Resources that lead up to this resource in maps',},
+ { name=>'goto_list',
+ type => 'list',
+ translate => 'Resources that follow this resource in maps',},
+ { name=>'sequsage_list',
+ type => 'list',
+ translate => 'Resources using or importing resource',},
) {
- if (exists($values{$field->{'name'}}) &&
- $values{$field->{'name'}} ne '') {
+ next if (! exists($values{$field->{'name'}}) ||
+ $values{$field->{'name'}} eq '');
+ if (exists($field->{'type'}) && $field->{'type'} eq 'list') {
+ $result .= ''.&mt($field->{'translate'}).'