From lon-capa-cvs@mail.lon-capa.org Mon Aug 5 03:09:05 2002 From: lon-capa-cvs@mail.lon-capa.org (foxr) Date: Mon, 05 Aug 2002 02:09:05 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /publisher loncfile.pm Message-ID: foxr Sun Aug 4 22:09:05 2002 EDT Modified files: /loncom/publisher loncfile.pm Log: Ensure that files manipulated in construction space will have permissions: rw-rw--- and directories: rwxrwxs--- This fix is inspired by, but not actually all of bug 59... Also need to catch this for uploads. Index: loncom/publisher/loncfile.pm diff -u loncom/publisher/loncfile.pm:1.13 loncom/publisher/loncfile.pm:1.14 --- loncom/publisher/loncfile.pm:1.13 Sun Jul 28 21:55:51 2002 +++ loncom/publisher/loncfile.pm Sun Aug 4 22:09:05 2002 @@ -10,7 +10,7 @@ # # -# $Id: loncfile.pm,v 1.13 2002/07/29 01:55:51 foxr Exp $ +# $Id: loncfile.pm,v 1.14 2002/08/05 02:09:05 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -856,9 +856,13 @@ &Debug($request ,"Will try to copy $oldfile to $newfile"); if(-e $oldfile) { unless (copy($oldfile, $newfile)) { - $request->print(' Error: '.$!.''); + $request->print(' copy Error: '.$!.''); return 0; } else { + unless (chmod(0660, $newfile)) { + $request->print(' chmod error: '.$!.''); + return 0; + } return 1; } } else { From lon-capa-cvs@mail.lon-capa.org Mon Aug 5 03:22:56 2002 From: lon-capa-cvs@mail.lon-capa.org (foxr) Date: Mon, 05 Aug 2002 02:22:56 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /publisher lonupload.pm Message-ID: foxr Sun Aug 4 22:22:56 2002 EDT Modified files: /loncom/publisher lonupload.pm Log: Fix bug 59: Uploaded file permissions not correct. Index: loncom/publisher/lonupload.pm diff -u loncom/publisher/lonupload.pm:1.10 loncom/publisher/lonupload.pm:1.11 --- loncom/publisher/lonupload.pm:1.10 Sun Dec 16 19:57:59 2001 +++ loncom/publisher/lonupload.pm Sun Aug 4 22:22:56 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to upload files into construction space # -# $Id: lonupload.pm,v 1.10 2001/12/17 00:57:59 harris41 Exp $ +# $Id: lonupload.pm,v 1.11 2002/08/05 02:22:56 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -156,6 +156,7 @@ 'The extension on this file is not recognized by LON-CAPA.'. ''); } elsif (copy($source,$target)) { + chmod(0660, $target); # Set permissions to rw-rw---. $r->print('File copied.'); $r->print('

View file'); From lon-capa-cvs@mail.lon-capa.org Mon Aug 5 08:56:00 2002 From: lon-capa-cvs@mail.lon-capa.org (harris41) Date: Mon, 05 Aug 2002 07:56:00 -0000 Subject: [LON-CAPA-cvs] cvs: doc /build installindex.html Message-ID: harris41 Mon Aug 5 03:56:00 2002 EDT Modified files: /doc/build installindex.html Log: adding a notice about interactive help (dev mailing list or IRC #loncapa) Index: doc/build/installindex.html diff -u doc/build/installindex.html:1.5 doc/build/installindex.html:1.6 --- doc/build/installindex.html:1.5 Wed May 1 20:51:58 2002 +++ doc/build/installindex.html Mon Aug 5 03:56:00 2002 @@ -1,6 +1,6 @@ - + All Good Things Must Work @@ -65,7 +65,7 @@ - +

Results per page: @@ -105,11 +105,14 @@ - +mailing list, or
+on IRC at irc.openprojects.net, channel +#loncapa.
+(You will need software like xchat.) +
+
Ask questions on the lon-capa-dev -mailing list, or on IRC at irc.openprojects.net, channel -#loncapa.
From lon-capa-cvs@mail.lon-capa.org Mon Aug 5 13:43:18 2002 From: lon-capa-cvs@mail.lon-capa.org (matthew) Date: Mon, 05 Aug 2002 12:43:18 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonmysql.pm Message-ID: matthew Mon Aug 5 08:43:18 2002 EDT Modified files: /loncom/interface lonmysql.pm Log: Handle empty @fulltext list. Index: loncom/interface/lonmysql.pm diff -u loncom/interface/lonmysql.pm:1.3 loncom/interface/lonmysql.pm:1.4 --- loncom/interface/lonmysql.pm:1.3 Tue Jul 30 14:26:40 2002 +++ loncom/interface/lonmysql.pm Mon Aug 5 08:43:18 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # MySQL utility functions # -# $Id: lonmysql.pm,v 1.3 2002/07/30 18:26:40 matthew Exp $ +# $Id: lonmysql.pm,v 1.4 2002/08/05 12:43:18 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -570,7 +570,7 @@ # skip blank items. push (@Columns,$col_des) if ($col_des ne ''); } - if (exists($table_des->{'fulltext'})) { + if (exists($table_des->{'fulltext'}) && (@{$table_des->{'fulltext'}})) { push (@Columns,'FULLTEXT ('.join(',',@{$table_des->{'fulltext'}}).')'); } $request .= "(".join(", ",@Columns).") "; From lon-capa-cvs@mail.lon-capa.org Mon Aug 5 15:16:19 2002 From: lon-capa-cvs@mail.lon-capa.org (stredwic) Date: Mon, 05 Aug 2002 14:16:19 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface loncoursedata.pm Message-ID: stredwic Mon Aug 5 10:16:19 2002 EDT Modified files: /loncom/interface loncoursedata.pm Log: Fixed the problem where not all the problems were showing up for BS111. The problem was that sequences in the start resource were being skipped. By simply adding a next in the process sequence block, it will process a sequence right away instead of trying to move to the next resource. Index: loncom/interface/loncoursedata.pm diff -u loncom/interface/loncoursedata.pm:1.11 loncom/interface/loncoursedata.pm:1.12 --- loncom/interface/loncoursedata.pm:1.11 Sat Aug 3 14:47:24 2002 +++ loncom/interface/loncoursedata.pm Mon Aug 5 10:16:19 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # (Publication Handler # -# $Id: loncoursedata.pm,v 1.11 2002/08/03 18:47:24 stredwic Exp $ +# $Id: loncoursedata.pm,v 1.12 2002/08/05 14:16:19 stredwic Exp $ # # Copyright Michigan State University Board of Trustees # @@ -182,7 +182,7 @@ =cut sub DownloadCourseInformation { - my ($namedata,$courseID,$lastDownloadTime)=@_; + my ($namedata,$courseID,$lastDownloadTime,$WhatIWant)=@_; my %courseData; my ($name,$domain) = split(/\:/,$namedata); @@ -197,13 +197,10 @@ } # Download course data - my $WhatIWant = '(version:(\w|\/|\.)+?$|'; - $WhatIWant .= '\d+?:(\w|\/|\.)+?:(resource\.\d+\.'; - $WhatIWant .= '(solved|tries|previous|awarded|(\d+\.submission))'; - $WhatIWant .= '|timestamp)'; - $WhatIWant .= ')'; -# %courseData=&Apache::lonnet::dump($courseID, $domain, $name, $WhatIWant); - %courseData=&Apache::lonnet::dump($courseID, $domain, $name); + if(!defined($WhatIWant)) { + $WhatIWant = '.'; + } + %courseData=&Apache::lonnet::dump($courseID, $domain, $name, $WhatIWant); $courseData{'UpToDate'} = 'false'; $courseData{'lastDownloadTime'}=time; return \%courseData; @@ -284,7 +281,11 @@ $currentSequence=-1; my $topLevelSequenceNumber = $currentSequence; + my $problemCount=0; + my $problemCount2=0; my %sequenceRecord; + my $sequenceCount=0; + my $sequenceCount2=0; while(1) { if($c->aborted()) { last; @@ -293,6 +294,7 @@ #if page || sequence if(defined($hash{'map_pc_'.$hash{'src_'.$currentResourceID}}) && !defined($sequenceRecord{$currentResourceID})) { + $sequenceCount++; $sequenceRecord{$currentResourceID}++; push(@sequences, $currentSequence); push(@currentResource, $currentResourceID); @@ -323,17 +325,22 @@ last; } } + next; } # Handle gradable resources: exams, problems, etc $currentResourceID=~/(\d+)\.(\d+)/; my $partA=$1; my $partB=$2; + if($hash{'src_'.$currentResourceID}=~/\.problem$/) { + $problemCount++; + } if($hash{'src_'.$currentResourceID}=~ /\.(problem|exam|quiz|assess|survey|form)$/ && $partA eq $currentSequence && !defined($sequenceRecord{$currentSequence.':'. $currentResourceID})) { + $problemCount2++; $sequenceRecord{$currentSequence.':'.$currentResourceID}++; my $Problem = &Apache::lonnet::symbclean( &Apache::lonnet::declutter($hash{'map_id_'.$partA}). @@ -409,6 +416,7 @@ $lastResourceID=pop(@finishResource); if(defined($cache->{$currentSequence.':problems'})) { + $sequenceCount2++; # Capture sequence information here $cache->{$currentSequence.':title'}= $hash{'title_'.$currentResourceID}; @@ -473,6 +481,10 @@ $currentResourceID=pop(@currentResource); } + $cache->{'jasoncount'}=$problemCount; + $cache->{'jasoncount2'}=$problemCount2; + $cache->{'jasonseq'}=$sequenceCount; + $cache->{'jasonseq2'}=$sequenceCount2; unless (untie(%hash)) { &Apache::lonnet::logthis("WARNING: ". "Could not untie coursemap $fn (browse)". From lon-capa-cvs@mail.lon-capa.org Mon Aug 5 15:59:24 2002 From: lon-capa-cvs@mail.lon-capa.org (sakharuk) Date: Mon, 05 Aug 2002 14:59:24 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /homework radiobuttonresponse.pm Message-ID: sakharuk Mon Aug 5 10:59:24 2002 EDT Modified files: /loncom/homework radiobuttonresponse.pm Log: Changed to make as close to optionresponse as possible. Index: loncom/homework/radiobuttonresponse.pm diff -u loncom/homework/radiobuttonresponse.pm:1.43 loncom/homework/radiobuttonresponse.pm:1.44 --- loncom/homework/radiobuttonresponse.pm:1.43 Mon Jul 29 16:43:47 2002 +++ loncom/homework/radiobuttonresponse.pm Mon Aug 5 10:59:24 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # mutliple choice style responses # -# $Id: radiobuttonresponse.pm,v 1.43 2002/07/29 20:43:47 albertel Exp $ +# $Id: radiobuttonresponse.pm,v 1.44 2002/08/05 14:59:24 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -246,6 +246,8 @@ foreach my $name (@whichfoils) { if ($target ne 'tex') { $result.="
"; + } else { + $result.='\vskip 0 mm '; } if ($Apache::response::foilgroup{$name.'.value'} eq 'true') { $result.='Correct'; @@ -266,12 +268,12 @@ if (defined($lastresponse{$name})) { $result .= 'checked="on"'; } $result .= '>'.$Apache::response::foilgroup{$name.'.text'}."\n"; } else { - $result .= $Apache::response::foilgroup{$name.'.text'}; + $result .= '\item '.$Apache::response::foilgroup{$name.'.text'}; } $temp++; } } - if ($target ne 'tex') { $result.="
"; } + if ($target ne 'tex') { $result.="
"; } else { $result.='\vskip 0 mm '; } return $result; } @@ -336,9 +338,6 @@ my $result=''; if ($target eq 'web' || $target eq 'tex') { &Apache::lonxml::startredirection; - if ($target eq 'tex') { - $result .= '\item '; - } } elsif ($target eq 'edit') { $result=&Apache::edit::tag_start($target,$token); $result.=&Apache::edit::text_arg('Name:','name',$token); From lon-capa-cvs@mail.lon-capa.org Mon Aug 5 16:36:44 2002 From: lon-capa-cvs@mail.lon-capa.org (sakharuk) Date: Mon, 05 Aug 2002 15:36:44 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /xml londefdef.pm Message-ID: sakharuk Mon Aug 5 11:36:44 2002 EDT Modified files: /loncom/xml londefdef.pm Log: Correction in tag to print the nicely written problems (as in apcalc) and badly written problems (as in the Ray's case) with something like $ \\ \\ \\ $. Index: loncom/xml/londefdef.pm diff -u loncom/xml/londefdef.pm:1.82 loncom/xml/londefdef.pm:1.83 --- loncom/xml/londefdef.pm:1.82 Thu Aug 1 15:47:29 2002 +++ loncom/xml/londefdef.pm Mon Aug 5 11:36:44 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Tags Default Definition Module # -# $Id: londefdef.pm,v 1.82 2002/08/01 19:47:29 sakharuk Exp $ +# $Id: londefdef.pm,v 1.83 2002/08/05 15:36:44 sakharuk Exp $ # # # Copyright Michigan State University Board of Trustees @@ -91,7 +91,7 @@ #&Apache::lonxml::debug("M is ends with:$currentstring:"); } elsif ($target eq 'tex') { $currentstring = &Apache::lonxml::get_all_text_unbalanced("/m",$parser); - if ($currentstring=~/\s*\\\\\s*/) {$currentstring = ' \vskip 0 mm ';} + if ($currentstring=~/^(\s*\\\\\s*)*$/) {$currentstring = ' \vskip 0 mm ';} } else { my $inside = &Apache::lonxml::get_all_text_unbalanced("/m",$parser); } From lon-capa-cvs@mail.lon-capa.org Mon Aug 5 16:55:21 2002 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Mon, 05 Aug 2002 15:55:21 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /homework radiobuttonresponse.pm Message-ID: albertel Mon Aug 5 11:55:21 2002 EDT Modified files: /loncom/homework radiobuttonresponse.pm Log: - show answer after answer date (was reverting to default display) Index: loncom/homework/radiobuttonresponse.pm diff -u loncom/homework/radiobuttonresponse.pm:1.44 loncom/homework/radiobuttonresponse.pm:1.45 --- loncom/homework/radiobuttonresponse.pm:1.44 Mon Aug 5 10:59:24 2002 +++ loncom/homework/radiobuttonresponse.pm Mon Aug 5 11:55:21 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # mutliple choice style responses # -# $Id: radiobuttonresponse.pm,v 1.44 2002/08/05 14:59:24 sakharuk Exp $ +# $Id: radiobuttonresponse.pm,v 1.45 2002/08/05 15:55:21 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -184,13 +184,27 @@ my $part=$Apache::inputtags::part; my $lastresponse=$Apache::lonhomework::history{"resource.$part.$id.submission"}; my %lastresponse=&Apache::lonnet::str2hash($lastresponse); - &Apache::lonhomework::showhash(%lastresponse); - foreach my $name (@names) { - if ($Apache::response::foilgroup{$name.'.value'} ne 'unused') { - $result.="
\n"; - $temp++; + if (($Apache::lonhomework::history{"resource.$part.solved"} =~ /^correct/) || ($Apache::inputtags::status[-1] eq 'SHOW_ANSWER')) { + foreach my $name (@names) { + if ($Apache::response::foilgroup{$name.'.value'} ne 'unused') { + $result.="
".$Apache::response::foilgroup{$name.'.value'}; + if ($Apache::response::foilgroup{$name.'.value'} eq 'true') { + $result.=''; + } + $result .= $Apache::response::foilgroup{$name.'.text'}; + if ($Apache::response::foilgroup{$name.'.value'} eq 'true') { + $result.=''; + } + } + } + } else { + foreach my $name (@names) { + if ($Apache::response::foilgroup{$name.'.value'} ne 'unused') { + $result.="
\n"; + $temp++; + } } } return $result; @@ -242,7 +256,7 @@ my $result; my @whichfoils=&whichfoils($max,$answer); - if ($Apache::lonhomework::history{"resource.$Apache::inputtags::part.solved"} =~ /^correct/ ) { + if ($Apache::lonhomework::history{"resource.$Apache::inputtags::part.solved"} =~ /^correct/ || ($Apache::inputtags::status[-1] eq 'SHOW_ANSWER')) { foreach my $name (@whichfoils) { if ($target ne 'tex') { $result.="
"; @@ -250,11 +264,14 @@ $result.='\vskip 0 mm '; } if ($Apache::response::foilgroup{$name.'.value'} eq 'true') { - $result.='Correct'; + $result.='Correct:'; } else { - $result.='Incorrect'; + $result.='Incorrect:'; + } + $result.=$Apache::response::foilgroup{$name.'.text'}."\n"; + if ($Apache::response::foilgroup{$name.'.value'} eq 'true') { + $result.=''; } - $result.=":".$Apache::response::foilgroup{$name.'.text'}."\n"; } } else { my $temp=0; From lon-capa-cvs@mail.lon-capa.org Mon Aug 5 16:55:39 2002 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Mon, 05 Aug 2002 15:55:39 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /homework optionresponse.pm Message-ID: albertel Mon Aug 5 11:55:39 2002 EDT Modified files: /loncom/homework optionresponse.pm Log: - removed global, and renamed a variable Index: loncom/homework/optionresponse.pm diff -u loncom/homework/optionresponse.pm:1.44 loncom/homework/optionresponse.pm:1.45 --- loncom/homework/optionresponse.pm:1.44 Mon Jul 29 16:43:47 2002 +++ loncom/homework/optionresponse.pm Mon Aug 5 11:55:39 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # option list style responses # -# $Id: optionresponse.pm,v 1.44 2002/07/29 20:43:47 albertel Exp $ +# $Id: optionresponse.pm,v 1.45 2002/08/05 15:55:39 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -273,7 +273,7 @@ my @falselist; my $result; my $name; - $Apache::optionresponse::displayoptionintex=0; + my $displayoptionintex=0; my @whichopt = &whichfoils($max); my $part=$Apache::inputtags::part; my $id=$Apache::inputtags::response[-1]; @@ -305,17 +305,17 @@ ."\n".$Apache::response::foilgroup{$name.'.text'}."\n"; $temp++; } else { - if ($Apache::optionresponse::displayoptionintex == 0) { - my $durtyoptionlist = $optionlist; - $durtyoptionlist =~ s/

