--- loncom/interface/loncoursedata.pm 2003/10/03 15:33:25 1.81.2.2 +++ loncom/interface/loncoursedata.pm 2003/08/27 21:34:24 1.85 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: loncoursedata.pm,v 1.81.2.2 2003/10/03 15:33:25 albertel Exp $ +# $Id: loncoursedata.pm,v 1.85 2003/08/27 21:34:24 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -104,8 +104,7 @@ sub get_sequence_assessment_data { my $fn=$ENV{'request.course.fn'}; ## ## use navmaps - my $navmap = Apache::lonnavmaps::navmap->new($fn.".db", - $fn."_parms.db",1,0); + my $navmap = Apache::lonnavmaps::navmap->new(); if (!defined($navmap)) { return 'Can not open Coursemap'; } @@ -159,6 +158,7 @@ sub get_sequence_assessment_data { } # get the map itself, instead of BEGIN_MAP $title = $previous->title(); + $title =~ s/\:/\&\#058;/g; $symb = $previous->symb(); $src = $previous->src(); # pick up the filename if there is no title available @@ -187,6 +187,7 @@ sub get_sequence_assessment_data { next if (! $curRes->is_problem());# && !$curRes->randomout); # Okay, from here on out we only deal with assessments $title = $curRes->title(); + $title =~ s/\:/\&\#058;/g; $symb = $curRes->symb(); $src = $curRes->src(); my $parts = $curRes->parts(); @@ -525,6 +526,8 @@ sub init_dbs { { name => 'student', type => 'VARCHAR(100)', restrictions => 'NOT NULL'}, + { name => 'classification', + type => 'varchar(100)', }, ], 'PRIMARY KEY' => ['student (100)'], 'KEY' => [{ columns => ['student_id']},], @@ -842,7 +845,7 @@ sub get_student_id { $have_read_student_table = 1; } if (! exists($ids_by_student{$student})) { - &Apache::lonmysql::store_row($student_table,[undef,$student]); + &Apache::lonmysql::store_row($student_table,[undef,$student,undef]); undef(%ids_by_student); my @Result = &Apache::lonmysql::get_rows($student_table); foreach (@Result) { @@ -872,36 +875,6 @@ sub get_student { =pod -=item &clear_internal_caches() - -Causes the internal caches used in get_student_id, get_student, -get_symb_id, get_symb, get_part_id, and get_part to be undef'd. - -Needs to be called before the first operation with the MySQL database -for a given Apache request. - -=cut - -################################################ -################################################ -sub clear_internal_caches { - $have_read_part_table = 0; - undef(%ids_by_part); - undef(%parts_by_id); - $have_read_symb_table = 0; - undef(%ids_by_symb); - undef(%symbs_by_id); - $have_read_student_table = 0; - undef(%ids_by_student); - undef(%students_by_id); -} - - -################################################ -################################################ - -=pod - =item &update_student_data() Input: $sname, $sdom, $courseid @@ -1195,33 +1168,6 @@ sub get_student_data_from_performance_ca $studentdata->{$symb}->{$base.'.awarddetail'} = $awarddetail; $studentdata->{$symb}->{'timestamp'} = $time if (defined($time) && $time ne ''); } - ## Get misc parameters - $request = 'SELECT c.symb,a.parameter,a.value '. - "FROM $student_table AS b ". - "LEFT JOIN $parameters_table AS a ON b.student_id=a.student_id ". - "LEFT JOIN $symb_table AS c ON c.symb_id = a.symb_id ". - "WHERE student='$student'"; - if (defined($symb) && $symb ne '') { - $request .= " AND c.symb=".$dbh->quote($symb); - } - $sth = $dbh->prepare($request); - $sth->execute(); - if ($sth->err()) { - &Apache::lonnet::logthis("Unable to execute MySQL request:"); - &Apache::lonnet::logthis("\n".$request."\n"); - &Apache::lonnet::logthis("error is:".$sth->errstr()); - if (defined($symb) && $symb ne '') { - $studentdata = $studentdata->{$symb}; - } - return $studentdata; - } - # - foreach my $row (@{$sth->fetchall_arrayref}) { - $rows_retrieved++; - my ($symb,$parameter,$value) = (@$row); - $studentdata->{$symb}->{$parameter} = $value; - } - # if (defined($symb) && $symb ne '') { $studentdata = $studentdata->{$symb}; }