After the download, please read the pages describing the -configuration, installation, and upgrading of LON-CAPA. -

-

-NOTE: -If you want to quickly install both RedHat 7.3 and LON-CAPA -(to ensure 100% reliability), download these -instructions. +configuration, +installation, +and +upgrading of LON-CAPA.

+

NOTE: Additional downloads are also available.

+
    +
  • Helpful resources for LON-CAPA, +
    + an integrated approach for quickly installing both RedHat 7.3 +and LON-CAPA (to ensure 100% reliability) +
    + software packages for the quick installation of CPAN perl modules +
  • +

  @@ -76,6 +81,50 @@ http://www.cvshome.org/ or read loncom/build/readme.html after downloading the current version of LON-CAPA as described above. +

+

+ +Helpful resources for LON-CAPA +

+

+The entire collection of helpful resources is located +at +http://install.lon-capa.org/resources/. +

+

+Most users of LON-CAPA should install LON-CAPA by +simultaneously installing both RedHat 7.3 and LON-CAPA. +Step-by-step directions are available +here. +

+

+The "LON-CAPA and RedHat 7.3" tarball is located +here. +

+

+LON-CAPA makes extensive use of perl modules from +CPAN. To help you install all +the necessary perl modules, there is a custom-compiled RPM for +RedHat 7.* systems: + +LON-CAPA-systemperl-3.4-rh7.i386.rpm. +

+

+To install the systemperl RPM, you should enter the following command: +

+
+ +
+
+rpm -Uvh --force LON-CAPA-systemperl-3.4-rh7.i386.rpm
+
+
+
+

+The systemperl RPM will overwrite some of +the files present in the regular RedHat perl RPM. +This is okay; this will not likely cause problems.

From lon-capa-cvs@mail.lon-capa.org Wed Aug 7 22:49:35 2002 From: lon-capa-cvs@mail.lon-capa.org (sakharuk) Date: Wed, 07 Aug 2002 21:49:35 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /homework randomlabel.pm Message-ID: sakharuk Wed Aug 7 17:49:35 2002 EDT Modified files: /loncom/homework randomlabel.pm Log: Changed algorithm for placing labels and converting width of the box. In addition now picture is adjusted to the left side of the page. Index: loncom/homework/randomlabel.pm diff -u loncom/homework/randomlabel.pm:1.33 loncom/homework/randomlabel.pm:1.34 --- loncom/homework/randomlabel.pm:1.33 Fri Aug 2 14:20:48 2002 +++ loncom/homework/randomlabel.pm Wed Aug 7 17:49:35 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # random labelling tool # -# $Id: randomlabel.pm,v 1.33 2002/08/02 18:20:48 sakharuk Exp $ +# $Id: randomlabel.pm,v 1.34 2002/08/07 21:49:35 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -115,12 +115,13 @@ } $bgimg=~s/\/$//; + my $dirtywidth=$texwidth+5; if ($texwidth==90) { - $result.='\vspace*{2mm} \parbox{\textwidth}{ \noindent \epsfxsize='.$texwidth.' mm \epsffile{'. - $bgimg.'}\setlength{\unitlength}{1mm} \begin{picture}('.$texwidth.','.$texwidth*$h/$w.')'; + $result.='\vspace*{2mm}\noindent \parbox{'.$dirtywidth.' mm}{ \noindent \epsfxsize='.$texwidth.' mm \epsffile{'. + $bgimg.'}\setlength{\unitlength}{1mm} \begin{picture}('.$texwidth.','.$texwidth*$h/$w.')(0,-'.$texwidth*$h/$w.')'; } else { - $result.='\vspace*{2mm} \parbox{\textwidth}{ \noindent \epsfxsize='.$texwidth.' mm \epsffile{'. - $bgimg.'}\setlength{\unitlength}{1mm} \begin{picture}('.$texwidth.','.$texwidth*$h/$w.')('.(100-$texwidth).','.(100-$texwidth)*$h/$w.')'; + $result.='\vspace*{2mm}\noindent \parbox{'.$dirtywidth.' mm}{ \noindent \epsfxsize='.$texwidth.' mm \epsffile{'. + $bgimg.'}\setlength{\unitlength}{1mm} \begin{picture}('.$texwidth.','.$texwidth*$h/$w.')(0,-'.$texwidth*$h/$w.')'; } } elsif ($target eq 'edit') { $result.=&Apache::edit::tag_start($target,$token); @@ -156,11 +157,14 @@ $result .= "\n
"; } elsif ($target eq 'tex') { $result='\end{picture}\\\\}'; - if (@$parstack[-1]=~/\$texwidth\s*=\s*?"90/) { #" @$parstack[-1]=~/\$height\s*=\s*?"(.+)?"/; - my $howtoskipback = $1/48; - $result.=' \vskip -'.$howtoskipback.' cm '; - } + my $one=$1; + @$parstack[-1]=~/\$width\s*=\s*?"(.+)?"/; + my $two=$1; + @$parstack[-1]=~/\$texwidth\s*=\s*?"(.+)?"/; + my $three=$1; + my $howtoskipback = $three*$one/$two; + $result.=' \vskip -'.$howtoskipback.' mm '; } elsif ($target eq 'edit') { $result.=&Apache::edit::end_table; } @@ -283,10 +287,10 @@ my $y = $Apache::randomlabel::ycoord[$i]; my $value = $Apache::randomlabel::value[$i]; #x latex coordinate - my $tcX=($x-5)*($texwidth/$wwidth); + my $tcX=($x)*($texwidth/$wwidth); #y latex coordinate - my $ratio=($wwidth > 0 ? $wheight/$wwidth : 1 ); - my $tcY=$TY1-$y*($TY1/$wheight)+$texwidth*$ratio; +# my $ratio=($wwidth > 0 ? $wheight/$wwidth : 1 ); + my $tcY=$TY1-$y*($TY1/$wheight); $tcX=sprintf('%.2f',$tcX); $tcY=sprintf('%.2f',$tcY); $result.='\put('.$tcX.','.$tcY.'){\normalsize \bf '.$label.'}'."\n"; From lon-capa-cvs@mail.lon-capa.org Thu Aug 8 03:30:40 2002 From: lon-capa-cvs@mail.lon-capa.org (foxr) Date: Thu, 08 Aug 2002 02:30:40 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /publisher lonupload.pm Message-ID: foxr Wed Aug 7 22:30:40 2002 EDT Modified files: /loncom/publisher lonupload.pm Log: BUG 442 - map %20 to ' ' in filenames. Index: loncom/publisher/lonupload.pm diff -u loncom/publisher/lonupload.pm:1.11 loncom/publisher/lonupload.pm:1.12 --- loncom/publisher/lonupload.pm:1.11 Sun Aug 4 22:22:56 2002 +++ loncom/publisher/lonupload.pm Wed Aug 7 22:30:39 2002 @@ -1,7 +1,8 @@ + # The LearningOnline Network with CAPA # Handler to upload files into construction space # -# $Id: lonupload.pm,v 1.11 2002/08/05 02:22:56 foxr Exp $ +# $Id: lonupload.pm,v 1.12 2002/08/08 02:30:39 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -55,6 +56,24 @@ use Apache::Constants qw(:common :http :methods); use Apache::loncacc; use Apache::loncommon(); +use Apache::Log(); + +my $DEBUG=0; + +sub Debug { + + # Marshall the parameters. + + my $r = shift; + my $log = $r->log; + my $message = shift; + + # Put out the indicated message butonly if DEBUG is false. + + if ($DEBUG) { + $log->debug($message); + } +} sub upfile_store { my $r=shift; @@ -85,7 +104,8 @@ $fn.=$ENV{'form.upfile.filename'}; $fn=~s/^\///; $fn=~s/(\/)+/\//g; - + $fn=~s/%20/ /g; + &Debug($r, "Filename for upload: $fn"); if (($fn) && ($fn!~/\/$/)) { $r->print( '
'. From lon-capa-cvs@mail.lon-capa.org Thu Aug 8 14:06:23 2002 From: lon-capa-cvs@mail.lon-capa.org (matthew) Date: Thu, 08 Aug 2002 13:06:23 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface loncommon.pm Message-ID: matthew Thu Aug 8 09:06:23 2002 EDT Modified files: /loncom/interface loncommon.pm Log: Attempt to prevent the lousyness with lonindexer remembering incorrectly to only show sequences. I have not been able to reproduce the error... Index: loncom/interface/loncommon.pm diff -u loncom/interface/loncommon.pm:1.49 loncom/interface/loncommon.pm:1.50 --- loncom/interface/loncommon.pm:1.49 Wed Aug 7 11:39:58 2002 +++ loncom/interface/loncommon.pm Thu Aug 8 09:06:22 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.49 2002/08/07 15:39:58 ng Exp $ +# $Id: loncommon.pm,v 1.50 2002/08/08 13:06:22 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -242,7 +242,7 @@ ############################################################### sub browser_and_searcher_javascript { return < matthew Thu Aug 8 09:07:17 2002 EDT Modified files: /loncom/interface lonindexer.pm Log: Minor cleanups and name changes. Index: loncom/interface/lonindexer.pm diff -u loncom/interface/lonindexer.pm:1.47 loncom/interface/lonindexer.pm:1.48 --- loncom/interface/lonindexer.pm:1.47 Tue Jul 30 15:47:13 2002 +++ loncom/interface/lonindexer.pm Thu Aug 8 09:07:17 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Directory Indexer # -# $Id: lonindexer.pm,v 1.47 2002/07/30 19:47:13 ng Exp $ +# $Id: lonindexer.pm,v 1.48 2002/08/08 13:07:17 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -135,16 +135,10 @@ &start_fresh_session(); } # -------------------- refresh environment with user database values (in %hash) - if ($hash{'mode_catalog'} eq 'interactive') { - $ENV{'form.catalogmode'}='interactive'; - } - if ($hash{'mode_catalog'} eq 'groupimport') { - $ENV{'form.catalogmode'}='groupimport'; - } + &setvalues(\%hash,'form.catalogmode',\%ENV,'form.catalogmode' ); # --------------------- define extra fields and buttons in case of special mode if ($ENV{'form.catalogmode'} eq 'interactive') { - $hash{'mode_catalog'}='interactive'; $extrafield=''. ''; @@ -154,7 +148,6 @@ END } elsif ($ENV{'form.catalogmode'} eq 'groupimport') { - $hash{'mode_catalog'}='groupimport'; $extrafield=''. ''; @@ -176,11 +169,11 @@ # $element is the name of the element in $formname which receives # the URL. # &Apache::lonxml::debug('Checking mode, form, element'); - &setvalues(\%hash,'form_mode' ,\%ENV,'form.mode' ); - &setvalues(\%hash,'form_form' ,\%ENV,'form.form' ); - &setvalues(\%hash,'form_element',\%ENV,'form.element'); - &setvalues(\%hash,'form_only' ,\%ENV,'form.only' ); - &setvalues(\%hash,'form_omit' ,\%ENV,'form.omit' ); + &setvalues(\%hash,'form.mode' ,\%ENV,'form.mode' ); + &setvalues(\%hash,'form.form' ,\%ENV,'form.form' ); + &setvalues(\%hash,'form.element',\%ENV,'form.element'); + &setvalues(\%hash,'form.only' ,\%ENV,'form.only' ); + &setvalues(\%hash,'form.omit' ,\%ENV,'form.omit' ); # Deal with 'omit' and 'only' if (exists $ENV{'form.omit'}) { @@ -902,19 +895,14 @@ # --------- settings whenever the user causes the indexer window to be launched sub start_fresh_session { - delete $hash{'mode_catalog'}; - delete $hash{'form_mode'}; - delete $hash{'form_form'}; - delete $hash{'form_element'}; - delete $hash{'form_omit'}; - delete $hash{'form_only'}; + delete $hash{'form.catalogmode'}; + delete $hash{'form.mode'}; + delete $hash{'form.form'}; + delete $hash{'form.element'}; + delete $hash{'form.omit'}; + delete $hash{'form.only'}; foreach (keys %hash) { - if ($_ =~ /^pre_/) { - delete $hash{$_}; - } - if ($_ =~ /^store/) { - delete $hash{$_}; - } + delete $hash{$_} if (/^(pre_|store)/); } } From lon-capa-cvs@mail.lon-capa.org Thu Aug 8 14:42:01 2002 From: lon-capa-cvs@mail.lon-capa.org (www) Date: Thu, 08 Aug 2002 13:42:01 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm Message-ID: www Thu Aug 8 09:42:01 2002 EDT Modified files: /loncom/lonnet/perl lonnet.pm Log: New routine to fetch uploaded file Index: loncom/lonnet/perl/lonnet.pm diff -u loncom/lonnet/perl/lonnet.pm:1.262 loncom/lonnet/perl/lonnet.pm:1.263 --- loncom/lonnet/perl/lonnet.pm:1.262 Wed Aug 7 16:40:57 2002 +++ loncom/lonnet/perl/lonnet.pm Thu Aug 8 09:42:01 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.262 2002/08/07 20:40:57 matthew Exp $ +# $Id: lonnet.pm,v 1.263 2002/08/08 13:42:01 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -608,6 +608,18 @@ return %returnhash; } +# -------------------------------------------------------------------- New chat + +sub chatsend { + my ($newentry,$anon)=@_; + my $cnum=$ENV{'course.'.$ENV{'request.course.id'}.'.num'}; + my $cdom=$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}; + my $chome=$ENV{'course.'.$ENV{'request.course.id'}.'.home'}; + &reply('chatsend:'.$cdom.':'.$cnum.':'. + &escape($ENV{'user.domain'}.':'.$ENV{'user.name'}.':'.$anon.':'. + &escape($newentry)),$chome); +} + # ----------------------------- Subscribe to a resource, return URL if possible sub subscribe { @@ -766,10 +778,15 @@ } # Notify homeserver to grep it # -# FIXME - this still needs to happen + if +(&reply('fetchuserfile:'.$docudom.'/'.$docuname.'/'.$fname,$docuhome) eq 'ok') + { # # Return the URL to it - return '/uploaded/'.$path.$fname; + return '/uploaded/'.$path.$fname; + } else { + return '/adm/notfound.html'; + } } # ------------------------------------------------------------------------- Log From lon-capa-cvs@mail.lon-capa.org Thu Aug 8 14:43:04 2002 From: lon-capa-cvs@mail.lon-capa.org (www) Date: Thu, 08 Aug 2002 13:43:04 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface loncommon.pm Message-ID: www Thu Aug 8 09:43:04 2002 EDT Modified files: /loncom/interface loncommon.pm Log: New routines to handle dates Index: loncom/interface/loncommon.pm diff -u loncom/interface/loncommon.pm:1.50 loncom/interface/loncommon.pm:1.51 --- loncom/interface/loncommon.pm:1.50 Thu Aug 8 09:06:22 2002 +++ loncom/interface/loncommon.pm Thu Aug 8 09:43:04 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.50 2002/08/08 13:06:22 matthew Exp $ +# $Id: loncommon.pm,v 1.51 2002/08/08 13:43:04 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -80,7 +80,7 @@ use strict; use Apache::lonnet(); use GDBM_File; -use POSIX qw(strftime); +use POSIX qw(strftime mktime); use Apache::Constants qw(:common); use Apache::lonmsg(); my $readit; @@ -1150,6 +1150,47 @@ } ############################################### + + +sub timehash { + my @ltime=localtime(shift); + return ( 'seconds' => $ltime[0], + 'minutes' => $ltime[1], + 'hours' => $ltime[2], + 'day' => $ltime[3], + 'month' => $ltime[4]+1, + 'year' => $ltime[5]+1900, + 'weekday' => $ltime[6], + 'dayyear' => $ltime[7]+1, + 'dlsav' => $ltime[8] ); +} + +sub maketime { + my %th=@_; + return POSIX::mktime( + ($th{'seconds'},$th{'minutes'},$th{'hours'}, + $th{'day'},$th{'month'}-1,$th{'year'}-1900,0,0,$th{'dlsav'})); +} + + +sub findallcourses { + my %courses=(); + my $now=time; + foreach (keys %ENV) { + if ($_=~/^user\.role\.\w+\.\/(\w+)\/(\w+)/) { + my ($starttime,$endtime)=$ENV{$_}; + my $active=1; + if ($starttime) { + if ($now<$starttime) { $active=0; } + } + if ($endtime) { + if ($now>$endtime) { $active=0; } + } + if ($active) { $courses{$1.'_'.$2}=1; } + } + } + return keys %courses; +} ############################################### From lon-capa-cvs@mail.lon-capa.org Thu Aug 8 14:44:17 2002 From: lon-capa-cvs@mail.lon-capa.org (www) Date: Thu, 08 Aug 2002 13:44:17 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonannounce.pm lonchat.pm lonchatfetch.pm lonparmset.pm mydesk.tab Message-ID: This is a MIME encoded message --www1028814257 Content-Type: text/plain www Thu Aug 8 09:44:17 2002 EDT Added files: /loncom/interface lonchatfetch.pm Modified files: /loncom/interface lonannounce.pm lonchat.pm lonparmset.pm mydesk.tab Log: Routines for chat, explanation of option in parmset, chat function kind of works --www1028814257 Content-Type: text/plain Content-Disposition: attachment; filename="www-20020808094417.txt" Index: loncom/interface/lonannounce.pm diff -u loncom/interface/lonannounce.pm:1.2 loncom/interface/lonannounce.pm:1.3 --- loncom/interface/lonannounce.pm:1.2 Wed Jul 24 16:40:58 2002 +++ loncom/interface/lonannounce.pm Thu Aug 8 09:44:17 2002 @@ -1,20 +1,81 @@ # The LearningOnline Network # Announce # -# (Internal Server Error Handler +# $Id: lonannounce.pm,v 1.3 2002/08/08 13:44:17 www Exp $ # -# (Login Screen -# 5/21/99,5/22,5/25,5/26,5/31,6/2,6/10,7/12,7/14, -# 1/14/00,5/29,5/30,6/1,6/29,7/1,11/9 Gerd Kortemeyer) +# Copyright Michigan State University Board of Trustees # -# 3/1/1 Gerd Kortemeyer) +# This file is part of the LearningOnline Network with CAPA (LON-CAPA). # -# 3/1 Gerd Kortemeyer +# LON-CAPA is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. # +# LON-CAPA is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LON-CAPA; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# /home/httpd/html/adm/gpl.txt +# +# http://www.lon-capa.org/ +# + package Apache::lonannounce; use strict; use Apache::Constants qw(:common); +use Apache::loncommon; + +sub readcalendar { + my $courseid=shift; + my $coursenum=$ENV{'course.'.$courseid.'.num'}; + my $coursedom=$ENV{'course.'.$courseid.'.domain'}; + my %thiscal=&Apache::lonnet::dump('calendar',$coursedom,$coursenum); + my %returnhash=(); + foreach (keys %thiscal) { + unless (($_=~/^error\:/) || ($thiscal{$_}=~/^error\:/)) { + $returnhash{$courseid.'@'.$_}=$thiscal{$_}; + } + } + return %returnhash; +} + +sub emptycell { + return ' '; +} + +sub normalcell { + my ($day,$text)=@_; + return ''.$day.'
'.$text.''; +} + +sub nextday { + my %th=@_; + $th{'day'}++; + return (&Apache::loncommon::maketime(%th),$th{'month'}); +} + +sub showday { + my ($tk,%allcal)=@_; + my %th=&Apache::loncommon::timehash($tk); + my ($nextday,$nextmonth)=&nextday(%th); + my $outp=''; + foreach (keys %allcal) { + my ($course,$startdate,$enddate)=($_=~/^(\w+)\@(\d+)\_(\d+)$/); + print $course.' '.localtime($startdate).' '.localtime($enddate). + localtime($tk).' '.localtime($nextday).'
'; + if (($startdate>$tk) && ($enddate<$nextday)) { + $outp.='___&&&___'.$course.'@'.$allcal{$_}; + } + } + return ($nextday,$nextmonth,&normalcell($th{'day'},$outp)); +} sub handler { my $r = shift; @@ -22,18 +83,180 @@ $r->send_http_header; return OK if $r->header_only; -# --------------------------------------------------- Print login screen header +# ---------------------------------------------------------- Get time right now + my $today=time; + my %todayhash=&Apache::loncommon::timehash($today); + +# ---------------------------------------------------------- Get month and year + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, + ['month','year']); +# ----------------------------------------------------- Summarize all calendars + my %allcal=(); + foreach (&Apache::loncommon::findallcourses()) { + %allcal=(%allcal,&readcalendar($_)); + } +# --------------------------------------------------- Decide what month to show + my $year=$todayhash{'year'}; + if ($ENV{'form.year'}) { $year=$ENV{'form.year'}; } + my $month=$todayhash{'month'}; + if ($ENV{'form.month'}) { $month=$ENV{'form.month'}; } +# --------------------------------------------- Find out first day of the month + + my %firstday=&Apache::loncommon::timehash( + &Apache::loncommon::maketime( 'day' => 1, 'month'=> $month, + 'year' => $year, 'hours' => 0, + 'minutes' => 0, 'seconds' => 0, + 'dlsav' => $todayhash{'dlsav'} )); + my $weekday=$firstday{'weekday'}; +# ------------------------------------------------------------ Print the screen $r->print(< The LearningOnline Network with CAPA + -

Printout

- - - +

Announcements

ENDDOCUMENT + +# does this user have privileges to post, etc? + my $allowed=0; + if ($ENV{'request.course.id'}) { + $allowed=&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}); + } + + if ($allowed) { + my $coursenum=$ENV{'course.'.$ENV{'request.course.id'}.'.num'}; + my $coursedom=$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}; +# ----------------------------------------------------- Store new submitted one + if ($ENV{'form.action'} eq 'new') { + &Apache::lonnet::put('calendar',{ + $ENV{'form.startdate'}.'_'.$ENV{'form.enddate'} => + $ENV{'form.msg'} },$coursedom,$coursenum); + } +# ---------------------------------------------------------------- Remove items + if ($ENV{'form.action'} eq 'del') { + my @delwhich=(); + foreach (keys %ENV) { + if ($_=~/^form\.remove\_(.+)$/) { + push(@delwhich,$1); + } + } + &Apache::lonnet::del('calendar',\@delwhich,$coursedom,$coursenum); + } +# -------------------------------------------------------- Form to post new one + my %tomorrowhash=%todayhash; + $tomorrowhash{'day'}++; + my $tomorrow=&Apache::loncommon::maketime(%tomorrowhash); + + $r->print(< + + + + + + +
Set Starting Date +Set Ending Date

+ +


+
+ENDFORM + } + my ($pm,$py,$fm,$fy)=($month-1,$year,$month+1,$year); + if ($pm<1) { ($pm,$py)=(12,$year-1); } + if ($fm>12){ ($fm,$fy)=(1,$year+1); } + $r->print('

'.('','January','February','March','April','May', + 'June','July','August','September','October', + 'November','December')[$month].' '.$year.'

'. + 'Previous Month '. + 'Next Month

'. + ''. + ''); + + my $tk=&Apache::loncommon::maketime(%firstday); + my $outp; + my $nm; + +# ---------------------------------------------------------------- Actual table + $r->print(''); + for (my $i=0;$i<$weekday;$i++) { $r->print(&emptycell); } + for (my $i=$weekday;$i<=6;$i++) { + ($tk,$nm,$outp)=&showday($tk,%allcal); + $r->print($outp); + } + $r->print(''); + + for (my $k=0;$k<=3;$k++) { + $r->print(''); + for (my $i=0;$i<=6;$i++) { + ($tk,$nm,$outp)=&showday($tk,%allcal); + if ($month!=$nm) { $outp=&emptycell; } + $r->print($outp); + } + $r->print(''); + } +# ------------------------------------------------------------------- End table + if ($allowed) { $r->print(''); } + $r->print('
SunMonTueWedThuFriSat

'. + 'Previous Month '. + 'Next Month

'. + ''); return OK; } Index: loncom/interface/lonchat.pm diff -u loncom/interface/lonchat.pm:1.2 loncom/interface/lonchat.pm:1.3 --- loncom/interface/lonchat.pm:1.2 Wed Jul 24 16:40:58 2002 +++ loncom/interface/lonchat.pm Thu Aug 8 09:44:17 2002 @@ -1,16 +1,31 @@ # The LearningOnline Network # Chat # -# (Internal Server Error Handler +# $Id: lonchat.pm,v 1.3 2002/08/08 13:44:17 www Exp $ # -# (Login Screen -# 5/21/99,5/22,5/25,5/26,5/31,6/2,6/10,7/12,7/14, -# 1/14/00,5/29,5/30,6/1,6/29,7/1,11/9 Gerd Kortemeyer) +# Copyright Michigan State University Board of Trustees # -# 3/1/1 Gerd Kortemeyer) +# This file is part of the LearningOnline Network with CAPA (LON-CAPA). # -# 3/1 Gerd Kortemeyer +# LON-CAPA is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. # +# LON-CAPA is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with LON-CAPA; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# /home/httpd/html/adm/gpl.txt +# +# http://www.lon-capa.org/ +# + package Apache::lonchat; use strict; @@ -22,6 +37,9 @@ $r->send_http_header; return OK if $r->header_only; + if ($ENV{'form.newentry'}) { + &Apache::lonnet::chatsend($ENV{'form.newchat'},$ENV{'form.anonymous'}); + } # --------------------------------------------------- Print login screen header $r->print(< @@ -29,8 +47,11 @@ The LearningOnline Network with CAPA -

Printout

- +
+ + + +
ENDDOCUMENT Index: loncom/interface/lonparmset.pm diff -u loncom/interface/lonparmset.pm:1.55 loncom/interface/lonparmset.pm:1.56 --- loncom/interface/lonparmset.pm:1.55 Mon Jul 22 10:23:29 2002 +++ loncom/interface/lonparmset.pm Thu Aug 8 09:44:17 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to set parameters for assessments # -# $Id: lonparmset.pm,v 1.55 2002/07/22 14:23:29 bowersj2 Exp $ +# $Id: lonparmset.pm,v 1.56 2002/08/08 13:44:17 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -757,9 +757,11 @@ 'pageseparators' => 'Visibly Separate Items on Pages
'. '("yes" for visible separation)', 'pch.roles.denied'=> 'Disallow Resource Discussion for '. - 'Roles ' . - Apache::loncommon::help_open_topic("Course_Disable_Discussion") - , + 'Roles
"st": '. + 'student, "ta": '. + 'TA, "in": '. + 'instructor;
role,role,...) '. + Apache::loncommon::help_open_topic("Course_Disable_Discussion"), 'pch.users.denied' => 'Disallow Resource Discussion for Users
'. '(user:domain,user:domain,...)', Index: loncom/interface/mydesk.tab diff -u loncom/interface/mydesk.tab:1.22 loncom/interface/mydesk.tab:1.23 --- loncom/interface/mydesk.tab:1.22 Tue Jul 30 16:26:48 2002 +++ loncom/interface/mydesk.tab Thu Aug 8 09:44:17 2002 @@ -8,47 +8,47 @@ # pro = author prt = rca and user is a co-author # pro = author prt = any # pro = p??? allowed if the user has the permissions given in ??? -1:1:smp:any:courses.gif:choose:course:go('/adm/roles'); -1:1:smp:rst:courses.gif:switch:course:go('/adm/roles'); -1:1:adv:any:roles.gif:switch:role:go('/adm/roles'); -1:1:adv:rcm:roles.gif:choose:role:go('/adm/roles'); -1:2:any:any:com.gif:commu-:nication:go('/adm/communicate'); +1:1:smp:any:courses.gif:choose:course:go('/adm/roles');:Choose Course +1:1:smp:rst:courses.gif:switch:course:go('/adm/roles');:Switch Course +1:1:adv:any:roles.gif:switch:role:go('/adm/roles');:Switch Role +1:1:adv:rcm:roles.gif:choose:role:go('/adm/roles');:Choose Role +1:2:any:any:com.gif:commu-:nication:go('/adm/communicate');:Communicate/Messages 2:1:clear 2:2:clear -2:2:pbre:$crs:nav.gif:navigate:contents:gopost('/adm/navmaps',currentURL); +2:2:pbre:$crs:nav.gif:navigate:contents:gopost('/adm/navmaps',currentURL);:Navigate Contents 2:3:clear 3:1:clear 4:1:clear -4:1:pbre:$crs:grds.gif:my:grades:go('/adm/studentcalc'); -4:1:pvgr:$crs:sprs.gif:course:grades:go('/adm/classcalc'); +4:1:pbre:$crs:grds.gif:my:grades:go('/adm/studentcalc');:Check My Grades +4:1:pvgr:$crs:sprs.gif:course:grades:go('/adm/classcalc');:Check Course Grades 4:2:clear -4:2:pvgr:$crs:chrt.gif:course:chart:gopost('/adm/statistics','Student Assessment'); +4:2:pvgr:$crs:chrt.gif:course:chart:gopost('/adm/statistics','Student Assessment');:Course Assessment Chart 4:3:clear -4:3:pvgr:$crs:stat.gif:course:stats:go('/adm/statistics'); +4:3:pvgr:$crs:stat.gif:course:stats:go('/adm/statistics');:Course Assessment Statistics 5:1:clear -5:1:pcst:$crs:enrl.gif:course:enroll:go('/adm/dropadd'); +5:1:pcst:$crs:enrl.gif:course:enroll:go('/adm/dropadd');:Drop/Add Students 5:2:clear -5:2:pcst:$crs:cprv.gif:user:roles:go('/adm/createuser'); -5:2:pcca:$udom:cprv.gif:user:roles:go('/adm/createuser'); -5:2:pmau:$udom:cprv.gif:user:roles:go('/adm/createuser'); +5:2:pcst:$crs:cprv.gif:user:roles:go('/adm/createuser');:Change User Roles +5:2:pcca:$udom:cprv.gif:user:roles:go('/adm/createuser');:Change User Roles +5:2:pmau:$udom:cprv.gif:user:roles:go('/adm/createuser');:Change User Roles 5:3:clear -5:3:pccc:$udom:ccrs.gif:create:course:go('/adm/createcourse'); -5:3:popa:$crs:parm.gif:course:parms:go('/adm/parmset'); +5:3:pccc:$udom:ccrs.gif:create:course:go('/adm/createcourse');:Create New Course +5:3:popa:$crs:parm.gif:course:parms:go('/adm/parmset');:Set Parameters/Deadlines/etc 6:1:clear -6:1:author:any:cstr.gif:con-:struct:cstrgo(currentURL,'/priv/$uname/'); -6:1:author:rca:cstr.gif:co con-:struct:cstrgo(currentURL,'/priv/$uname/'); +6:1:author:any:cstr.gif:con-:struct:cstrgo(currentURL,'/priv/$uname/');:Enter Construction Space +6:1:author:rca:cstr.gif:co con-:struct:cstrgo(currentURL,'/priv/$uname/');:Enter Co-Construction Space 6:2:clear -6:2:author:any:res.gif:resource:space:go('/res/$udom/$uname/?launch=1'); -6:2:author:rca:res.gif:co res:space:go('/res/$udom/$uname/?launch=1'); +6:2:author:any:res.gif:resource:space:go('/res/$udom/$uname/?launch=1');:Browse Published Resources +6:2:author:rca:res.gif:co res:space:go('/res/$udom/$uname/?launch=1');:Browse Published Resources 6:3:clear 7:2:clear -7:2:adv:rcm:egrd.gif:enter:grades:go('/adm/grades'); +7:2:adv:rcm:egrd.gif:enter:grades:go('/adm/grades');:Enter Grades 10:1:clear -10:1:pbre:$crs:anno.gif:calendar:announce:go('/adm/announcements'); +10:1:any:any:anno.gif:calendar:announce:go('/adm/announcements');:Announcements and Calendar 10:2:clear -10:2:pbre:$crs:docs.gif:course:docs:go('/adm/coursedocs'); +10:2:pbre:$crs:docs.gif:course:docs:go('/adm/coursedocs');:Course Documents 10:3:clear -10:3:pbre:$crs:bchat.gif:course:chat:go('/adm/chat'); -11:1:any:any:src.gif:search:library:go('/adm/searchcat'); -11:2:any:any:pref.gif:prefer-:ences:go('/adm/preferences'); -11:3:any:any:logout.gif:exit::go('/adm/logout'); +10:3:pbre:$crs:bchat.gif:course:chat:go('/res/adm/pages/chatroom.html');:Chat +11:1:any:any:src.gif:search:library:go('/adm/searchcat');:Search Published Resources +11:2:any:any:pref.gif:prefer-:ences:go('/adm/preferences');:Set Preferences +11:3:any:any:logout.gif:exit::go('/adm/logout');:Exit Index: loncom/interface/lonchatfetch.pm +++ loncom/interface/lonchatfetch.pm # The LearningOnline Network # Chat Fetching # # $Id: lonchatfetch.pm,v 1.1 2002/08/08 13:44:17 www Exp $ # # Copyright Michigan State University Board of Trustees # # This file is part of the LearningOnline Network with CAPA (LON-CAPA). # # LON-CAPA is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # LON-CAPA is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with LON-CAPA; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # /home/httpd/html/adm/gpl.txt # # http://www.lon-capa.org/ # package Apache::lonchatfetch; use strict; use Apache::Constants qw(:common); use Apache::lontexconvert; sub handler { my $r = shift; $r->content_type('text/html'); $r->send_http_header; return OK if $r->header_only; # ------------------------------------------------------------ retrieve entries my $cnum=$ENV{'course.'.$ENV{'request.course.id'}.'.num'}; my $cdom=$ENV{'course.'.$ENV{'request.course.id'}.'.domain'}; my $chome=$ENV{'course.'.$ENV{'request.course.id'}.'.home'}; my @entries=split(/\:/, &Apache::lonnet::reply("chatretr:$cdom:$cnum",$chome)); my ($lastid)=($entries[$#entries]=~/^(\w+)/); my ($thentime,$idnum)=split(/\_/,$lastid); # -------------------------------------------------------- see which ones apply &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['lastid']); my $include=0; my $newstuff=''; unless ($ENV{'form.lastid'}) { $include=1; } foreach (@entries) { if ($include) { my ($id,$msg)=split(/\:/,&Apache::lonnet::unescape($_)); chomp($msg); my ($msgtime,$msgnum)=split(/\_/,$id); my ($sdom,$snum,$anon,$contrib)=split(/\:/, &Apache::lonnet::unescape($msg)); $contrib=&Apache::lonnet::unescape($contrib); $contrib=~s/\n/\
/g; $contrib=&Apache::lontexconvert::msgtexconverted($contrib); $contrib=~s/\n/ /g; $contrib=~s/\'/\&\#39\;/g; my $sender=$snum.' at '.$sdom; if ($anon) { } $newstuff.=''.$sender.' ('.localtime($msgtime).'): '. $contrib."
"; } else { $_=~/^(\w+)/; if ($1 eq $ENV{'form.lastid'}) { $include=1; } } } $r->print(< The LearningOnline Network with CAPA ENDDOCUMENT return OK; } 1; __END__ --www1028814257-- From lon-capa-cvs@mail.lon-capa.org Thu Aug 8 14:45:21 2002 From: lon-capa-cvs@mail.lon-capa.org (www) Date: Thu, 08 Aug 2002 13:45:21 -0000 Subject: [LON-CAPA-cvs] cvs: loncom / loncapa_apache.conf lond lontrans.pm /auth lontokacc.pm lonuploadedacc.pm Message-ID: This is a MIME encoded message --www1028814321 Content-Type: text/plain www Thu Aug 8 09:45:21 2002 EDT Modified files: /loncom loncapa_apache.conf lond lontrans.pm /loncom/auth lontokacc.pm lonuploadedacc.pm Log: Routines for file upload --www1028814321 Content-Type: text/plain Content-Disposition: attachment; filename="www-20020808094521.txt" Index: loncom/loncapa_apache.conf diff -u loncom/loncapa_apache.conf:1.12 loncom/loncapa_apache.conf:1.13 --- loncom/loncapa_apache.conf:1.12 Fri Aug 2 10:45:04 2002 +++ loncom/loncapa_apache.conf Thu Aug 8 09:45:21 2002 @@ -1,7 +1,7 @@ ## ## loncapa_apache.conf -- Apache HTTP LON-CAPA configuration file ## -## $Id: loncapa_apache.conf,v 1.12 2002/08/02 14:45:04 www Exp $ +## $Id: loncapa_apache.conf,v 1.13 2002/08/08 13:45:21 www Exp $ ## ## 1/11/2002 - Scott Harrison ## 2/19/2002 - Scott Harrison @@ -56,11 +56,9 @@ PerlAccessHandler Apache::lontokacc -ErrorDocument 404 /adm/notfound.html -ErrorDocument 500 /adm/errorhandler - + PerlAccessHandler Apache::lonuploadedacc ErrorDocument 404 /adm/notfound.html ErrorDocument 500 /adm/errorhandler @@ -413,7 +411,13 @@ PerlAccessHandler Apache::lonacc SetHandler perl-script PerlHandler Apache::lonchat -ErrorDocument 403 /adm/login +ErrorDocument 500 /adm/errorhandler + + + +PerlAccessHandler Apache::lonacc +SetHandler perl-script +PerlHandler Apache::lonchatfetch ErrorDocument 500 /adm/errorhandler Index: loncom/lond diff -u loncom/lond:1.85 loncom/lond:1.86 --- loncom/lond:1.85 Thu Aug 1 14:44:19 2002 +++ loncom/lond Thu Aug 8 09:45:21 2002 @@ -2,7 +2,7 @@ # The LearningOnline Network # lond "LON Daemon" Server (port "LOND" 5663) # -# $Id: lond,v 1.85 2002/08/01 18:44:19 www Exp $ +# $Id: lond,v 1.86 2002/08/08 13:45:21 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -949,10 +949,48 @@ } # -------------------------------------- fetch a user file from a remote server } elsif ($userinput =~ /^fetchuserfile/) { - my ($cmd,$fname)=split(/:/,$userinput); + my ($cmd,$fname)=split(/:/,$userinput); + my ($udom,$uname,$ufile)=split(/\//,$fname); + my $udir=propath($udom,$uname).'/userfiles'; + unless (-e $udir) { mkdir($udir); } + if (-e $udir) { + $ufile=~s/^[\.\~]+//; + $ufile=~s/\///g; + my $transname=$udir.'/'.$ufile; + my $remoteurl='http://'.$clientip.'/userfiles/'.$fname; + my $response; + { + my $ua=new LWP::UserAgent; + my $request=new HTTP::Request('GET',"$remoteurl"); + $response=$ua->request($request,$transname); + } + if ($response->is_error()) { + unlink($transname); + my $message=$response->status_line; + &logthis( + "LWP GET: $message for $fname ($remoteurl)"); + print $client "failed\n"; + } else { + print $client "ok\n"; + } + } else { + print $client "not_home\n"; + } # ------------------------------------------ authenticate access to a user file - } elsif ($userinput =~ /^authuserfile/) { + } elsif ($userinput =~ /^tokenauthuserfile/) { my ($cmd,$fname,$session)=split(/:/,$userinput); + chomp($session); + $reply='non_auth'; + if (open(ENVIN,$perlvar{'lonIDsDir'}.'/'. + $session.'.id')) { + while ($line=) { + if ($line=~/userfile\.$fname\=/) { $reply='ok'; } + } + close(ENVIN); + print $client $reply."\n"; + } else { + print $client "invalid_token\n"; + } # ----------------------------------------------------------------- unsubscribe } elsif ($userinput =~ /^unsub/) { my ($cmd,$fname)=split(/:/,$userinput); @@ -1264,6 +1302,20 @@ } else { print $client "error:$!\n"; } +# -------------------------------------------------------------------- chatsend + } elsif ($userinput =~ /^chatsend/) { + my ($cmd,$cdom,$cnum,$newpost)=split(/\:/,$userinput); + &chatadd($cdom,$cnum,$newpost); + print $client "ok\n"; +# -------------------------------------------------------------------- chatretr + } elsif ($userinput =~ /^chatretr/) { + my ($cmd,$cdom,$cnum)=split(/\:/,$userinput); + my $reply=''; + foreach (&getchat($cdom,$cnum)) { + $reply.=&escape($_).':'; + } + $reply=~s/\:$//; + print $client $reply."\n"; # ------------------------------------------------------------------- querysend } elsif ($userinput =~ /^querysend/) { my ($cmd,$query, @@ -1514,6 +1566,42 @@ if ($newline) { print $sh $newline; } $sh->close(); return $found; +} + +sub getchat { + my ($cdom,$cname)=@_; + my @entries; + if (open(CHATIN,&propath($cdom,$cname).'/chatroom.txt')) { + while ($line=) { push(@entries,$line); } + close(CHATIN); + return @entries; + } + return (); +} + +sub chatadd { + my ($cdom,$cname,$newchat)=@_; + my @entries=&getchat($cdom,$cname); + my $time=time; + my ($lastid)=($entries[$#entries]=~/^(\w+)\:/); + my ($thentime,$idnum)=split(/\_/,$lastid); + my $newid=$time.'_000000'; + if ($thentime==$time) { + $idnum=~s/^0+//; + $idnum++; + $idnum=substr('000000'.$idnum,-6,6); + $newid=$time.'_'.$idnum; + } + push (@entries,$newid.':'.$newchat."\n"); + my $expired=$time-3600; + open(CHATOUT,'>'.&propath($cdom,$cname).'/chatroom.txt'); + foreach (@entries) { + my ($thistime)=($_=~/(\d+)\_/); + if ($thistime>$expired) { + print CHATOUT $_; + } + } + close(CHATOUT); } sub unsub { Index: loncom/lontrans.pm diff -u loncom/lontrans.pm:1.1 loncom/lontrans.pm:1.2 --- loncom/lontrans.pm:1.1 Fri Aug 2 10:45:04 2002 +++ loncom/lontrans.pm Thu Aug 8 09:45:21 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network # URL translation for User Files # -# $Id: lontrans.pm,v 1.1 2002/08/02 14:45:04 www Exp $ +# $Id: lontrans.pm,v 1.2 2002/08/08 13:45:21 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -33,9 +33,23 @@ use Apache::lonnet(); use Apache::File(); +sub propath { + my ($udom,$uname)=@_; + $udom=~s/\W//g; + $uname=~s/\W//g; + my $subdir=$uname.'__'; + $subdir =~ s/(.)(.)(.).*/$1\/$2\/$3/; + my $proname="$Apache::lonnet::perlvar{'lonUsersDir'}/$udom/$subdir/$uname"; + return $proname; +} + + sub handler { my $r = shift; - return DECLINED; + unless ($r->uri=~/^\/uploaded\//) { return DECLINED; } + my ($dum1,$dum2,$udom,$uname,$ufile)=split(/\//,$r->uri); + $ufile=~s/^[\~\.]+//; + $r->filename(&propath($udom,$uname).'/userfiles/'.$ufile); } 1; Index: loncom/auth/lontokacc.pm diff -u loncom/auth/lontokacc.pm:1.5 loncom/auth/lontokacc.pm:1.6 --- loncom/auth/lontokacc.pm:1.5 Fri Aug 2 10:45:04 2002 +++ loncom/auth/lontokacc.pm Thu Aug 8 09:45:21 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network # Access Handler for User File Transfers # -# $Id: lontokacc.pm,v 1.5 2002/08/02 14:45:04 www Exp $ +# $Id: lontokacc.pm,v 1.6 2002/08/08 13:45:21 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -40,6 +40,10 @@ $r->log_reason("Spoof request ".$reqhost); return FORBIDDEN; } + if ($reqhost eq 'localhost.localdomain') { + $r->register_cleanup(\&removefile); + return OK; + } my $readline; my $lontabdir=$r->dir_config('lonTabDir'); { @@ -64,10 +68,11 @@ sub removefile { my $r=shift; - if ($r->status==HTTP_OK) { + if ($r->status==200) { + unlink($r->filename); &Apache::lonnet::logthis('Unlinking '.$r->filename); } else { - &Apache::lonnet::logthis("Failed to transfer ".$r->filename); + &Apache::lonnet::logthis('Failed to transfer '.$r->filename); } } 1; Index: loncom/auth/lonuploadedacc.pm diff -u loncom/auth/lonuploadedacc.pm:1.1 loncom/auth/lonuploadedacc.pm:1.2 --- loncom/auth/lonuploadedacc.pm:1.1 Fri Aug 2 10:45:04 2002 +++ loncom/auth/lonuploadedacc.pm Thu Aug 8 09:45:21 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network # Access Handler for User Files # -# $Id: lonuploadedacc.pm,v 1.1 2002/08/02 14:45:04 www Exp $ +# $Id: lonuploadedacc.pm,v 1.2 2002/08/08 13:45:21 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -31,11 +31,25 @@ use strict; use Apache::Constants qw(:common :remotehost); use Apache::lonnet(); -use Apache::File(); sub handler { my $r = shift; - return OK; + my $args=$r->args; + &Apache::loncommon::get_unprocessed_cgi($args,['token']); + my ($dum1,$dum2,$udom,$uname,$ufile)=split(/\//,$r->uri); + $ufile=~s/^[\~\.]+//; + my ($server)=($ENV{'form.token'}=~/\_([a-zA-Z0-9]+)$/); + + my $reply=&Apache::lonnet::reply('tokenauthuserfile:'. + $udom.'/'.$uname.'/'.$ufile.':'.$ENV{'form.token'}, + $server); + if ($reply eq 'ok') { + return OK; + } else { + &Apache::lonnet::logthis( +"Refused userfile access $uname at $udom for $ufile from $server with $ENV{'form.token'}: $reply"); + return FORBIDDEN; + } } 1; --www1028814321-- From lon-capa-cvs@mail.lon-capa.org Thu Aug 8 14:46:36 2002 From: lon-capa-cvs@mail.lon-capa.org (www) Date: Thu, 08 Aug 2002 13:46:36 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /html/res/adm/pages chatroom.html Message-ID: www Thu Aug 8 09:46:36 2002 EDT Added files: /loncom/html/res/adm/pages chatroom.html Log: New files to establish chat frameset Index: loncom/html/res/adm/pages/chatroom.html +++ loncom/html/res/adm/pages/chatroom.html From lon-capa-cvs@mail.lon-capa.org Thu Aug 8 15:06:08 2002 From: lon-capa-cvs@mail.lon-capa.org (www) Date: Thu, 08 Aug 2002 14:06:08 -0000 Subject: [LON-CAPA-cvs] cvs: doc /loncapafiles loncapafiles.lpml Message-ID: www Thu Aug 8 10:06:08 2002 EDT Modified files: /doc/loncapafiles loncapafiles.lpml Log: New files for chatroom Index: doc/loncapafiles/loncapafiles.lpml diff -u doc/loncapafiles/loncapafiles.lpml:1.156 doc/loncapafiles/loncapafiles.lpml:1.157 --- doc/loncapafiles/loncapafiles.lpml:1.156 Wed Aug 7 11:55:40 2002 +++ doc/loncapafiles/loncapafiles.lpml Thu Aug 8 10:06:08 2002 @@ -3,7 +3,7 @@ - + - + HEADER @@ -63,6 +65,9 @@ $r->print(< +
+
About + LON-CAPA help and More Help
FOOTER Index: loncom/interface/lonwizard.pm +++ loncom/interface/lonwizard.pm # This is the LON-CAPA HTML Wizard framework, for wrapping easy # functionality easily. package Apache::lonwizard; use Apache::Constants qw(:common :http); use Apache::loncommon; =head1 lonwizard - HTML "Wizard" framework for LON-CAPA I know how most developers feel about Wizards, but the fact is they are a well-established UI widget that users feel comfortable with. It can take a complicated multi-dimensional problem the user has (such as the canonical Course Parameter example) and turn in into a series of bite-sized one-dimensional questions. Or take the some four-question form and put it in a Wizard, and present the same user with the same form outside of the Wizard, and the user will *think* the Wizard is easier. For the developer, wizards do provide an easy way to bundle easy bits of functionality for the user. It can be easier to write a Wizard then provide another custom interface. All classes are in the Apache::lonwizard namespace. (For a perldoc'ed example of a wizard you can use as an example, see loncourseparmwizard.pm.) =cut # To prevent runaway file counts, this file has lonwizard, # lonwizstate, and other wizard classes. use strict; use HTML::Entities; =pod =head1 Class: lonwizard =head2 lonwizard Attributes =over 4 =item B: The string name of the current state. =item B: The human-readable title of the wizard =item B<STATES>: A hash mapping the string names of states to references to the actual states. =item B<VARS>: Hash that maintains the persistent variable values. =item B<HISTORY>: An array containing the names of the previous states. Used for "back" functionality. =item B<DONE>: A boolean value, true if the wizard has completed. =back =cut sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = {}; # If there is a state from the previous form, use that. If there is no # state, use the start state parameter. if (defined $ENV{"form.CURRENT_STATE"}) { $self->{STATE} = $ENV{"form.CURRENT_STATE"}; } else { $self->{STATE} = "START"; } # set up return URL: Return the user to the referer page, unless the # form has stored a value. if (defined $ENV{"form.RETURN_PAGE"}) { $self->{RETURN_PAGE} = $ENV{"form.RETURN_PAGE"}; } else { $self->{RETURN_PAGE} = $ENV{REFERER}; } $self->{TITLE} = shift; $self->{STATES} = {}; $self->{VARS} = {}; $self->{HISTORY} = {}; $self->{DONE} = 0; bless($self, $class); return $self; } =pod =head2 lonwizard methods =over 2 =item B<new>(title): Returns a new instance of the given wizard type. "title" is the human-readable name of the wizard. A new wizard always starts on the B<START> state name. =item B<declareVars>(varList): Call this function to declare the var names you want the wizard to maintain for you. The wizard will automatically output the hidden form fields and parse the values for you on the next call. =over 2 =item Note that these variables are reserved for the wizard; if you output other form values in your state, you must use other names. For example, declaring "student" will cause the wizard to emit a form value with the name "student"; if your state emits form entries, do not name them "student". =back =cut sub declareVars { my $self = shift; my $varlist = shift; # for each string in the passed in list, foreach my $element ( @{$varlist} ) { # assign the var the default of "" $self->{VARS}{$element} = ""; # if there's a form in the env, use that instead my $envname = "form." . $element; if (defined ($ENV{$envname})) { $self->{VARS}->{$element} = $ENV{$envname}; } } } # Private function; takes all of the declared vars and returns a string # corresponding to the hidden input fields that will re-construct the # variables. sub _saveVars { my $self = shift; my $result = ""; print $self->{VARS}{VAR1}; foreach my $varname (keys %{$self->{VARS}}) { $result .= '<input type="hidden" name="' . HTML::Entities::encode($varname) . '" value="' . HTML::Entities::encode($self->{VARS}{$varname}) . "\" />\n"; } # also save state & return page $result .= '<input type="hidden" name="CURRENT_STATE" value="' . HTML::Entities::encode($self->{STATE}) . '" />' . "\n"; $result .= '<input type="hidden" name="RETURN_PAGE" value="' . HTML::Entities::encode($self->{RETURN_PAGE}) . '" />' . "\n"; return $result; } =pod =item B<registerState>(referenceToStateObj): Registers a state as part of the wizard, so the wizard can use it. The 'referenceToStateObj' should be a reference to an instantiated lonwizstate object. This is normally called at the end of the lonwizstate constructor. =cut sub registerState { my $self = shift; my $state = shift; my $stateName = $state->name(); $self->{STATES}{$stateName} = $state; } =pod =item B<changeState>(stateName): Given a string representing the name of some registered state, this causes the wizard to change to that state. Generally, states will call this. =cut sub changeState { my $self = shift; $self->{STATE} = shift; } =pod =item B<display>(): This is the main method that the handler using the wizard calls. =cut # Done in five phases # 1: Do the post processing for the previous state. # 2: Do the preprocessing for the current state. # 3: Check to see if state changed, if so, postprocess current and move to next. # Repeat until state stays stable. # 4: Render the current state to the screen as an HTML page. sub display { my $self = shift; my $result = ""; # Phase 1: Post processing for state of previous screen (which is actually # the current state), if it wasn't the beginning state. if ($self->{STATE} ne "START" || $ENV{"form.SUBMIT"} eq "Next ->") { my $prevState = $self->{STATES}{$self->{STATE}}; $prevState->postprocess(); } # Note, to handle errors in a state's input that a user must correct, # do not transition in the postprocess, and force the user to correct # the error. # Phase 2: Preprocess current state my $startState = $self->{STATE}; my $state = $self->{STATES}{$startState}; $state->preprocess(); # Phase 3: While the current state is different from the previous state, # keep processing. while ( $startState ne $self->{STATE} ) { $startState = $self->{STATE}; $state = $self->{STATES}{$startState}; $state->preprocess(); } # Phase 4: Display. my $stateTitle = $state->title(); $result .= <<HEADER; <html> <head> <title>LON-CAPA Wizard: $self->{NAME}

LON-CAPA Wizard: $self->{TITLE}

$stateTitle

HEADER $result .= $self->_saveVars(); $result .= $state->render() . "

 

"; if ($self->{STATE} ne $self->{START_STATE}) { $result .= '  '; } if ($self->{DONE}) { my $returnPage = $self->{RETURN_PAGE}; $result .= "End Wizard"; } else { $result .= ''; } $result .= < FOOTER } =pod =item B([name]): Returns the name of the wizard. If a parameter is passed, that will be saved as the name. =cut # Returns/sets the name of this wizard, i.e., "Assignment Parameter" sub title { my $self = shift; if (@_) { $self->{TITLE} = shift}; return $self->{TITLE}; } =pod =item B(): Returns a hash reference containing the stored vars for this wizard. The states use this for variables maintained across states. Example: CgetVars()};> This provides read-only access, apparently. =cut sub getVars { my $self = shift; return ($self->{VARS}); } =pod =item B(key, val): Sets the var named "key" to "val" in the wizard's form array. =cut sub setVar { my $self = shift; my $key = shift; my $val = shift; $self->{VARS}{$key} = $val; print "set $key to $val
"; } =pod =item B(): If a state calls this, the wizard will consider itself completed. The state should display a friendly "Done" message, and the wizard will display a link returning the user to the invoking page, rather then a "Next" button. =cut # A temp function for debugging sub handler { my $r = shift; Apache::loncommon::get_unprocessed_cgi($ENV{QUERY_STRING}); my $mes = "Using this wizard, you can
  • change the due date of an assignment
  • change the due date for a whole map of assignments
  • change the due date for just one person
"; my $wizard = Apache::lonwizard->new("Test Wizard"); my $mesState = Apache::lonwizard::message_state->new($wizard, "START", "Welcome to the Assignment Parameter Wizard", $mes, "NEXT"); my $mesState2 = Apache::lonwizard::choice_state->new($wizard, "NEXT", "Fucking the Cow", "How should the cow be fucked?", "Wow, with so many wonderful choices, how will you choose!?!", "START", "VAR1", {'standing & dildoated','standing & didldoated', 'rotten','rotten', 'sitting','sitting'}); $wizard->declareVars( ["VAR1", "VAR2", "VAR3"] ); $r->print($wizard->display()); return OK; } 1; =head1 Class: lonwizstate A "lonwizstate" object represents a lonwizard state. A "state" is basically what is visible on the screen. For instance, a state may display a radio button dialog with three buttons, and wait for the user to choose one. Several pre-prepared child classes are include in lonwizard. If you create a new wizard type, be sure to add it to lonwizard.pm so others can use it too. =head2 lonwizstate methods These methods should be overridden in derived states, except B which may be sufficient. =over 2 =item B (parentLonWizReference, stateName, stateTitle): Creates a new state and returns it. The first argument is a reference to the parent wizard. The second is the name of the state, which I be unique. The third is the title, which will be displayed on the screen to the human. =item B(): preprocess sets up all of the information the state needs to do its job, such as querying data bases to obtain lists of choices, and sets up data for the render method. If preprocess decides to jump to a new state, it is responsible for manually running post-process, if it so desires. =over 2 =item If this method calls the parent lonwizard's B method to another state, then the state will never be rendered on the screen, and the wizard will move to the specified state. This is useful if the state may only be necessary to clarify an ambiguous input, such as selecting a part from a multi-part problem, which isn't necessary if the problem only has one state. =back =item B(): render returns a string of itself to be rendered to the screen, which the wizard will display. =back =cut package Apache::lonwizard::state; use strict; sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = {}; $self->{WIZARD} = shift; $self->{NAME} = shift; $self->{TITLE} = shift; bless($self); $self->{WIZARD}->registerState($self); return $self; } sub name { my $self = shift; if (@_) { $self->{NAME} = shift}; return $self->{NAME}; } sub title { my $self = shift; if (@_) { $self->{TITLE} = shift}; return $self->{TITLE}; } sub preprocess { return 1; } sub render { return "This is the empty state. If you can see this, it's a bug.\n" } sub postprocess { return 1; } 1; =pod =back =head1 Prepackaged States lonwizard provides several pre-packaged states that you can drop into your Wizard and obtain common functionality. =head2 Class: message_state message_state is a state the simply displays a message. It does not do any pre- or postprocessing. It makes a good initial state, which traditionally is a short message telling the user what they are about to accomplish, and may contain warnings or preconditions that should be fulfilled before using the wizard. =over 4 =item overridden method B(parentLonWizReference, stateName, message, nextState): Two new parameters "message" will be the HTML message displayed to the user, and "nextState" is the name of the next state. =back =cut package Apache::lonwizard::message_state; no strict; @ISA = ("Apache::lonwizard::state"); use strict; sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = bless $proto->SUPER::new(shift, shift, shift); $self->{MESSAGE} = shift; $self->{NEXT_STATE} = shift; return $self; } sub postprocess { my $self = shift; $self->{WIZARD}->changeState($self->{NEXT_STATE}); return 1; } sub render { my $self = shift; return $self->{MESSAGE}; } 1; package Apache::lonwizard::choice_state; no strict; @ISA = ("Apache::lonwizard::state"); use strict; sub new { my $proto = shift; my $class = ref($proto) || $proto; my $self = bless $proto->SUPER::new(shift, shift, shift); $self->{MESSAGE_BEFORE} = shift; $self->{MESSAGE_AFTER} = shift; $self->{NEXT_STATE} = shift; $self->{VAR_NAME} = shift; $self->{CHOICE_HASH} = shift; $self->{NO_CHOICES} = 0; } =pod =head2 Class: choice_state Choice state provides a single choice to the user as a text selection box. You pass it a message and hash containing [human_name] -> [computer_name] entries, and it will display the choices and store the result in the provided variable. If there is only one choice, the state will automatically make it and go to the next state. =over 4 =item overridden method B(parentLonWizReference, stateName, stateTitle, messageBefore, messageAfter, nextState, varName, choiceHash): messageBefore is the HTML text that will be displayed before the choice display, messageAfter will display after. Keys will be sorted according to human name. nextState is the state to proceed to after the choice. varName is the name of the wizard var to store the computer_name answer in. choiceHash is the hash described above. It is optional because you may override it. =cut sub preprocess { my $self = shift; my %choices = %{$self->{CHOICE_HASH}}; my %wizvars = %{$self->{WIZARD}->getVars()}; my @keys = keys(%choices); @keys = sort @keys; if (scalar(@keys) == 0) { # No choices... so prepare to display error message and cancel further execution. $self->{NO_CHOICES} = 1; $self->{WIZARD}->setDone(); return; } if (scalar(@keys) == 1) { # If there is only one choice, pick it and move on. $wizvars{$self->{VAR_NAME}} = $choices{$keys[0]}; $self->{WIZARD}->changeState($self->{NEXT_STATE}); return; } # Otherwise, do normal processing in the render routine. return; } sub determineChoices { return {"NO_CHOICE" => "No choices were given."}; } sub render { my $self = shift; my $result = ""; my $var = $self->{VAR_NAME}; my %choices = %{$self->{CHOICE_HASH}}; if (!defined ($self->{CHOICE_HASH})) { $self->determineChoices(); } my %choices = %{$self->{CHOICE_HASH}}; my @keys = keys (%choices); $result .= "\n\n"; return $result; } sub postprocess { my $self = shift; my $wizard = $self->{WIZARD}; $wizard->setVar($self->{VAR_NAME}, $ENV{"form." . $self->{VAR_NAME} . ".forminput"}); $wizard->changeState($self->{NEXT_STATE}); return 1; } package Apache::lonwizard::switch_state; no strict; @ISA = ("Apache::lonwizard::state"); use strict; --bowersj21028904511-- From lon-capa-cvs@mail.lon-capa.org Fri Aug 9 16:05:03 2002 From: lon-capa-cvs@mail.lon-capa.org (bowersj2) Date: Fri, 09 Aug 2002 15:05:03 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonwizard.pm Message-ID: bowersj2 Fri Aug 9 11:05:03 2002 EDT Removed files: /loncom/interface lonwizard.pm Log: This file is not yet ready for use, or indeed anything else. From lon-capa-cvs@mail.lon-capa.org Fri Aug 9 18:08:19 2002 From: lon-capa-cvs@mail.lon-capa.org (matthew) Date: Fri, 09 Aug 2002 17:08:19 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonmysql.pm Message-ID: matthew Fri Aug 9 13:08:19 2002 EDT Modified files: /loncom/interface lonmysql.pm Log: General cleanups. Added new function &remove_from_table to remove a row from a table. Index: loncom/interface/lonmysql.pm diff -u loncom/interface/lonmysql.pm:1.4 loncom/interface/lonmysql.pm:1.5 --- loncom/interface/lonmysql.pm:1.4 Mon Aug 5 08:43:18 2002 +++ loncom/interface/lonmysql.pm Fri Aug 9 13:08:19 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # MySQL utility functions # -# $Id: lonmysql.pm,v 1.4 2002/08/05 12:43:18 matthew Exp $ +# $Id: lonmysql.pm,v 1.5 2002/08/09 17:08:19 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -481,7 +481,7 @@ # Determine the column order # $db_command = "DESCRIBE $tablename"; - my $sth = $dbh->prepare($db_command); + $sth = $dbh->prepare($db_command); $sth->execute(); if ($sth->err) { $errorstring = "$dbh ATTEMPTED:\n".$db_command."\nRESULTING ERROR:\n". @@ -609,7 +609,6 @@ ############################### sub get_new_table_id { my $newid = 0; - my $name_regex = '^'.$ENV{'user.name'}.'_'.$ENV{'user.domain'}."_(\d+)\$"; my @tables = &tables_in_db(); foreach (@tables) { if (/^$ENV{'user.name'}_$ENV{'user.domain'}_(\d+)$/) { @@ -738,7 +737,7 @@ ########################################### sub tables_in_db { return undef if (!defined(&connect_to_db())); - my $sth=$dbh->prepare('SHOW TABLES;'); + my $sth=$dbh->prepare('SHOW TABLES'); $sth->execute(); if ($sth->err) { $errorstring = "$dbh ATTEMPTED:\n".'SHOW TABLES'. @@ -808,6 +807,41 @@ return $result; } +########################################### + +=pod + +=item &remove_from_table($table_id,$column,$value) + +Executes a "delete from $tableid where $column like binary '$value'". + +=cut + +########################################### +sub remove_from_table { + my ($table_id,$column,$value) = @_; + return undef if (!defined(&connect_to_db())); + # + $table_id = &translate_id($table_id); + my $command = 'DELETE FROM '.$table_id.' WHERE '.$dbh->quote($column). + " LIKE BINARY ".$dbh->quote($value); + my $sth = $dbh->prepare($command); + $sth->execute(); + if ($sth->err) { + $errorstring = "ERROR on execution of ".$command."\n".$sth->errstr; + return undef; + } + my $rows = $sth->rows; + return $rows; +} + + 1; __END__; + +=pod + +=back + +=cut From lon-capa-cvs@mail.lon-capa.org Fri Aug 9 18:43:30 2002 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Fri, 09 Aug 2002 17:43:30 -0000 Subject: [LON-CAPA-cvs] cvs: loncom / lond Message-ID: albertel Fri Aug 9 13:43:30 2002 EDT Modified files: /loncom lond Log: - mkdir needs 2 arguments Index: loncom/lond diff -u loncom/lond:1.87 loncom/lond:1.88 --- loncom/lond:1.87 Fri Aug 9 06:05:00 2002 +++ loncom/lond Fri Aug 9 13:43:30 2002 @@ -2,7 +2,7 @@ # The LearningOnline Network # lond "LON Daemon" Server (port "LOND" 5663) # -# $Id: lond,v 1.87 2002/08/09 10:05:00 www Exp $ +# $Id: lond,v 1.88 2002/08/09 17:43:30 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -952,7 +952,7 @@ my ($cmd,$fname)=split(/:/,$userinput); my ($udom,$uname,$ufile)=split(/\//,$fname); my $udir=propath($udom,$uname).'/userfiles'; - unless (-e $udir) { mkdir($udir); } + unless (-e $udir) { mkdir($udir,0770); } if (-e $udir) { $ufile=~s/^[\.\~]+//; $ufile=~s/\///g; @@ -1573,44 +1573,42 @@ my %hash; my $proname=&propath($cdom,$cname); my @entries=(); - if - (tie(%hash,'GDBM_File',"$proname/nohist_chatroom.db",&GDBM_READER(),0640)) - { - @entries=map { $_.':'.$hash{$_} } sort keys %hash; - untie %hash; + if (tie(%hash,'GDBM_File',"$proname/nohist_chatroom.db", + &GDBM_READER(),0640)) { + @entries=map { $_.':'.$hash{$_} } sort keys %hash; + untie %hash; } return @entries; } sub chatadd { - my ($cdom,$cname,$newchat)=@_; - my %hash; - my $proname=&propath($cdom,$cname); - my @entries=(); - if - (tie(%hash,'GDBM_File',"$proname/nohist_chatroom.db",&GDBM_WRCREAT(),0640)) - { - @entries=map { $_.':'.$hash{$_} } sort keys %hash; - my $time=time; - my ($lastid)=($entries[$#entries]=~/^(\w+)\:/); - my ($thentime,$idnum)=split(/\_/,$lastid); - my $newid=$time.'_000000'; - if ($thentime==$time) { - $idnum=~s/^0+//; - $idnum++; - $idnum=substr('000000'.$idnum,-6,6); - $newid=$time.'_'.$idnum; - } - $hash{$newid}=$newchat; - my $expired=$time-3600; - foreach (keys %hash) { - my ($thistime)=($_=~/(\d+)\_/); - if ($thistime<$expired) { - undef $hash{$_}; - } + my ($cdom,$cname,$newchat)=@_; + my %hash; + my $proname=&propath($cdom,$cname); + my @entries=(); + if (tie(%hash,'GDBM_File',"$proname/nohist_chatroom.db", + &GDBM_WRCREAT(),0640)) { + @entries=map { $_.':'.$hash{$_} } sort keys %hash; + my $time=time; + my ($lastid)=($entries[$#entries]=~/^(\w+)\:/); + my ($thentime,$idnum)=split(/\_/,$lastid); + my $newid=$time.'_000000'; + if ($thentime==$time) { + $idnum=~s/^0+//; + $idnum++; + $idnum=substr('000000'.$idnum,-6,6); + $newid=$time.'_'.$idnum; + } + $hash{$newid}=$newchat; + my $expired=$time-3600; + foreach (keys %hash) { + my ($thistime)=($_=~/(\d+)\_/); + if ($thistime<$expired) { + undef $hash{$_}; + } + } + untie %hash; } - untie %hash; - } } sub unsub { From lon-capa-cvs@mail.lon-capa.org Fri Aug 9 18:57:48 2002 From: lon-capa-cvs@mail.lon-capa.org (matthew) Date: Fri, 09 Aug 2002 17:57:48 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /publisher lonpublisher.pm Message-ID: matthew Fri Aug 9 13:57:48 2002 EDT Modified files: /loncom/publisher lonpublisher.pm Log: Bug 561 - nonexistant metadata table produces a user-visible error now. Changed to use lonmysql to access the MySQL database and do the insertion/ deletion of elements. Removed some old POD documentation. Index: loncom/publisher/lonpublisher.pm diff -u loncom/publisher/lonpublisher.pm:1.88 loncom/publisher/lonpublisher.pm:1.89 --- loncom/publisher/lonpublisher.pm:1.88 Wed Aug 7 15:59:06 2002 +++ loncom/publisher/lonpublisher.pm Fri Aug 9 13:57:48 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Publication Handler # -# $Id: lonpublisher.pm,v 1.88 2002/08/07 19:59:06 albertel Exp $ +# $Id: lonpublisher.pm,v 1.89 2002/08/09 17:57:48 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -75,6 +75,7 @@ use DBI; use Apache::lonnet(); use Apache::loncommon(); +use Apache::lonmysql; my %addid; my %nokey; @@ -467,6 +468,62 @@ return ($outstring,%allow); } +######################################### +######################################### + +=pod + +=item store_metadata + +Store the metadata in the metadata table in the loncapa database. +Uses lonmysql to access the database. + +Inputs: \%metadata + +Returns: (error,status). error is undef on success, status is undef on error. + +=cut + +######################################### +######################################### +sub store_metadata { + my %metadata = %{shift()}; + my $error; + # Determine if the table exists + my $status = &Apache::lonmysql::check_table('metadata'); + if (! defined($status)) { + $error='WARNING: Cannot connect to '. + 'database!'; + &Apache::lonnet::logthis($error); + return ($error,undef); + } + if ($status == 0) { + # It would be nice to actually create the table.... + $error ='WARNING: The metadata table does not '. + 'exist in the LON-CAPA database.'; + &Apache::lonnet::logthis($error); + return ($error,undef); + } + # Remove old value from table + $status = &Apache::lonmysql::remove_from_table + ('metadata','url',$metadata{'url'}); + if (! defined($status)) { + $error = 'Error when removing old values from '. + 'metadata table in LON-CAPA database.'; + &Apache::lonnet::logthis($error); + return ($error,undef); + } + # Store data in table. + $status = &Apache::lonmysql::store_row('metadata',\%metadata); + if (! defined($status)) { + $error='Error occured storing new values in '. + 'metadata table in LON-CAPA database'; + &Apache::lonnet::logthis($error); + return ($error,undef); + } + return (undef,$status); +} + sub publish { my ($source,$target,$style)=@_; @@ -858,65 +915,23 @@ } # -------------------------------- Synchronize entry with SQL metadata database - my $warning; - - unless ($metadatafields{'copyright'} eq 'priv') { - - my $dbh; - { - unless ( - $dbh = DBI->connect("DBI:mysql:loncapa","www", - $Apache::lonnet::perlvar{'lonSqlAccess'},{ RaiseError =>0,PrintError=>0}) - ) { - $warning='WARNING: Cannot connect to '. - 'database!'; - } - else { - my %sqldatafields; - $sqldatafields{'url'}=$distarget; - my $sth=$dbh->prepare( - 'delete from metadata where url like binary'. - '"'.$sqldatafields{'url'}.'"'); - $sth->execute(); - foreach ('title','author','subject','keywords','notes','abstract', - 'mime','language','creationdate','lastrevisiondate','owner', - 'copyright') { - my $field=$metadatafields{$_}; $field=~s/\"/\'\'/g; - $sqldatafields{$_}=$field; - } - - $sth=$dbh->prepare('insert into metadata values ('. - '"'.delete($sqldatafields{'title'}).'"'.','. - '"'.delete($sqldatafields{'author'}).'"'.','. - '"'.delete($sqldatafields{'subject'}).'"'.','. - '"'.delete($sqldatafields{'url'}).'"'.','. - '"'.delete($sqldatafields{'keywords'}).'"'.','. - '"'.'current'.'"'.','. - '"'.delete($sqldatafields{'notes'}).'"'.','. - '"'.delete($sqldatafields{'abstract'}).'"'.','. - '"'.delete($sqldatafields{'mime'}).'"'.','. - '"'.delete($sqldatafields{'language'}).'"'.','. - '"'. - sqltime(delete($sqldatafields{'creationdate'})) - .'"'.','. - '"'. - sqltime(delete( - $sqldatafields{'lastrevisiondate'})).'"'.','. - '"'.delete($sqldatafields{'owner'}).'"'.','. - '"'.delete( - $sqldatafields{'copyright'}).'"'.')'); - $sth->execute(); - $dbh->disconnect; - $scrout.='

Synchronized SQL metadata database'; - print $logfile "\nSynchronized SQL metadata database"; - } + my $warning; + $metadatafields{'url'} = $distarget; + $metadatafields{'version'} = 'current'; + unless ($metadatafields{'copyright'} eq 'priv') { + my ($error,$success) = &store_metadata(\%metadatafields); + if (! $success) { + $scrout.='

Synchronized SQL metadata database'; + print $logfile "\nSynchronized SQL metadata database"; + } else { + $warning.=$error; + print $logfile "\n".$error; + } + } else { + $scrout.='

Private Publication - did not synchronize database'; + print $logfile "\nPrivate: Did not synchronize data into ". + "SQL metadata database"; } - -} else { - $scrout.='

Private Publication - did not synchronize database'; - print $logfile "\nPrivate: Did not synchronize data into ". - "SQL metadata database"; -} # ----------------------------------------------------------- Copy old versions if (-e $target) { @@ -1210,107 +1225,9 @@ 1; __END__ -=head1 NAME - -Apache::lonpublisher - Publication Handler - -=head1 SYNOPSIS - -Invoked by /etc/httpd/conf/srm.conf: - - - PerlAccessHandler Apache::lonacc - SetHandler perl-script - PerlHandler Apache::lonpublisher - ErrorDocument 403 /adm/login - ErrorDocument 404 /adm/notfound.html - ErrorDocument 406 /adm/unauthorized.html - ErrorDocument 500 /adm/errorhandler - - -=head1 INTRODUCTION - -This module publishes a file. This involves gathering metadata, -versioning the file, copying file from construction space to -publication space, and copying metadata from construction space -to publication space. - -This is part of the LearningOnline Network with CAPA project -described at http://www.lon-capa.org. - -=head1 HANDLER SUBROUTINE - -This routine is called by Apache and mod_perl. - -=over 4 - -=item * - -Get query string for limited number of parameters - -=item * - -Check filename - -=item * - -File is there and owned, init lookup tables - -=item * - -Start page output - -=item * - -Individual file - -=item * - -publish from $thisfn to $thistarget with $thisembstyle - -=back - -=head1 OTHER SUBROUTINES - -=over 4 - -=item * - -metaeval() : Evaluate string with metadata - -=item * - -metaread() : Read a metadata file - -=item * - -sqltime() : convert 'time' format into a datetime sql format - -=item * - -textfield() : form field - -=item * - -hiddenfield() : form field - -=item * - -selectbox() : form field - -=item * - -urlfixup() : fixup URL (Publication Step One) - -=item * - -publish() : publish (Publication Step One) - -=item * - -phasetwo() : render second interface showing status of publication steps -(Publication Step Two) +=pod =back =cut + From lon-capa-cvs@mail.lon-capa.org Fri Aug 9 18:59:14 2002 From: lon-capa-cvs@mail.lon-capa.org (matthew) Date: Fri, 09 Aug 2002 17:59:14 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /publisher lonpublisher.pm Message-ID: This is a MIME encoded message --matthew1028915954 Content-Type: text/plain matthew Fri Aug 9 13:59:14 2002 EDT Modified files: /loncom/publisher lonpublisher.pm Log: POD Documentation update. --matthew1028915954 Content-Type: text/plain Content-Disposition: attachment; filename="matthew-20020809135914.txt" Index: loncom/publisher/lonpublisher.pm diff -u loncom/publisher/lonpublisher.pm:1.89 loncom/publisher/lonpublisher.pm:1.90 --- loncom/publisher/lonpublisher.pm:1.89 Fri Aug 9 13:57:48 2002 +++ loncom/publisher/lonpublisher.pm Fri Aug 9 13:59:14 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Publication Handler # -# $Id: lonpublisher.pm,v 1.89 2002/08/09 17:57:48 matthew Exp $ +# $Id: lonpublisher.pm,v 1.90 2002/08/09 17:59:14 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -61,6 +61,43 @@ ## ## ############################################################################### + +###################################################################### +###################################################################### + +=pod + +=head1 Name + +lonpublisher - LON-CAPA publishing handler + +=head1 Synopsis + +lonpublisher takes the proper steps to add resources to the LON-CAPA +digital library. This includes updating the metadata table in the +LON-CAPA database. + +=head1 Description + +lonpublisher is many things to many people. +To all people it is woefully documented. +This documentation conforms to this standard. + +This module publishes a file. This involves gathering metadata, +versioning the file, copying file from construction space to +publication space, and copying metadata from construction space +to publication space. + +=head2 Internal Functions + +=over 4 + +=cut + +###################################################################### +###################################################################### + + package Apache::lonpublisher; # ------------------------------------------------- modules used by this module @@ -88,7 +125,19 @@ my $cuname; my $cudom; -# ----------------------------------------------- Evaluate string with metadata +######################################### +######################################### + +=pod + +=item metaeval + +Evaluate string with metadata + +=cut + +######################################### +######################################### sub metaeval { my $metastring=shift; @@ -131,7 +180,19 @@ } } -# -------------------------------------------------------- Read a metadata file +######################################### +######################################### + +=pod + +=item metaread + +Read a metadata file + +=cut + +######################################### +######################################### sub metaread { my ($logfile,$fn)=@_; unless (-e $fn) { @@ -148,7 +209,19 @@ return '
Processed file: '.$fn.''; } -# ---------------------------- convert 'time' format into a datetime sql format +######################################### +######################################### + +=pod + +=item sqltime + +Convert 'time' format into a datetime sql format + +=cut + +######################################### +######################################### sub sqltime { my $timef=shift @_; my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = @@ -157,8 +230,28 @@ return "$year-$mon-$mday $hour:$min:$sec"; } -# --------------------------------------------------------- Various form fields +######################################### +######################################### + +=pod + +=item Form field generating functions + +=over 4 + +=item textfield + +=item hiddenfield + +=item selectbox + +=back + +=cut + +######################################### +######################################### sub textfield { my ($title,$name,$value)=@_; return "\n

$title:
". @@ -185,8 +278,19 @@ return $selout.''; } -# -------------------------------------------------------- Publication Step One +######################################### +######################################### + +=pod + +=item urlfixup + +Fix up a url? First step of publication +=cut + +######################################### +######################################### sub urlfixup { my ($url,$target)=@_; unless ($url) { return ''; } @@ -207,7 +311,19 @@ return $url; } +######################################### +######################################### + +=pod + +=item absoluteurl + +Currently undocumented + +=cut +######################################### +######################################### sub absoluteurl { my ($url,$target)=@_; unless ($url) { return ''; } @@ -218,6 +334,19 @@ return $url; } +######################################### +######################################### + +=pod + +=item set_allow + +Currently undocumented + +=cut + +######################################### +######################################### sub set_allow { my ($allow,$logfile,$target,$tag,$oldurl)=@_; my $newurl=&urlfixup($oldurl,$target); @@ -236,6 +365,19 @@ return $return_url } +######################################### +######################################### + +=pod + +=item get_subscribed_hosts + +Currently undocumented + +=cut + +######################################### +######################################### sub get_subscribed_hosts { my ($target)=@_; my @subscribed; @@ -269,6 +411,19 @@ } +######################################### +######################################### + +=pod + +=item get_max_ids_indices + +Currently undocumented + +=cut + +######################################### +######################################### sub get_max_ids_indices { my ($content)=@_; my $maxindex=10; @@ -300,6 +455,19 @@ return ($needsfixup,$maxid,$maxindex); } +######################################### +######################################### + +=pod + +=item get_all_text_unbalanced + +Currently undocumented + +=cut + +######################################### +######################################### sub get_all_text_unbalanced { #there is a copy of this in lonxml.pm my($tag,$pars)= @_; @@ -329,6 +497,19 @@ return $result } +######################################### +######################################### + +=pod + +=item fix_ids_and_indices + +Currently undocumented + +=cut + +######################################### +######################################### #Arguably this should all be done as a lonnet::ssi instead sub fix_ids_and_indices { my ($logfile,$source,$target)=@_; @@ -524,6 +705,19 @@ return (undef,$status); } +######################################### +######################################### + +=pod + +=item publish + +Currently undocumented. This is the workhorse function of this module. + +=cut + +######################################### +######################################### sub publish { my ($source,$target,$style)=@_; @@ -843,8 +1037,20 @@ '

'; } -# -------------------------------------------------------- Publication Step Two +######################################### +######################################### + +=pod + +=item phasetwo + +Render second interface showing status of publication steps. +This is publication step two. + +=cut +######################################### +######################################### sub phasetwo { my ($source,$target,$style,$distarget)=@_; @@ -1067,8 +1273,36 @@ } -# ================================================================ Main Handler +######################################### +######################################### + +=pod + +=item handler + +A basic outline of the handler subroutine follows. + +=over 4 + +=item Get query string for limited number of parameters + +=item Check filename + +=item File is there and owned, init lookup tables + +=item Start page output + +=item Individual file + +=item publish from $thisfn to $thistarget with $thisembstyle + +=back + +=cut + +######################################### +######################################### sub handler { my $r=shift; --matthew1028915954-- From lon-capa-cvs@mail.lon-capa.org Fri Aug 9 19:03:05 2002 From: lon-capa-cvs@mail.lon-capa.org (matthew) Date: Fri, 09 Aug 2002 18:03:05 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /publisher lonpublisher.pm Message-ID: matthew Fri Aug 9 14:03:05 2002 EDT Modified files: /loncom/publisher lonpublisher.pm Log: Fixed bonehead logic error. Index: loncom/publisher/lonpublisher.pm diff -u loncom/publisher/lonpublisher.pm:1.90 loncom/publisher/lonpublisher.pm:1.91 --- loncom/publisher/lonpublisher.pm:1.90 Fri Aug 9 13:59:14 2002 +++ loncom/publisher/lonpublisher.pm Fri Aug 9 14:03:05 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Publication Handler # -# $Id: lonpublisher.pm,v 1.90 2002/08/09 17:59:14 matthew Exp $ +# $Id: lonpublisher.pm,v 1.91 2002/08/09 18:03:05 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1126,7 +1126,7 @@ $metadatafields{'version'} = 'current'; unless ($metadatafields{'copyright'} eq 'priv') { my ($error,$success) = &store_metadata(\%metadatafields); - if (! $success) { + if ($success) { $scrout.='

Synchronized SQL metadata database'; print $logfile "\nSynchronized SQL metadata database"; } else { From lon-capa-cvs@mail.lon-capa.org Fri Aug 9 19:06:46 2002 From: lon-capa-cvs@mail.lon-capa.org (sakharuk) Date: Fri, 09 Aug 2002 18:06:46 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm Message-ID: sakharuk Fri Aug 9 14:06:46 2002 EDT Modified files: /loncom/interface lonprintout.pm Log: Added co-author on the same foot as author. Index: loncom/interface/lonprintout.pm diff -u loncom/interface/lonprintout.pm:1.47 loncom/interface/lonprintout.pm:1.48 --- loncom/interface/lonprintout.pm:1.47 Mon Aug 5 15:18:43 2002 +++ loncom/interface/lonprintout.pm Fri Aug 9 14:06:46 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.47 2002/08/05 19:18:43 sakharuk Exp $ +# $Id: lonprintout.pm,v 1.48 2002/08/09 18:06:46 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -72,7 +72,7 @@ Current document (you will print what you see on the screen)
ENDMENUOUT1 - if (not $ENV{'request.role'}=~m/^au\./) { + if ((not $ENV{'request.role'}=~m/^au\./) and (not $ENV{'request.role'}=~m/^ca\./)) { $r->print(< All problems from the primary sequence
The whole primary sequence (problems plus all html and xml files)
@@ -140,12 +140,15 @@ my $laystyle = 'book'; my $result = ''; my $number_of_columns = 1; +# my $number_of_columns = $ENV{'form.numberofcolumns'}; if ($choice eq 'Standard LaTeX output for current document') { #-- single document - problem, page, html, xml my %moreenv; $moreenv{'form.grade_target'}='tex'; - if ($ENV{'request.role'}=~m/^au\./) {$ENV{'form.url'}=~s/http:\/\/[^\/]+//;} + if ($ENV{'request.role'}=~m/^au\./ or $ENV{'request.role'}=~m/^ca\./) { + $ENV{'form.url'}=~s/http:\/\/[^\/]+//; + } $moreenv{'request.filename'}=$ENV{'form.url'}; &Apache::lonnet::appenv(%moreenv); my $texversion=&Apache::lonnet::ssi($ENV{'form.url'}); @@ -200,19 +203,49 @@ my $file=&Apache::lonnet::filelocation("",$main_seq); my $filecontents=&Apache::lonnet::getfile($file); my @file_seq = &content_map($filecontents); + for (my $iu=0;$iu<=$#file_seq;$iu++) { + $file_seq[$iu]=~s/^"//; + $file_seq[$iu]=~s/"$//; + $file_seq[$iu]=&Apache::lonnet::filelocation("",$file_seq[$iu]); +#remove $result .= ' SSS '.$file_seq[$iu].' FFF '; + } + my $i=0; + while ($i<=$#file_seq) { + unless ($file_seq[$i]=~m/\.(problem|page)/) { + if ($file_seq[$i]=~m/\.sequence/) { + my $filecontents=&Apache::lonnet::getfile($file_seq[$i]); + my @newfile_seq = &content_map($filecontents); + $result .=' START '.$i.' LOOK '.$filecontents.' FINISH '; +# splice @file_seq,$1,1,@newfile_seq; +# $i=-1; + } else { + splice @file_seq,$1,1; + } + } + + + + + $i++; + } + for (my $iu=0;$iu<=$#file_seq;$iu++) { + $result .= ' SSS '.$file_seq[$iu].' FFF '; + } + + # do we have any other sequence inside? # $result.=$#file_seq.' '; - my $i=1; - while ($i<=$#file_seq) { +## my $i=1; +## while ($i<=$#file_seq) { # $result.=' '.$file_seq[$i].' '; - $file_seq[$i]=~s/^"//; - $file_seq[$i]=~s/"$//; - if ($file_seq[$i]=~m/\.sequence\s*$/) { - $file = &Apache::lonnet::filelocation("",$file_seq[$i]); +## $file_seq[$i]=~s/^"//; +## $file_seq[$i]=~s/"$//; +## if ($file_seq[$i]=~m/\.sequence\s*$/) { +## $file = &Apache::lonnet::filelocation("",$file_seq[$i]); # $result.=' location '.$file.' '; # $result .= 'FFFFFFFFF'.$file.' '; - $filecontents=&Apache::lonnet::getfile($file); - @add_file_seq = &content_map($filecontents); +## $filecontents=&Apache::lonnet::getfile($file); +## @add_file_seq = &content_map($filecontents); # # for (my $iu=0;$iu<=$#add_file_seq;$iu++) { @@ -221,14 +254,14 @@ # - splice(@file_seq,$i,1,@add_file_seq); - @add_file_seq = (); - $i = -1; - } - $i++; - last; #do not forget to remove - } - @master_seq = @file_seq; +## splice(@file_seq,$i,1,@add_file_seq); +## @add_file_seq = (); +## $i = -1; +## } +## $i++; +## last; #do not forget to remove +## } +## @master_seq = @file_seq; # # for (my $iu=0;$iu<=$#file_seq;$iu++) { @@ -237,32 +270,32 @@ # #-- produce an output string - for (my $i=0;$i<=$#master_seq;$i++) { - $_ = $master_seq[$i]; - m/\"(.*)\"/; - $_ = $1; - my $urlp = $1; - if (/\.(problem|exam|quiz|assess|survey|form|library)/) { - my %moreenv; - $moreenv{'form.grade_target'}='tex'; - &Apache::lonnet::appenv(%moreenv); - my $texversion=&Apache::lonnet::ssi($urlp); - &Apache::lonnet::delenv('form.grade_target'); - $result .= $texversion; - } - } - $result = &additional_cleanup($result); +### for (my $i=0;$i<=$#master_seq;$i++) { +### $_ = $master_seq[$i]; +### m/\"(.*)\"/; +### $_ = $1; +### my $urlp = $1; +### if (/\.(problem|exam|quiz|assess|survey|form|library)/) { +### my %moreenv; +### $moreenv{'form.grade_target'}='tex'; +### &Apache::lonnet::appenv(%moreenv); +### my $texversion=&Apache::lonnet::ssi($urlp); +### &Apache::lonnet::delenv('form.grade_target'); +### $result .= $texversion; +### } +### } +### $result = &additional_cleanup($result); } elsif ($choice eq 'Subdirectory print') { my $subdirtoprint = &Apache::lonnet::filelocation("",$ENV{'form.url'}); $subdirtoprint =~ s/\/[^\/]+$//; my @list_of_files = (); - if ($ENV{'request.role'}=~m/^au\./) { + if ($ENV{'request.role'}=~m/^au\./ or $ENV{'request.role'}=~m/^ca\./) { $subdirtoprint =~ s/^[^~]*~(\w+)\//\/home\/$1\/public_html\//; } else { $subdirtoprint =~ s/.*(\/res\/)/$1/; } my @content_directory = (); - if ($ENV{'request.role'}=~m/^au\./) { + if ($ENV{'request.role'}=~m/^au\./ or $ENV{'request.role'}=~m/^ca\./) { @content_directory = &Apache::lonnet::dirlist($subdirtoprint,$ENV{'user.domain'}, $ENV{'user.name'},''); } else { @content_directory = &Apache::lonnet::dirlist($subdirtoprint); @@ -279,7 +312,9 @@ my %moreenv; $moreenv{'form.grade_target'}='tex'; &Apache::lonnet::appenv(%moreenv); - if ($ENV{'request.role'}=~m/^au\./) { $urlp =~ s/\/home\/([^\/]*)\/public_html/\/~$1/; } + if ($ENV{'request.role'}=~m/^au\./ or $ENV{'request.role'}=~m/^ca\./) { + $urlp =~ s/\/home\/([^\/]*)\/public_html/\/~$1/; + } my $texversion=&Apache::lonnet::ssi($urlp); &Apache::lonnet::delenv('form.grade_target'); $texversion =~ s/(\\begin{document})/$1 {\\tiny\\begin{verbatim}$urlp\\end{verbatim}}/; @@ -326,7 +361,6 @@ $result =~ s/\s%/\\%/g; #corrects % $result =~ s/(\s)+/$1/g; #removes more than one empty space $result =~ s/\\\\\s*\\vskip/\\vskip/gm; -# $result =~ s/ (<|>|) / \$$1\$ /g; #corrects < or > $result =~ s/\\\\\s*\\noindent\s*(\\\\)+/\\\\\\noindent /g; $result =~ s/{\\par }\s*\\\\/\\\\/gm; $result =~ s/\\\\\s+\[/ \[/g; From lon-capa-cvs@mail.lon-capa.org Fri Aug 9 19:12:19 2002 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Fri, 09 Aug 2002 18:12:19 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm Message-ID: albertel Fri Aug 9 14:12:19 2002 EDT Modified files: /loncom/lonnet/perl lonnet.pm Log: - updated str2array and other associated calls to work better with mixed arrays and hashes, BUG#548 - based on work done by stredwic Index: loncom/lonnet/perl/lonnet.pm diff -u loncom/lonnet/perl/lonnet.pm:1.264 loncom/lonnet/perl/lonnet.pm:1.265 --- loncom/lonnet/perl/lonnet.pm:1.264 Thu Aug 8 16:33:50 2002 +++ loncom/lonnet/perl/lonnet.pm Fri Aug 9 14:12:19 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.264 2002/08/08 20:33:50 matthew Exp $ +# $Id: lonnet.pm,v 1.265 2002/08/09 18:12:19 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1000,97 +1000,195 @@ } } +sub get_scalar { + my ($string,$end) = @_; + my $value; + if ($$string =~ s/^([^&]*?)($end)/$2/) { + $value = $1; + } elsif ($$string =~ s/^([^&]*?)&//) { + $value = $1; + } + return &unescape($value); +} + +sub array2str { + my (@array) = @_; + my $result=&arrayref2str(\@array); + $result=~s/^__ARRAY_REF__//; + $result=~s/__END_ARRAY_REF__$//; + return $result; +} + sub arrayref2str { my ($arrayref) = @_; - my $result='_ARRAY_REF__'; + my $result='__ARRAY_REF__'; foreach my $elem (@$arrayref) { - if (ref($elem) eq 'ARRAY') { - $result.=&escape(&arrayref2str($elem)).'&'; - } elsif (ref($elem) eq 'HASH') { - $result.=&escape(&hashref2str($elem)).'&'; - } elsif (ref($elem)) { - &logthis("Got a ref of ".(ref($elem))." skipping."); + if(ref($elem) eq 'ARRAY') { + $result.=&arrayref2str($elem).'&'; + } elsif(ref($elem) eq 'HASH') { + $result.=&hashref2str($elem).'&'; + } elsif(ref($elem)) { + #print("Got a ref of ".(ref($elem))." skipping."); } else { $result.=&escape($elem).'&'; } } $result=~s/\&$//; + $result .= '__END_ARRAY_REF__'; return $result; } sub hash2str { my (%hash) = @_; my $result=&hashref2str(\%hash); - $result=~s/^_HASH_REF__//; + $result=~s/^__HASH_REF__//; + $result=~s/__END_HASH_REF__$//; return $result; } sub hashref2str { my ($hashref)=@_; - my $result='_HASH_REF__'; + my $result='__HASH_REF__'; foreach (keys(%$hashref)) { if (ref($_) eq 'ARRAY') { - $result.=&escape(&arrayref2str($_)).'='; + $result.=&arrayref2str($_).'='; } elsif (ref($_) eq 'HASH') { - $result.=&escape(&hashref2str($_)).'='; + $result.=&hashref2str($_).'='; } elsif (ref($_)) { - &logthis("Got a ref of ".(ref($_))." skipping."); + $result.='='; + #print("Got a ref of ".(ref($_))." skipping."); } else { - $result.=&escape($_).'='; + if ($_) {$result.=&escape($_).'=';} else { last; } } - if (ref($$hashref{$_}) eq 'ARRAY') { - $result.=&escape(&arrayref2str($$hashref{$_})).'&'; - } elsif (ref($$hashref{$_}) eq 'HASH') { - $result.=&escape(&hashref2str($$hashref{$_})).'&'; - } elsif (ref($$hashref{$_})) { - &logthis("Got a ref of ".(ref($$hashref{$_}))." skipping."); + if(ref($hashref->{$_}) eq 'ARRAY') { + $result.=&arrayref2str($hashref->{$_}).'&'; + } elsif(ref($hashref->{$_}) eq 'HASH') { + $result.=&hashref2str($hashref->{$_}).'&'; + } elsif(ref($hashref->{$_})) { + $result.='&'; + #print("Got a ref of ".(ref($hashref->{$_}))." skipping."); } else { - $result.=&escape($$hashref{$_}).'&'; + $result.=&escape($hashref->{$_}).'&'; } } $result=~s/\&$//; + $result .= '__END_HASH_REF__'; return $result; } sub str2hash { + my ($string)=@_; + my ($hash)=&str2hashref('__HASH_REF__'.$string.'__END_HASH_REF__'); + return %$hash; +} + +sub str2hashref { my ($string) = @_; - my %returnhash; - foreach (split(/\&/,$string)) { - my ($name,$value)=split(/\=/,$_); - $name=&unescape($name); - $value=&unescape($value); - if ($value =~ /^_HASH_REF__/) { - $value =~ s/^_HASH_REF__//; - my %hash=&str2hash($value); - $value=\%hash; - } elsif ($value =~ /^_ARRAY_REF__/) { - $value =~ s/^_ARRAY_REF__//; - my @array=&str2array($value); - $value=\@array; - } - $returnhash{$name}=$value; + + my %hash; + + if($string !~ /^__HASH_REF__/) { + if (! ($string eq '' || !defined($string))) { + $hash{'error'}='Not hash reference'; + } + return (\%hash, $string); + } + + $string =~ s/^__HASH_REF__//; + + while($string !~ /^__END_HASH_REF__/) { + #key + my $key=''; + if($string =~ /^__HASH_REF__/) { + ($key, $string)=&str2hashref($string); + if(defined($key->{'error'})) { + $hash{'error'}='Bad data'; + return (\%hash, $string); + } + } elsif($string =~ /^__ARRAY_REF__/) { + ($key, $string)=&str2arrayref($string); + if($key->[0] eq 'Array reference error') { + $hash{'error'}='Bad data'; + return (\%hash, $string); + } + } else { + $string =~ s/^(.*?)=//; + $key=$1 + } + $string =~ s/^=//; + + #value + my $value=''; + if($string =~ /^__HASH_REF__/) { + ($value, $string)=&str2hashref($string); + if(defined($value->{'error'})) { + $hash{'error'}='Bad data'; + return (\%hash, $string); + } + } elsif($string =~ /^__ARRAY_REF__/) { + ($value, $string)=&str2arrayref($string); + if($value->[0] eq 'Array reference error') { + $hash{'error'}='Bad data'; + return (\%hash, $string); + } + } else { + $value=&get_scalar(\$string,'__END_HASH_REF__'); + } + $string =~ s/^&//; + + $hash{$key}=$value; } - return (%returnhash); + + $string =~ s/^__END_HASH_REF__//; + + return (\%hash, $string); } sub str2array { + my ($string)=@_; + my ($array)=&str2arrayref('__ARRAY_REF__'.$string.'__END_ARRAY_REF__'); + return @$array; +} + +sub str2arrayref { my ($string) = @_; - my @returnarray; - foreach my $value (split(/\&/,$string)) { - $value=&unescape($value); - if ($value =~ /^_HASH_REF__/) { - $value =~ s/^_HASH_REF__//; - my %hash=&str2hash($value); - $value=\%hash; - } elsif ($value =~ /^_ARRAY_REF__/) { - $value =~ s/^_ARRAY_REF__//; - my @array=&str2array($value); - $value=\@array; - } - push(@returnarray,$value); + my @array; + + if($string !~ /^__ARRAY_REF__/) { + if (! ($string eq '' || !defined($string))) { + $array[0]='Array reference error'; + } + return (\@array, $string); } - return (@returnarray); + + $string =~ s/^__ARRAY_REF__//; + + while($string !~ /^__END_ARRAY_REF__/) { + my $value=''; + if($string =~ /^__HASH_REF__/) { + ($value, $string)=&str2hashref($string); + if(defined($value->{'error'})) { + $array[0] ='Array reference error'; + return (\@array, $string); + } + } elsif($string =~ /^__ARRAY_REF__/) { + ($value, $string)=&str2arrayref($string); + if($value->[0] eq 'Array reference error') { + $array[0] ='Array reference error'; + return (\@array, $string); + } + } else { + $value=&get_scalar(\$string,'__END_ARRAY_REF__'); + } + $string =~ s/^&//; + + push(@array, $value); + } + + $string =~ s/^__END_ARRAY_REF__//; + + return (\@array, $string); } # -------------------------------------------------------------------Temp Store From lon-capa-cvs@mail.lon-capa.org Fri Aug 9 19:18:37 2002 From: lon-capa-cvs@mail.lon-capa.org (www) Date: Fri, 09 Aug 2002 18:18:37 -0000 Subject: [LON-CAPA-cvs] cvs: loncom / lond Message-ID: www Fri Aug 9 14:18:37 2002 EDT Modified files: /loncom lond Log: delete, not undef, to remove a hash entry in chatroom Index: loncom/lond diff -u loncom/lond:1.88 loncom/lond:1.89 --- loncom/lond:1.88 Fri Aug 9 13:43:30 2002 +++ loncom/lond Fri Aug 9 14:18:36 2002 @@ -2,7 +2,7 @@ # The LearningOnline Network # lond "LON Daemon" Server (port "LOND" 5663) # -# $Id: lond,v 1.88 2002/08/09 17:43:30 albertel Exp $ +# $Id: lond,v 1.89 2002/08/09 18:18:36 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1604,7 +1604,7 @@ foreach (keys %hash) { my ($thistime)=($_=~/(\d+)\_/); if ($thistime<$expired) { - undef $hash{$_}; + delete $hash{$_}; } } untie %hash; From lon-capa-cvs@mail.lon-capa.org Fri Aug 9 20:49:30 2002 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Fri, 09 Aug 2002 19:49:30 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /build Makefile /interface lonevaluate.pm lonmeta.pm /interface/statistics lonproblemstatistics.pm /lonnet/perl lonnet.pm /publisher lonpublisher.pm doc/loncapafiles reseval_fixup.piml Message-ID: albertel Fri Aug 9 15:49:30 2002 EDT Added files: /doc/loncapafiles reseval_fixup.piml Modified files: /loncom/interface lonevaluate.pm lonmeta.pm /loncom/interface/statistics lonproblemstatistics.pm /loncom/publisher lonpublisher.pm /loncom/lonnet/perl lonnet.pm /loncom/build Makefile Log: - fixes bug#257, moved resevaldata.db to nohist_resevaldata.db, and deletes hist file - After installing these diffs you need to do a make install before restarting the webserver Index: loncom/interface/lonevaluate.pm diff -u loncom/interface/lonevaluate.pm:1.8 loncom/interface/lonevaluate.pm:1.9 --- loncom/interface/lonevaluate.pm:1.8 Fri Mar 29 10:15:54 2002 +++ loncom/interface/lonevaluate.pm Fri Aug 9 15:49:30 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network # Evaluate # -# $Id: lonevaluate.pm,v 1.8 2002/03/29 15:15:54 www Exp $ +# $Id: lonevaluate.pm,v 1.9 2002/08/09 19:49:30 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -67,7 +67,7 @@ my @retrieve=map{ $prefix.$_ } @items; my %currenteval= - &Apache::lonnet::get('resevaldata',\@retrieve,$rdomain,$rauth); + &Apache::lonnet::get('nohist_resevaldata',\@retrieve,$rdomain,$rauth); my $already=($currenteval{$prefix.'timestamp'} ne ''); @@ -103,7 +103,7 @@

Thank you for your input!

ENDHEADER $r->print('Storing feedback: '. - &Apache::lonnet::put('resevaldata',\%currenteval,$rdomain,$rauth)); + &Apache::lonnet::put('nohist_resevaldata',\%currenteval,$rdomain,$rauth)); unless ($already) { $r->print('
Logging first evaluation'); } Index: loncom/interface/lonmeta.pm diff -u loncom/interface/lonmeta.pm:1.15 loncom/interface/lonmeta.pm:1.16 --- loncom/interface/lonmeta.pm:1.15 Fri Mar 29 13:44:41 2002 +++ loncom/interface/lonmeta.pm Fri Aug 9 15:49:30 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Metadata display handler # -# $Id: lonmeta.pm,v 1.15 2002/03/29 18:44:41 www Exp $ +# $Id: lonmeta.pm,v 1.16 2002/08/09 19:49:30 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -47,8 +47,8 @@ my $regexp=&Apache::lonnet::escape($url); $regexp=~s/(\W)/\\$1/g; $regexp='___'.$regexp.'___'; - my %evaldata=&Apache::lonnet::dump - ('resevaldata',$adomain,$aauthor,$regexp); + my %evaldata=&Apache::lonnet::dump('nohist_resevaldata',$adomain, + $aauthor,$regexp); my %sum; my %cnt; my %listitems=('count' => 'add', Index: loncom/interface/statistics/lonproblemstatistics.pm diff -u loncom/interface/statistics/lonproblemstatistics.pm:1.16 loncom/interface/statistics/lonproblemstatistics.pm:1.17 --- loncom/interface/statistics/lonproblemstatistics.pm:1.16 Tue Aug 6 13:38:26 2002 +++ loncom/interface/statistics/lonproblemstatistics.pm Fri Aug 9 15:49:30 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # (Publication Handler # -# $Id: lonproblemstatistics.pm,v 1.16 2002/08/06 17:38:26 minaeibi Exp $ +# $Id: lonproblemstatistics.pm,v 1.17 2002/08/09 19:49:30 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -558,9 +558,10 @@ #check with Gerd $urlres=~/^(\w+)\/(\w+)/; - if ($StdNo) { - &Apache::lonnet::put('resevaldata',\%storestats,$1,$2); - } + if ($StdNo) { + &Apache::lonnet::put('nohist_resevaldata',\%storestats, + $1,$2); + } #-------------------------------- Row of statistical table &TableRow($cache,$join,$cIdx,($p_count-1),$r,$color, \%TempCache); Index: loncom/publisher/lonpublisher.pm diff -u loncom/publisher/lonpublisher.pm:1.91 loncom/publisher/lonpublisher.pm:1.92 --- loncom/publisher/lonpublisher.pm:1.91 Fri Aug 9 14:03:05 2002 +++ loncom/publisher/lonpublisher.pm Fri Aug 9 15:49:30 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Publication Handler # -# $Id: lonpublisher.pm,v 1.91 2002/08/09 18:03:05 matthew Exp $ +# $Id: lonpublisher.pm,v 1.92 2002/08/09 19:49:30 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -777,7 +777,8 @@ => time); $thisdep=~/^\/res\/(\w+)\/(\w+)\//; if ((defined($1)) && (defined($2))) { - &Apache::lonnet::put('resevaldata',\%temphash,$1,$2); + &Apache::lonnet::put('nohist_resevaldata',\%temphash, + $1,$2); } } } Index: loncom/lonnet/perl/lonnet.pm diff -u loncom/lonnet/perl/lonnet.pm:1.265 loncom/lonnet/perl/lonnet.pm:1.266 --- loncom/lonnet/perl/lonnet.pm:1.265 Fri Aug 9 14:12:19 2002 +++ loncom/lonnet/perl/lonnet.pm Fri Aug 9 15:49:30 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.265 2002/08/09 18:12:19 albertel Exp $ +# $Id: lonnet.pm,v 1.266 2002/08/09 19:49:30 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -820,7 +820,7 @@ my $entry=$_; $entry=~/\_\_\_(\w+)\/(\w+)\/(.*)\_\_\_(\w+)$/; my %temphash=($entry => $accesshash{$entry}); - if (&Apache::lonnet::put('resevaldata',\%temphash,$1,$2) eq 'ok') { + if (&Apache::lonnet::put('nohist_resevaldata',\%temphash,$1,$2) eq 'ok') { delete $accesshash{$entry}; } } Index: loncom/build/Makefile diff -u loncom/build/Makefile:1.129 loncom/build/Makefile:1.130 --- loncom/build/Makefile:1.129 Tue Jul 23 18:17:22 2002 +++ loncom/build/Makefile Fri Aug 9 15:49:30 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Scott Harrison, your friendly neighborhood volunteer -# $Id: Makefile,v 1.129 2002/07/23 22:17:22 harris41 Exp $ +# $Id: Makefile,v 1.130 2002/08/09 19:49:30 albertel Exp $ # TYPICAL USAGE of this Makefile is primarily for two targets: # "make build" and "make install". @@ -348,8 +348,14 @@ cat $(SOURCE)/doc/loncapafiles/updatequery.piml | \ perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(QUERYLAUNCH) +reseval_fixup: + cat $(SOURCE)/doc/loncapafiles/reseval_fixup.piml | \ + perl piml_parse.pl $(CATEGORY) $(DIST) "$(TARGET)" $(LAUNCH) | \ + tee -a WARNINGS + postinstall: make webserverconf + make reseval_fixup make sanitycheck VERSION: Index: doc/loncapafiles/reseval_fixup.piml +++ doc/loncapafiles/reseval_fixup.piml / /home/httpd/lonUsers # get a list of all user directories my @dirs=`find -type d `; my @userdirs=grep(m|/[^/]*/[^/]*/[^/]*/[^/]*/[^/]*/[^/]*/[^/]*/[^/]*|, @dirs); foreach my $udir (@userdirs) { chomp($udir); print("$udir \n"); if (-e "$udir/resevaldata.hist") { unlink("$udir/resevaldata.hist"); } if (-e "$udir/resevaldata.db") { `mv $udir/resevaldata.db $udir/nohist_resevaldata.db`; } } From lon-capa-cvs@mail.lon-capa.org Fri Aug 9 21:15:17 2002 From: lon-capa-cvs@mail.lon-capa.org (www) Date: Fri, 09 Aug 2002 20:15:17 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonannounce.pm Message-ID: www Fri Aug 9 16:15:17 2002 EDT Modified files: /loncom/interface lonannounce.pm Log: Does stuff now. Still needs "remove". Index: loncom/interface/lonannounce.pm diff -u loncom/interface/lonannounce.pm:1.3 loncom/interface/lonannounce.pm:1.4 --- loncom/interface/lonannounce.pm:1.3 Thu Aug 8 09:44:17 2002 +++ loncom/interface/lonannounce.pm Fri Aug 9 16:15:16 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network # Announce # -# $Id: lonannounce.pm,v 1.3 2002/08/08 13:44:17 www Exp $ +# $Id: lonannounce.pm,v 1.4 2002/08/09 20:15:16 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -52,7 +52,16 @@ sub normalcell { my ($day,$text)=@_; - return ''.$day.'
'.$text.''; + my $output=''; + foreach (split(/\_\_\_\&\&\&\_\_\_/,$text)) { + if ($_) { + my ($courseid,$msg)=split(/\@/,$_); + my $fullmsg=$ENV{'course.'.$courseid.'.description'}.': '.$msg; + $output.=''. + substr($msg,0,20).'...
'; + } + } + return ''.$day.'
'.$output.''; } sub nextday { @@ -66,11 +75,10 @@ my %th=&Apache::loncommon::timehash($tk); my ($nextday,$nextmonth)=&nextday(%th); my $outp=''; + my $oneday=24*3600; foreach (keys %allcal) { my ($course,$startdate,$enddate)=($_=~/^(\w+)\@(\d+)\_(\d+)$/); - print $course.' '.localtime($startdate).' '.localtime($enddate). - localtime($tk).' '.localtime($nextday).'
'; - if (($startdate>$tk) && ($enddate<$nextday)) { + if (($startdate<$nextday) && ($enddate>$tk)) { $outp.='___&&&___'.$course.'@'.$allcal{$_}; } } From lon-capa-cvs@mail.lon-capa.org Fri Aug 9 21:38:42 2002 From: lon-capa-cvs@mail.lon-capa.org (sakharuk) Date: Fri, 09 Aug 2002 20:38:42 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm Message-ID: sakharuk Fri Aug 9 16:38:42 2002 EDT Modified files: /loncom/interface lonprintout.pm Log: Prints the whole course (problems only). It works for the nested sequences. Tested on apcalc - works well. Need to be tested on course with pages and for course with nonlinear sequences. Index: loncom/interface/lonprintout.pm diff -u loncom/interface/lonprintout.pm:1.48 loncom/interface/lonprintout.pm:1.49 --- loncom/interface/lonprintout.pm:1.48 Fri Aug 9 14:06:46 2002 +++ loncom/interface/lonprintout.pm Fri Aug 9 16:38:42 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.48 2002/08/09 18:06:46 sakharuk Exp $ +# $Id: lonprintout.pm,v 1.49 2002/08/09 20:38:42 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -196,8 +196,6 @@ } $result = &additional_cleanup($result); } elsif ($choice eq 'Standard LaTeX output for the top level sequence') { - my @master_seq = (); - my @add_file_seq = (); # where is the main sequence of the course? my $main_seq = '/res/'.$ENV{'request.course.uri'}; my $file=&Apache::lonnet::filelocation("",$main_seq); @@ -206,85 +204,59 @@ for (my $iu=0;$iu<=$#file_seq;$iu++) { $file_seq[$iu]=~s/^"//; $file_seq[$iu]=~s/"$//; - $file_seq[$iu]=&Apache::lonnet::filelocation("",$file_seq[$iu]); -#remove $result .= ' SSS '.$file_seq[$iu].' FFF '; + if ($file_seq[$iu]=~m/\S+/) { + $file_seq[$iu]=&Apache::lonnet::filelocation("",$file_seq[$iu]); + } else { + $file_seq[$iu]= 'REMOVE IT PLEASE'; + } } my $i=0; - while ($i<=$#file_seq) { + my $limit = $#file_seq; + while ($i<=$limit) { unless ($file_seq[$i]=~m/\.(problem|page)/) { if ($file_seq[$i]=~m/\.sequence/) { my $filecontents=&Apache::lonnet::getfile($file_seq[$i]); my @newfile_seq = &content_map($filecontents); - $result .=' START '.$i.' LOOK '.$filecontents.' FINISH '; -# splice @file_seq,$1,1,@newfile_seq; -# $i=-1; + for (my $iu=0;$iu<=$#newfile_seq;$iu++) { + $newfile_seq[$iu]=~s/^"//; + $newfile_seq[$iu]=~s/"$//; + if ($newfile_seq[$iu]=~m/\S+/) { + $newfile_seq[$iu]=&Apache::lonnet::filelocation("",$newfile_seq[$iu]); + } else { + $newfile_seq[$iu]= 'REMOVE IT PLEASE'; + } + } + splice @file_seq,$i,1,@newfile_seq; + $i=0; + $limit = $#file_seq; } else { - splice @file_seq,$1,1; + splice @file_seq,$i,1,'REMOVE IT PLEASE'; } } - - - - $i++; } for (my $iu=0;$iu<=$#file_seq;$iu++) { - $result .= ' SSS '.$file_seq[$iu].' FFF '; + if ($file_seq[$iu]=~m/REMOVE IT PLEASE/) { + splice @file_seq,$iu,1; + } + } + if ($file_seq[-1]=~m/REMOVE IT PLEASE/) { + pop @file_seq; } - - - # do we have any other sequence inside? -# $result.=$#file_seq.' '; -## my $i=1; -## while ($i<=$#file_seq) { -# $result.=' '.$file_seq[$i].' '; -## $file_seq[$i]=~s/^"//; -## $file_seq[$i]=~s/"$//; -## if ($file_seq[$i]=~m/\.sequence\s*$/) { -## $file = &Apache::lonnet::filelocation("",$file_seq[$i]); -# $result.=' location '.$file.' '; -# $result .= 'FFFFFFFFF'.$file.' '; -## $filecontents=&Apache::lonnet::getfile($file); -## @add_file_seq = &content_map($filecontents); - -# -# for (my $iu=0;$iu<=$#add_file_seq;$iu++) { -# $result .= ' SDSD '.$add_file_seq[$iu].' FDFD '; -# } -# - - -## splice(@file_seq,$i,1,@add_file_seq); -## @add_file_seq = (); -## $i = -1; -## } -## $i++; -## last; #do not forget to remove -## } -## @master_seq = @file_seq; - -# -# for (my $iu=0;$iu<=$#file_seq;$iu++) { -# $result .= ' SSS '.$file_seq[$iu].' FFF '; -# } -# - #-- produce an output string -### for (my $i=0;$i<=$#master_seq;$i++) { -### $_ = $master_seq[$i]; -### m/\"(.*)\"/; -### $_ = $1; -### my $urlp = $1; -### if (/\.(problem|exam|quiz|assess|survey|form|library)/) { -### my %moreenv; -### $moreenv{'form.grade_target'}='tex'; -### &Apache::lonnet::appenv(%moreenv); -### my $texversion=&Apache::lonnet::ssi($urlp); -### &Apache::lonnet::delenv('form.grade_target'); -### $result .= $texversion; -### } -### } -### $result = &additional_cleanup($result); + for (my $i=0;$i<=$#file_seq;$i++) { + my $urlp = $file_seq[$i]; + $urlp=~s/\/home\/httpd\/html//; + if ($urlp=~m/\.(problem|exam|quiz|assess|survey|form|library)/) { + my %moreenv; + $moreenv{'form.grade_target'}='tex'; + &Apache::lonnet::appenv(%moreenv); + my $texversion=&Apache::lonnet::ssi($urlp); + &Apache::lonnet::delenv('form.grade_target'); + $result .= $texversion; + } + } + $result = &additional_cleanup($result); } elsif ($choice eq 'Subdirectory print') { my $subdirtoprint = &Apache::lonnet::filelocation("",$ENV{'form.url'}); $subdirtoprint =~ s/\/[^\/]+$//; From lon-capa-cvs@mail.lon-capa.org Fri Aug 9 21:39:13 2002 From: lon-capa-cvs@mail.lon-capa.org (www) Date: Fri, 09 Aug 2002 20:39:13 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonannounce.pm Message-ID: www Fri Aug 9 16:39:13 2002 EDT Modified files: /loncom/interface lonannounce.pm Log: Wonderful. Index: loncom/interface/lonannounce.pm diff -u loncom/interface/lonannounce.pm:1.4 loncom/interface/lonannounce.pm:1.5 --- loncom/interface/lonannounce.pm:1.4 Fri Aug 9 16:15:16 2002 +++ loncom/interface/lonannounce.pm Fri Aug 9 16:39:13 2002 @@ -1,7 +1,7 @@ # The LearningOnline Network # Announce # -# $Id: lonannounce.pm,v 1.4 2002/08/09 20:15:16 www Exp $ +# $Id: lonannounce.pm,v 1.5 2002/08/09 20:39:13 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -55,9 +55,16 @@ my $output=''; foreach (split(/\_\_\_\&\&\&\_\_\_/,$text)) { if ($_) { - my ($courseid,$msg)=split(/\@/,$_); + my ($courseid,$start,$end,@msg)=split(/\@/,$_); + my $msg=join('@',@msg); my $fullmsg=$ENV{'course.'.$courseid.'.description'}.': '.$msg; - $output.=''. + if ($courseid eq $ENV{'request.course.id'}) { + if (&Apache::lonnet::allowed('srm',$ENV{'request.course.id'})) { + $output.=''; + } + } + $output.=''. substr($msg,0,20).'...
'; } } @@ -79,7 +86,8 @@ foreach (keys %allcal) { my ($course,$startdate,$enddate)=($_=~/^(\w+)\@(\d+)\_(\d+)$/); if (($startdate<$nextday) && ($enddate>$tk)) { - $outp.='___&&&___'.$course.'@'.$allcal{$_}; + $outp.='___&&&___'.$course.'@'.$startdate.'@'.$enddate.'@'. + $allcal{$_}; } } return ($nextday,$nextmonth,&normalcell($th{'day'},$outp)); @@ -98,11 +106,6 @@ # ---------------------------------------------------------- Get month and year &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, ['month','year']); -# ----------------------------------------------------- Summarize all calendars - my %allcal=(); - foreach (&Apache::loncommon::findallcourses()) { - %allcal=(%allcal,&readcalendar($_)); - } # --------------------------------------------------- Decide what month to show my $year=$todayhash{'year'}; if ($ENV{'form.year'}) { $year=$ENV{'form.year'}; } @@ -226,6 +229,13 @@
ENDFORM } +# ----------------------------------------------------- Summarize all calendars + my %allcal=(); + foreach (&Apache::loncommon::findallcourses()) { + %allcal=(%allcal,&readcalendar($_)); + } + +# ------------------------------- Initialize table and forward backward buttons my ($pm,$py,$fm,$fy)=($month-1,$year,$month+1,$year); if ($pm<1) { ($pm,$py)=(12,$year-1); } if ($fm>12){ ($fm,$fy)=(1,$year+1); } From lon-capa-cvs@mail.lon-capa.org Sat Aug 10 15:57:54 2002 From: lon-capa-cvs@mail.lon-capa.org (matthew) Date: Sat, 10 Aug 2002 14:57:54 -0000 Subject: [LON-CAPA-cvs] cvs: loncom / loncapa_apache.conf Message-ID: matthew Sat Aug 10 10:57:54 2002 EDT Modified files: /loncom loncapa_apache.conf Log: Attempt to prevent logging of errors on accesses to the remote. Index: loncom/loncapa_apache.conf diff -u loncom/loncapa_apache.conf:1.13 loncom/loncapa_apache.conf:1.14 --- loncom/loncapa_apache.conf:1.13 Thu Aug 8 09:45:21 2002 +++ loncom/loncapa_apache.conf Sat Aug 10 10:57:54 2002 @@ -1,7 +1,7 @@ ## ## loncapa_apache.conf -- Apache HTTP LON-CAPA configuration file ## -## $Id: loncapa_apache.conf,v 1.13 2002/08/08 13:45:21 www Exp $ +## $Id: loncapa_apache.conf,v 1.14 2002/08/10 14:57:54 matthew Exp $ ## ## 1/11/2002 - Scott Harrison ## 2/19/2002 - Scott Harrison @@ -44,6 +44,14 @@ # ------------------------------------------------------------- Access Handlers PerlTransHandler Apache::lontrans + + +ErrorDocument 403 /adm/login +ErrorDocument 404 /adm/notfound.html +ErrorDocument 406 /adm/roles +ErrorDocument 500 /adm/errorhandler + + PerlAccessHandler Apache::lonacc From lon-capa-cvs@mail.lon-capa.org Sun Aug 11 19:38:07 2002 From: lon-capa-cvs@mail.lon-capa.org (www) Date: Sun, 11 Aug 2002 18:38:07 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /html/adm/lonLCDfont 0.gif 1.gif 2.gif 3.gif 4.gif 5.gif 6.gif 7.gif 8.gif 9.gif a.gif b.gif c.gif colon.gif d.gif e.gif f.gif g.gif h.gif hyphen.gif i.gif j.gif k.gif l.gif m.gif n.gif o.gif p.gif q.gif r.gif s.gif slash.gif space.gif t.gif u.gif v.gif w.gif x.gif y.gif z.gif /html/res/adm/pages 0.gif 1.gif 2.gif 3.gif 4.gif 5.gif 6.gif 7.gif 8.gif 9.gif a.gif b.gif c.gif colon.gif d.gif e.gif f.gif g.gif h.gif hyphen.gif i.gif j.gif k.gif l.gif m.gif menu.html n.gif o.gif p.gif q.gif r.gif s.gif slash.gif space.gif t.gif u.gif v.gif w.gif x.gif y.gif z.gif Message-ID: www Sun Aug 11 14:38:07 2002 EDT Added files: /loncom/html/adm/lonLCDfont 0.gif 1.gif 2.gif 3.gif 4.gif 5.gif 6.gif 7.gif 8.gif 9.gif a.gif b.gif c.gif colon.gif d.gif e.gif f.gif g.gif h.gif hyphen.gif i.gif j.gif k.gif l.gif m.gif n.gif o.gif p.gif q.gif r.gif s.gif slash.gif space.gif t.gif u.gif v.gif w.gif x.gif y.gif z.gif Removed files: /loncom/html/res/adm/pages 0.gif 1.gif 2.gif 3.gif 4.gif 5.gif 6.gif 7.gif 8.gif 9.gif a.gif b.gif c.gif colon.gif d.gif e.gif f.gif g.gif h.gif hyphen.gif i.gif j.gif k.gif l.gif m.gif n.gif o.gif p.gif q.gif r.gif s.gif slash.gif space.gif t.gif u.gif v.gif w.gif x.gif y.gif z.gif Modified files: /loncom/html/res/adm/pages menu.html Log: Move LCD font to avoid log file inflation for running clock while logged out. Index: loncom/html/res/adm/pages/menu.html diff -u loncom/html/res/adm/pages/menu.html:1.64 loncom/html/res/adm/pages/menu.html:1.65 --- loncom/html/res/adm/pages/menu.html:1.64 Fri Jul 26 08:51:11 2002 +++ loncom/html/res/adm/pages/menu.html Sun Aug 11 14:38:07 2002 @@ -4,7 +4,7 @@ Remote Control // -// $Id: menu.html,v 1.64 2002/07/26 12:51:11 matthew Exp $ +// $Id: menu.html,v 1.65 2002/08/11 18:38:07 www Exp $ // // Copyright Michigan State University Board of Trustees // @@ -47,7 +47,7 @@ var dislocked = 1; var imgpath='/res/adm/pages/'; - +var fontpath='/adm/lonLCDfont/'; var currentURL=''; var reloadURL=''; var currentStale=1; @@ -188,7 +188,7 @@ if (ch==':') { ch='colon'; } if (ch=='/') { ch='slash'; } } else { ch='space'; } - this.document['i'+i].src=imgpath+ch+'.gif'; + this.document['i'+i].src=fontpath+ch+'.gif'; } for (i=0;i<=7;i++) { if (i www Sun Aug 11 14:49:39 2002 EDT Modified files: /doc/loncapafiles loncapafiles.lpml Log: Shifting the LCD font to non-auth space Index: doc/loncapafiles/loncapafiles.lpml diff -u doc/loncapafiles/loncapafiles.lpml:1.158 doc/loncapafiles/loncapafiles.lpml:1.159 --- doc/loncapafiles/loncapafiles.lpml:1.158 Fri Aug 9 10:48:31 2002 +++ doc/loncapafiles/loncapafiles.lpml Sun Aug 11 14:49:39 2002 @@ -3,7 +3,7 @@ - +