From 您好!@zaphod.lite.msu.edu Mon Mar 3 09:53:21 2003 From: 您好!@zaphod.lite.msu.edu (您好!@zaphod.lite.msu.edu) Date: Mon, 03 Mar 03 09:53:21 中国标准时间 Subject: [LON-CAPA-cvs] 我们专业从事网站网页设计 Message-ID: <200303030153.h231qxL15400@zaphod.lite.msu.edu> ------=_NextPart_000_0004_03ADAABF.0B09003D Content-Type: multipart/alternative; boundary="----=_NextPart_001_0005_03ADAABF.0B09003D" ------=_NextPart_001_0005_03ADAABF.0B09003D Content-Type: text/plain; charset=gb2312 Content-Transfer-Encoding: quoted-printable 这是用超文本格式编写的邮件,请使用超文本方式浏览。 ------=_NextPart_001_0005_03ADAABF.0B09003D Content-Type: text/html; charset=gb2312 Content-Transfer-Encoding: quoted-printable =C3=C0=B6=FB=BB=A5=C1=AA=CD=F8=D5=BE=C9=E8=BC=C6=B9=A4=D7=F7=CA=D2<= /title> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dgb2312">= </head> <body bgcolor=3D"#FFFFFF" text=3D"#000000">=C4=FA=BA=C3=A3=A1=D5=E2=CA=C7=D2= =BB=B7=E2=C9=C6=D2=E2=B5=C4=C9=CC=D2=B5=D3=CA=BC=FE=A3=BA<br><br> =A1=A1=A1=A1<a href=3D"http://mere.cn.gs" target=3D"_blank">=C3=C0=B6=FB=BB= =A5=C1=AA=CD=F8=D5=BE=C9=E8=BC=C6=B9=A4=D7=F7=CA=D2=A3=A8=CD=F8=D6=B7=A3=BA= http://mere.cn.gs=A3=A9</a>=D7=A8=D2=B5=B4=D3=CA=C2=CD=F8=D5=BE=CD=F8=D2=B3= =C9=E8=BC=C6=A1=A2=CD=F8=D5=BE=CA=FD =BE=DD=BF=E2=B1=E0=B3=CC=A1=A2=C6=BD=C3=E6=B9=E3=B8=E6=C9=E8=BC=C6=A3=A1=D3= =D0=D0=E8=D2=AA=CE=D2=C3=C7=B7=FE=CE=F1=B5=C4=C5=F3=D3=D1=BF=C9=D2=D4=D6=B1= =BD=D3=B8=FA=D5=BE=B3=A4=C1=AA=CF=B5=A3=BA0755-26383669=D1=EE=C9=FA <p>=A1=A1=A1=A1 =CE=AA=C8=C3=B8=FC=B6=E0=B5=C4=C6=F3=CA=C2=D2=B5=B5=A5=CE=BB= =CA=DC=D2=E6=A1=A2=D4=F6=C7=BF=C6=F3=D2=B5=BE=BA=D5=F9=C1=A6=BA=CD=CA=F7=C1= =A2=C6=F3=D2=B5=D0=CE=CF=F3,<a href=3D"http://mere.cn.gs" target=3D"_blank"= >=C3=C0=B6=FB=BB=A5=C1=AA=CD=F8=D5=BE=C9=E8=BC=C6=B9=A4=D7=F7=CA=D2=A3=A8=CD= =F8=D6=B7=A3=BAhttp://mere.cn.gs=A3=A9</a> =CD=C6=B3=F6=C8=AB=B9=FA=A3=A8=D7=EE=D3=C5=B5=C4=C9=E8=BC=C6=D6=CA=C1=BF= =BA=CD=BC=DB=B8=F1=B1=C8=A3=A9=D7=EE=D3=C5=BB=DD=B5=C4=CD=F8=D5=BE=C9=E8=BC= =C6=BC=DB=B8=F1 =CC=E1=B9=A9=D7=EE=D3=C5=D6=CA=B5=C4=CD=F8=C2=E7=B7=FE=CE=F1= =A3=AC=D3=EB=CD=AC=D0=D0=B1=C8=A3=AC=CF=E0=CD=AC=B5=C4=BC=DB=B8=F1=CE=D2=C3= =C7=CC=E1=B9=A9=D7=EE=D3=C5=B5=C4=B7=FE=CE=F1=A3=AC=CF=E0=CD=AC=B5=C4=B7=FE= =CE=F1=CE=D2=C3=C7=CA=B5=D0=D0=D7=EE =B5=CD=B5=C4=CA=D5=B7=D1=A1=A3=B1=BE=B9= =A4=D7=F7=CA=D2=B5=C4=B7=FE=CE=F1=D7=DA=D6=BC=CA=C7=A3=BA=A1=B0=B3=CF=D0=C5= =A1=A2=B3=CF=BF=D2=A1=A2=B3=CF=CA=B5=A3=AC=C6=B7=D6=CA=B8=DF=B2=C5=C4=DC=C6= =B7=CE=BB=B8=DF=A1=B1=A3=AC=B8=FC=B6=E0=A1=A2=B8=FC=BA=C3=A1=A2 =B8=FC=BF=EC=B5=D8=CE=AA=BF=CD=BB=A7=B7=FE=CE=F1=A1=A3=D0=BB=D0=BB=A3=A1= </p> <p> =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1\\\|= ///<br> =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1\\- -/= /<br> =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1( @ @ = )<br> =A9=B3=A9=A5=A9=A5=A9=A5=A9=A5=A9=A5=A9=A5=A9=A5=A9=A5 oOOo-(_)-oOOo=A9=A5= =A9=B7<br> =A9=A7 =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1= =A1=A1=A1=A1=A1=A1=A1=A1 =A9=A7<br> =A9=A7 =D5=BE=B3=A4=A3=BA=D1=EE=B8=EB=CE=B5=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1= =A1=A1=A1=A1=A1=A1=A1=A1 =A9=A7<br> =A9=A7 =CD=F8=C3=FB=A3=BA=B8=EB=D7=D3 =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1= =A1=A1=A1=A1=A1=A1=A1=A1=A9=A7<br> =A9=A7 =B5=E7=BB=B0=A3=BA0755-26383669=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1= =A9=A7<br> =A9=A7 =CD=F8=D6=B7=A3=BA<a href=3D"http://mere.cn.gs" target=3D"_blank"= >http://mere.cn.gs</a> =A1=A1=A1=A1=A1=A1 =A9=A7<br> =A9=A7 =D3=CA=CF=E4=A3=BAemailhi@163.com=A1=A1=A1=A1=A1=A1 =A1=A1 =A9=A7= <br> =A9=A7 oicq: 4133332 =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1 =A9= =A7 <br> =A9=A7 =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1= =A1=A1=A1=A1=A1=A1=A1=A1 =A9=A7<br> =A9=A7 =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1<<=C3=C0=B6=FB=B9= =A4=D7=F7=CA=D2>> =CA=BE=A9=A7<br> =A9=A7 =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1= =A1=A1=A1=A1Oooo =A9=A7<br> =A9=BB=A9=A5=A9=A5=A9=A5=A9=A5=A9=A5=A9=A5=A9=A5=A9=A5=A9=A5 oooO =A9=A5= ( =A1=A1)=A9=BF<br> =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1( =A1=A1) =A1= =A1=A1=A1) /<br> =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1 \ ( =A1=A1=A1= =A1(_/<br> =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1\_)<br= > </p> <p><br> =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=D6=C2<br> =C0=F1!<br> =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1= =A1=A1=A1=A1 <br> </p> </body> </html> ------=_NextPart_001_0005_03ADAABF.0B09003D-- ------=_NextPart_000_0004_03ADAABF.0B09003D-- From lon-capa-cvs@mail.lon-capa.org Mon Mar 3 13:03:58 2003 From: lon-capa-cvs@mail.lon-capa.org (www) Date: Mon, 03 Mar 2003 13:03:58 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonaboutme.pm lonbulletin.pm loncommon.pm lonmenu.pm lonnavmaps.pm lonsimplepage.pm lonsyllabus.pm Message-ID: <cvswww1046696638@cvsserver> This is a MIME encoded message --www1046696638 Content-Type: text/plain www Mon Mar 3 08:03:58 2003 EDT Modified files: /loncom/interface lonaboutme.pm lonbulletin.pm loncommon.pm lonmenu.pm lonnavmaps.pm lonsimplepage.pm lonsyllabus.pm Log: Work on textbased menus: "forward", "back", etc, on Syllabus, NavMaps, ... --www1046696638 Content-Type: text/plain Content-Disposition: attachment; filename="www-20030303080358.txt" Index: loncom/interface/lonaboutme.pm diff -u loncom/interface/lonaboutme.pm:1.13 loncom/interface/lonaboutme.pm:1.14 --- loncom/interface/lonaboutme.pm:1.13 Fri Feb 28 11:16:59 2003 +++ loncom/interface/lonaboutme.pm Mon Mar 3 08:03:58 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network # "About Me" Personal Information # -# $Id: lonaboutme.pm,v 1.13 2003/02/28 16:16:59 www Exp $ +# $Id: lonaboutme.pm,v 1.14 2003/03/03 13:03:58 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -50,7 +50,7 @@ my (undef,undef,$cdom,$cnum)=split(/\//,$r->uri); # Is this even a user? if (&Apache::lonnet::homeserver($cnum,$cdom) eq 'no_host') { - $r->print('<body>No user information available</body>'); + $r->print('</head><body>No user information available</body></html>'); return OK; } # --------------------------------------------------------- The syllabus fields @@ -76,7 +76,8 @@ # --------------------------------------- There is such a user, get environment my %courseenv=&Apache::lonnet::dump('environment',$cdom,$cnum); $r->print('</head>'.&Apache::loncommon::bodytag - ("Personal Information",$forcestudent,$addentries,'',$cdom)); + ("Personal Information",$forcestudent,$addentries,'',$cdom, + $ENV{'form.register'})); $r->print('<h1>'.&Apache::loncommon::plainname($cnum,$cdom).'</h1>'); if ($courseenv{'nickname'}) { $r->print( Index: loncom/interface/lonbulletin.pm diff -u loncom/interface/lonbulletin.pm:1.7 loncom/interface/lonbulletin.pm:1.8 --- loncom/interface/lonbulletin.pm:1.7 Fri Feb 28 11:16:59 2003 +++ loncom/interface/lonbulletin.pm Mon Mar 3 08:03:58 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network # Bulletin Board Handler # -# $Id: lonbulletin.pm,v 1.7 2003/02/28 16:16:59 www Exp $ +# $Id: lonbulletin.pm,v 1.8 2003/03/03 13:03:58 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -51,7 +51,7 @@ my (undef,undef,undef,undef,$marker)=split(/\//,$r->uri); # Is this even in a course? unless ($ENV{'request.course.id'}) { - $r->print('<body>Not in a course</body>'); + $r->print('</head><body>Not in a course</body></html>'); return OK; } @@ -90,7 +90,8 @@ # --------------------------------------- There is such a user, get environment $r->print('</head>'.&Apache::loncommon::bodytag - ("Bulletin Board/Discussion",$forcestudent,$addentries,'',$dom)); + ("Bulletin Board/Discussion",$forcestudent,$addentries,'',$dom, + $ENV{'form.register'})); my $allowed=&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}); Index: loncom/interface/loncommon.pm diff -u loncom/interface/loncommon.pm:1.85 loncom/interface/loncommon.pm:1.86 --- loncom/interface/loncommon.pm:1.85 Tue Feb 25 16:54:14 2003 +++ loncom/interface/loncommon.pm Mon Mar 3 08:03:58 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common routines # -# $Id: loncommon.pm,v 1.85 2003/02/25 21:54:14 albertel Exp $ +# $Id: loncommon.pm,v 1.86 2003/03/03 13:03:58 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1530,6 +1530,8 @@ $addentries, extra parameters for the <body> tag. $bodyonly, if defined, only return the <body> tag. $domain, if defined, force a given domain. + $forcereg, if page should register as content page (relevant for + text interface only) Returns: A uniform header for LON-CAPA web pages. If $bodyonly is nonzero, a string containing a <body> tag will be returned. @@ -1543,7 +1545,7 @@ ############################################### sub bodytag { - my ($title,$function,$addentries,$bodyonly,$domain)=@_; + my ($title,$function,$addentries,$bodyonly,$domain,$forcereg)=@_; unless ($function) { $function='student'; if ($ENV{'request.role'}=~/^(cc|in|ta|ep)/) { @@ -1587,7 +1589,8 @@ if ($bodyonly) { return $bodytag; } elsif ($ENV{'browser.interface'} eq 'textual') { - return $bodytag.&Apache::lonmenu::menubuttons(undef,'web'). + return $bodytag.&Apache::lonmenu::menubuttons($forcereg,'web', + $forcereg). '<h1>LON-CAPA: '.$title.'</h1>'; } else { return(<<ENDBODY); Index: loncom/interface/lonmenu.pm diff -u loncom/interface/lonmenu.pm:1.44 loncom/interface/lonmenu.pm:1.45 --- loncom/interface/lonmenu.pm:1.44 Thu Feb 20 17:04:18 2003 +++ loncom/interface/lonmenu.pm Mon Mar 3 08:03:58 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.44 2003/02/20 22:04:18 www Exp $ +# $Id: lonmenu.pm,v 1.45 2003/03/03 13:03:58 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -70,7 +70,7 @@ my $result = ''; if ($target eq 'edit') { - $result .="<script type=\"text/javascrtipt\">\n". + $result .="<script type=\"text/javascript\">\n". "if (typeof swmenu != 'undefined') {swmenu.currentURL=null;}\n". &Apache::loncommon::browser_and_searcher_javascript(). "\n</script>\n"; Index: loncom/interface/lonnavmaps.pm diff -u loncom/interface/lonnavmaps.pm:1.150 loncom/interface/lonnavmaps.pm:1.151 --- loncom/interface/lonnavmaps.pm:1.150 Fri Feb 28 11:16:59 2003 +++ loncom/interface/lonnavmaps.pm Mon Mar 3 08:03:58 2003 @@ -2,7 +2,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.150 2003/02/28 16:16:59 www Exp $ +# $Id: lonnavmaps.pm,v 1.151 2003/03/03 13:03:58 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -167,7 +167,7 @@ # Header $r->print('</head>'. &Apache::loncommon::bodytag('Navigate Course Contents','', - $addentries)); + $addentries,'','',$ENV{'form.register'})); $r->print('<script>window.focus();</script>'); $r->rflush(); Index: loncom/interface/lonsimplepage.pm diff -u loncom/interface/lonsimplepage.pm:1.7 loncom/interface/lonsimplepage.pm:1.8 --- loncom/interface/lonsimplepage.pm:1.7 Fri Feb 28 11:16:59 2003 +++ loncom/interface/lonsimplepage.pm Mon Mar 3 08:03:58 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network # Simple Page Editor # -# $Id: lonsimplepage.pm,v 1.7 2003/02/28 16:16:59 www Exp $ +# $Id: lonsimplepage.pm,v 1.8 2003/03/03 13:03:58 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -50,7 +50,7 @@ my (undef,undef,undef,undef,$marker)=split(/\//,$r->uri); # Is this even in a course? unless ($ENV{'request.course.id'}) { - $r->print('<body>Not in a course</body>'); + $r->print('</head><body>Not in a course</body></html>'); return OK; } @@ -91,7 +91,7 @@ # --------------------------------------- There is such a user, get environment $r->print('</head>'.&Apache::loncommon::bodytag - ("Course Page",$forcestudent,$addentries,'',$dom)); + ("Course Page",$forcestudent,$addentries,'',$dom,$ENV{'form.register'})); my $allowed=&Apache::lonnet::allowed('srm',$ENV{'request.course.id'}); Index: loncom/interface/lonsyllabus.pm diff -u loncom/interface/lonsyllabus.pm:1.14 loncom/interface/lonsyllabus.pm:1.15 --- loncom/interface/lonsyllabus.pm:1.14 Fri Feb 28 11:16:59 2003 +++ loncom/interface/lonsyllabus.pm Mon Mar 3 08:03:58 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network # Syllabus # -# $Id: lonsyllabus.pm,v 1.14 2003/02/28 16:16:59 www Exp $ +# $Id: lonsyllabus.pm,v 1.15 2003/03/03 13:03:58 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -51,7 +51,7 @@ # Is this even a course? my $homeserver=&Apache::lonnet::homeserver($cnum,$cdom); if ($homeserver eq 'no_host') { - $r->print('<body>No syllabus available</body>'); + $r->print('</head><body>No syllabus available</body></html>'); return OK; } # --------------------------------------------------------- The syllabus fields @@ -89,7 +89,7 @@ # ------------------------------------- There is such a course, get environment my %courseenv=&Apache::lonnet::dump('environment',$cdom,$cnum); $r->print('</head>'.&Apache::loncommon::bodytag - ("Syllabus",$forcestudent,$addentries,'',$cdom)); + ("Syllabus",$forcestudent,$addentries,'',$cdom,$ENV{'form.register'})); $r->print('<h1>'.$courseenv{'description'}.'</h1><h3>'. $Apache::lonnet::domaindescription{$cdom}.'</h3>'); my %syllabus=&Apache::lonnet::dump('syllabus',$cdom,$cnum); --www1046696638-- From lon-capa-cvs@mail.lon-capa.org Mon Mar 3 14:39:41 2003 From: lon-capa-cvs@mail.lon-capa.org (sakharuk) Date: Mon, 03 Mar 2003 14:39:41 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /homework/caparesponse caparesponse.pm Message-ID: <cvssakharuk1046702381@cvsserver> sakharuk Mon Mar 3 09:39:41 2003 EDT Modified files: /loncom/homework/caparesponse caparesponse.pm Log: Added printing of the statement - (in units ...) for the bubble type exam. Index: loncom/homework/caparesponse/caparesponse.pm diff -u loncom/homework/caparesponse/caparesponse.pm:1.80 loncom/homework/caparesponse/caparesponse.pm:1.81 --- loncom/homework/caparesponse/caparesponse.pm:1.80 Thu Feb 27 17:20:40 2003 +++ loncom/homework/caparesponse/caparesponse.pm Mon Mar 3 09:39:41 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # caparesponse definition # -# $Id: caparesponse.pm,v 1.80 2003/02/27 22:20:40 albertel Exp $ +# $Id: caparesponse.pm,v 1.81 2003/03/03 14:39:41 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -178,6 +178,9 @@ if ($target eq 'web') { $result="<br />The correct answer is "; } elsif ($target eq 'tex') { + if (defined $unit and $Apache::lonhomework::type eq 'exam') { + $result.=' \textit{(in} \verb|'.$unit.'|\textit{)} '; + } #$result='\vskip 0 mm The correct answer is \\texttt{'; } for (my $i=0; $i <= $#answers; $i++) { From lon-capa-cvs@mail.lon-capa.org Mon Mar 3 15:59:43 2003 From: lon-capa-cvs@mail.lon-capa.org (www) Date: Mon, 03 Mar 2003 15:59:43 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /homework structuretags.pm Message-ID: <cvswww1046707183@cvsserver> www Mon Mar 3 10:59:43 2003 EDT Modified files: /loncom/homework structuretags.pm Log: Menubuttons "Forward", "Backward", etc, on top of homework Index: loncom/homework/structuretags.pm diff -u loncom/homework/structuretags.pm:1.151 loncom/homework/structuretags.pm:1.152 --- loncom/homework/structuretags.pm:1.151 Thu Feb 27 15:01:05 2003 +++ loncom/homework/structuretags.pm Mon Mar 3 10:59:42 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.151 2003/02/27 20:01:05 sakharuk Exp $ +# $Id: structuretags.pm,v 1.152 2003/03/03 15:59:42 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -101,7 +101,7 @@ $body_tag_start.='bgcolor="#ffffff"'; } } - $body_tag_start.='>'.&Apache::lonmenu::menubuttons(undef,$target); + $body_tag_start.='>'.&Apache::lonmenu::menubuttons(undef,$target,1); if ($target eq 'web' && $ENV{'request.state'} ne 'construct') { my ($symb)=&Apache::lonxml::whichuser(); if ($symb eq '') { From lon-capa-cvs@mail.lon-capa.org Mon Mar 3 19:17:51 2003 From: lon-capa-cvs@mail.lon-capa.org (matthew) Date: Mon, 03 Mar 2003 19:17:51 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonstatistics.pm Message-ID: <cvsmatthew1046719071@cvsserver> matthew Mon Mar 3 14:17:51 2003 EDT Modified files: /loncom/interface lonstatistics.pm Log: Removed 'update all student data' button. Changed 'Refresh' to "Update Display". Changed all those idiotic scalar(my @tmp = split(//,$var)) statements to length($var). Index: loncom/interface/lonstatistics.pm diff -u loncom/interface/lonstatistics.pm:1.62 loncom/interface/lonstatistics.pm:1.63 --- loncom/interface/lonstatistics.pm:1.62 Fri Feb 28 16:19:53 2003 +++ loncom/interface/lonstatistics.pm Mon Mar 3 14:17:51 2003 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstatistics.pm,v 1.62 2003/02/28 21:19:53 matthew Exp $ +# $Id: lonstatistics.pm,v 1.63 2003/03/03 19:17:51 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -235,8 +235,7 @@ @StudentDataOrder = qw/fullname username domain id section status/; foreach my $field (@StudentDataOrder) { $StudentData{$field}->{'title'} = $field; - $StudentData{$field}->{'base_width'} = - scalar (my @Tmp = split(//,$field)); + $StudentData{$field}->{'base_width'} = length($field); $StudentData{$field}->{'width'} = $StudentData{$field}->{'base_width'}; } @@ -251,7 +250,7 @@ $studenthash->{$field}=$student_data->[$i]; # Keep track of the width of the fields next if (! exists($StudentData{$field})); - my $length = scalar(my @Tmp1 = split(//,$student_data->[$i])); + my $length = length($student_data->[$i]); if ($StudentData{$field}->{'width'} < $length) { $StudentData{$field}->{'width'} = $length; } @@ -464,12 +463,12 @@ # # Compute column widths foreach my $seq (@Sequences) { - my $name_length = scalar(my @Tmp1 = split(//,$seq->{'title'})); + my $name_length = length($seq->{'title'}); my $num_parts = $seq->{'num_assess_parts'}; # # The number of columns needed for the summation text: # " 1/5" = 1+3 columns, " 10/99" = 1+5 columns - my $sum_length = 1+1+2*(scalar(my @Tmp2 = split(//,$num_parts))); + my $sum_length = 1+1+2*(length($num_parts)); my $num_col = $num_parts+$sum_length; if ($num_col < $name_length) { $num_col = $name_length; @@ -1252,14 +1251,12 @@ my $Str = ''; $Str .= '<table border="0"><tbody><tr>'."\n"; - $Str .= '<td></td><td></td>'."\n"; + $Str .= '<td></td>'."\n"; $Str .= '<td align="center"><b>Select a Report</b></td>'."\n"; $Str .= '<td align="center"><b>Student Status</b></td></tr>'."\n"; $Str .= '<tr>'."\n"; $Str .= '<td align="center"><input type="submit" name="Refresh" '; - $Str .= 'value="Refresh" /></td>'."\n"; - $Str .= '<td align="center"><input type="submit" name="DownloadAll" '; - $Str .= 'value="Update All Student Data" /></td>'."\n"; + $Str .= 'value="Update Display" /></td>'."\n"; $Str .= '<td align="center">'; $Str .= '<select name="reportSelected" onchange="document.'; $Str .= 'Statistics.submit()">'."\n"; From lon-capa-cvs@mail.lon-capa.org Mon Mar 3 19:28:29 2003 From: lon-capa-cvs@mail.lon-capa.org (matthew) Date: Mon, 03 Mar 2003 19:28:29 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface/statistics lonstudentassessment.pm Message-ID: <cvsmatthew1046719709@cvsserver> This is a MIME encoded message --matthew1046719709 Content-Type: text/plain matthew Mon Mar 3 14:28:29 2003 EDT Modified files: /loncom/interface/statistics lonstudentassessment.pm Log: Big Changes: Started adding different output options. No longer begins computing before the user has made selections. The code is being simplified to some degree and obfuscated in other ways. Each output type has three subroutines associated with it: initialize, outputstudent, and finish. Function pointers are used (defaulting the output mode to 'html'). Currently excel and csv output both result in "Not Implemented". Renamed &CreateTableHeadings to &html_initialize, &ChartOutputStudent to &html_outputstudent, and added &html_finish. Each of these routines was changed to make it responsible for *all* html output of the chart, other than the selection form. Still remaining to be filled in are the routines for csv and excel output. --matthew1046719709 Content-Type: text/plain Content-Disposition: attachment; filename="matthew-20030303142829.txt" Index: loncom/interface/statistics/lonstudentassessment.pm diff -u loncom/interface/statistics/lonstudentassessment.pm:1.30 loncom/interface/statistics/lonstudentassessment.pm:1.31 --- loncom/interface/statistics/lonstudentassessment.pm:1.30 Fri Feb 28 16:19:00 2003 +++ loncom/interface/statistics/lonstudentassessment.pm Mon Mar 3 14:28:29 2003 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentassessment.pm,v 1.30 2003/02/28 21:19:00 matthew Exp $ +# $Id: lonstudentassessment.pm,v 1.31 2003/03/03 19:28:29 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -54,7 +54,23 @@ use Apache::lonhtmlcommon; use Apache::loncoursedata; use Apache::lonnet; # for logging porpoises -use GDBM_File; +use Spreadsheet::WriteExcel; + +####################################################### +####################################################### +=pod + +=item Package Variables + +=over 4 + +=item $Statistics Hash ref to store student data. Indexed by symb, + contains hashes with keys 'score' and 'max'. + +=cut + +####################################################### +####################################################### my $Statistics; @@ -63,27 +79,40 @@ =pod -=item &BuildStudentAssessmentPage() +=item $show_links 'yes' or 'no' for linking to student performance data -Inputs: +=item $output_mode 'html', 'excel', or 'csv' for output mode -=over 4 +=item $show 'all' or 'totals' determines how much data is output -=item $cacheDB The name of the cache file used to store student data +=cut -=item $students Array ref containing the name(s) of the students -selected for display +####################################################### +####################################################### +my $show_links; +my $output_mode; +my $show; -=item $courseID The ID of the course +####################################################### +####################################################### +# End of package variable declarations -=item $formName The name of the html form - 'Statistics' +=pod -=item $headings Array ref of headings to show +=back -=item $spacing A string of spaces +=cut -=item $studentInformation Array ref of possible headings for student info -('fullname','section',...) +####################################################### +####################################################### + +=pod + +=item &BuildStudentAssessmentPage() + +Inputs: + +=over 4 =item $r Apache Request @@ -98,36 +127,88 @@ sub BuildStudentAssessmentPage { my ($r,$c)=@_; undef($Statistics); - # + # Print out the HTML headers for the interface + # This also parses the output mode selector + # This step must always be done. $r->print(&CreateInterface()); + $r->print('<input type="hidden" name="notfirstrun" value="true" />'); $r->rflush(); + if (! exists($ENV{'form.notfirstrun'})) { + $r->print(<<ENDMSG); +<p> +<font size="+1"> +Please make your selections in the boxes above and hit +the button marked "Update Display". +</font> +</p> +ENDMSG + return; + } + # + # + my $initialize = \&html_initialize; + my $output_student = \&html_outputstudent; + my $finish = \&html_finish; + # + if ($output_mode eq 'excel') { + $initialize = \&excel_initialize; + $output_student = \&excel_outputstudent; + $finish = \&excel_finish; + } elsif ($output_mode eq 'csv') { + $initialize = \&csv_initialize; + $output_student = \&csv_outputstudent; + $finish = \&csv_finish; + } # - $r->print(&CreateTableHeadings()); if($c->aborted()) { return ; } - - my $Count = 0; - $r->print('<pre>'."\n"); + # + # Call the initialize routine selected above + $initialize->($r); foreach my $student (@Apache::lonstatistics::Students) { - if($c->aborted()) { return ; } - $r->print(&ChartOutputStudent($student)); - # output it - - $Count++; - if($Count % 5 == 0) { - $r->print("</pre>\n<pre>"); + if($c->aborted()) { + $finish->($r); + return ; } - - $r->rflush(); + # Call the output_student routine selected above + $output_student->($r,$student); } - $r->print('</pre>'."\n"); - my $Str; + # Call the "finish" routine selected above + $finish->($r); + # return; } ####################################################### ####################################################### +sub get_student_fields_to_show { + my @to_show = @Apache::lonstatistics::SelectedStudentData; + foreach (@to_show) { + if ($_ eq 'all') { + @to_show = @Apache::lonstatistics::StudentDataOrder; + last; + } + } + return @to_show; +} + +sub get_sequences_to_show { + my @Sequences; + foreach my $map_symb (@Apache::lonstatistics::SelectedMaps) { + foreach my $sequence (@Apache::lonstatistics::Sequences) { + next if ($sequence->{'symb'} ne $map_symb && $map_symb ne 'all'); + next if ($sequence->{'num_assess'} < 1); + push (@Sequences,$sequence); + } + } + return @Sequences; +} + + +####################################################### +####################################################### + =pod =item &CreateInterface() @@ -152,6 +233,7 @@ $Str .= '<td align="center"><b>Sections</b></td>'; $Str .= '<td align="center"><b>Student Data</b></td>'; $Str .= '<td align="center"><b>Sequences and Folders</b></td>'; + $Str .= '<td align="center"><b>Output Format</b></td>'; $Str .= '</tr>'."\n"; # $Str .= '<tr><td align="center">'."\n"; @@ -170,78 +252,108 @@ $Str .= '</td><td>'."\n"; $Str .= &Apache::lonstatistics::MapSelect('Maps','multiple,all',5, $only_seq_with_assessments); + $Str .= '</td><td>'."\n"; + $Str .= &CreateAndParseOutputSelector(); $Str .= '</td></tr>'."\n"; $Str .= '</table>'."\n"; return $Str; } - ####################################################### ####################################################### =pod -=item Table Output Routines - -=over 4 +=item &CreateAndParseOutputSelector() =cut ####################################################### ####################################################### -{ - my $padding; +sub CreateAndParseOutputSelector { + my $Str = ''; + my $elementname = 'outputmode'; + # + # Format for output options is 'mode, restrictions'; + my @Options = ('html, with links','html, without links', + 'html, totals only','excel, totals only', + 'csv, totals only','csv, everything'); + my $selected = 'html, with links'; + if (exists($ENV{'form.'.$elementname})) { + if (ref($ENV{'form.'.$elementname} eq 'ARRAY')) { + $selected = $ENV{'form.'.$elementname}->[0]; + } else { + $selected = $ENV{'form.'.$elementname}; + } + } + # + # Set package variables describing output mode + $show_links = 'no'; + $output_mode = 'html'; + $show = 'all'; + my ($mode,$restriction) = split(',',$selected); + $restriction =~ s/^\s*//; + if ($mode =~ /^(html|excel|csv)$/) { + $output_mode = $mode; + } else { + $output_mode = 'html'; + } + if ($restriction eq 'with links') { + $show_links = 'yes'; + } else { + $show_links = 'no'; + } + if ($restriction eq 'totals only') { + $show = 'totals'; + } else { + $show = 'everything'; + } + # + # Build the form element + $Str = qq/<select size="5" name="$elementname">/; + foreach my $option (@Options) { + $Str .= qq/\n <option value="$option"/; + $Str .= " selected " if ($option eq $selected); + $Str .= ">$option<\/option>"; + } + $Str .= "\n</select>"; + return $Str; +} ####################################################### ####################################################### =pod -=item &CreateTableHeadings() +=head2 HTML output routines -Create HTML for the columns of student data to show. -Called by &BuildStudentAssessmentPage(). Calls -&Apache::lonhtmlcommon::CreateHeadings(). +=item &html_initialize($r) -Inputs: +Create labels for the columns of student data to show. -=over 4 +=item &html_outputstudent($r,$student) -=item $cache The ubiquitous cache - -=item $spacing A string of spaces - -=item $infoKeys Array ref to names of keys to display from the cache -which describe students - -=item $infoHeadings Array ref to headings of columns for student info - -=item $sequenceKeys Array ref of names of keys to use to retrieve sequence -data from the cache - -=item $sequenceHeadings Array ref of names of sequences used for output. - -=back +Return a line of the chart for a student. -Returns: A string containing the HTML of the table headings. +=item &html_finish($r) =cut ####################################################### ####################################################### -sub CreateTableHeadings { +{ + my $padding; + my $count; + +sub html_initialize { + my ($r) = @_; # $padding = ' 'x3; + $count = 1; # - my $Str = '<pre>'; + my $Str = "<pre>\n"; # First, the @StudentData fields need to be listed - my @to_show = @Apache::lonstatistics::SelectedStudentData; - foreach (@to_show) { - if ($_ eq 'all') { - @to_show = @Apache::lonstatistics::StudentDataOrder; - last; - } - } + my @to_show = &get_student_fields_to_show(); foreach my $field (@to_show) { my $title=$Apache::lonstatistics::StudentData{$field}->{'title'}; my $base =$Apache::lonstatistics::StudentData{$field}->{'base_width'}; @@ -249,48 +361,27 @@ $Str .= $title.' 'x($width-$base).$padding; } # Now the selected sequences need to be listed - foreach my $map_symb (@Apache::lonstatistics::SelectedMaps) { - foreach my $sequence (@Apache::lonstatistics::Sequences) { - next if ($sequence->{'symb'} ne $map_symb && $map_symb ne 'all'); - next if ($sequence->{'num_assess'} < 1); - my $title = $sequence->{'title'}; - my $base = $sequence->{'base_width'}; - my $width = $sequence->{'width'}; - $Str .= $title.' 'x($width-$base).$padding; - } + foreach my $sequence (&get_sequences_to_show) { + my $title = $sequence->{'title'}; + my $base = $sequence->{'base_width'}; + my $width = $sequence->{'width'}; + $Str .= $title.' 'x($width-$base).$padding; } - $Str .= 'total'; - $Str .= "</pre>\n"; - return $Str; + $Str .= "total (of shown problems)</pre>\n"; + $Str .= "<pre>"; + $r->print($Str); + $r->rflush(); + return; } -####################################################### -####################################################### - -=pod - -=item &ChartOutputStudent($student) - -Return a line of the chart for a student. - -=cut - -####################################################### -####################################################### -sub ChartOutputStudent { - my $student = shift; +sub html_outputstudent { + my ($r,$student) = @_; my $Str = ''; # First, the @StudentData fields need to be listed - my @to_show = @Apache::lonstatistics::SelectedStudentData; - foreach (@to_show) { - if ($_ eq 'all') { - @to_show = @Apache::lonstatistics::StudentDataOrder; - last; - } - } + my @to_show = &get_student_fields_to_show(); foreach my $field (@to_show) { my $title=$student->{$field}; - my $base =scalar(my @Tmp = split(//,$title)); + my $base = length($title); my $width=$Apache::lonstatistics::StudentData{$field}->{'width'}; $Str .= $title.' 'x($width-$base).$padding; } @@ -304,22 +395,34 @@ } if (scalar(@tmp) < 1) { $Str .= '<font color="blue">No Course Data</font>'."\n"; - return $Str; + $r->print($Str); + $r->rflush(); + return; } # # By sequence build up the data my $studentstats; - foreach my $map_symb (@Apache::lonstatistics::SelectedMaps) { - foreach my $seq (@Apache::lonstatistics::Sequences) { - next if ($map_symb ne $seq->{'symb'} && $map_symb ne 'all'); - next if ($seq->{'num_assess'} < 1); - my ($performance,$score,$seq_max) = - &StudentPerformanceOnSequence($student,\%StudentsData, - $seq,'linkify'); - $Str .= $performance.$padding; - $studentstats->{$seq->{'symb'}}->{'score'}= $score; - $studentstats->{$seq->{'symb'}}->{'max'} = $seq_max; + my $PerformanceStr = ''; + foreach my $seq (&get_sequences_to_show) { + my ($performance,$score,$seq_max) = + &StudentPerformanceOnSequence($student,\%StudentsData, + $seq,$show_links); + my $ratio = $score.'/'.$seq_max; + # + if ($show eq 'totals') { + $performance = ' 'x(length($seq_max)-length($score)).$ratio; + $performance .= ' 'x($seq->{'width'}-length($performance)); + } else { + # Pad with extra spaces + $performance .= ' 'x($seq->{'width'}-$seq_max- + length($ratio) + ).$ratio; } + # + $Str .= $performance.$padding; + # + $studentstats->{$seq->{'symb'}}->{'score'}= $score; + $studentstats->{$seq->{'symb'}}->{'max'} = $seq_max; } # # Total it up and store the statistics info. @@ -330,24 +433,119 @@ $score += $seq_stats->{'score'}; $max += $seq_stats->{'max'}; } - my $scorelength = scalar(my @tmp1 = split(//,$score)); - my $maxlength = scalar(my @tmp2 = split(//,$max)); - $Str .= ' '.' 'x($maxlength-$scorelength).$score.'/'.$max; + $Str .= ' '.' 'x(length($max)-length($score)).$score.'/'.$max; $Str .= " \n"; - return $Str; + $r->print($Str); + # + $count++; + if($count % 5 == 0) { + $r->print("</pre><pre>"); + } + # + $r->rflush(); + return; } +sub html_finish { + my ($r) = @_; + $r->print("</pre>\n"); + $r->rflush(); + return; +} + +} + ####################################################### ####################################################### =pod -=back +=head2 EXCEL subroutines + +=item &excel_initialize($r) + +=item &excel_outputstudent($r,$student) + +=item &excel_finish($r) + +=cut + +####################################################### +####################################################### +{ + +my $excel_sheet; + +sub excel_initialize { + my ($r) = @_; + # + $r->print("<h1>Not implemented yet</h1>"); + return; + my $filename = '/prtspool/'. + $ENV{'user.name'}.'_'.$ENV{'user.domain'}.'_'. + time.'_'.rand(1000000000).'.xls'; + $excel_sheet = Spreadsheet::WriteExcel->new('/home/httpd'.$filename); + if (! defined($excel_sheet)) { + $r->log_error("Error creating excel spreadsheet $filename: $!"); + $r->print("Problems creating new Excel file. ". + "This error has been logged. ". + "Please alert your LON-CAPA administrator"); + return 0; + } + # + # The excel spreadsheet stores temporary data in files, then put them + # together. If needed we should be able to disable this (memory only). + # The temporary directory must be specified before calling 'addworksheet'. + # File::Temp is used to determine the temporary directory. + $excel_sheet->set_tempdir($Apache::lonnet::tmpdir); + # + # Determine the name to give the worksheet +# $excel_sheet->addworksheet(); + + return; +} + +sub excel_outputstudent { + my ($r,$student) = @_; +} + +sub excel_finish { + my ($r) = @_; +} + +} +####################################################### +####################################################### + +=pod + +=head2 CSV output routines + +=item &csv_initialize($r) + +=item &csv_outputstudent($r,$student) + +=item &csv_finish($r) =cut ####################################################### ####################################################### +{ + +sub csv_initialize{ + my ($r) = @_; + $r->print("<h1>Not implemented yet</h1>"); + return; +} + +sub csv_outputstudent { + my ($r,$student) = @_; +} + +sub csv_finish { + my ($r) = @_; +} } @@ -377,9 +575,10 @@ ####################################################### ####################################################### sub StudentPerformanceOnSequence { - my ($student,$studentdata,$seq,$links) = @_; + my ($student,$studentdata,$seq,$links,$totalonly) = @_; + $totalonly = 0 if (! defined($totalonly)); + $links = 'no' if (! defined($links)); my $Str = ''; - my $output_width = 0; my ($sum,$max) = (0,0); foreach my $resource (@{$seq->{'contents'}}) { next if ($resource->{'type'} ne 'assessment'); @@ -426,8 +625,7 @@ } } # - $output_width++; - if (defined($links) && $symbol ne ' ') { + if ($links eq 'yes' && $symbol ne ' ') { $symbol = '<a href="/adm/grades'. '?symb='.&Apache::lonnet::escape($resource->{'symb'}). '&student='.$student->{'username'}. @@ -438,13 +636,6 @@ } $Str .= $value; } - # Put on the totals - my $ratio = $sum.'/'.$max; - my $ratio_length = scalar(my @tmp1 = split(//,$ratio)); - # Pad with extra spaces - my $width = $seq->{'width'}; - $Str .= ' 'x($width-$output_width-$ratio_length).$ratio; - # return ($Str,$sum,$max); } --matthew1046719709-- From lon-capa-cvs@mail.lon-capa.org Mon Mar 3 20:24:25 2003 From: lon-capa-cvs@mail.lon-capa.org (www) Date: Mon, 03 Mar 2003 20:24:25 -0000 Subject: [LON-CAPA-cvs] cvs: rat / lonpageflip.pm Message-ID: <cvswww1046723065@cvsserver> www Mon Mar 3 15:24:25 2003 EDT Modified files: /rat lonpageflip.pm Log: URLs to go to should not be pulled from the symb, since that will lack query strings and public/wrapper prefixes. Index: rat/lonpageflip.pm diff -u rat/lonpageflip.pm:1.35 rat/lonpageflip.pm:1.36 --- rat/lonpageflip.pm:1.35 Sat Mar 1 10:13:59 2003 +++ rat/lonpageflip.pm Mon Mar 3 15:24:25 2003 @@ -2,7 +2,7 @@ # # Page flip handler # -# $Id: lonpageflip.pm,v 1.35 2003/03/01 15:13:59 www Exp $ +# $Id: lonpageflip.pm,v 1.36 2003/03/03 20:24:25 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -198,8 +198,13 @@ untie(%hash); } my $newloc; - if ($last) { - $newloc=&Apache::lonnet::clutter((split(/\_\_\_/,$last))[1]); + if (($last) && (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'.db', + &GDBM_READER(),0640))) { + my ($murl,$mid,$fn)=split(/\_\_\_/,$last); + $newloc=$hash{'src_'. + $hash{'map_pc_'.&Apache::lonnet::clutter($murl)}. + '.'.$mid}; + untie %hash; } else { $newloc='/adm/noidea.html'; } From lon-capa-cvs@mail.lon-capa.org Mon Mar 3 20:26:08 2003 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Mon, 03 Mar 2003 20:26:08 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm Message-ID: <cvsalbertel1046723168@cvsserver> albertel Mon Mar 3 15:26:08 2003 EDT Modified files: /loncom/interface lonprintout.pm Log: - wizard seems to only bomb, disabling it by default Index: loncom/interface/lonprintout.pm diff -u loncom/interface/lonprintout.pm:1.124 loncom/interface/lonprintout.pm:1.125 --- loncom/interface/lonprintout.pm:1.124 Fri Feb 28 18:42:18 2003 +++ loncom/interface/lonprintout.pm Mon Mar 3 15:26:08 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.124 2003/02/28 23:42:18 bowersj2 Exp $ +# $Id: lonprintout.pm,v 1.125 2003/03/03 20:26:08 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1205,7 +1205,7 @@ my $r = shift; # A hook for me to work without disturbing Alex. - if (!$ENV{'form.jeremy'}) { + if ($ENV{'form.jeremy'}) { printWizard($r); return OK; } From lon-capa-cvs@mail.lon-capa.org Mon Mar 3 20:35:20 2003 From: lon-capa-cvs@mail.lon-capa.org (www) Date: Mon, 03 Mar 2003 20:35:20 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonmenu.pm Message-ID: <cvswww1046723720@cvsserver> www Mon Mar 3 15:35:20 2003 EDT Modified files: /loncom/interface lonmenu.pm Log: When reloading URL, don't forget the query string. Index: loncom/interface/lonmenu.pm diff -u loncom/interface/lonmenu.pm:1.45 loncom/interface/lonmenu.pm:1.46 --- loncom/interface/lonmenu.pm:1.45 Mon Mar 3 08:03:58 2003 +++ loncom/interface/lonmenu.pm Mon Mar 3 15:35:20 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Routines to control the menu # -# $Id: lonmenu.pm,v 1.45 2003/03/03 13:03:58 www Exp $ +# $Id: lonmenu.pm,v 1.46 2003/03/03 20:35:20 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -245,7 +245,7 @@ $newmail $buttons swmenu.currentURL=window.location.pathname; - swmenu.reloadURL=window.location.pathname; + swmenu.reloadURL=window.location.pathname+window.location.search; swmenu.currentSymb="$ENV{'request.symb'}"; swmenu.reloadSymb="$ENV{'request.symb'}"; swmenu.currentStale=0; From lon-capa-cvs@mail.lon-capa.org Mon Mar 3 20:58:18 2003 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Mon, 03 Mar 2003 20:58:18 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm Message-ID: <cvsalbertel1046725098@cvsserver> albertel Mon Mar 3 15:58:18 2003 EDT Modified files: /loncom/interface lonprintout.pm Log: - name code handling cleanup - need to check if section is -1 (This means no section) Index: loncom/interface/lonprintout.pm diff -u loncom/interface/lonprintout.pm:1.125 loncom/interface/lonprintout.pm:1.126 --- loncom/interface/lonprintout.pm:1.125 Mon Mar 3 15:26:08 2003 +++ loncom/interface/lonprintout.pm Mon Mar 3 15:58:18 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.125 2003/03/03 20:26:08 albertel Exp $ +# $Id: lonprintout.pm,v 1.126 2003/03/03 20:58:18 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -370,6 +370,7 @@ $sdom,$sname); my $section=&Apache::lonnet::usection ($sdom,$sname,$ENV{'request.course.id'}); + if ($section == -1) { $section = ''; } $r->print( '<br /><input type=checkbox name="whomtoprint'.$i.'" value="'.$section.':'.$_.'"> '. $reply{'firstname'}.' '. @@ -607,7 +608,7 @@ foreach my $person (@students) { my $current_output = ''; my ($usersection,$username,$userdomain) = split /:/,$person; - my $fullname = &Apache::grades::get_fullname($username,$userdomain); + my $fullname = &get_name($username,$userdomain); #goes through all resources, checks if they are available for current student, and produces output foreach my $curresline (@master_seq) { my ($curres,$symb) = split /&&/, $curresline; @@ -1104,6 +1105,16 @@ } +sub get_name { + my ($uname,$udom)=@_; + if (!defined($uname)) { $uname=$ENV{'user.name'}; } + if (!defined($udom)) { $uname=$ENV{'user.domain'}; } + my $plainname=&Apache::loncommon::plainname($uname,$udom); + if ($plainname=~/^\s*$/) { $plainname=$uname; } + return &Apache::lonxml::latex_special_symbols($plainname,undef,undef, + 'header'); +} + sub page_format_transformation { my ($papersize,$layout,$numberofcolumns,$choice,$text,$assignment) = @_; my ($textwidth,$textheight,$oddoffset,$evenoffset); @@ -1113,14 +1124,17 @@ } else { ($textwidth,$textheight,$oddoffset,$evenoffset) = ($ENV{'form.width'},$ENV{'form.height'},$ENV{'form.leftmargin'},$ENV{'form.leftmargin'}); } - my $firstname = &Apache::lonxml::latex_special_symbols(&Apache::lonnet::unescape($ENV{'environment.firstname'}),'','','header'); - my $lastname = &Apache::lonxml::latex_special_symbols(&Apache::lonnet::unescape($ENV{'environment.lastname'}),'','','header'); + my $name = &get_name(); + if ($name =~ /^\s*$/) { + $name=&Apache::lonxml::latex_special_symbols($ENV{'user.name'},undef, + undef,'header'); + } my $courseidinfo = &Apache::lonxml::latex_special_symbols(&Apache::lonnet::unescape($ENV{'course.'.$ENV{'request.course.id'}.'.description'}),'','','header'); if ($layout eq 'CBI') { - $text =~ s/\\begin{document}/\\setlength{\\oddsidemargin}{$oddoffset}\\setlength{\\evensidemargin}{$evenoffset}\\setlength{\\topmargin}{200pt}\\setlength{\\textwidth}{$textwidth}\\setlength{\\textheight}{$textheight}\\setlength{\\parindent}{20pt}\\setlength{\\marginparwidth}{90pt}\\setlength{\\textfloatsep}{8pt plus 2\.0pt minus 4\.0pt}\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm} \\begin{document}\\setcounter{page}{1}\\noindent\\parbox{\\minipagewidth}{\\noindent\\fbox{\\textbf{$firstname $lastname}} \\hfill $courseidinfo} \\vskip 5 mm /; + $text =~ s/\\begin{document}/\\setlength{\\oddsidemargin}{$oddoffset}\\setlength{\\evensidemargin}{$evenoffset}\\setlength{\\topmargin}{200pt}\\setlength{\\textwidth}{$textwidth}\\setlength{\\textheight}{$textheight}\\setlength{\\parindent}{20pt}\\setlength{\\marginparwidth}{90pt}\\setlength{\\textfloatsep}{8pt plus 2\.0pt minus 4\.0pt}\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm} \\begin{document}\\setcounter{page}{1}\\noindent\\parbox{\\minipagewidth}{\\noindent\\fbox{\\textbf{$name}} \\hfill $courseidinfo} \\vskip 5 mm /; } elsif ($layout eq 'CAPA') { if ($choice ne 'All class print') { - $text =~ s/\\begin{document}/\\textheight $textheight\\oddsidemargin = $evenoffset\\evensidemargin = $evenoffset\\textwidth= $textwidth\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\usepackage{fancyhdr}\\pagestyle{fancy}\\rhead{}\\chead{}\\lhead{\\textbf{$firstname $lastname} - $courseidinfo \\hfill \\thepage \\\\ \\textit{$assignment}}\\begin{document}\\voffset=-0\.8 cm\\setcounter{page}{1}/; + $text =~ s/\\begin{document}/\\textheight $textheight\\oddsidemargin = $evenoffset\\evensidemargin = $evenoffset\\textwidth= $textwidth\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\usepackage{fancyhdr}\\pagestyle{fancy}\\rhead{}\\chead{}\\lhead{\\textbf{$name} - $courseidinfo \\hfill \\thepage \\\\ \\textit{$assignment}}\\begin{document}\\voffset=-0\.8 cm\\setcounter{page}{1}/; } else { $text =~ s/\\pagestyle{fancy}\\rhead{}\\chead{}\s*\\begin{document}/\\textheight $textheight\\oddsidemargin = $evenoffset\\evensidemargin = $evenoffset\\textwidth= $textwidth\\newlength{\\minipagewidth}\\setlength{\\minipagewidth}{\\textwidth\/\$number_of_columns-0\.2cm}\\renewcommand{\\ref}{\\keephidden\}\\pagestyle{fancy}\\rhead{}\\chead{}\\begin{document}\\voffset=-0\.8cm\\setcounter{page}{1} \\vskip 5 mm /; From lon-capa-cvs@mail.lon-capa.org Mon Mar 3 21:52:24 2003 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Mon, 03 Mar 2003 21:52:24 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface loncoursedata.pm lonhtmlcommon.pm /interface/statistics lonproblemanalysis.pm Message-ID: <cvsalbertel1046728344@cvsserver> This is a MIME encoded message --albertel1046728344 Content-Type: text/plain albertel Mon Mar 3 16:52:24 2003 EDT Modified files: /loncom/interface lonhtmlcommon.pm loncoursedata.pm /loncom/interface/statistics lonproblemanalysis.pm Log: - adding timing info to the popwin, and adding new functionality, - converted stats to use new interface --albertel1046728344 Content-Type: text/plain Content-Disposition: attachment; filename="albertel-20030303165224.txt" Index: loncom/interface/lonhtmlcommon.pm diff -u loncom/interface/lonhtmlcommon.pm:1.13 loncom/interface/lonhtmlcommon.pm:1.14 --- loncom/interface/lonhtmlcommon.pm:1.13 Thu Feb 20 09:34:59 2003 +++ loncom/interface/lonhtmlcommon.pm Mon Mar 3 16:52:24 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.13 2003/02/20 14:34:59 matthew Exp $ +# $Id: lonhtmlcommon.pm,v 1.14 2003/03/03 21:52:24 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -640,33 +640,57 @@ # Create progress sub Create_PrgWin { - my ($r, $title, $heading)=@_; + my ($r, $title, $heading, $number_to_do)=@_; $r->print('<script>'. "popwin=open(\'\',\'popwin\',\'width=400,height=100\');". - "popwin.document.writeln(\'<html><body bgcolor=\"#88DDFF\">". - "<title>$title". + "popwin.document.writeln(\'$title". + "". "

$heading

". "
". - "
". + "". "\');". "popwin.document.close();". ""); + my %prog_state; + $prog_state{'now'}=0; + $prog_state{'since'}=time; + $prog_state{'started'}=time; + $prog_state{'total'}=$number_to_do; + $r->rflush(); + return %prog_state; } # update progress sub Update_PrgWin { - my ($displayString,$r)=@_; + my ($r,$prog_state,$displayString)=@_; $r->print(''); + $$prog_state{'started'}=time; + $r->rflush(); +} + +# increment progress state +sub Increment_PrgWin { + my ($r,$prog_state,$extraInfo)=@_; + $$prog_state{'now'}++; + $r->print(''); + $$prog_state{'started'}=time; + sleep 1; $r->rflush(); } # close Progress Line sub Close_PrgWin { - my ($r)=@_; + my ($r,$prog_state)=@_; $r->print(''."\n"); + undef(%$prog_state); $r->rflush(); } Index: loncom/interface/loncoursedata.pm diff -u loncom/interface/loncoursedata.pm:1.54 loncom/interface/loncoursedata.pm:1.55 --- loncom/interface/loncoursedata.pm:1.54 Fri Feb 28 18:19:01 2003 +++ loncom/interface/loncoursedata.pm Mon Mar 3 16:52:24 2003 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: loncoursedata.pm,v 1.54 2003/02/28 23:19:01 bowersj2 Exp $ +# $Id: loncoursedata.pm,v 1.55 2003/03/03 21:52:24 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1308,21 +1308,20 @@ $WhatIWant .= ')'; # $WhatIWant = '.'; + my %prog_state; if($status eq 'true') { - &Apache::lonhtmlcommon::Create_PrgWin($r, $title, $heading); + %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r, $title, + $heading,($#$students)+1); } - my $displayString; - my $count=0; foreach (@$students) { my %cache; if($c->aborted()) { return 'Aborted'; } if($status eq 'true') { - $count++; - my $displayString = $count.'/'.$studentCount.': '.$_; - &Apache::lonhtmlcommon::Update_PrgWin($displayString, $r); + &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state, + 'last student '.$_); } my $downloadTime='Not downloaded'; @@ -1359,7 +1358,7 @@ next; } } - if($status eq 'true') { &Apache::lonhtmlcommon::Close_PrgWin($r); } + if($status eq 'true') { &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); } return 'OK'; } @@ -1380,10 +1379,11 @@ &CheckForResidualDownload($cacheDB, 'true', 'true', $courseID, $r, $c); my $studentCount = scalar(@$students); + my %prog_state; if($status eq 'true') { - &Apache::lonhtmlcommon::Create_PrgWin($r, $title, $heading); + %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r, $title, + $heading,($#$students)+1); } - my $count=0; my $displayString=''; foreach (@$students) { if($c->aborted()) { @@ -1391,9 +1391,8 @@ } if($status eq 'true') { - $count++; - $displayString = $count.'/'.$studentCount.': '.$_; - &Apache::lonhtmlcommon::Update_PrgWin($displayString, $r); + &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state, + 'last student '.$_); } my %cache; @@ -1438,7 +1437,8 @@ } untie(%downloadData); } - if($status eq 'true') { &Apache::lonhtmlcommon::Close_PrgWin($r); } + if($status eq 'true') { &Apache::lonhtmlcommon::Close_PrgWin($r, + \%prog_state); } return &CheckForResidualDownload($cacheDB, 'true', 'true', $courseID, $r, $c); @@ -1477,8 +1477,10 @@ my $heading = 'Process Course Data'; my $title = 'LON-CAPA Statistics'; my $studentCount = scalar(@students); + my %prog_state; if($status eq 'true') { - &Apache::lonhtmlcommon::Create_PrgWin($r, $title, $heading); + %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r, $title, + $heading,$#students+1); } my $count=1; @@ -1486,8 +1488,8 @@ last if($c->aborted()); if($status eq 'true') { - my $displayString = $count.'/'.$studentCount.': '.$name; - &Apache::lonhtmlcommon::Update_PrgWin($displayString, $r); + &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state, + 'last student '.$name); } if($extract eq 'true') { @@ -1498,7 +1500,8 @@ $count++; } - if($status eq 'true') { &Apache::lonhtmlcommon::Close_PrgWin($r); } + if($status eq 'true') { &Apache::lonhtmlcommon::Close_PrgWin($r, + \%prog_state); } untie(%cache); untie(%downloadData); Index: loncom/interface/statistics/lonproblemanalysis.pm diff -u loncom/interface/statistics/lonproblemanalysis.pm:1.19 loncom/interface/statistics/lonproblemanalysis.pm:1.20 --- loncom/interface/statistics/lonproblemanalysis.pm:1.19 Tue Feb 25 15:47:47 2003 +++ loncom/interface/statistics/lonproblemanalysis.pm Mon Mar 3 16:52:24 2003 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonproblemanalysis.pm,v 1.19 2003/02/25 20:47:47 matthew Exp $ +# $Id: lonproblemanalysis.pm,v 1.20 2003/03/03 21:52:24 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -173,20 +173,20 @@ $Str = ''; if($c->aborted()) { untie(%cache); return; } - &Apache::lonhtmlcommon::Create_PrgWin($r, $title, $heading); - my $count=0; + my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r, $title, + $heading,$#students+1); + #Java script Progress window for(my $index=0; $index<(scalar @$students); $index++) { if($c->aborted()) { untie(%cache); return; } - $count++; - my $displayString = $count.'/'.$studentCount.': '.$_; - &Apache::lonhtmlcommon::Update_PrgWin($displayString, $r); + &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state, + 'last student '.$students->[$index]); &OpStatus($problemId, $students->[$index], \%ConceptData, $analyzeData->{'foil_to_concept'}, $analyzeData, \%cache, $courseID); } - &Apache::lonhtmlcommon::Close_PrgWin($r); + &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); $Str .= '
'; for (my $k=0; $k<$interval; $k++ ) { --albertel1046728344-- From lon-capa-cvs@mail.lon-capa.org Mon Mar 3 21:53:15 2003 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Mon, 03 Mar 2003 21:53:15 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm Message-ID: albertel Mon Mar 3 16:53:15 2003 EDT Modified files: /loncom/interface lonprintout.pm Log: - adding status info to printing out whole class Index: loncom/interface/lonprintout.pm diff -u loncom/interface/lonprintout.pm:1.126 loncom/interface/lonprintout.pm:1.127 --- loncom/interface/lonprintout.pm:1.126 Mon Mar 3 15:58:18 2003 +++ loncom/interface/lonprintout.pm Mon Mar 3 16:53:15 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.126 2003/03/03 20:58:18 albertel Exp $ +# $Id: lonprintout.pm,v 1.127 2003/03/03 21:53:15 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -605,6 +605,7 @@ my %moreenv; $moreenv{'form.textwidth'}=$LaTeXwidth; &Apache::lonnet::appenv(%moreenv); + my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin2($r,'Print Status','Class Print Status',$#students+1); foreach my $person (@students) { my $current_output = ''; my ($usersection,$username,$userdomain) = split /:/,$person; @@ -638,7 +639,10 @@ $result .= $current_output; &Apache::lonnet::delenv('form.counter'); &Apache::lonxml::init_counter(); + &Apache::lonhtmlcommon::Increment_PrgWin2($r,\%prog_state, + 'last student '.$fullname); } + &Apache::lonhtmlcommon::Close_PrgWin2($r,\%prog_state); $result .= '\end{document}'; &Apache::lonnet::delenv('form.textwidth'); } elsif ($choice eq 'Subdirectory print') { From lon-capa-cvs@mail.lon-capa.org Mon Mar 3 22:00:03 2003 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Mon, 03 Mar 2003 22:00:03 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonhtmlcommon.pm lonspreadsheet.pm /interface/statistics lonproblemanalysis.pm Message-ID: albertel Mon Mar 3 17:00:03 2003 EDT Modified files: /loncom/interface lonspreadsheet.pm lonhtmlcommon.pm /loncom/interface/statistics lonproblemanalysis.pm Log: - converted lonspreadsheet to use new mechanism - removed debugging sleep - typo in lonproblemanalysis Index: loncom/interface/lonspreadsheet.pm diff -u loncom/interface/lonspreadsheet.pm:1.172 loncom/interface/lonspreadsheet.pm:1.173 --- loncom/interface/lonspreadsheet.pm:1.172 Mon Feb 17 11:29:51 2003 +++ loncom/interface/lonspreadsheet.pm Mon Mar 3 17:00:03 2003 @@ -1,5 +1,5 @@ # -# $Id: lonspreadsheet.pm,v 1.172 2003/02/17 16:29:51 matthew Exp $ +# $Id: lonspreadsheet.pm,v 1.173 2003/03/03 22:00:03 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3198,20 +3198,12 @@ foreach ($self->rows()) { $total++ if ($formulas{'A'.$_} !~ /^[!~-]/); } - my $now=0; - my $since=time; - $r->print(< - popwin=open('','popwin','width=400,height=100'); - popwin.document.writeln(''+ - '

Spreadsheet Calculation Progress

'+ - '
'+ - '
'+ - ''); - popwin.document.close(); - -ENDPOP - $r->rflush(); + + my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r, + 'Spreadsheet Status','Spreadsheet Calculation Progress', $total); + &Apache::lonhtmlcommon::Update_PrgWin($r,\%prog_state, + 'Processing Course Assessment Data'); + # It would be nice to load in the classlist and assessment info at this # point, before attacking the student spreadsheets. foreach my $row ($self->rows()) { @@ -3225,13 +3217,8 @@ my @studentdata=$self->exportsheet($sname,$sdom,'studentcalc', undef,undef,$r); undef %userrdatas; - $now++; - $r->print(''); - $r->rflush(); - # + &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state, + 'last student'); my $index=0; foreach ('A','B','C','D','E','F','G','H','I','J','K','L','M', 'N','O','P','Q','R','S','T','U','V','W','X','Y','Z') { @@ -3251,8 +3238,7 @@ } $self->formulas(\%formulas); $self->constants(\%constants); - $r->print(''); - $r->rflush(); + &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); } # ------------------------------------------------ Load data for one assessment Index: loncom/interface/lonhtmlcommon.pm diff -u loncom/interface/lonhtmlcommon.pm:1.14 loncom/interface/lonhtmlcommon.pm:1.15 --- loncom/interface/lonhtmlcommon.pm:1.14 Mon Mar 3 16:52:24 2003 +++ loncom/interface/lonhtmlcommon.pm Mon Mar 3 17:00:03 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.14 2003/03/03 21:52:24 albertel Exp $ +# $Id: lonhtmlcommon.pm,v 1.15 2003/03/03 22:00:03 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -682,7 +682,6 @@ ' secs remaining ('.(time-$$prog_state{'started'}). ' seconds for '.$extraInfo.')";'.''); $$prog_state{'started'}=time; - sleep 1; $r->rflush(); } Index: loncom/interface/statistics/lonproblemanalysis.pm diff -u loncom/interface/statistics/lonproblemanalysis.pm:1.20 loncom/interface/statistics/lonproblemanalysis.pm:1.21 --- loncom/interface/statistics/lonproblemanalysis.pm:1.20 Mon Mar 3 16:52:24 2003 +++ loncom/interface/statistics/lonproblemanalysis.pm Mon Mar 3 17:00:03 2003 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonproblemanalysis.pm,v 1.20 2003/03/03 21:52:24 albertel Exp $ +# $Id: lonproblemanalysis.pm,v 1.21 2003/03/03 22:00:03 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -175,7 +175,7 @@ my %prog_state=&Apache::lonhtmlcommon::Create_PrgWin($r, $title, - $heading,$#students+1); + $heading,$#$students+1); #Java script Progress window for(my $index=0; $index<(scalar @$students); $index++) { From lon-capa-cvs@mail.lon-capa.org Mon Mar 3 22:54:05 2003 From: lon-capa-cvs@mail.lon-capa.org (matthew) Date: Mon, 03 Mar 2003 22:54:05 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface/statistics lonstudentassessment.pm Message-ID: This is a MIME encoded message --matthew1046732045 Content-Type: text/plain matthew Mon Mar 3 17:54:05 2003 EDT Modified files: /loncom/interface/statistics lonstudentassessment.pm Log: Implemented Excel output. Should be pretty much done. Two output modes. One gives score and max possible for each sequence for each student. Second gives only scores for each sequence for each student, saving columns. Beginning to change output selector. --matthew1046732045 Content-Type: text/plain Content-Disposition: attachment; filename="matthew-20030303175405.txt" Index: loncom/interface/statistics/lonstudentassessment.pm diff -u loncom/interface/statistics/lonstudentassessment.pm:1.31 loncom/interface/statistics/lonstudentassessment.pm:1.32 --- loncom/interface/statistics/lonstudentassessment.pm:1.31 Mon Mar 3 14:28:29 2003 +++ loncom/interface/statistics/lonstudentassessment.pm Mon Mar 3 17:54:05 2003 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentassessment.pm,v 1.31 2003/03/03 19:28:29 matthew Exp $ +# $Id: lonstudentassessment.pm,v 1.32 2003/03/03 22:54:05 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -83,7 +83,7 @@ =item $output_mode 'html', 'excel', or 'csv' for output mode -=item $show 'all' or 'totals' determines how much data is output +=item $show 'all', 'totals', or 'scores' determines how much data is output =cut @@ -270,14 +270,41 @@ ####################################################### ####################################################### +my @OutputOptions = + ({ name => 'HTML, with links', + value => 'html, with links', + description => ''}, + { name => 'HTML, without links', + value => 'html, without links', + description => ''}, + { name => 'HTML, totals', + value => 'html, totals', + description => ''}, + { name => 'HTML, scores only', + value => 'html, scores only', + description => ''}, + { name => 'Excel, totals', + value => 'excel, totals', + description => ''}, + { name => 'Excel, scores only', + value => 'excel, scores only', + description => ''}, + { name => 'CSV, totals', + value => 'csv, totals', + description => ''}, + { name => 'CSV, scores only', + value => 'csv, scores only', + description => ''}, + { name => 'CSV, everything', + value => 'csv, everything', + description => ''} + ); + sub CreateAndParseOutputSelector { my $Str = ''; my $elementname = 'outputmode'; # # Format for output options is 'mode, restrictions'; - my @Options = ('html, with links','html, without links', - 'html, totals only','excel, totals only', - 'csv, totals only','csv, everything'); my $selected = 'html, with links'; if (exists($ENV{'form.'.$elementname})) { if (ref($ENV{'form.'.$elementname} eq 'ARRAY')) { @@ -303,18 +330,20 @@ } else { $show_links = 'no'; } - if ($restriction eq 'totals only') { + if ($restriction eq 'totals') { $show = 'totals'; + } elsif ($restriction eq 'scores only') { + $show = 'scores'; } else { $show = 'everything'; } # # Build the form element $Str = qq/"; return $Str; @@ -412,6 +441,9 @@ if ($show eq 'totals') { $performance = ' 'x(length($seq_max)-length($score)).$ratio; $performance .= ' 'x($seq->{'width'}-length($performance)); + } elsif ($show eq 'scores') { + $performance = $score; + $performance .= ' 'x($seq->{'width'}-length($performance)); } else { # Pad with extra spaces $performance .= ' 'x($seq->{'width'}-$seq_max- @@ -475,42 +507,173 @@ { my $excel_sheet; +my $excel_workbook; + +my $filename; +my $rows_output; +my $cols_output; + +my $num_students; +my $start_time; sub excel_initialize { my ($r) = @_; # - $r->print("

Not implemented yet

"); - return; - my $filename = '/prtspool/'. + $filename = '/prtspool/'. $ENV{'user.name'}.'_'.$ENV{'user.domain'}.'_'. time.'_'.rand(1000000000).'.xls'; - $excel_sheet = Spreadsheet::WriteExcel->new('/home/httpd'.$filename); - if (! defined($excel_sheet)) { + # + $excel_workbook = undef; + $excel_sheet = undef; + # + $rows_output = 0; + $cols_output = 0; + # + $num_students = 0; + $start_time = time; + # + # Create sheet + $excel_workbook = Spreadsheet::WriteExcel->new('/home/httpd'.$filename); + # + # Check for errors + if (! defined($excel_workbook)) { $r->log_error("Error creating excel spreadsheet $filename: $!"); $r->print("Problems creating new Excel file. ". "This error has been logged. ". "Please alert your LON-CAPA administrator"); - return 0; + return ; } # # The excel spreadsheet stores temporary data in files, then put them # together. If needed we should be able to disable this (memory only). # The temporary directory must be specified before calling 'addworksheet'. # File::Temp is used to determine the temporary directory. - $excel_sheet->set_tempdir($Apache::lonnet::tmpdir); + $excel_workbook->set_tempdir($Apache::lonnet::tmpdir); + # + # Add a worksheet + $excel_sheet = $excel_workbook->addworksheet + ($ENV{'course.'.$ENV{'request.course.id'}.'.description'}); + # + # Add the student headers + foreach my $field (&get_student_fields_to_show()) { + $excel_sheet->write(1,$cols_output++,$field); + } + # + # Add the Sequence Headers + foreach my $seq (&get_sequences_to_show) { + $excel_sheet->write(0,$cols_output,$seq->{'title'}); + if ($show eq 'totals') { + $excel_sheet->write(1,$cols_output,'score'); + $excel_sheet->write(1,$cols_output+1,'maximum'); + $cols_output += 2; + } else { + $cols_output++; + } + } + # + # Bookkeeping + if ($show eq 'totals') { + $rows_output = 2; + } else { + $rows_output = 1; + } + # + # Let the user know what we are doing + my $studentcount = scalar(@Apache::lonstatistics::Students); + $r->print("

Compiling Excel spreadsheet for ". + $studentcount.' student'); + $r->print('s') if ($studentcount > 1); + $r->print("

\n"); + $r->rflush(); # - # Determine the name to give the worksheet -# $excel_sheet->addworksheet(); - return; } sub excel_outputstudent { my ($r,$student) = @_; + return if (! defined($excel_sheet)); + $cols_output=0; + # + # Write out student data + my @to_show = &get_student_fields_to_show(); + foreach my $field (@to_show) { + $excel_sheet->write($rows_output,$cols_output++,$student->{$field}); + } + # + # Get student assessment data + my %StudentsData; + my @tmp = &Apache::loncoursedata::get_current_state($student->{'username'}, + $student->{'domain'}, + undef, + $ENV{'request.course.id'}); + if ((scalar @tmp > 0) && ($tmp[0] !~ /^error:/)) { + %StudentsData = @tmp; + } + # + # Write out sequence scores and totals data + foreach my $seq (&get_sequences_to_show) { + my ($performance,$score,$seq_max) = + &StudentPerformanceOnSequence($student,\%StudentsData, + $seq,'no'); + if ($show eq 'totals' || $show eq 'scores') { + $excel_sheet->write($rows_output,$cols_output++,$score); + } + if ($show eq 'totals') { + $excel_sheet->write($rows_output,$cols_output++,$seq_max); + } + } + # + # Bookkeeping + $rows_output++; + $cols_output=0; + # + # Time estimate + $num_students++; + if ($num_students % 10 == 0) { + my $time_est = (time - $start_time)/$num_students * + (scalar(@Apache::lonstatistics::Students)-$num_students); + $time_est = int($time_est); + if (int ($time_est/60) > 0) { + my $min = int($time_est/60); + my $sec = $time_est % 60; + $time_est = $min.' minutes'; + if ($sec > 1) { + $time_est.= ', '.$sec.' seconds'; + } elsif ($sec > 0) { + $time_est.= ', '.$sec.' second'; + } + } else { + $time_est .= ' seconds'; + } + $r->print($num_students.' out of '. + (scalar(@Apache::lonstatistics::Students)). + " students processed. ". + $time_est." remain.
\n"); + $r->rflush(); + } + return; } sub excel_finish { my ($r) = @_; + return if (! defined($excel_sheet)); + # + # Write the excel file + $excel_workbook->close(); + my $c = $r->connection(); + # + return if($c->aborted()); + # + # Tell the user where to get their excel file + $r->print('

'. + 'Your Excel spreadsheet.'."\n"); + my $total_time = time - $start_time; + if (int ($total_time / 60) > 0) { + $total_time = int($total_time/60).' minutes, '.($total_time % 60); + } + $r->print('
'.$total_time.' seconds total'); + $r->rflush(); + return; } } @@ -575,8 +738,7 @@ ####################################################### ####################################################### sub StudentPerformanceOnSequence { - my ($student,$studentdata,$seq,$links,$totalonly) = @_; - $totalonly = 0 if (! defined($totalonly)); + my ($student,$studentdata,$seq,$links) = @_; $links = 'no' if (! defined($links)); my $Str = ''; my ($sum,$max) = (0,0); --matthew1046732045-- From 您好!@zaphod.lite.msu.edu Tue Mar 4 10:53:55 2003 From: 您好!@zaphod.lite.msu.edu (您好!@zaphod.lite.msu.edu) Date: Tue, 04 Mar 03 10:53:55 中国标准时间 Subject: [LON-CAPA-cvs] 我们专业从事网站网页设计 Message-ID: <200303040253.h242raL03224@zaphod.lite.msu.edu> ------=_NextPart_000_000B_3DB20006.B9160014 Content-Type: multipart/alternative; boundary="----=_NextPart_001_000C_3DB20006.B9160014" ------=_NextPart_001_000C_3DB20006.B9160014 Content-Type: text/plain; charset=gb2312 Content-Transfer-Encoding: quoted-printable 这是用超文本格式编写的邮件,请使用超文本方式浏览。 --------------------------- =C8=E7=B9=FB=D5=E2=B7=E2=D3=CA=BC=FE=B4=F2=C8=C5=C4=FA=C1=CB=A3=AC=B7=B3=C7= =EB=CB=E6=CA=D6=C9=BE=B5=F4=A3=AC=B2=A2=C7=EB=BC=FB=C1=C2=A1=A3 =C8=F4=C4=FA=B2=BB=CF=A3=CD=FB=D4=D9=B4=CE=CA=D5=B5=BD=CE=D2=C3=C7=B5=C4=D3= =CA=BC=FE=A3=AC=C7=EB=B5=E3=BB=F7=D5=E2=C0=EF=A1=A3 http://www.shangpala.com/unsub/unsubscribe.asp?id=3D2521&language=3Dgb2312= ?id=3D4768&language=3Dgb2312 ------=_NextPart_001_000C_3DB20006.B9160014 Content-Type: text/html; charset=gb2312 Content-Transfer-Encoding: quoted-printable =C3=C0=B6=FB=BB=A5=C1=AA=CD=F8=D5=BE=C9=E8=BC=C6=B9=A4=D7=F7=CA=D2<= /title> <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dgb2312">= </head> <body bgcolor=3D"#FFFFFF" text=3D"#000000">=C4=FA=BA=C3=A3=A1=D5=E2=CA=C7=D2= =BB=B7=E2=C9=C6=D2=E2=B5=C4=C9=CC=D2=B5=D3=CA=BC=FE,=BE=B4=C7=EB=BA=A3=BA=AD= !<br><br> =A1=A1=A1=A1<a href=3D"http://mere.cn.gs" target=3D"_blank">=C3=C0=B6=FB=BB= =A5=C1=AA=CD=F8=D5=BE=C9=E8=BC=C6=B9=A4=D7=F7=CA=D2=A3=A8=CD=F8=D6=B7=A3=BA= http://mere.cn.gs=A3=A9</a>=D7=A8=D2=B5=B4=D3=CA=C2=CD=F8=D5=BE=CD=F8=D2=B3= =C9=E8=BC=C6=A1=A2=CD=F8=D5=BE=CA=FD =BE=DD=BF=E2=B1=E0=B3=CC=A1=A2=C6=BD=C3=E6=B9=E3=B8=E6=C9=E8=BC=C6=A3=A1=D3= =D0=D0=E8=D2=AA=CE=D2=C3=C7=B7=FE=CE=F1=B5=C4=C5=F3=D3=D1=BF=C9=D2=D4=D6=B1= =BD=D3=B8=FA=D5=BE=B3=A4=C1=AA=CF=B5=A3=BA0755-26383669=D1=EE=C9=FA <p>=A1=A1=A1=A1 =CE=AA=C8=C3=B8=FC=B6=E0=B5=C4=C6=F3=CA=C2=D2=B5=B5=A5=CE=BB= =CA=DC=D2=E6=A1=A2=D4=F6=C7=BF=C6=F3=D2=B5=BE=BA=D5=F9=C1=A6=BA=CD=CA=F7=C1= =A2=C6=F3=D2=B5=D0=CE=CF=F3,<a href=3D"http://mere.cn.gs" target=3D"_blank"= >=C3=C0=B6=FB=BB=A5=C1=AA=CD=F8=D5=BE=C9=E8=BC=C6=B9=A4=D7=F7=CA=D2=A3=A8=CD= =F8=D6=B7=A3=BAhttp://mere.cn.gs=A3=A9</a> =CD=C6=B3=F6=C8=AB=B9=FA=A3=A8=D7=EE=D3=C5=B5=C4=C9=E8=BC=C6=D6=CA=C1=BF= =BA=CD=BC=DB=B8=F1=B1=C8=A3=A9=D7=EE=D3=C5=BB=DD=B5=C4=CD=F8=D5=BE=C9=E8=BC= =C6=BC=DB=B8=F1 =CC=E1=B9=A9=D7=EE=D3=C5=D6=CA=B5=C4=CD=F8=C2=E7=B7=FE=CE=F1= =A3=AC=D3=EB=CD=AC=D0=D0=B1=C8=A3=AC=CF=E0=CD=AC=B5=C4=BC=DB=B8=F1=CE=D2=C3= =C7=CC=E1=B9=A9=D7=EE=D3=C5=B5=C4=B7=FE=CE=F1=A3=AC=CF=E0=CD=AC=B5=C4=B7=FE= =CE=F1=CE=D2=C3=C7=CA=B5=D0=D0=D7=EE =B5=CD=B5=C4=CA=D5=B7=D1=A1=A3=B1=BE=B9= =A4=D7=F7=CA=D2=B5=C4=B7=FE=CE=F1=D7=DA=D6=BC=CA=C7=A3=BA=A1=B0=B3=CF=D0=C5= =A1=A2=B3=CF=BF=D2=A1=A2=B3=CF=CA=B5=A3=AC=C6=B7=D6=CA=B8=DF=B2=C5=C4=DC=C6= =B7=CE=BB=B8=DF=A1=B1=A3=AC=B8=FC=B6=E0=A1=A2=B8=FC=BA=C3=A1=A2 =B8=FC=BF=EC=B5=D8=CE=AA=BF=CD=BB=A7=B7=FE=CE=F1=A1=A3=D0=BB=D0=BB=A3=A1= </p> <p> =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1\\\|= ///<br> =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1\\- -/= /<br> =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1( @ @ = )<br> =A9=B3=A9=A5=A9=A5=A9=A5=A9=A5=A9=A5=A9=A5=A9=A5=A9=A5 oOOo-(_)-oOOo=A9=A5= =A9=B7<br> =A9=A7 =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1= =A1=A1=A1=A1=A1=A1=A1=A1 =A9=A7<br> =A9=A7 =D5=BE=B3=A4=A3=BA=D1=EE=B8=EB=CE=B5=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1= =A1=A1=A1=A1=A1=A1=A1=A1 =A9=A7<br> =A9=A7 =CD=F8=C3=FB=A3=BA=B8=EB=D7=D3 =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1= =A1=A1=A1=A1=A1=A1=A1=A1=A9=A7<br> =A9=A7 =B5=E7=BB=B0=A3=BA0755-26383669=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1= =A9=A7<br> =A9=A7 =CD=F8=D6=B7=A3=BA<a href=3D"http://mere.cn.gs" target=3D"_blank"= >http://mere.cn.gs</a> =A1=A1=A1=A1=A1=A1 =A9=A7<br> =A9=A7 =D3=CA=CF=E4=A3=BAemailhi@163.com=A1=A1=A1=A1=A1=A1 =A1=A1 =A9=A7= <br> =A9=A7 oicq: 4133332 =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1 =A9= =A7 <br> =A9=A7 =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1= =A1=A1=A1=A1=A1=A1=A1=A1 =A9=A7<br> =A9=A7 =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1<<=C3=C0=B6=FB=B9= =A4=D7=F7=CA=D2>> =CA=BE=A9=A7<br> =A9=A7 =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1= =A1=A1=A1=A1Oooo =A9=A7<br> =A9=BB=A9=A5=A9=A5=A9=A5=A9=A5=A9=A5=A9=A5=A9=A5=A9=A5=A9=A5 oooO =A9=A5= ( =A1=A1)=A9=BF<br> =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1( =A1=A1) =A1= =A1=A1=A1) /<br> =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1 \ ( =A1=A1=A1= =A1(_/<br> =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1\_)<br= > </p> <p><br> =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=D6=C2<br> =C0=F1!<br> =A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1=A1= =A1=A1=A1=A1 <br> </p> <hr><table width=3D658 border=3D0><tr><td valign=3Dtop><a href=3Dhttp://ww= w.shangpala.com/unsub/unsubscribe.asp?id=3D2521&language=3Dgb2312?id=3D4768= &language=3Dgb2312><P>=C8=E7=B9=FB=D5=E2=B7=E2=D3=CA=BC=FE=B4=F2=C8=C5=C4=FA= =C1=CB=A3=AC=B7=B3=C7=EB=CB=E6=CA=D6=C9=BE=B5=F4=A3=AC=B2=A2=C7=EB=BC=FB=C1= =C2=A1=A3<BR>=C8=F4=C4=FA=B2=BB=CF=A3=CD=FB=D4=D9=B4=CE=CA=D5=B5=BD=CE=D2=C3= =C7=B5=C4=D3=CA=BC=FE=A3=AC=C7=EB=B5=E3=BB=F7=D5=E2=C0=EF=A1=A3</P></a></td= ></tr></table></body> </html> ------=_NextPart_001_000C_3DB20006.B9160014-- ------=_NextPart_000_000B_3DB20006.B9160014-- From lon-capa-cvs@mail.lon-capa.org Tue Mar 4 16:10:09 2003 From: lon-capa-cvs@mail.lon-capa.org (matthew) Date: Tue, 04 Mar 2003 16:10:09 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface/statistics lonstudentassessment.pm Message-ID: <cvsmatthew1046794209@cvsserver> matthew Tue Mar 4 11:10:09 2003 EDT Modified files: /loncom/interface/statistics lonstudentassessment.pm Log: Added some header information (course desc, sections listed, and date) to excel files. Index: loncom/interface/statistics/lonstudentassessment.pm diff -u loncom/interface/statistics/lonstudentassessment.pm:1.33 loncom/interface/statistics/lonstudentassessment.pm:1.34 --- loncom/interface/statistics/lonstudentassessment.pm:1.33 Tue Mar 4 09:21:36 2003 +++ loncom/interface/statistics/lonstudentassessment.pm Tue Mar 4 11:10:09 2003 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentassessment.pm,v 1.33 2003/03/04 14:21:36 matthew Exp $ +# $Id: lonstudentassessment.pm,v 1.34 2003/03/04 16:10:09 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -587,17 +587,49 @@ } $excel_sheet = $excel_workbook->addworksheet($sheetname); # + # Put the course description in the header + $excel_sheet->write($rows_output,$cols_output++, + $ENV{'course.'.$ENV{'request.course.id'}.'.description'}); + $cols_output += 3; + # + # Put a description of the sections listed + my $sectionstring = ''; + my @Sections = @Apache::lonstatistics::SelectedSections; + if (scalar(@Sections) > 1) { + if (scalar(@Sections) > 2) { + my $last = pop(@Sections); + $sectionstring = "Sections ".join(', ',@Sections).', and '.$last; + } else { + $sectionstring = "Sections ".join(' and ',@Sections); + } + } else { + if ($Sections[0] eq 'all') { + $sectionstring = "All sections"; + } else { + $sectionstring = "Section ".$Sections[0]; + } + } + $excel_sheet->write($rows_output,$cols_output++,$sectionstring); + $cols_output += scalar(@Sections); + # + # Put the date in there too + $excel_sheet->write($rows_output,$cols_output++, + 'Compiled on '.localtime(time)); + # + $rows_output++; + # # Add the student headers + $cols_output = 0; foreach my $field (&get_student_fields_to_show()) { - $excel_sheet->write(1,$cols_output++,$field); + $excel_sheet->write($rows_output,$cols_output++,$field); } # # Add the Sequence Headers foreach my $seq (&get_sequences_to_show) { - $excel_sheet->write(0,$cols_output,$seq->{'title'}); + $excel_sheet->write($rows_output,$cols_output,$seq->{'title'}); if ($show eq 'totals') { - $excel_sheet->write(1,$cols_output,'score'); - $excel_sheet->write(1,$cols_output+1,'maximum'); + $excel_sheet->write($rows_output+1,$cols_output,'score'); + $excel_sheet->write($rows_output+1,$cols_output+1,'maximum'); $cols_output += 2; } else { $cols_output++; @@ -606,9 +638,9 @@ # # Bookkeeping if ($show eq 'totals') { - $rows_output = 2; + $rows_output += 2; } else { - $rows_output = 1; + $rows_output += 1; } # # Let the user know what we are doing @@ -681,7 +713,8 @@ $r->print($num_students.' out of '. (scalar(@Apache::lonstatistics::Students)). " students processed. ". - $time_est." remain. <br />\n"); + $time_est." remain. Elapsed: ".(time - $start_time). + "<br />\n"); $r->rflush(); } return; From lon-capa-cvs@mail.lon-capa.org Tue Mar 4 22:30:10 2003 From: lon-capa-cvs@mail.lon-capa.org (matthew) Date: Tue, 04 Mar 2003 22:30:10 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonnavmaps.pm Message-ID: <cvsmatthew1046817010@cvsserver> matthew Tue Mar 4 17:30:10 2003 EDT Modified files: /loncom/interface lonnavmaps.pm Log: &extract_parts now calls metadata to get 'packages' to get the parts. Index: loncom/interface/lonnavmaps.pm diff -u loncom/interface/lonnavmaps.pm:1.151 loncom/interface/lonnavmaps.pm:1.152 --- loncom/interface/lonnavmaps.pm:1.151 Mon Mar 3 08:03:58 2003 +++ loncom/interface/lonnavmaps.pm Tue Mar 4 17:30:10 2003 @@ -2,7 +2,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.151 2003/03/03 13:03:58 www Exp $ +# $Id: lonnavmaps.pm,v 1.152 2003/03/04 22:30:10 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2698,15 +2698,14 @@ # Retrieve part count, if this is a problem if ($self->is_problem()) { - my $metadata = &Apache::lonnet::metadata($self->src(), 'allpossiblekeys'); + my $metadata = &Apache::lonnet::metadata($self->src(), 'packages'); if (!$metadata) { $self->{RESOURCE_ERROR} = 1; $self->{PARTS} = []; return; } - foreach (split(/\,/,$metadata)) { - if ($_ =~ /^parameter\_(.*)\_opendate$/) { + if ($_ =~ /^part_(.*)$/) { my $part = $1; # check to see if part is turned off. if (! Apache::loncommon::check_if_partid_hidden($part, $self->symb())) { From lon-capa-cvs@mail.lon-capa.org Tue Mar 4 22:32:20 2003 From: lon-capa-cvs@mail.lon-capa.org (matthew) Date: Tue, 04 Mar 2003 22:32:20 -0000 Subject: [LON-CAPA-cvs] cvs: loncom / lond Message-ID: <cvsmatthew1046817140@cvsserver> This is a MIME encoded message --matthew1046817140 Content-Type: text/plain matthew Tue Mar 4 17:32:20 2003 EDT Modified files: /loncom lond Log: Made error messages more verbose - I'm seeing a ton of the " tie(GDBM) Failed" float by and I need to narrow down my search. --matthew1046817140 Content-Type: text/plain Content-Disposition: attachment; filename="matthew-20030304173220.txt" Index: loncom/lond diff -u loncom/lond:1.110 loncom/lond:1.111 --- loncom/lond:1.110 Sat Mar 1 22:58:55 2003 +++ loncom/lond Tue Mar 4 17:32:20 2003 @@ -2,7 +2,7 @@ # The LearningOnline Network # lond "LON Daemon" Server (port "LOND" 5663) # -# $Id: lond,v 1.110 2003/03/02 03:58:55 www Exp $ +# $Id: lond,v 1.111 2003/03/04 22:32:20 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -856,7 +856,8 @@ unless (-e $fpnow) { unless (mkdir($fpnow,0777)) { $fperror="error: ".($!+0) - ." mkdir failed\n"; + ." mkdir failed while attempting " + ."makeuser\n"; } } } @@ -1028,7 +1029,8 @@ print $client "ok\n"; } else { print $client "error: ".($!+0) - ." IO::File->new Failed\n"; + ." IO::File->new Failed " + ."while attempting log\n"; } } # ------------------------------------------------------------------------- put @@ -1057,11 +1059,13 @@ print $client "ok\n"; } else { print $client "error: ".($!+0) - ." untie(GDBM) failed\n"; + ." untie(GDBM) failed ". + "while attempting put\n"; } } else { print $client "error: ".($!) - ." tie(GDBM) Failed\n"; + ." tie(GDBM) Failed ". + "while attempting put\n"; } } else { print $client "refused\n"; @@ -1101,11 +1105,13 @@ print $client "ok\n"; } else { print $client "error: ".($!+0) - ." untie(GDBM) Failed\n"; + ." untie(GDBM) Failed ". + "while attempting rolesput\n"; } } else { print $client "error: ".($!+0) - ." tie(GDBM) Failed\n"; + ." tie(GDBM) Failed ". + "while attempting rolesput\n"; } } else { print $client "refused\n"; @@ -1129,11 +1135,13 @@ print $client "$qresult\n"; } else { print $client "error: ".($!+0) - ." untie(GDBM) Failed\n"; + ." untie(GDBM) Failed ". + "while attempting get\n"; } } else { print $client "error: ".($!+0) - ." tie(GDBM) Failed\n"; + ." tie(GDBM) Failed ". + "while attempting get\n"; } # ------------------------------------------------------------------------ eget } elsif ($userinput =~ /^eget/) { @@ -1167,11 +1175,13 @@ } } else { print $client "error: ".($!+0) - ." untie(GDBM) Failed\n"; + ." untie(GDBM) Failed ". + "while attempting eget\n"; } } else { print $client "error: ".($!+0) - ." tie(GDBM) Failed\n"; + ." tie(GDBM) Failed ". + "while attempting eget\n"; } # ------------------------------------------------------------------------- del } elsif ($userinput =~ /^del/) { @@ -1197,11 +1207,13 @@ print $client "ok\n"; } else { print $client "error: ".($!+0) - ." untie(GDBM) Failed\n"; + ." untie(GDBM) Failed ". + "while attempting del\n"; } } else { print $client "error: ".($!+0) - ." tie(GDBM) Failed\n"; + ." tie(GDBM) Failed ". + "while attempting del\n"; } # ------------------------------------------------------------------------ keys } elsif ($userinput =~ /^keys/) { @@ -1220,11 +1232,13 @@ print $client "$qresult\n"; } else { print $client "error: ".($!+0) - ." untie(GDBM) Failed\n"; + ." untie(GDBM) Failed ". + "while attempting keys\n"; } } else { print $client "error: ".($!+0) - ." tie(GDBM) Failed\n"; + ." tie(GDBM) Failed ". + "while attempting keys\n"; } # ----------------------------------------------------------------- dumpcurrent } elsif ($userinput =~ /^currentdump/) { @@ -1263,11 +1277,13 @@ print $client "$qresult\n"; } else { print $client "error: ".($!+0) - ." untie(GDBM) Failed\n"; + ." untie(GDBM) Failed ". + "while attempting currentdump\n"; } } else { print $client "error: ".($!+0) - ." tie(GDBM) Failed\n"; + ." tie(GDBM) Failed ". + "while attempting currentdump\n"; } # ------------------------------------------------------------------------ dump } elsif ($userinput =~ /^dump/) { @@ -1299,11 +1315,13 @@ print $client "$qresult\n"; } else { print $client "error: ".($!+0) - ." untie(GDBM) Failed\n"; + ." untie(GDBM) Failed ". + "while attempting dump\n"; } } else { print $client "error: ".($!+0) - ." tie(GDBM) Failed\n"; + ." tie(GDBM) Failed ". + "while attempting dump\n"; } # ----------------------------------------------------------------------- store } elsif ($userinput =~ /^store/) { @@ -1341,11 +1359,13 @@ print $client "ok\n"; } else { print $client "error: ".($!+0) - ." untie(GDBM) Failed\n"; + ." untie(GDBM) Failed ". + "while attempting store\n"; } } else { print $client "error: ".($!+0) - ." tie(GDBM) Failed\n"; + ." tie(GDBM) Failed ". + "while attempting store\n"; } } else { print $client "refused\n"; @@ -1377,11 +1397,13 @@ print $client "$qresult\n"; } else { print $client "error: ".($!+0) - ." untie(GDBM) Failed\n"; + ." untie(GDBM) Failed ". + "while attempting restore\n"; } } else { print $client "error: ".($!+0) - ." tie(GDBM) Failed\n"; + ." tie(GDBM) Failed ". + "while attempting restore\n"; } # -------------------------------------------------------------------- chatsend } elsif ($userinput =~ /^chatsend/) { @@ -1421,7 +1443,8 @@ } else { print $client "error: ".($!+0) - ." IO::File->new Failed\n"; + ." IO::File->new Failed ". + "while attempting queryreply\n"; } # ----------------------------------------------------------------------- idput } elsif ($userinput =~ /^idput/) { @@ -1446,11 +1469,13 @@ print $client "ok\n"; } else { print $client "error: ".($!+0) - ." untie(GDBM) Failed\n"; + ." untie(GDBM) Failed ". + "while attempting idput\n"; } } else { print $client "error: ".($!+0) - ." tie(GDBM) Failed\n"; + ." tie(GDBM) Failed ". + "while attempting idput\n"; } # ----------------------------------------------------------------------- idget } elsif ($userinput =~ /^idget/) { @@ -1469,11 +1494,13 @@ print $client "$qresult\n"; } else { print $client "error: ".($!+0) - ." untie(GDBM) Failed\n"; + ." untie(GDBM) Failed ". + "while attempting idget\n"; } } else { print $client "error: ".($!+0) - ." tie(GDBM) Failed\n"; + ." tie(GDBM) Failed ". + "while attempting idget\n"; } # ---------------------------------------------------------------------- tmpput } elsif ($userinput =~ /^tmpput/) { @@ -1491,7 +1518,8 @@ } else { print $client "error: ".($!+0) - ."IO::File->new Failed\n"; + ."IO::File->new Failed ". + "while attempting tmpput\n"; } # ---------------------------------------------------------------------- tmpget @@ -1508,7 +1536,8 @@ } else { print $client "error: ".($!+0) - ."IO::File->new Failed\n"; + ."IO::File->new Failed ". + "while attempting tmpget\n"; } # ---------------------------------------------------------------------- tmpdel @@ -1521,7 +1550,8 @@ print $client "ok\n"; } else { print $client "error: ".($!+0) - ."Unlink tmp Failed\n"; + ."Unlink tmp Failed ". + "while attempting tmpdel\n"; } # -------------------------------------------------------------------------- ls } elsif ($userinput =~ /^ls/) { --matthew1046817140-- From lon-capa-cvs@mail.lon-capa.org Wed Mar 5 14:39:08 2003 From: lon-capa-cvs@mail.lon-capa.org (matthew) Date: Wed, 05 Mar 2003 14:39:08 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface loncoursedata.pm Message-ID: <cvsmatthew1046875148@cvsserver> matthew Wed Mar 5 09:39:08 2003 EDT Modified files: /loncom/interface loncoursedata.pm Log: &get_current_state() now uses a cache file per student per class instead of one for the entire course. Removed old lonnet::logthis() calls as well. Index: loncom/interface/loncoursedata.pm diff -u loncom/interface/loncoursedata.pm:1.55 loncom/interface/loncoursedata.pm:1.56 --- loncom/interface/loncoursedata.pm:1.55 Mon Mar 3 16:52:24 2003 +++ loncom/interface/loncoursedata.pm Wed Mar 5 09:39:08 2003 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: loncoursedata.pm,v 1.55 2003/03/03 21:52:24 albertel Exp $ +# $Id: loncoursedata.pm,v 1.56 2003/03/05 14:39:08 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1580,9 +1580,14 @@ # $courseid = $ENV{'request.course.id'} if (! defined($courseid)); # +# my $cachefilename = $Apache::lonnet::tmpdir.$ENV{'user.name'}.'_'. +# $ENV{'user.domain'}.'_'. +# $courseid.'_student_data.db'; my $cachefilename = $Apache::lonnet::tmpdir.$ENV{'user.name'}.'_'. $ENV{'user.domain'}.'_'. - $courseid.'_student_data.db'; + $courseid.'_'. + $sname.'_'.$sdom. + '_student_data.db'; my %cache; # my %student_data; # return values go here @@ -1594,18 +1599,16 @@ if (tie(%cache,'GDBM_File',$cachefilename,&GDBM_READER(),0640)) { if (exists($cache{$key.'time'})) { $updatetime = $cache{$key.'time'}; -# &Apache::lonnet::logthis('got updatetime of '.$updatetime); } untie(%cache); } - # timestamp/devalidation + # timestamp/devalidation check should go here. my $modifiedtime = 1; # Take whatever steps are neccessary at this point to give $modifiedtime a # new value # if (($updatetime < $modifiedtime) || (defined($forcedownload) && $forcedownload)) { -# &Apache::lonnet::logthis("loading data"); # Get all the students current data my $time_of_retrieval = time; my @tmp = &Apache::lonnet::currentdump($courseid,$sdom,$sname); @@ -1627,7 +1630,6 @@ # keys instead of unescaping every key. # if (tie(%cache,'GDBM_File',$cachefilename,&GDBM_WRCREAT(),0640)) { -# &Apache::lonnet::logthis("writing data"); while (my ($current_symb,$param_hash) = each(%student_data)) { my @Parameters = %{$param_hash}; my $value = join(':',map { &Apache::lonnet::escape($_); } @@ -1639,7 +1641,6 @@ untie(%cache); } } else { - &Apache::lonnet::logthis('retrieving cached data '); if (tie(%cache,'GDBM_File',$cachefilename,&GDBM_READER(),0640)) { if (defined($symb)) { my $searchkey = $key.&Apache::lonnet::escape($symb); @@ -1652,7 +1653,6 @@ if ($testkey =~ /$searchkey/) { # \Q \E? May be necc. my $tmpsymb = $1; next if ($tmpsymb =~ 'time'); -# &Apache::lonnet::logthis('found '.$tmpsymb.':'); $student_data{&Apache::lonnet::unescape($tmpsymb)} = &make_into_hash($params); } @@ -1662,10 +1662,8 @@ } } if (! defined($symb)) { -# &Apache::lonnet::logthis("returning all data"); return %student_data; } elsif (exists($student_data{$symb})) { -# &Apache::lonnet::logthis("returning data for symb=".$symb); return %{$student_data{$symb}}; } else { return (); From lon-capa-cvs@mail.lon-capa.org Wed Mar 5 16:25:57 2003 From: lon-capa-cvs@mail.lon-capa.org (sakharuk) Date: Wed, 05 Mar 2003 16:25:57 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /homework structuretags.pm Message-ID: <cvssakharuk1046881557@cvsserver> sakharuk Wed Mar 5 11:25:57 2003 EDT Modified files: /loncom/homework structuretags.pm Log: Now you can see in which particular problem LaTeX error was occured. See cgi script prinyout.pl too. Index: loncom/homework/structuretags.pm diff -u loncom/homework/structuretags.pm:1.152 loncom/homework/structuretags.pm:1.153 --- loncom/homework/structuretags.pm:1.152 Mon Mar 3 10:59:42 2003 +++ loncom/homework/structuretags.pm Wed Mar 5 11:25:57 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.152 2003/03/03 15:59:42 www Exp $ +# $Id: structuretags.pm,v 1.153 2003/03/05 16:25:57 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -382,14 +382,15 @@ my @due_file_content = <$temp_file>; my $due_file_content = $due_file_content[$#due_file_content]; chomp $due_file_content; + my $name_of_resourse= &get_resource_name($parstack,$safeeval); if ($due_file_content ne $duedate) { $temp_file = Apache::File->new('>'.$filename); print $temp_file "$duedate\n"; if (not $ENV{'request.symb'} =~ m/\.page_/) { if(not $duedate=~m/1969/ and $Apache::lonhomework::type ne 'exam') { - $result .= '\begin{document} \noindent\textit{Due date: '.$duedate.'} \vskip 1 mm\noindent \begin{minipage}{\textwidth}'; + $result .= '\begin{document} \typeout{STAMPOFPASSEDRESOURCESTART Resource <h2>"'.$name_of_resourse.'"</h2> located in <br /><small><b>'.$ENV{'request.uri'}.'</b></small><br /> STAMPOFPASSEDRESOURCEEND} \noindent\textit{Due date: '.$duedate.'} \vskip 1 mm\noindent \begin{minipage}{\textwidth}'; } else { - $result .= '\begin{document} \noindent \vskip 1 mm \noindent\begin{minipage}{\textwidth}'; + $result .= '\begin{document} \typeout{STAMPOFPASSEDRESOURCESTART Resource <h2>"'.$name_of_resourse.'"</h2> located in <br /><small><b>'.$ENV{'request.uri'}.'</b></small><br /> STAMPOFPASSEDRESOURCEEND} \noindent \vskip 1 mm \noindent\begin{minipage}{\textwidth}'; if ($Apache::lonhomework::type eq 'exam' and $allow_print_points==1) { $result .= '\fbox{\textit{'.$weight.' pt}}';} } } else { @@ -397,7 +398,7 @@ } } else { if (not $ENV{'request.symb'} =~ m/\.page_/) { - $result .= '\begin{document} \noindent \vskip 1 mm\noindent\begin{minipage}{\textwidth}'; + $result .= '\begin{document} \typeout{STAMPOFPASSEDRESOURCESTART Resource <h2>"'.$name_of_resourse.'"</h2> located in <br /><small><b>'.$ENV{'request.uri'}.'</b></small><br /> STAMPOFPASSEDRESOURCEEND} \noindent \vskip 1 mm\noindent\begin{minipage}{\textwidth}'; if (($Apache::lonhomework::type eq 'exam') and ($allow_print_points==1)) { $result .= '\fbox{\textit{'.$weight.' pt}}';} } else { $result .= '\vskip 1mm \\\\\\\\'; From lon-capa-cvs@mail.lon-capa.org Wed Mar 5 16:28:04 2003 From: lon-capa-cvs@mail.lon-capa.org (sakharuk) Date: Wed, 05 Mar 2003 16:28:04 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface printout.pl Message-ID: <cvssakharuk1046881684@cvsserver> sakharuk Wed Mar 5 11:28:04 2003 EDT Modified files: /loncom/interface printout.pl Log: Exact (or more correctly almost exact) "pointer" to the problem where LaTeX error was occured is shows up on the screen. Added one more LaTeX error indication (one of the most frequent errors). Index: loncom/interface/printout.pl diff -u loncom/interface/printout.pl:1.21 loncom/interface/printout.pl:1.22 --- loncom/interface/printout.pl:1.21 Wed Sep 18 14:42:57 2002 +++ loncom/interface/printout.pl Wed Mar 5 11:28:04 2003 @@ -57,12 +57,17 @@ my $body_log_file = join(' ',@content_of_file); if ($body_log_file=~m/!\s+Emergency stop/) { #LaTeX failed to parse tex file - print "<h1>LaTeX could not successfully parse your tex file.</h1>"; - print "<h2>It probably has errors in it.</h2>"; - print "Here are the error messages in the LaTeX log file</br>"; + print "<h2>LaTeX could not successfully parse your tex file.</h2>"; + print "It probably has errors in it.<br />"; + my $whereitbegins = rindex $body_log_file,'STAMPOFPASSEDRESOURCESTART'; + my $whereitends = rindex $body_log_file,'STAMPOFPASSEDRESOURCEEND'; + if ($whereitbegins!=-1 and $whereitends!=-1) { + print "With very high probability this error occured in ".substr($body_log_file,$whereitbegins+26,$whereitends-$whereitbegins-26)."<br /><br />"; + } + print "Here are the error messages in the LaTeX log file</br><br />"; my $sygnal = 0; for (my $i=0;$i<=$#content_of_file;$i++) { - if ($content_of_file[$i]=~m/^!/) { + if ($content_of_file[$i]=~m/^Runaway argument?/ or $content_of_file[$i]=~m/^!/) { $sygnal = 1; } if ($content_of_file[$i]=~m/Here is how much of/) { @@ -84,7 +89,7 @@ $new_name_file =~ m/^(.*)\./; my $tempo_file = $1.'temporar.ps'; my $name_file = $1.'.pdf'; - if ($laystyle eq 'album') { + if ($laystyle eq 'album' and $numberofcolumns eq '2') { $comma = "psnup -2 -s1.0 $new_name_file"; system("$comma $tempo_file"); system("ps2pdf $tempo_file $name_file"); @@ -104,7 +109,7 @@ $texdvi =~ s/\.tex/\.dvi/; $texps =~ s/\.tex/\.ps/; my @garb = ($texlog,$texaux,$texdvi,$texps); - unlink @garb; +# unlink @garb; unlink $duefile; print "<a href=\"/prtspool/$name_file\">Your PDF document</a>"; print "\n"; From gdszmerenet20030228@yahoo.com.cn Thu Mar 6 01:58:24 2003 From: gdszmerenet20030228@yahoo.com.cn (gdszmerenet20030228@yahoo.com.cn) Date: Thu, 06 Mar 03 01:58:24 中国标准时间 Subject: [LON-CAPA-cvs] 产品及网站推广的最佳助手 Message-ID: <200303051758.h25Hvx518971@zaphod.lite.msu.edu> ------=_NextPart_000_003E_5229AAAC.F67D0005 Content-Type: multipart/alternative; boundary="----=_NextPart_001_003F_5229AAAC.F67D0005" ------=_NextPart_001_003F_5229AAAC.F67D0005 Content-Type: text/plain; charset=gb2312 Content-Transfer-Encoding: quoted-printable 这是用超文本格式编写的邮件,请使用超文本方式浏览。 --------------------------- =C8=E7=B9=FB=D5=E2=B7=E2=D3=CA=BC=FE=B4=F2=C8=C5=C4=FA=C1=CB=A3=AC=B7=B3=C7= =EB=CB=E6=CA=D6=C9=BE=B5=F4=A3=AC=B2=A2=C7=EB=BC=FB=C1=C2=A1=A3 =C8=F4=C4=FA=B2=BB=CF=A3=CD=FB=D4=D9=B4=CE=CA=D5=B5=BD=CE=D2=C3=C7=B5=C4=D3= =CA=BC=FE=A3=AC=C7=EB=B5=E3=BB=F7=D5=E2=C0=EF=A1=A3 http://www.shangpala.com/unsub/unsubscribe.asp?id=3D2521&language=3Dgb2312= ?id=3D4768&language=3Dgb2312 ------=_NextPart_001_003F_5229AAAC.F67D0005 Content-Type: text/html; charset=gb2312 Content-Transfer-Encoding: quoted-printable <html> <head> <title>=D7=EE=D0=C2=CD=F8=C2=E7=D3=AA=CF=FA=C8=ED=BC=FE=B9=AB=B2=BC</title= > <meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3Dgb2312">= </head> <body bgcolor=3D"#FFFFFF" text=3D"#000000"> =D7=EE=D0=C2=CD=F8=C2=E7=D3=AA=CF=FA=C8=ED=BC=FE=B9=AB=B2=BC:<br> <br> <font color=3D"#FF0000">*=C3=C0=B6=FB=CD=F8=C2=E7=D3=AA=CF=FA=D7=A8=BC=D2=A3= =BA</font><br> =A1=A1=A1=A1 =C3=C0=B6=FB=CD=F8=C2=E7=D3=AA=CF=FA=D7=A8=BC=D2=CA=C7=D2=BB=BF= =EE=D7=D4=B6=AF=CE=AA=C6=F3=D2=B5=B7=A2=B2=BC=D0=C5=CF=A2=B5=C4=C8=ED=BC=FE= =A1=A3=B1=BE=C8=ED=BC=FE=BC=AF=D0=C5=CF=A2=B7=A2=B2=BC=A1=A2=D0=C5=CF=A2=CB= =D1=CB=F7=A1=A2=D3=CA=BC=FE=C8=BA=B7=A2=A1=A2=D2=FD=C7=E6=B5=C7=C2=BC=CE=AA= =D2=BB=CC=E5=A1=A3=CD=F8=C9=CF=D0=C5=CF=A2=B7=A2=B2=BC=CA=C7=C6=F3=D2=B5=D4= =DA=CD=F8=C9=CF=BD=F8=D0=D0=D0=FB=B4=AB=B5=C4=D6=D8=D2=AA=CA=D6=B6=CE=A3=AC= =C8=CE=BA=CE=B4=AB=CD=B3=B5=C4=D0=FB=B4=AB=B7=BD=B7=A8=A3=AC=B6=BC=B2=BB=BC= =B0=CD=F8=C2=E7=D0=C5=CF=A2=B7=A2=B2=BC=C4=C7=D1=F9=B3=C9=B1=BE=B5=CD=C1=AE= =A1=A2=D3=D0=D0=A7=A1=A3*<a href=3D"http://mere.cn.gs/soft.htm" target=3D"_= blank">=CF=EA=C7=E9=C7=EB=BD=F8</a>**<a href=3D"http://www.bh666.net/soft/m= erenet.exe">=CF=C2=D4=D8=CA=D4=D3=C3</a>*<br> <br> <font color=3D"#FF0000">*=C3=C0=B6=FB=C9=CC=CE=F1=D3=CA=BC=FE=B9=FA=BC=CA=CC= =D8=BF=EC=A3=BA</font><br> =A1=A1=A1=A1 =C3=C0=B6=FB=C9=CC=CE=F1=D3=CA=BC=FE=B9=FA=BC=CA=CC=D8=BF=EC(= =CE=DE=D0=E8SMTP=C9=E8=D6=C3=A3=AC=CE=DE=D0=E8=B0=B2=D7=B0)=CA=C7=CE=AA=CA=CA= =D3=A6=CF=F2=B9=FA=BC=CA=C9=CF=B8=F7=B8=F6=B2=BB=CD=AC=B9=FA=BC=D2=B7=A2=CB= =CD=C9=CC=CE=F1=D3=CA=BC=FE=B6=F8=D6=C6=D7=F7=B5=C4=B9=A6=C4=DC=C8=AB=C3=E6= =A1=A2=CB=D9=B6=C8=C6=E6=BF=EC=A1=A2=D0=D4=C4=DC=CE=C8=B6=A8=B5=C4=C8=BA=B7= =A2=C8=ED=BC=FE=A3=AC=CC=D8=B1=F0=BE=DF=D3=D0=CD=AC=C0=E0=C8=ED=BC=FE=D6=D0= =CA=D7=B4=B4=B5=C4=D6=A7=B3=D6=D3=CA=BC=FE=CD=CB=B6=A9=B9=A6=C4=DC=A3=A1=A3= =A1=A3=A1<br> =A1=A1=A1=A1 *<a href=3D"http://mere.cn.gs/soft.htm" target=3D"_blank">=CF= =EA=C7=E9=C7=EB=BD=F8</a>**<a href=3D"http://www.bh666.net/soft/etrain.zip"= >=CF=C2=D4=D8=CA=D4=D3=C3</a>*<br> <font color=3D"#FF0000"><br> *=C3=C0=B6=FB=CD=F8=C2=E7=BF=CD=BB=A7=D0=C5=CF=A2=CB=D1=CB=F7=D7=A8=BC=D2=A3= =BA</font><br> =A1=A1=A1=A1 =B1=BE=CC=D7=C8=ED=BC=FE=CD=A8=B9=FD=B6=D4=B4=F3=C1=BF=D5=E4=B9= =F3=B5=C4=B9=FA=C4=DA=CD=E2=CB=D1=CB=F7=D2=FD=C7=E6=A1=A2=C9=CC=C3=B3=CD=F8= =D5=BE=A1=A2=B9=A4=C9=CC=BB=C6=D2=B3=B5=C8=BD=F8=D0=D0=D1=D0=BE=BF=A3=AC=D7= =DB=BA=CF=C1=CB=CD=F8=C2=E7=C9=CF=D6=DA=B6=E0=CB=D1=CB=F7=C8=ED=BC=FE=B5=C4= =D3=C5=B5=E3=A3=AC=BC=AF=CB=D1=CB=F7=A1=A2=D0=A3=D1=E9=A1=A2=B7=A2=CB=CD=A1= =A2=B6=A8=D6=C6=D3=DA=D2=BB=C9=ED=B5=C4=BF=C9=D2=D4=CB=D1=CB=F7=B9=AB=CB=BE= =C3=FB=B3=C6=B5=C4=B9=A6=C4=DC=C8=AB=C3=E6=B5=C4=CB=D1=CB=F7=C8=ED=BC=FE=A1= =A3=CD=A8=B9=FD=B1=BE=CC=D7=C8=ED=BC=FE=A3=AC=C4=E3=BF=C9=D2=D4=CB=E6=D0=C4= =CB=F9=D3=FB=B5=C4=CB=D1=CB=F7=C4=E3=B5=C4=C4=BF=B1=EA=CD=F8=D5=BE=A3=AC=BF= =C9=D2=D4=BD=AB=CD=F8=D5=BE=D6=D0=D3=D0=D0=A7=B5=C4=B9=AB=CB=BE=C3=FB=B3=C6= =D3=EB=CF=E0=D3=A6=B5=C4EMAIL=B5=D8=D6=B7=D6=B1=BD=D3=CC=E1=C8=A1=B3=F6=C0=B4= =A3=A1<br> =A1=A1=A1=A1 *<a href=3D"http://mere.cn.gs/soft.htm" target=3D"_blank">=CF= =EA=C7=E9=C7=EB=BD=F8</a>**<a href=3D"http://www.bh666.net/soft/Extractor.z= ip">=CF=C2=D4=D8=CA=D4=D3=C3</a>*<br> <br> ..<a href=3D"http://mere.cn.gs/soft.htm" target=3D"_blank">=C7=EB=BF=B4=B8= =FC=B6=E0=C8=ED=BC=FE</a> <hr><table width=3D658 border=3D0><tr><td valign=3Dtop><a href=3Dhttp://ww= w.shangpala.com/unsub/unsubscribe.asp?id=3D2521&language=3Dgb2312?id=3D4768= &language=3Dgb2312><P>=C8=E7=B9=FB=D5=E2=B7=E2=D3=CA=BC=FE=B4=F2=C8=C5=C4=FA= =C1=CB=A3=AC=B7=B3=C7=EB=CB=E6=CA=D6=C9=BE=B5=F4=A3=AC=B2=A2=C7=EB=BC=FB=C1= =C2=A1=A3<BR>=C8=F4=C4=FA=B2=BB=CF=A3=CD=FB=D4=D9=B4=CE=CA=D5=B5=BD=CE=D2=C3= =C7=B5=C4=D3=CA=BC=FE=A3=AC=C7=EB=B5=E3=BB=F7=D5=E2=C0=EF=A1=A3</P></a></td= ></tr></table></body> </html> ------=_NextPart_001_003F_5229AAAC.F67D0005-- ------=_NextPart_000_003E_5229AAAC.F67D0005-- From jerf@jerf.org Thu Mar 6 23:32:31 2003 From: jerf@jerf.org (Jeremy Bowers) Date: Thu, 06 Mar 2003 18:32:31 -0500 Subject: [LON-CAPA-cvs] Re: lonprintout.pm In-Reply-To: <cvsalbertel1046723168@cvsserver> References: <cvsalbertel1046723168@cvsserver> Message-ID: <3E67DA8F.2020905@jerf.org> albertel wrote: > albertel Mon Mar 3 15:26:08 2003 EDT > > Modified files: > /loncom/interface lonprintout.pm > Log: > - wizard seems to only bomb, disabling it by default Doesn't bomb for me, what's the error in the log? (I checked to see if there were uncommitted changes, I don't see any in my repository.) From lon-capa-cvs@mail.lon-capa.org Wed Mar 5 20:31:13 2003 From: lon-capa-cvs@mail.lon-capa.org (matthew) Date: Wed, 05 Mar 2003 20:31:13 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface/statistics lonstudentassessment.pm Message-ID: <cvsmatthew1046896273@cvsserver> This is a MIME encoded message --matthew1046896273 Content-Type: text/plain matthew Wed Mar 5 15:31:13 2003 EDT Modified files: /loncom/interface/statistics lonstudentassessment.pm Log: Renamed 'Sequences and Folders' to the more generic 'Problem Sets' Changed method of determining output mode variables. The globals $output_mode, $show, and $show_links are now given values from the hashes in the array @OutputOptions. Fixed bug which caused the five student groupings to be off when a student did not have any course data. Added beginnings of multi-sheet excel file output. --matthew1046896273 Content-Type: text/plain Content-Disposition: attachment; filename="matthew-20030305153113.txt" Index: loncom/interface/statistics/lonstudentassessment.pm diff -u loncom/interface/statistics/lonstudentassessment.pm:1.34 loncom/interface/statistics/lonstudentassessment.pm:1.35 --- loncom/interface/statistics/lonstudentassessment.pm:1.34 Tue Mar 4 11:10:09 2003 +++ loncom/interface/statistics/lonstudentassessment.pm Wed Mar 5 15:31:13 2003 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentassessment.pm,v 1.34 2003/03/04 16:10:09 matthew Exp $ +# $Id: lonstudentassessment.pm,v 1.35 2003/03/05 20:31:13 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -156,6 +156,10 @@ $initialize = \&excel_initialize; $output_student = \&excel_outputstudent; $finish = \&excel_finish; + } elsif ($output_mode eq 'multi-sheet excel') { + $initialize = \&multi_sheet_excel_initialize; + $output_student = \&multi_sheet_excel_outputstudent; + $finish = \&multi_sheet_excel_finish; } elsif ($output_mode eq 'csv') { $initialize = \&csv_initialize; $output_student = \&csv_outputstudent; @@ -233,7 +237,7 @@ $Str .= '<tr>'; $Str .= '<td align="center"><b>Sections</b></td>'; $Str .= '<td align="center"><b>Student Data</b></td>'; - $Str .= '<td align="center"><b>Sequences and Folders</b></td>'; + $Str .= '<td align="center"><b>Problem Sets</b></td>'; $Str .= '<td align="center"><b>Output Format</b></td>'; $Str .= '</tr>'."\n"; # @@ -275,47 +279,97 @@ ({ name => 'HTML, with links', value => 'html, with links', description => 'Output HTML with each symbol linked to the problem '. - 'which generated it.'}, + 'which generated it.', + mode => 'html', + show => 'all', + show_links => 'yes', + }, { name => 'HTML, without links', value => 'html, without links', description => 'Output HTML. By not including links, the size of the'. ' web page is greatly reduced. If your browser crashes on the '. - 'full display, try this.'}, + 'full display, try this.', + mode => 'html', + show => 'all', + show_links => 'no', + }, { name => 'HTML, scores only', value => 'html, scores only', description => 'Output HTML, only showing the total number of correct'. ' problems (or problem parts) and not the maximum possible for '. - 'each student'}, + 'each student', + mode => 'html', + show => 'scores', + show_links => 'no', + }, { name => 'HTML, totals', value => 'html, totals', description => 'Output HTML, but only the summary statistics for each'. - ' sequence selected.'}, + ' sequence selected.', + mode => 'html', + show => 'totals', + show_links => 'no', + }, { name => 'Excel, scores only', value => 'excel, scores only', description => 'Output an Excel file (compatable with Excel 95), '. 'with a single column for each sequence showing the students '. - 'score.'}, -# { name => 'Excel, everything', -# value => 'excel, everything', -# description => 'Output an Excel file (compatable with Excel 95), '. -# 'with a seperate worksheet for each sequence you have selected '. -# 'the data for each problem part '. -# '(number of tries, status, points awarded) '. -# 'will be listed.'}, + 'score.', + mode => 'excel', + show => 'scores', + show_links => 'no', + }, { name => 'Excel, totals', value => 'excel, totals', description => 'Output an Excel file (compatable with Excel 95), '. 'with two columns for each sequence, the students score on the '. - 'sequence and the students maximum possible on the sequence'}, + 'sequence and the students maximum possible on the sequence', + mode => 'excel', + show => 'totals', + show_links => 'no', + }, + { name => 'multi-sheet Excel', + value => 'multi-sheet excel', + description => 'Output an Excel file (compatable with Excel 95), '. + 'with a seperate worksheet for each sequence you have selected '. + 'the data for each problem part '. + '(number of tries, status, points awarded) will be listed.', + mode => 'multi-sheet excel', + show => 'totals', + show_links => 'no', + }, + { name => 'multi-sheet Excel, by section', + value => 'multi-sheet excel, by section', + description => 'Output an Excel file (compatable with Excel 95), '. + 'with a seperate worksheet for each sequence you have selected '. + 'the data for each problem part '. + '(number of tries, status, points awarded) will be listed. '. + 'There will be one Excel workbook for each section selected.', + mode => 'multi-sheet excel', + show => 'by section', + show_links => 'no', + }, { name => 'CSV, everything', value => 'csv, everything', - description => ''}, + description => '', + mode => 'csv', + show => 'all', + show_links => 'no', + }, { name => 'CSV, scores only', value => 'csv, scores only', - description => ''}, + description => '', + mode => 'csv', + show => 'scores', + show_links => 'no', + }, { name => 'CSV, totals', value => 'csv, totals', - description => ''}, + description => '', + mode => 'csv', + show => 'totals', + show_links => 'no', + }, ); sub OutputDescriptions { @@ -348,25 +402,13 @@ $show_links = 'no'; $output_mode = 'html'; $show = 'all'; - my ($mode,$restriction) = split(',',$selected); - $restriction =~ s/^\s*//; - if ($mode =~ /^(html|excel|csv)$/) { - $output_mode = $mode; - } else { - $output_mode = 'html'; - } - if ($restriction eq 'with links') { - $show_links = 'yes'; - } else { - $show_links = 'no'; - } - if ($restriction eq 'totals') { - $show = 'totals'; - } elsif ($restriction eq 'scores only') { - $show = 'scores'; - } else { - $show = 'everything'; + foreach my $option (@OutputOptions) { + next if ($option->{'value'} ne $selected); + $output_mode = $option->{'mode'}; + $show = $option->{'show'}; + $show_links = $option->{'show_links'}; } + # # Build the form element $Str = qq/<select size="5" name="$elementname">/; @@ -408,7 +450,7 @@ my ($r) = @_; # $padding = ' 'x3; - $count = 1; + $count = 0; # my $Str = "<pre>\n"; # First, the @StudentData fields need to be listed @@ -436,6 +478,10 @@ sub html_outputstudent { my ($r,$student) = @_; my $Str = ''; + # + if($count++ % 5 == 0 && $count > 0) { + $r->print("</pre><pre>"); + } # First, the @StudentData fields need to be listed my @to_show = &get_student_fields_to_show(); foreach my $field (@to_show) { @@ -499,11 +545,6 @@ $Str .= " \n"; $r->print($Str); # - $count++; - if($count % 5 == 0) { - $r->print("</pre><pre>"); - } - # $r->rflush(); return; } @@ -517,6 +558,78 @@ } +####################################################### +####################################################### + +=pod + +=head2 Multi-Sheet EXCEL subroutines + +=item &multi_sheet_excel_initialize($r) + +=item &multi_sheet_excel_outputstudent($r,$student) + +=item &multi_sheet_excel_finish($r) + +=cut + +####################################################### +####################################################### +{ + +sub multi_sheet_excel_initialize { + my ($r)=@_; + $r->print("<h1>Not yet implemented</h1>"); + # + # Estimate the size of the file. We would like to have < 5 megs of data. + my $max_size = 5000000; + my $num_students = scalar(@Apache::lonstatistics::Students); + my $num_sequences = 0; + my $num_data_per_part = 2; # 'status' and 'numtries' + my $fields_per_student = scalar(&get_student_fields_to_show()); + my $bytes_per_field = 20; # Back of the envelope calculation + foreach my $seq (&get_sequences_to_show) { + $num_sequences++ if ($seq->{'num_assess'} > 0); + $fields_per_student += $num_data_per_part * $seq->{'num_assess_parts'}; + } + my $size_estimate = $fields_per_student*$num_students*$bytes_per_field; + # + # Compute number of workbooks + my $num_workbooks = 1; + if ($size_estimate > $max_size) { # try to stay under 5 megs + $num_workbooks += int($size_estimate / $max_size); + } + if ($show eq 'by section') { + if (@Apache::lonstatistics::SelectedSections > 1 && + $Apache::lonstatistics::SelectedSections[0] ne 'all') { + $num_workbooks = scalar(@Apache::lonstatistics::SelectedSections); + } else { + # @Apache::lonstatistics::Sections contains 'all' as well. + $num_workbooks = scalar(@Apache::lonstatistics::Sections) - 1; + } + } + + $r->print("Maximum allowed size: ".$max_size." bytes<br />"); + $r->print("Number of students: ".$num_students."<br />"); + $r->print("Number of fields per student: ".$fields_per_student."<br />"); + $r->print("Total number of fields: ".($fields_per_student*$num_students). + "<br />"); + $r->print("Bytes per field: ".$bytes_per_field." (estimated)"."<br />"); + $r->print("Estimated size: ".$size_estimate." bytes<br />"); + $r->print("Number of workbooks: ".$num_workbooks."<br />"); + $r->rflush(); + return; +} + +sub multi_sheet_excel_outputstudent { + my ($r,$student) = @_; +} + +sub multi_sheet_excel_finish { + my ($r) = @_; +} + +} ####################################################### ####################################################### --matthew1046896273-- From guy@albertelli.com Wed Mar 5 21:25:42 2003 From: guy@albertelli.com (Guy Albertelli II) Date: Wed, 5 Mar 2003 16:25:42 -0500 (EST) Subject: [LON-CAPA-cvs] cvs: loncom /interface/statistics lonstudentassessment.pm In-Reply-To: <cvsmatthew1046896273@cvsserver> Message-ID: <200303052125.h25LPgXf025750@mileva.lite.msu.edu> Hi Matthew, > Renamed 'Sequences and Folders' to the more generic 'Problem Sets' I would argue 'Problem Sets' is less generic, I would prefer if you'd changed it back. (We will be having Exams, quizzes, etc in here problem sets has a lot of connatations in an instructors mind, 'Sequences and Folders' doesn't) -- guy@albertelli.com LON-CAPA Developer 0-7-7-4- From lon-capa-cvs@mail.lon-capa.org Thu Mar 6 18:16:04 2003 From: lon-capa-cvs@mail.lon-capa.org (bowersj2) Date: Thu, 06 Mar 2003 18:16:04 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm Message-ID: <cvsbowersj21046974564@cvsserver> bowersj2 Thu Mar 6 13:16:04 2003 EDT Modified files: /loncom/interface lonprintout.pm Log: If there is no title for the resource, use the file name. Index: loncom/interface/lonprintout.pm diff -u loncom/interface/lonprintout.pm:1.127 loncom/interface/lonprintout.pm:1.128 --- loncom/interface/lonprintout.pm:1.127 Mon Mar 3 16:53:15 2003 +++ loncom/interface/lonprintout.pm Thu Mar 6 13:16:04 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.127 2003/03/03 21:53:15 albertel Exp $ +# $Id: lonprintout.pm,v 1.128 2003/03/06 18:16:04 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1312,6 +1312,10 @@ $r->rflush(); my ($resourceTitle,$sequenceTitle,$mapTitle) = &details_for_menu; + if (!$resourceTitle) { # if the resource doesn't have a title, use the filename + my $url = $ENV{'form.postdata'}; + $resourceTitle = substr($url, rindex($url, '/') + 1); + } my $wizard = Apache::lonwizard->new("Printing Wizard", $ENV{QUERY_STRING}); # PRINT_TYPE: What the user wants to print (current docs, From lon-capa-cvs@mail.lon-capa.org Thu Mar 6 21:05:27 2003 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Thu, 06 Mar 2003 21:05:27 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /homework structuretags.pm Message-ID: <cvsalbertel1046984727@cvsserver> albertel Thu Mar 6 16:05:27 2003 EDT Modified files: /loncom/homework structuretags.pm Log: - remove part info from global when </part> is hit Index: loncom/homework/structuretags.pm diff -u loncom/homework/structuretags.pm:1.153 loncom/homework/structuretags.pm:1.154 --- loncom/homework/structuretags.pm:1.153 Wed Mar 5 11:25:57 2003 +++ loncom/homework/structuretags.pm Thu Mar 6 16:05:27 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.153 2003/03/05 16:25:57 sakharuk Exp $ +# $Id: structuretags.pm,v 1.154 2003/03/06 21:05:27 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -742,6 +742,7 @@ $result=$gradestatus; } pop @Apache::inputtags::status; + $Apache::inputtags::part=''; return $result; } From lon-capa-cvs@mail.lon-capa.org Thu Mar 6 21:08:21 2003 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Thu, 06 Mar 2003 21:08:21 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm Message-ID: <cvsalbertel1046984901@cvsserver> albertel Thu Mar 6 16:08:21 2003 EDT Modified files: /loncom/lonnet/perl lonnet.pm Log: - I thin <part> inside of <import> works now, it does reorder the info so that the part info comes before the import info Index: loncom/lonnet/perl/lonnet.pm diff -u loncom/lonnet/perl/lonnet.pm:1.332 loncom/lonnet/perl/lonnet.pm:1.333 --- loncom/lonnet/perl/lonnet.pm:1.332 Sat Mar 1 10:13:58 2003 +++ loncom/lonnet/perl/lonnet.pm Thu Mar 6 16:08:21 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.332 2003/03/01 15:13:58 www Exp $ +# $Id: lonnet.pm,v 1.333 2003/03/06 21:08:21 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3081,12 +3081,19 @@ # my $package=$token->[2]->{'package'}; my $keyroot=''; - if ($prefix) { - $keyroot.=$prefix; - } else { - if (defined($token->[2]->{'part'})) { - $keyroot.='_'.$token->[2]->{'part'}; - } + if (defined($prefix) && $prefix !~ /^__/) { + # prefix that has a part already + $keyroot=$prefix; + } elsif (defined($prefix)) { + # prefix that is missing a part + if (defined($token->[2]->{'part'})) { + $keyroot='_'.$token->[2]->{'part'}.substr($prefix,1); + } + } else { + # no prefix at all + if (defined($token->[2]->{'part'})) { + $keyroot='_'.$token->[2]->{'part'}; + } } if (defined($token->[2]->{'id'})) { $keyroot.='_'.$token->[2]->{'id'}; From lon-capa-cvs@mail.lon-capa.org Thu Mar 6 21:12:54 2003 From: lon-capa-cvs@mail.lon-capa.org (matthew) Date: Thu, 06 Mar 2003 21:12:54 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface/statistics lonstudentassessment.pm Message-ID: <cvsmatthew1046985174@cvsserver> matthew Thu Mar 6 16:12:54 2003 EDT Modified files: /loncom/interface/statistics lonstudentassessment.pm Log: Use lonhtmlcommon progress windows. Index: loncom/interface/statistics/lonstudentassessment.pm diff -u loncom/interface/statistics/lonstudentassessment.pm:1.35 loncom/interface/statistics/lonstudentassessment.pm:1.36 --- loncom/interface/statistics/lonstudentassessment.pm:1.35 Wed Mar 5 15:31:13 2003 +++ loncom/interface/statistics/lonstudentassessment.pm Thu Mar 6 16:12:54 2003 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentassessment.pm,v 1.35 2003/03/05 20:31:13 matthew Exp $ +# $Id: lonstudentassessment.pm,v 1.36 2003/03/06 21:12:54 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -656,8 +656,7 @@ my $rows_output; my $cols_output; -my $num_students; -my $start_time; +my %prog_state; # progress window state sub excel_initialize { my ($r) = @_; @@ -672,9 +671,6 @@ $rows_output = 0; $cols_output = 0; # - $num_students = 0; - $start_time = time; - # # Create sheet $excel_workbook = Spreadsheet::WriteExcel->new('/home/httpd'.$filename); # @@ -764,6 +760,11 @@ $r->print("</h1>\n"); $r->rflush(); # + # Initialize progress window + %prog_state=&Apache::lonhtmlcommon::Create_PrgWin + ($r,'Excel File Compilation Status', + 'Excel File Compilation Progress', $studentcount); + # return; } @@ -805,31 +806,8 @@ $rows_output++; $cols_output=0; # - # Time estimate - $num_students++; - if ($num_students % 10 == 0) { - my $time_est = (time - $start_time)/$num_students * - (scalar(@Apache::lonstatistics::Students)-$num_students); - $time_est = int($time_est); - if (int ($time_est/60) > 0) { - my $min = int($time_est/60); - my $sec = $time_est % 60; - $time_est = $min.' minutes'; - if ($sec > 1) { - $time_est.= ', '.$sec.' seconds'; - } elsif ($sec > 0) { - $time_est.= ', '.$sec.' second'; - } - } else { - $time_est .= ' seconds'; - } - $r->print($num_students.' out of '. - (scalar(@Apache::lonstatistics::Students)). - " students processed. ". - $time_est." remain. Elapsed: ".(time - $start_time). - "<br />\n"); - $r->rflush(); - } + # Update the progress window + &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,'last student'); return; } @@ -843,14 +821,12 @@ # return if($c->aborted()); # + # Close the progress window + &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); + # # Tell the user where to get their excel file - $r->print('<br /><br />'. + $r->print('<br />'. '<a href="'.$filename.'">Your Excel spreadsheet.</a>'."\n"); - my $total_time = time - $start_time; - if (int ($total_time / 60) > 0) { - $total_time = int($total_time/60).' minutes, '.($total_time % 60); - } - $r->print('<br />'.$total_time.' seconds total'); $r->rflush(); return; } From lon-capa-cvs@mail.lon-capa.org Thu Mar 6 22:41:42 2003 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Thu, 06 Mar 2003 22:41:42 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm Message-ID: <cvsalbertel1046990502@cvsserver> albertel Thu Mar 6 17:41:42 2003 EDT Modified files: /loncom/lonnet/perl lonnet.pm Log: - <part> inside <import> seems to fully work now Index: loncom/lonnet/perl/lonnet.pm diff -u loncom/lonnet/perl/lonnet.pm:1.333 loncom/lonnet/perl/lonnet.pm:1.334 --- loncom/lonnet/perl/lonnet.pm:1.333 Thu Mar 6 16:08:21 2003 +++ loncom/lonnet/perl/lonnet.pm Thu Mar 6 17:41:41 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.333 2003/03/06 21:08:21 albertel Exp $ +# $Id: lonnet.pm,v 1.334 2003/03/06 22:41:41 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3041,6 +3041,22 @@ return ''; } +sub add_prefix_and_part { + my ($prefix,$part)=@_; + my $keyroot; + if (defined($prefix) && $prefix !~ /^__/) { + # prefix that has a part already + $keyroot=$prefix; + } elsif (defined($prefix)) { + # prefix that is missing a part + if (defined($part)) { $keyroot='_'.$part.substr($prefix,1); } + } else { + # no prefix at all + if (defined($part)) { $keyroot='_'.$part; } + } + return $keyroot; +} + # ---------------------------------------------------------------- Get metadata sub metadata { @@ -3080,21 +3096,7 @@ # This is a package - get package info # my $package=$token->[2]->{'package'}; - my $keyroot=''; - if (defined($prefix) && $prefix !~ /^__/) { - # prefix that has a part already - $keyroot=$prefix; - } elsif (defined($prefix)) { - # prefix that is missing a part - if (defined($token->[2]->{'part'})) { - $keyroot='_'.$token->[2]->{'part'}.substr($prefix,1); - } - } else { - # no prefix at all - if (defined($token->[2]->{'part'})) { - $keyroot='_'.$token->[2]->{'part'}; - } - } + my $keyroot=&add_prefix_and_part($prefix,$token->[2]->{'part'}); if (defined($token->[2]->{'id'})) { $keyroot.='_'.$token->[2]->{'id'}; } @@ -3135,13 +3137,8 @@ } else { $unikey=$entry; } - if ($prefix) { - $unikey.=$prefix; - } else { - if (defined($token->[2]->{'part'})) { - $unikey.='_'.$token->[2]->{'part'}; - } - } + $unikey.=&add_prefix_and_part($prefix,$token->[2]->{'part'}); + if (defined($token->[2]->{'id'})) { $unikey.='_'.$token->[2]->{'id'}; } From lon-capa-cvs@mail.lon-capa.org Thu Mar 6 22:45:04 2003 From: lon-capa-cvs@mail.lon-capa.org (matthew) Date: Thu, 06 Mar 2003 22:45:04 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface/statistics lonstudentassessment.pm Message-ID: <cvsmatthew1046990704@cvsserver> matthew Thu Mar 6 17:45:04 2003 EDT Modified files: /loncom/interface/statistics lonstudentassessment.pm Log: Added csv download. 'scores','totals', and 'all' work wonderfully now. Index: loncom/interface/statistics/lonstudentassessment.pm diff -u loncom/interface/statistics/lonstudentassessment.pm:1.36 loncom/interface/statistics/lonstudentassessment.pm:1.37 --- loncom/interface/statistics/lonstudentassessment.pm:1.36 Thu Mar 6 16:12:54 2003 +++ loncom/interface/statistics/lonstudentassessment.pm Thu Mar 6 17:45:04 2003 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentassessment.pm,v 1.36 2003/03/06 21:12:54 matthew Exp $ +# $Id: lonstudentassessment.pm,v 1.37 2003/03/06 22:45:04 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -851,18 +851,137 @@ ####################################################### { +my $outputfile; +my $filename; + +my %prog_state; # progress window state + sub csv_initialize{ my ($r) = @_; - $r->print("<h1>Not implemented yet</h1>"); + # + # Clean up + $filename = undef; + $outputfile = undef; + undef(%prog_state); + # + # Open a file + $filename = '/prtspool/'. + $ENV{'user.name'}.'_'.$ENV{'user.domain'}.'_'. + time.'_'.rand(1000000000).'.csv'; + unless ($outputfile = Apache::File->new('>/home/httpd'.$filename)) { + $r->log_error("Couldn't open $filename for output $!"); + $r->print("Problems occured in writing the csv file. ". + "This error has been logged. ". + "Please alert your LON-CAPA administrator."); + $outputfile = undef; + } + # + # Print out the headings + my $Str = ''; + my $Str2 = undef; + foreach my $field (&get_student_fields_to_show()) { + if ($show eq 'scores') { + $Str .= '"'.&Apache::loncommon::csv_translate($field).'",'; + } elsif ($show eq 'totals') { + $Str .= '"",'; # first row empty on the student fields + $Str2 .= '"'.&Apache::loncommon::csv_translate($field).'",'; + } elsif ($show eq 'all') { + $Str .= '"'.&Apache::loncommon::csv_translate($field).'",'; + } + } + foreach my $seq (&get_sequences_to_show) { + if ($show eq 'scores') { + $Str .= '"'.&Apache::loncommon::csv_translate($seq->{'title'}). + '",'; + } elsif ($show eq 'totals') { + $Str .= '"'.&Apache::loncommon::csv_translate($seq->{'title'}). + '","",'; + $Str2 .= '"score","total possible",'; + } elsif ($show eq 'all') { + $Str .= '"'.&Apache::loncommon::csv_translate($seq->{'title'}). + '",'; + $Str .= '"",'x($seq->{'num_assess_parts'}-1); + $Str .= '"score","total possible",'; + } + } + chop($Str); + $Str .= "\n"; + print $outputfile $Str; + if (defined($Str2)) { + chop($Str2); + $Str2 .= "\n"; + print $outputfile $Str2; + } + # + # Initialize progress window + my $studentcount = scalar(@Apache::lonstatistics::Students); + %prog_state=&Apache::lonhtmlcommon::Create_PrgWin + ($r,'CSV File Compilation Status', + 'CSV File Compilation Progress', $studentcount); return; } sub csv_outputstudent { my ($r,$student) = @_; + return if (! defined($outputfile)); + my $Str = ''; + # + # Output student fields + my @to_show = &get_student_fields_to_show(); + foreach my $field (@to_show) { + $Str .= '"'.&Apache::loncommon::csv_translate($student->{$field}).'",'; + } + # + # Get student assessment data + my %StudentsData; + my @tmp = &Apache::loncoursedata::get_current_state($student->{'username'}, + $student->{'domain'}, + undef, + $ENV{'request.course.id'}); + if ((scalar @tmp > 0) && ($tmp[0] !~ /^error:/)) { + %StudentsData = @tmp; + } + # + # Output performance data + foreach my $seq (&get_sequences_to_show) { + my ($performance,$score,$seq_max) = + &StudentPerformanceOnSequence($student,\%StudentsData, + $seq,'no'); + if ($show eq 'scores') { + $Str .= '"'.$score.'",'; + } elsif ($show eq 'totals') { + $Str .= '"'.$score.'","'.$seq_max.'",'; + } elsif ($show eq 'all') { + $Str .= '"'.join('","',(split(//,$performance),$score,$seq_max)). + '",'; + } + } + chop($Str); + $Str .= "\n"; + print $outputfile $Str; + # + # Update the progress window + &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state,'last student'); + return; } sub csv_finish { my ($r) = @_; + return if (! defined($outputfile)); + close($outputfile); + # + my $c = $r->connection(); + return if ($c->aborted()); + # + # Close the progress window + &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); + # + # Tell the user where to get their csv file + $r->print('<br />'. + '<a href="'.$filename.'">Your csv file.</a>'."\n"); + $r->rflush(); + return; + } } From lon-capa-cvs@mail.lon-capa.org Fri Mar 7 04:20:20 2003 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Fri, 07 Mar 2003 04:20:20 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonspreadsheet.pm Message-ID: <cvsalbertel1047010820@cvsserver> albertel Thu Mar 6 23:20:20 2003 EDT Modified files: /loncom/interface lonspreadsheet.pm Log: - cascading up the part list now works - accepts parts with : and - in them Index: loncom/interface/lonspreadsheet.pm diff -u loncom/interface/lonspreadsheet.pm:1.173 loncom/interface/lonspreadsheet.pm:1.174 --- loncom/interface/lonspreadsheet.pm:1.173 Mon Mar 3 17:00:03 2003 +++ loncom/interface/lonspreadsheet.pm Thu Mar 6 23:20:20 2003 @@ -1,5 +1,5 @@ # -# $Id: lonspreadsheet.pm,v 1.173 2003/03/03 22:00:03 albertel Exp $ +# $Id: lonspreadsheet.pm,v 1.174 2003/03/07 04:20:20 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -722,8 +722,27 @@ # second, check map parms my $thisparm = $parmhash{$symbparm}; return $thisparm if (defined($thisparm)); + # first, check default - return &Apache::lonnet::metadata($fn,$rwhat.'.default'); + $thisparm = &Apache::lonnet::metadata($fn,$rwhat.'.default'); + return $thisparm if (defined($thisparm)); + + #Cascade Up + my $space=$what; + $space=~s/\.\w+$//; + if ($space ne '0') { + my @parts=split(/_/,$space); + my $id=pop(@parts); + my $part=join('_',@parts); + if ($part eq '') { $part='0'; } + my $newwhat=$rwhat; + $newwhat=~s/\Q$space\E/$part/; + my $partgeneral=&parmval($newwhat,$symb,$uname,$udom,$csec); + if (defined($partgeneral)) { return $partgeneral; } + } + + #nothing defined + return ''; } # @@ -1507,7 +1526,7 @@ foreach my $varname ( @vars ) { if ($varname=~/\D/) { $formula=~s/$varname/'$c{\''.$varname.'\'}'/ge; - $varname=~s/$var/\(\\w\+\)/g; + $varname=~s/$var/\([\\w:-]\+\)/g; foreach (keys(%{$self->{'constants'}})) { if ($_=~/$varname/) { $values{$1}=1; From lon-capa-cvs@mail.lon-capa.org Fri Mar 7 15:04:00 2003 From: lon-capa-cvs@mail.lon-capa.org (matthew) Date: Fri, 07 Mar 2003 15:04:00 -0000 Subject: [LON-CAPA-cvs] cvs: loncom / lond Message-ID: <cvsmatthew1047049440@cvsserver> matthew Fri Mar 7 10:04:00 2003 EDT Modified files: /loncom lond Log: Since GDBM does not bother to check to see if the file it wants exists before trying to open it a 'bad block error' will result when a non-existant file is tied. lond now reports: "error:No such file or GDBM reported bad block error\n" when this occurs on a 'get' call so we don't bother logging the error every time a file is requested that does not exist. &Apache::lonnet::EXT() in particular expects an error of this form. Index: loncom/lond diff -u loncom/lond:1.111 loncom/lond:1.112 --- loncom/lond:1.111 Tue Mar 4 17:32:20 2003 +++ loncom/lond Fri Mar 7 10:04:00 2003 @@ -2,7 +2,7 @@ # The LearningOnline Network # lond "LON Daemon" Server (port "LOND" 5663) # -# $Id: lond,v 1.111 2003/03/04 22:32:20 matthew Exp $ +# $Id: lond,v 1.112 2003/03/07 15:04:00 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1139,9 +1139,14 @@ "while attempting get\n"; } } else { - print $client "error: ".($!+0) - ." tie(GDBM) Failed ". - "while attempting get\n"; + if ($!+0 == 2) { + print $client "error:No such file or ". + "GDBM reported bad block error\n"; + } else { + print $client "error: ".($!+0) + ." tie(GDBM) Failed ". + "while attempting get\n"; + } } # ------------------------------------------------------------------------ eget } elsif ($userinput =~ /^eget/) { From lon-capa-cvs@mail.lon-capa.org Fri Mar 7 15:18:39 2003 From: lon-capa-cvs@mail.lon-capa.org (matthew) Date: Fri, 07 Mar 2003 15:18:39 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface/statistics lonstudentassessment.pm Message-ID: <cvsmatthew1047050319@cvsserver> matthew Fri Mar 7 10:18:39 2003 EDT Modified files: /loncom/interface/statistics lonstudentassessment.pm Log: Added timestamp to html and csv output. Already present in excel output. Index: loncom/interface/statistics/lonstudentassessment.pm diff -u loncom/interface/statistics/lonstudentassessment.pm:1.37 loncom/interface/statistics/lonstudentassessment.pm:1.38 --- loncom/interface/statistics/lonstudentassessment.pm:1.37 Thu Mar 6 17:45:04 2003 +++ loncom/interface/statistics/lonstudentassessment.pm Fri Mar 7 10:18:39 2003 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentassessment.pm,v 1.37 2003/03/06 22:45:04 matthew Exp $ +# $Id: lonstudentassessment.pm,v 1.38 2003/03/07 15:18:39 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -452,6 +452,8 @@ $padding = ' 'x3; $count = 0; # + $r->print("<h3>".$ENV{'course.'.$ENV{'request.course.id'}.'.description'}. + "  ".localtime(time)."</h3>"); my $Str = "<pre>\n"; # First, the @StudentData fields need to be listed my @to_show = &get_student_fields_to_show(); @@ -875,6 +877,13 @@ "Please alert your LON-CAPA administrator."); $outputfile = undef; } + # + # Datestamp + my $description = $ENV{'course.'.$ENV{'request.course.id'}.'.description'}; + print $outputfile '"'.&Apache::loncommon::csv_translate($description).'",'. + '"'.&Apache::loncommon::csv_translate(scalar(localtime(time))).'"'. + "\n"; + # # Print out the headings my $Str = ''; From lon-capa-cvs@mail.lon-capa.org Fri Mar 7 17:01:45 2003 From: lon-capa-cvs@mail.lon-capa.org (matthew) Date: Fri, 07 Mar 2003 17:01:45 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface/statistics lonstudentassessment.pm Message-ID: <cvsmatthew1047056505@cvsserver> matthew Fri Mar 7 12:01:45 2003 EDT Modified files: /loncom/interface/statistics lonstudentassessment.pm Log: Added summary table to html output. Added new output mode to let instructors get just the summary table, without all those pesky students. Rewrote &StudentAverageTotal to implement this. Index: loncom/interface/statistics/lonstudentassessment.pm diff -u loncom/interface/statistics/lonstudentassessment.pm:1.38 loncom/interface/statistics/lonstudentassessment.pm:1.39 --- loncom/interface/statistics/lonstudentassessment.pm:1.38 Fri Mar 7 10:18:39 2003 +++ loncom/interface/statistics/lonstudentassessment.pm Fri Mar 7 12:01:45 2003 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentassessment.pm,v 1.38 2003/03/07 15:18:39 matthew Exp $ +# $Id: lonstudentassessment.pm,v 1.39 2003/03/07 17:01:45 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -305,11 +305,19 @@ { name => 'HTML, totals', value => 'html, totals', description => 'Output HTML, but only the summary statistics for each'. - ' sequence selected.', + ' sequence selected for each student.', mode => 'html', show => 'totals', show_links => 'no', }, + { name => 'HTML, summary table only', + value => 'html summary table only', + description => 'Output HTML, but only the final summary table for '. + 'all students across all sequences.', + mode => 'html', + show => 'final table', + show_links => 'no', + }, { name => 'Excel, scores only', value => 'excel, scores only', description => 'Output an Excel file (compatable with Excel 95), '. @@ -446,14 +454,27 @@ my $padding; my $count; + my $nodata_count; # The number of students for which there is no data + my %prog_state; # progress state used by loncommon PrgWin routines + sub html_initialize { my ($r) = @_; # $padding = ' 'x3; $count = 0; + $nodata_count = 0; # $r->print("<h3>".$ENV{'course.'.$ENV{'request.course.id'}.'.description'}. "  ".localtime(time)."</h3>"); + + # + # Set up progress window for 'final table' display only + if ($show eq 'final table') { + my $studentcount = scalar(@Apache::lonstatistics::Students); + %prog_state=&Apache::lonhtmlcommon::Create_PrgWin + ($r,'Summary Table Status', + 'Summary Table Compilation Progress', $studentcount); + } my $Str = "<pre>\n"; # First, the @StudentData fields need to be listed my @to_show = &get_student_fields_to_show(); @@ -472,6 +493,11 @@ } $Str .= "total (of shown problems)</pre>\n"; $Str .= "<pre>"; + # + # Check for suppression of output + if ($show eq 'final table') { + $Str = ''; + } $r->print($Str); $r->rflush(); return; @@ -501,6 +527,8 @@ %StudentsData = @tmp; } if (scalar(@tmp) < 1) { + $nodata_count++; + return if ($show eq 'final table'); $Str .= '<font color="blue">No Course Data</font>'."\n"; $r->print($Str); $r->rflush(); @@ -545,6 +573,14 @@ } $Str .= ' '.' 'x(length($max)-length($score)).$score.'/'.$max; $Str .= " \n"; + # + # Check for suppressed output and update the progress window if so... + if ($show eq 'final table') { + $Str = ''; + &Apache::lonhtmlcommon::Increment_PrgWin($r,\%prog_state, + 'last student'); + } + # $r->print($Str); # $r->rflush(); @@ -553,11 +589,51 @@ sub html_finish { my ($r) = @_; - $r->print("</pre>\n"); + # + # Check for suppressed output and close the progress window if so + if ($show eq 'final table') { + &Apache::lonhtmlcommon::Close_PrgWin($r,\%prog_state); + } else { + $r->print("</pre>\n"); + } + $r->print(&StudentAverageTotal()); $r->rflush(); return; } +sub StudentAverageTotal { + my $Str = "<h3>Summary Tables</h3>\n"; + my $num_students = scalar(@Apache::lonstatistics::Students); + my $total_ave = 0; + my $total_max = 0; + $Str .= '<table border=2 cellspacing="1">'."\n"; + $Str .= "<tr><th>Title</th><th>Average</th><th>Maximum</th></tr>\n"; + foreach my $seq (&get_sequences_to_show) { + my $ave = int(100*($Statistics->{$seq->{'symb'}}->{'score'}/ + ($num_students-$nodata_count)))/100; + $total_ave += $ave; + my $max = $seq->{'num_assess_parts'}; + $total_max += $max; + if ($ave == 0) { + $ave = "0.00"; + } + $ave .= ' '; + $max .= '   '; + $Str .= '<tr><td>'.$seq->{'title'}.'</td>'. + '<td align="right">'.$ave.'</td>'. + '<td align="right">'.$max.'</td></tr>'."\n"; + } + $total_ave = int(100*$total_ave)/100; # only two digit + $Str .= "</table>\n"; + $Str .= '<table border=2 cellspacing="1">'."\n"; + $Str .= '<tr><th>Number of Students</th><th>Average</th>'. + "<th>Maximum</th></tr>\n"; + $Str .= '<tr><td>'.($num_students-$nodata_count).'</td>'. + '<td>'.$total_ave.'</td><td>'.$total_max.'</td>'; + $Str .= "</table>\n"; + return $Str; +} + } ####################################################### @@ -1082,69 +1158,6 @@ $Str .= $value; } return ($Str,$sum,$max); -} - -####################################################### -####################################################### -sub StudentAverageTotal { - my ($cache, $students, $sequenceKeys)=@_; - my $Str = "\n<b>Summary Tables:</b>\n"; - my %Correct = (); - my $ProblemsSolved = 0; - my $TotalProblems = 0; - my $StudentCount = 0; - - foreach my $name (@$students) { - $StudentCount++; - foreach my $sequence (@$sequenceKeys) { - $Correct{$sequence} += - $cache->{$name.':'.$sequence.':problemsCorrect'}; - } - $ProblemsSolved += $cache->{$name.':problemsSolved'}; - $TotalProblems += $cache->{$name.':totalProblems'}; - } - if ($StudentCount) { - $ProblemsSolved = sprintf( "%.2f", - $ProblemsSolved/$StudentCount); - $TotalProblems /= $StudentCount; - } else { - $ProblemsSolved = 0; - $TotalProblems = 0; - } - - $Str .= '<table border=2 cellspacing="1">'."\n"; - $Str .= '<tr><td><b>Students Count</b></td><td><b>'. - $StudentCount.'</b></td></tr>'."\n"; - $Str .= '<tr><td><b>Total Problems</b></td><td><b>'. - $TotalProblems.'</b></td></tr>'."\n"; - $Str .= '<tr><td><b>Average Correct</b></td><td><b>'. - $ProblemsSolved.'</b></td></tr>'."\n"; - $Str .= '</table>'."\n"; - - $Str .= '<table border=2 cellspacing="1">'."\n"; - $Str .= '<tr><th>Title</th><th>Total Problems</th>'. - '<th>Average Correct</th></tr>'."\n"; - foreach my $S(@$sequenceKeys) { - my $title=$cache->{$S.':title'}; - #$Str .= $cache->{$S.':problems'}; - #my @problems=split(':', $cache->{$S.':problems'}); - #my $pCount=scalar @problems; - my $pCount=MaxSeqPr($cache,@$students[0],$S); - my $crr; - if ($StudentCount) { - $crr=sprintf( "%.2f", $Correct{$S}/$StudentCount ); - } else { - $crr="0.00"; - } - $Str .= '<tr><td>'.$title. - '</td><td align=center>'.$pCount. - '</td><td align=center>'.$crr. - '</td></tr>'."\n"; - } - - $Str .= '</table>'."\n"; - - return $Str; } ####################################################### From lon-capa-cvs@mail.lon-capa.org Fri Mar 7 17:52:37 2003 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Fri, 07 Mar 2003 17:52:37 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /publisher lonpublisher.pm Message-ID: <cvsalbertel1047059557@cvsserver> albertel Fri Mar 7 12:52:37 2003 EDT Modified files: /loncom/publisher lonpublisher.pm Log: - if an error occurs during phase one of publishing don't do phasetwo Index: loncom/publisher/lonpublisher.pm diff -u loncom/publisher/lonpublisher.pm:1.112 loncom/publisher/lonpublisher.pm:1.113 --- loncom/publisher/lonpublisher.pm:1.112 Tue Feb 18 18:18:50 2003 +++ loncom/publisher/lonpublisher.pm Fri Mar 7 12:52:37 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Publication Handler # -# $Id: lonpublisher.pm,v 1.112 2003/02/18 23:18:50 albertel Exp $ +# $Id: lonpublisher.pm,v 1.113 2003/03/07 17:52:37 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -789,6 +789,10 @@ backup copies, performs any automatic processing (prior to publication, especially for rat and ssi files), +Returns a 2 element array, the first is the string to be shown to the +user, the second is an error code, either 1 (an error occured) or 0 +(no error occurred) + I<Additional documentation needed.> =cut @@ -805,8 +809,7 @@ my %allow=(); unless ($logfile=Apache::File->new('>>'.$source.'.log')) { - return - '<font color=red>No write permission to user directory, FAIL</font>'; + return ('<font color=red>No write permission to user directory, FAIL</font>',1); } print $logfile "\n\n================= Publish ".localtime()." Phase One ================\n"; @@ -820,14 +823,14 @@ print $logfile "Copied original file to ".$copyfile."\n"; } else { print $logfile "Unable to write backup ".$copyfile.':'.$!."\n"; - return "<font color=red>Failed to write backup copy, $!,FAIL</font>"; + return ("<font color=red>Failed to write backup copy, $!,FAIL</font>",1); } # ------------------------------------------------------------- IDs and indices my ($outstring,$error); ($outstring,$error,%allow)=&fix_ids_and_indices($logfile,$source, $target); - if ($error) { return $outstring; } + if ($error) { return ($outstring,$error); } # ------------------------------------------------------------ Construct Allows $scrout.='<h3>Dependencies</h3>'; @@ -872,9 +875,8 @@ my $org; unless ($org=Apache::File->new('>'.$source)) { print $logfile "No write permit to $source\n"; - return - '<font color="red">No write permission to '.$source. - ', FAIL</font>'; + return ('<font color="red">No write permission to '.$source. + ', FAIL</font>',1); } print($org $outstring); } @@ -1122,8 +1124,7 @@ my $copyright_help = Apache::loncommon::help_open_topic('Publishing_Copyright'); $scrout =~ s/DISTRIBUTION:/'DISTRIBUTION: ' . $copyright_help/ge; - return $scrout. - '<p><input type="submit" value="Finalize Publication" /></p></form>'; + return ($scrout.'<p><input type="submit" value="Finalize Publication" /></p></form>',0); # ============================================================================= # BATCH MODE # @@ -1151,7 +1152,7 @@ $ENV{'form.copyright'}='default'; } $ENV{'form.allmeta'}=&Apache::lonnet::escape($allmeta); - return $scrout; + return ($scrout,0); } } @@ -1472,13 +1473,16 @@ # phase one takes # my ($source,$target,$style,$batch)=@_; - $r->print('<p>'.&publish($srcfile,$targetfile,$thisembstyle,1).'</p>'); + my ($outstring,$error)=&publish($srcfile,$targetfile,$thisembstyle,1); + $r->print('<p>'.$outstring.'</p>'); # phase two takes # my ($source,$target,$style,$distarget,batch)=@_; # $ENV{'form.allmeta'},$ENV{'form.title'},$ENV{'form.author'},... - $r->print('<p>'); - &phasetwo($r,$srcfile,$targetfile,$thisembstyle,$thisdistarget,1); - $r->print('</p>'); + if (!$error) { + $r->print('<p>'); + &phasetwo($r,$srcfile,$targetfile,$thisembstyle,$thisdistarget,1); + $r->print('</p>'); + } return ''; } @@ -1593,7 +1597,7 @@ # -------------------------------------------------------------- Check filename - my $fn=$ENV{'form.filename'}; + my $fn=&Apache::lonnet::unescape($ENV{'form.filename'}); unless ($fn) { @@ -1723,13 +1727,12 @@ # ------------------ Publishing from $thisfn to $thistarget with $thisembstyle. unless ($ENV{'form.phase'} eq 'two') { - $r->print( - '<hr />'.&publish($thisfn,$thistarget,$thisembstyle)); + my ($outstring,$error)=&publish($thisfn,$thistarget,$thisembstyle); + $r->print('<hr />'.$outstring); } else { $r->print('<hr />'); &phasetwo($r,$thisfn,$thistarget,$thisembstyle,$thisdistarget); - } - + } } $r->print('</body></html>'); From lon-capa-cvs@mail.lon-capa.org Fri Mar 7 17:55:05 2003 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Fri, 07 Mar 2003 17:55:05 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /publisher lonpublisher.pm Message-ID: <cvsalbertel1047059705@cvsserver> albertel Fri Mar 7 12:55:05 2003 EDT Modified files: /loncom/publisher lonpublisher.pm Log: - XHTMLing Index: loncom/publisher/lonpublisher.pm diff -u loncom/publisher/lonpublisher.pm:1.113 loncom/publisher/lonpublisher.pm:1.114 --- loncom/publisher/lonpublisher.pm:1.113 Fri Mar 7 12:52:37 2003 +++ loncom/publisher/lonpublisher.pm Fri Mar 7 12:55:05 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Publication Handler # -# $Id: lonpublisher.pm,v 1.113 2003/03/07 17:52:37 albertel Exp $ +# $Id: lonpublisher.pm,v 1.114 2003/03/07 17:55:05 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -809,7 +809,7 @@ my %allow=(); unless ($logfile=Apache::File->new('>>'.$source.'.log')) { - return ('<font color=red>No write permission to user directory, FAIL</font>',1); + return ('<font color="red">No write permission to user directory, FAIL</font>',1); } print $logfile "\n\n================= Publish ".localtime()." Phase One ================\n"; @@ -823,7 +823,7 @@ print $logfile "Copied original file to ".$copyfile."\n"; } else { print $logfile "Unable to write backup ".$copyfile.':'.$!."\n"; - return ("<font color=red>Failed to write backup copy, $!,FAIL</font>",1); + return ("<font color=\"red\">Failed to write backup copy, $!,FAIL</font>",1); } # ------------------------------------------------------------- IDs and indices @@ -1202,14 +1202,14 @@ if ($target=~/\_\_\_/) { $r->print( - '<font color=red>Unsupported character combination "<tt>___</tt>" in filename, FAIL</font>'); + '<font color="red">Unsupported character combination "<tt>___</tt>" in filename, FAIL</font>'); return 0; } $distarget=~s/\/+/\//g; my $logfile; unless ($logfile=Apache::File->new('>>'.$source.'.log')) { $r->print( - '<font color=red>No write permission to user directory, FAIL</font>'); + '<font color="red">No write permission to user directory, FAIL</font>'); return 0; } print $logfile @@ -1250,7 +1250,7 @@ my $mfh; unless ($mfh=Apache::File->new('>'.$source.'.meta')) { return - '<font color=red>Could not write metadata, FAIL</font>'; + '<font color="red">Could not write metadata, FAIL</font>'; } foreach (sort keys %metadatafields) { unless ($_=~/\./) { @@ -1302,7 +1302,7 @@ my $srcd=$1; unless ($srcd=~/^\/home\/httpd\/html\/res/) { print $logfile "\nPANIC: Target dir is ".$srcd; - return "<font color=red>Invalid target directory, FAIL</font>"; + return "<font color=\"red\">Invalid target directory, FAIL</font>"; } opendir(DIR,$srcd); while ($filename=readdir(DIR)) { @@ -1327,7 +1327,7 @@ $r->print('<p>Copied old target file'); } else { print $logfile "Unable to write ".$copyfile.':'.$!."\n"; - return "<font color=red>Failed to copy old target, $!, FAIL</font>"; + return "<font color=\"red\">Failed to copy old target, $!, FAIL</font>"; } # --------------------------------------------------------------- Copy Metadata @@ -1341,7 +1341,7 @@ print $logfile "Unable to write metadata ".$copyfile.':'.$!."\n"; if (-e $target.'.meta') { return - "<font color=red>Failed to write old metadata copy, $!, FAIL</font>"; + "<font color=\"red\">Failed to write old metadata copy, $!, FAIL</font>"; } } @@ -1372,7 +1372,7 @@ $r->print('<p>Copied source file'); } else { print $logfile "\nUnable to write ".$copyfile.':'.$!."\n"; - return "<font color=red>Failed to copy source, $!, FAIL</font>"; + return "<font color=\"red\">Failed to copy source, $!, FAIL</font>"; } # --------------------------------------------------------------- Copy Metadata @@ -1385,7 +1385,7 @@ } else { print $logfile "\nUnable to write metadata ".$copyfile.':'.$!."\n"; return - "<font color=red>Failed to write metadata copy, $!, FAIL</font>"; + "<font color=\"red\">Failed to write metadata copy, $!, FAIL</font>"; } $r->rflush; # --------------------------------------------------- Send update notifications From lon-capa-cvs@mail.lon-capa.org Fri Mar 7 18:46:38 2003 From: lon-capa-cvs@mail.lon-capa.org (matthew) Date: Fri, 07 Mar 2003 18:46:38 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonstatistics.pm /interface/statistics lonstudentassessment.pm Message-ID: <cvsmatthew1047062798@cvsserver> matthew Fri Mar 7 13:46:38 2003 EDT Modified files: /loncom/interface lonstatistics.pm /loncom/interface/statistics lonstudentassessment.pm Log: moved &get_sequences_to_show from lonstudentassessment.pm to &Sequences_with_Assess in lonstatistics.pm. Index: loncom/interface/lonstatistics.pm diff -u loncom/interface/lonstatistics.pm:1.63 loncom/interface/lonstatistics.pm:1.64 --- loncom/interface/lonstatistics.pm:1.63 Mon Mar 3 14:17:51 2003 +++ loncom/interface/lonstatistics.pm Fri Mar 7 13:46:38 2003 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstatistics.pm,v 1.63 2003/03/03 19:17:51 matthew Exp $ +# $Id: lonstatistics.pm,v 1.64 2003/03/07 18:46:38 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -434,6 +434,33 @@ } else { @SelectedMaps = ('all'); } +} + + +####################################################### +####################################################### + +=pod + +=item &Sequences_with_Assess() + +Returns an array containing the subset of @Sequences which contain +assessments. + +=cut + +####################################################### +####################################################### +sub Sequences_with_Assess { + my @Sequences_to_Show; + foreach my $map_symb (@SelectedMaps) { + foreach my $sequence (@Sequences) { + next if ($sequence->{'symb'} ne $map_symb && $map_symb ne 'all'); + next if ($sequence->{'num_assess'} < 1); + push (@Sequences_to_Show,$sequence); + } + } + return @Sequences_to_Show; } ####################################################### Index: loncom/interface/statistics/lonstudentassessment.pm diff -u loncom/interface/statistics/lonstudentassessment.pm:1.39 loncom/interface/statistics/lonstudentassessment.pm:1.40 --- loncom/interface/statistics/lonstudentassessment.pm:1.39 Fri Mar 7 12:01:45 2003 +++ loncom/interface/statistics/lonstudentassessment.pm Fri Mar 7 13:46:38 2003 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentassessment.pm,v 1.39 2003/03/07 17:01:45 matthew Exp $ +# $Id: lonstudentassessment.pm,v 1.40 2003/03/07 18:46:38 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -198,19 +198,6 @@ return @to_show; } -sub get_sequences_to_show { - my @Sequences; - foreach my $map_symb (@Apache::lonstatistics::SelectedMaps) { - foreach my $sequence (@Apache::lonstatistics::Sequences) { - next if ($sequence->{'symb'} ne $map_symb && $map_symb ne 'all'); - next if ($sequence->{'num_assess'} < 1); - push (@Sequences,$sequence); - } - } - return @Sequences; -} - - ####################################################### ####################################################### @@ -485,7 +472,7 @@ $Str .= $title.' 'x($width-$base).$padding; } # Now the selected sequences need to be listed - foreach my $sequence (&get_sequences_to_show) { + foreach my $sequence (&Apache::lonstatistics::Sequences_with_Assess()){ my $title = $sequence->{'title'}; my $base = $sequence->{'base_width'}; my $width = $sequence->{'width'}; @@ -538,7 +525,7 @@ # By sequence build up the data my $studentstats; my $PerformanceStr = ''; - foreach my $seq (&get_sequences_to_show) { + foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) { my ($performance,$score,$seq_max) = &StudentPerformanceOnSequence($student,\%StudentsData, $seq,$show_links); @@ -608,7 +595,7 @@ my $total_max = 0; $Str .= '<table border=2 cellspacing="1">'."\n"; $Str .= "<tr><th>Title</th><th>Average</th><th>Maximum</th></tr>\n"; - foreach my $seq (&get_sequences_to_show) { + foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) { my $ave = int(100*($Statistics->{$seq->{'symb'}}->{'score'}/ ($num_students-$nodata_count)))/100; $total_ave += $ave; @@ -666,7 +653,7 @@ my $num_data_per_part = 2; # 'status' and 'numtries' my $fields_per_student = scalar(&get_student_fields_to_show()); my $bytes_per_field = 20; # Back of the envelope calculation - foreach my $seq (&get_sequences_to_show) { + foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) { $num_sequences++ if ($seq->{'num_assess'} > 0); $fields_per_student += $num_data_per_part * $seq->{'num_assess_parts'}; } @@ -812,7 +799,7 @@ } # # Add the Sequence Headers - foreach my $seq (&get_sequences_to_show) { + foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) { $excel_sheet->write($rows_output,$cols_output,$seq->{'title'}); if ($show eq 'totals') { $excel_sheet->write($rows_output+1,$cols_output,'score'); @@ -868,7 +855,7 @@ } # # Write out sequence scores and totals data - foreach my $seq (&get_sequences_to_show) { + foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) { my ($performance,$score,$seq_max) = &StudentPerformanceOnSequence($student,\%StudentsData, $seq,'no'); @@ -974,7 +961,7 @@ $Str .= '"'.&Apache::loncommon::csv_translate($field).'",'; } } - foreach my $seq (&get_sequences_to_show) { + foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) { if ($show eq 'scores') { $Str .= '"'.&Apache::loncommon::csv_translate($seq->{'title'}). '",'; @@ -1028,7 +1015,7 @@ } # # Output performance data - foreach my $seq (&get_sequences_to_show) { + foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) { my ($performance,$score,$seq_max) = &StudentPerformanceOnSequence($student,\%StudentsData, $seq,'no'); From lon-capa-cvs@mail.lon-capa.org Fri Mar 7 19:09:11 2003 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Fri, 07 Mar 2003 19:09:11 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonhtmlcommon.pm Message-ID: <cvsalbertel1047064151@cvsserver> albertel Fri Mar 7 14:09:11 2003 EDT Modified files: /loncom/interface lonhtmlcommon.pm Log: - pt in matthew minute/seconds code, change hash indices to be clearer Index: loncom/interface/lonhtmlcommon.pm diff -u loncom/interface/lonhtmlcommon.pm:1.15 loncom/interface/lonhtmlcommon.pm:1.16 --- loncom/interface/lonhtmlcommon.pm:1.15 Mon Mar 3 17:00:03 2003 +++ loncom/interface/lonhtmlcommon.pm Fri Mar 7 14:09:11 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # a pile of common html routines # -# $Id: lonhtmlcommon.pm,v 1.15 2003/03/03 22:00:03 albertel Exp $ +# $Id: lonhtmlcommon.pm,v 1.16 2003/03/07 19:09:11 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -653,10 +653,10 @@ "</script>"); my %prog_state; - $prog_state{'now'}=0; - $prog_state{'since'}=time; - $prog_state{'started'}=time; - $prog_state{'total'}=$number_to_do; + $prog_state{'done'}=0; + $prog_state{'firststart'}=time; + $prog_state{'laststart'}=time; + $prog_state{'max'}=$number_to_do; $r->rflush(); return %prog_state; @@ -667,21 +667,35 @@ my ($r,$prog_state,$displayString)=@_; $r->print('<script>popwin.document.popremain.remaining.value="'. $displayString.'";</script>'); - $$prog_state{'started'}=time; + $$prog_state{'laststart'}=time; $r->rflush(); } # increment progress state sub Increment_PrgWin { my ($r,$prog_state,$extraInfo)=@_; - $$prog_state{'now'}++; + $$prog_state{'done'}++; + my $time_est= (time - $$prog_state{'firststart'})/$$prog_state{'done'} * + ($$prog_state{'max'}-$$prog_state{'done'}); + $time_est = int($time_est); + if (int ($time_est/60) > 0) { + my $min = int($time_est/60); + my $sec = $time_est % 60; + $time_est = $min.' minutes'; + if ($sec > 1) { + $time_est.= ', '.$sec.' seconds'; + } elsif ($sec > 0) { + $time_est.= ', '.$sec.' second'; + } + } else { + $time_est .= ' seconds'; + } + $r->print('<script>popwin.document.popremain.remaining.value="'. - $$prog_state{'now'}.'/'.$$prog_state{'total'}. - ': '.int((time-$$prog_state{'since'})/ - $$prog_state{'now'}*($$prog_state{'total'}-$$prog_state{'now'})). - ' secs remaining ('.(time-$$prog_state{'started'}). + $$prog_state{'done'}.'/'.$$prog_state{'max'}. + ': '.$time_est.' remaining ('.(time-$$prog_state{'laststart'}). ' seconds for '.$extraInfo.')";'.'</script>'); - $$prog_state{'started'}=time; + $$prog_state{'laststart'}=time; $r->rflush(); } From lon-capa-cvs@mail.lon-capa.org Fri Mar 7 23:32:06 2003 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Fri, 07 Mar 2003 23:32:06 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonspreadsheet.pm Message-ID: <cvsalbertel1047079926@cvsserver> albertel Fri Mar 7 18:32:06 2003 EDT Modified files: /loncom/interface lonspreadsheet.pm Log: - spaces seem to work wel in part numbers, I need to do more testing of it, but it looks good so far Index: loncom/interface/lonspreadsheet.pm diff -u loncom/interface/lonspreadsheet.pm:1.174 loncom/interface/lonspreadsheet.pm:1.175 --- loncom/interface/lonspreadsheet.pm:1.174 Thu Mar 6 23:20:20 2003 +++ loncom/interface/lonspreadsheet.pm Fri Mar 7 18:32:05 2003 @@ -1,5 +1,5 @@ # -# $Id: lonspreadsheet.pm,v 1.174 2003/03/07 04:20:20 albertel Exp $ +# $Id: lonspreadsheet.pm,v 1.175 2003/03/07 23:32:05 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1526,7 +1526,7 @@ foreach my $varname ( @vars ) { if ($varname=~/\D/) { $formula=~s/$varname/'$c{\''.$varname.'\'}'/ge; - $varname=~s/$var/\([\\w:-]\+\)/g; + $varname=~s/$var/\([\\w:- ]\+\)/g; foreach (keys(%{$self->{'constants'}})) { if ($_=~/$varname/) { $values{$1}=1; From lon-capa-cvs@mail.lon-capa.org Fri Mar 7 23:37:10 2003 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Fri, 07 Mar 2003 23:37:10 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm Message-ID: <cvsalbertel1047080230@cvsserver> albertel Fri Mar 7 18:37:10 2003 EDT Modified files: /loncom/lonnet/perl lonnet.pm Log: - some little things - BUG#523 EXT now understands CSTR (actually it piggybacks off of lonhomeworks understanding of CSTR as far as restore, and passes whichuser info to get) - you don't need to escape _ in regexp - convert metadata to use clutter/filelocation Index: loncom/lonnet/perl/lonnet.pm diff -u loncom/lonnet/perl/lonnet.pm:1.334 loncom/lonnet/perl/lonnet.pm:1.335 --- loncom/lonnet/perl/lonnet.pm:1.334 Thu Mar 6 17:41:41 2003 +++ loncom/lonnet/perl/lonnet.pm Fri Mar 7 18:37:09 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.334 2003/03/06 22:41:41 albertel Exp $ +# $Id: lonnet.pm,v 1.335 2003/03/07 23:37:09 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -729,8 +729,8 @@ $author=~s/\/home\/httpd\/html\/res\/([^\/]*)\/([^\/]*).*/$1\/$2/; my ($udom,$uname)=split(/\//,$author); my $home=homeserver($uname,$udom); - if ($home eq 'no_host') { - return 'not_found'; + if ($home eq 'no_host') { + return 'not_found'; } my $answer=reply("sub:$fname",$home); if (($answer eq 'con_lost') || ($answer eq 'rejected')) { @@ -2855,8 +2855,12 @@ if ($realm eq 'user') { # --------------------------------------------------------------- user.resource if ($space eq 'resource') { - my %restored=&restore(undef,undef,$udom,$uname); - return $restored{$qualifierrest}; + if (defined($Apache::lonhomework::parsing_a_problem)) { + return $Apache::lonhomework::history{$qualifierrest}; + } else { + my %restored=&restore($symbparm,$courseid,$udom,$uname); + return $restored{$qualifierrest}; + } # ----------------------------------------------------------------- user.access } elsif ($space eq 'access') { # FIXME - not supporting calls for a specific user @@ -2891,9 +2895,8 @@ return $uname; # ---------------------------------------------------- Any other user namespace } else { - my $item=($rest)?$qualifier.'.'.$rest:$qualifier; - my %reply=&get($space,[$item]); - return $reply{$item}; + my %reply=&get($space,[$qualifierrest],$udom,$uname); + return $reply{$qualifierrest}; } } elsif ($realm eq 'query') { # ---------------------------------------------- pull stuff out of query string @@ -3010,7 +3013,7 @@ # ------------------------------------------------------------------ Cascade up unless ($space eq '0') { - my ($part,$id)=split(/\_/,$space); + my ($part,$id)=split(/_/,$space); if ($id) { my $partgeneral=&EXT('resource.'.$part.'.'.$qualifierrest, $symbparm,$udom,$uname); @@ -3085,7 +3088,7 @@ } my %metathesekeys=(); unless ($filename=~/\.meta$/) { $filename.='.meta'; } - my $metastring=&getfile($perlvar{'lonDocRoot'}.'/res/'.$filename); + my $metastring=&getfile(&filelocation('',&clutter($filename))); my $parser=HTML::LCParser->new(\$metastring); my $token; undef %metathesekeys; From lon-capa-cvs@mail.lon-capa.org Fri Mar 7 23:41:30 2003 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Fri, 07 Mar 2003 23:41:30 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /homework structuretags.pm Message-ID: <cvsalbertel1047080490@cvsserver> albertel Fri Mar 7 18:41:30 2003 EDT Modified files: /loncom/homework structuretags.pm Log: - clean up the globals in end_problem - new global $Apache::lonhomework::parsing_a_problem set to 1 while between start_problem and end_problem Index: loncom/homework/structuretags.pm diff -u loncom/homework/structuretags.pm:1.154 loncom/homework/structuretags.pm:1.155 --- loncom/homework/structuretags.pm:1.154 Thu Mar 6 16:05:27 2003 +++ loncom/homework/structuretags.pm Fri Mar 7 18:41:29 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # definition of tags that give a structure to a document # -# $Id: structuretags.pm,v 1.154 2003/03/06 21:05:27 albertel Exp $ +# $Id: structuretags.pm,v 1.155 2003/03/07 23:41:29 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -241,6 +241,7 @@ sub start_problem { my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; + $Apache::lonhomework::parsing_a_problem=1; # meta is called from lonpublisher, which doesn't uses the normal # lonhomework method of parsing the file which means that inputtags # won't get reset @@ -476,6 +477,12 @@ &Apache::lonxml::debug("in end_problem with $target, edit"); $result = &problem_edit_footer(); } + + undef(%Apache::lonhomework::history); + undef(%Apache::lonhomework::results); + undef($Apache::inputtags::part); + undef($Apache::lonhomework::parsing_a_problem); + return $result; } From lon-capa-cvs@mail.lon-capa.org Fri Mar 7 23:42:40 2003 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Fri, 07 Mar 2003 23:42:40 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /homework capa.units Message-ID: <cvsalbertel1047080560@cvsserver> albertel Fri Mar 7 18:42:40 2003 EDT Modified files: /loncom/homework capa.units Log: -someone wnated days, sounded like a good idea Index: loncom/homework/capa.units diff -u loncom/homework/capa.units:1.8 loncom/homework/capa.units:1.9 --- loncom/homework/capa.units:1.8 Fri Jan 31 17:15:58 2003 +++ loncom/homework/capa.units Fri Mar 7 18:42:40 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Physical Unit definitions # -# $Id: capa.units,v 1.8 2003/01/31 22:15:58 albertel Exp $ +# $Id: capa.units,v 1.9 2003/03/07 23:42:40 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -75,6 +75,7 @@ gram g 0.001 kg # mass day day 24.0 hr # time +day days 24.0 hr # time year yr 365.24 day # time hour hr 3600. s # time hour h 3600. s # time From lon-capa-cvs@mail.lon-capa.org Fri Mar 7 23:43:21 2003 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Fri, 07 Mar 2003 23:43:21 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /homework lonhomework.pm Message-ID: <cvsalbertel1047080601@cvsserver> albertel Fri Mar 7 18:43:21 2003 EDT Modified files: /loncom/homework lonhomework.pm Log: - really want to make sure this gets unset while not parsing Index: loncom/homework/lonhomework.pm diff -u loncom/homework/lonhomework.pm:1.112 loncom/homework/lonhomework.pm:1.113 --- loncom/homework/lonhomework.pm:1.112 Wed Feb 26 17:22:20 2003 +++ loncom/homework/lonhomework.pm Fri Mar 7 18:43:21 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Homework handler # -# $Id: lonhomework.pm,v 1.112 2003/02/26 22:22:20 albertel Exp $ +# $Id: lonhomework.pm,v 1.113 2003/03/07 23:43:21 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -483,7 +483,7 @@ &Apache::lonxml::debug("Should be parsing now"); $result = &Apache::lonxml::xmlparse($request, $target, $problem, &setup_vars($target),%mystyle); - + undef($Apache::lonhomework::parsing_a_problem); #$request->print("Result follows:"); if ($target eq 'modified') { &handle_save_or_undo($request,\$problem,\$result); From lon-capa-cvs@mail.lon-capa.org Fri Mar 7 23:45:32 2003 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Fri, 07 Mar 2003 23:45:32 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm Message-ID: <cvsalbertel1047080732@cvsserver> albertel Fri Mar 7 18:45:32 2003 EDT Modified files: /loncom/lonnet/perl lonnet.pm Log: - EXT was skiping levels when cascading up Index: loncom/lonnet/perl/lonnet.pm diff -u loncom/lonnet/perl/lonnet.pm:1.335 loncom/lonnet/perl/lonnet.pm:1.336 --- loncom/lonnet/perl/lonnet.pm:1.335 Fri Mar 7 18:37:09 2003 +++ loncom/lonnet/perl/lonnet.pm Fri Mar 7 18:45:31 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.335 2003/03/07 23:37:09 albertel Exp $ +# $Id: lonnet.pm,v 1.336 2003/03/07 23:45:31 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2831,7 +2831,6 @@ my ($varname,$symbparm,$udom,$uname,)=@_; unless ($varname) { return ''; } - #get real user name/domain, courseid and symb my $courseid; if (!($uname && $udom)) { @@ -3013,16 +3012,12 @@ # ------------------------------------------------------------------ Cascade up unless ($space eq '0') { - my ($part,$id)=split(/_/,$space); - if ($id) { - my $partgeneral=&EXT('resource.'.$part.'.'.$qualifierrest, - $symbparm,$udom,$uname); - if (defined($partgeneral)) { return $partgeneral; } - } else { - my $resourcegeneral=&EXT('resource.0.'.$qualifierrest, - $symbparm,$udom,$uname); - if (defined($resourcegeneral)) { return $resourcegeneral; } - } + my @parts=split(/_/,$space); + my $id=pop(@parts); + my $part=join('_',@parts); + if ($part eq '') { $part='0'; } + my $partgeneral=&EXT('resource.'.$part.'.'.$qualifierrest, + $symbparm,$udom,$uname); } # ---------------------------------------------------- Any other user namespace From lon-capa-cvs@mail.lon-capa.org Sat Mar 8 01:39:29 2003 From: lon-capa-cvs@mail.lon-capa.org (www) Date: Sat, 08 Mar 2003 01:39:29 -0000 Subject: [LON-CAPA-cvs] cvs: rat / lonpageflip.pm Message-ID: <cvswww1047087569@cvsserver> www Fri Mar 7 20:39:29 2003 EDT Modified files: /rat lonpageflip.pm Log: More informative message when reaching the beginning and the end of the course. Also, make error messages text-based. Index: rat/lonpageflip.pm diff -u rat/lonpageflip.pm:1.36 rat/lonpageflip.pm:1.37 --- rat/lonpageflip.pm:1.36 Mon Mar 3 15:24:25 2003 +++ rat/lonpageflip.pm Fri Mar 7 20:39:29 2003 @@ -2,7 +2,7 @@ # # Page flip handler # -# $Id: lonpageflip.pm,v 1.36 2003/03/03 20:24:25 www Exp $ +# $Id: lonpageflip.pm,v 1.37 2003/03/08 01:39:29 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -185,6 +185,7 @@ my $redirecturl=''; my $next=''; my @possibilities=(); + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['postdata']); if (($ENV{'form.postdata'})&&($ENV{'request.course.fn'})) { $ENV{'form.postdata'}=~/(\w+)\:(.*)/; my $direction=$1; @@ -200,10 +201,12 @@ my $newloc; if (($last) && (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.'.db', &GDBM_READER(),0640))) { - my ($murl,$mid,$fn)=split(/\_\_\_/,$last); - $newloc=$hash{'src_'. - $hash{'map_pc_'.&Apache::lonnet::clutter($murl)}. - '.'.$mid}; + my ($murl,$fn)=split(/\_\_\_/,$last); + my $id; + ($murl,$id,$fn)=split(/\_\_\_/,&Apache::lonnet::symbread($fn)); + $newloc=$hash{'src_'. + $hash{'map_pc_'.&Apache::lonnet::clutter($murl)}.'.'.$id}; + unless ($newloc) { $newloc='/adm/noidea.html'; } untie %hash; } else { $newloc='/adm/noidea.html'; @@ -331,11 +334,12 @@ $r->content_type('text/html'); $r->send_http_header; if ($#possibilities>0) { + my $bodytag= + &Apache::loncommon::bodytag('Multiple Resources'); $r->print(<<ENDSTART); <head><title>Choose Next Location - -

LON-CAPA

-There are several possibilities of where to go next. +$bodytag +

There are several possibilities of where to go next

Please click on the the resource you intend to access:

@@ -354,13 +358,17 @@ $r->print(''); return OK; } else { + my $bodytag=&Apache::loncommon::bodytag('No Resource'); $r->print(<Choose Next Location - - -

Sorry!

-

Next resource could not be identified.

-

You probably are at the beginning or the end of the course.

+No Resource +$bodytag +

Next resource could not be identified.

+

You probably are at the beginning or the end of the +course.

+ ENDNONE From lon-capa-cvs@mail.lon-capa.org Sat Mar 8 01:41:54 2003 From: lon-capa-cvs@mail.lon-capa.org (www) Date: Sat, 08 Mar 2003 01:41:54 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /publisher loncfile.pm publisher.html Message-ID: www Fri Mar 7 20:41:54 2003 EDT Modified files: /loncom/publisher loncfile.pm publisher.html Log: New .sequence and .page menu options Index: loncom/publisher/loncfile.pm diff -u loncom/publisher/loncfile.pm:1.27 loncom/publisher/loncfile.pm:1.28 --- loncom/publisher/loncfile.pm:1.27 Wed Feb 12 14:56:14 2003 +++ loncom/publisher/loncfile.pm Fri Mar 7 20:41:53 2003 @@ -9,7 +9,7 @@ # and displays a page showing the results of the action. # # -# $Id: loncfile.pm,v 1.27 2003/02/12 19:56:14 albertel Exp $ +# $Id: loncfile.pm,v 1.28 2003/03/08 01:41:53 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -863,7 +863,9 @@ &NewDir1($r, $uname, $dir, $ENV{'form.newfilename'}); } elsif ($ENV{'form.action'} eq 'newfile' || $ENV{'form.action'} eq 'newhtmlfile' || - $ENV{'form.action'} eq 'newproblemfile') { + $ENV{'form.action'} eq 'newproblemfile' || + $ENV{'form.action'} eq 'newpagefile' || + $ENV{'form.action'} eq 'newsequencefile') { if($ENV{'form.newfilename'}) { my $newfilename = $ENV{'form.newfilename'}; if (!defined($dir)) { @@ -1291,7 +1293,9 @@ $r->print('

Copy

'); } elsif ($ENV{'form.action'} eq 'newfile' || $ENV{'form.action'} eq 'newhtmlfile' || - $ENV{'form.action'} eq 'newproblemfile') { + $ENV{'form.action'} eq 'newproblemfile' || + $ENV{'form.action'} eq 'newpagefile' || + $ENV{'form.action'} eq 'newsequencefile' ) { $r->print('

New Resource

'); } else { $r->print('

Unknown Action

'); Index: loncom/publisher/publisher.html diff -u loncom/publisher/publisher.html:1.26 loncom/publisher/publisher.html:1.27 --- loncom/publisher/publisher.html:1.26 Mon Feb 10 17:52:59 2003 +++ loncom/publisher/publisher.html Fri Mar 7 20:41:54 2003 @@ -123,6 +123,8 @@ + + From lon-capa-cvs@mail.lon-capa.org Sat Mar 8 01:43:12 2003 From: lon-capa-cvs@mail.lon-capa.org (www) Date: Sat, 08 Mar 2003 01:43:12 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonsearchcat.pm Message-ID: www Fri Mar 7 20:43:12 2003 EDT Modified files: /loncom/interface lonsearchcat.pm Log: Search course contents Index: loncom/interface/lonsearchcat.pm diff -u loncom/interface/lonsearchcat.pm:1.166 loncom/interface/lonsearchcat.pm:1.167 --- loncom/interface/lonsearchcat.pm:1.166 Mon Feb 10 16:25:43 2003 +++ loncom/interface/lonsearchcat.pm Fri Mar 7 20:43:12 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.166 2003/02/10 21:25:43 albertel Exp $ +# $Id: lonsearchcat.pm,v 1.167 2003/03/08 01:43:12 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -74,7 +74,7 @@ # ------------------------------------------------- modules used by this module use strict; -use Apache::Constants qw(:common); +use Apache::Constants qw(:common :http); use Apache::lonnet(); use Apache::File(); use CGI qw(:standard); @@ -142,6 +142,10 @@ my $hidden_fields; my $bodytag; +my %alreadyseen; +my $hashtied; +my %hash; + ###################################################################### ###################################################################### @@ -338,6 +342,8 @@ &run_search($r,$query,$customquery,$customshow, $libraries,$pretty_string); } + } elsif ($ENV{'form.phase'} eq 'course_search') { + &course_search($r); } elsif(($ENV{'form.phase'} eq 'basic_search') || ($ENV{'form.phase'} eq 'adv_search')) { $ENV{'form.searchmode'} = 'basic'; @@ -396,6 +402,102 @@ ###################################################################### ###################################################################### +sub course_search { + my $r=shift; + my $bodytag=&Apache::loncommon::bodytag('Course Search'); + my $pretty_search_string = ''.$ENV{'form.courseexp'}.''; + my $search_string = $ENV{'form.courseexp'}; + my @New_Words; + if ($ENV{'form.crsrelated'}) { + ($search_string,@New_Words) = &related_version($ENV{'form.courseexp'}); + if (@New_Words) { + $pretty_search_string .= " with related words: @New_Words."; + } else { + $pretty_search_string .= " with no related words."; + } + } + my $fulltext=$ENV{'form.crsfulltext'}; + my @allwords=($search_string,@New_Words); + $r->print('LON-CAPA Course Search'. + $bodytag.$pretty_search_string); + $r->rflush(); +# ======================================================= Go through the course + $hashtied=0; + undef %alreadyseen; + %alreadyseen=(); + &tiehash(); + foreach (keys %hash) { + if (($_=~/^src\_(.+)$/) && (!$alreadyseen{$hash{$_}})) { + &checkonthis($r,$hash{$_},0,$hash{'title_'.$1},@allwords,$fulltext); + } + } + &untiehash(); +# =================================================== Done going through course + $r->print(''); +} + +# ---------------------------------------------------------------- tie the hash + +sub tiehash { + $hashtied=0; + if ($ENV{'request.course.fn'}) { + if (tie(%hash,'GDBM_File',$ENV{'request.course.fn'}.".db", + &GDBM_READER(),0640)) { + $hashtied=1; + } + } +} + +sub untiehash { + if ($hashtied) { untie %hash; } + $hashtied=0; +} + +# =============================== This pulls up a resource and its dependencies + +sub checkonthis { + my ($r,$url,$level,$title,@allwords,$fulltext)=@_; + $alreadyseen{$url}=1; + $r->rflush(); + my $result=&Apache::lonnet::metadata($url,'title').' '. + &Apache::lonnet::metadata($url,'subject').' '. + &Apache::lonnet::metadata($url,'abstract').' '. + &Apache::lonnet::metadata($url,'keywords'); + if (($url) && ($fulltext)) { + $result.=&Apache::lonnet::ssibody($url); + } + $result=~s/\s+/ /gs; + my $applies=0; + foreach (@allwords) { + if ($_=~/\w/) { + if ($result=~/$_/si) { + $applies++; + } + } + } +# Does this resource apply? + if ($applies) { + $r->print('
'); + for (my $i=0;$i<=$level*5;$i++) { + $r->print(' '); + } + $r->print(''. + ($title?$title:$url).''); + $r->rflush(); + } +# Check also the dependencies of this one + my $dependencies= + &Apache::lonnet::metadata($url,'dependencies'); + foreach (split(/\,/,$dependencies)) { + if (($_=~/^\/res\//) && (!$alreadyseen{$_})) { + &checkonthis($r,$_,$level+1,'',@allwords,$fulltext); + } + } +} + +###################################################################### +###################################################################### + =pod =item &print_basic_search_form() @@ -409,7 +511,7 @@ sub print_basic_search_form{ my ($r,$closebutton) = @_; - my $bodytag=&Apache::loncommon::bodytag('Catalog Search'); + my $bodytag=&Apache::loncommon::bodytag('Search'); my $scrout=<<"ENDDOCUMENT"; @@ -423,6 +525,10 @@ $bodytag +ENDDOCUMENT +if (&Apache::lonnet::allowed('bre',$ENV{'request.role.domain'})) { + $scrout.=(<Catalog Search
$hidden_fields @@ -460,6 +566,35 @@ per page.

+ENDDOCUMENT + if ($ENV{'request.course.id'}) { $scrout.='
'; } +} +if ($ENV{'request.course.id'}) { + $scrout.=(<Course Search +
+ +$hidden_fields +

+Enter terms or phrases, then press SEARCH below. +

+

+ + + + +
+ENDCOURSESEARCH + $scrout.=' '.&simpletextfield('courseexp',$ENV{'form.courseexp'},40); + my $crscheckbox = &simplecheckbox('crsfulltext',$ENV{'form.crsfulltext'}); + my $relcheckbox = &simplecheckbox('crsrelated',$ENV{'form.crsrelated'}); +$scrout.=(<
$relcheckbox use related words
$crscheckbox fulltext search (time consuming)

+

+ENDENDCOURSE +} + $scrout.=(< ENDDOCUMENT @@ -2968,6 +3103,7 @@ &Apache::lonnet::logthis('Failed cleanup searchcat: groupsearch_db'); } } + &untiehash(); &Apache::lonmysql::disconnect_from_db(); } From lon-capa-cvs@mail.lon-capa.org Sat Mar 8 01:44:04 2003 From: lon-capa-cvs@mail.lon-capa.org (www) Date: Sat, 08 Mar 2003 01:44:04 -0000 Subject: [LON-CAPA-cvs] cvs: loncom / loncapa_apache.conf Message-ID: www Fri Mar 7 20:44:04 2003 EDT Modified files: /loncom loncapa_apache.conf Log: Call cleanup handler Index: loncom/loncapa_apache.conf diff -u loncom/loncapa_apache.conf:1.37 loncom/loncapa_apache.conf:1.38 --- loncom/loncapa_apache.conf:1.37 Tue Feb 25 16:56:48 2003 +++ loncom/loncapa_apache.conf Fri Mar 7 20:44:04 2003 @@ -1,7 +1,7 @@ ## ## loncapa_apache.conf -- Apache HTTP LON-CAPA configuration file ## -## $Id: loncapa_apache.conf,v 1.37 2003/02/25 21:56:48 www Exp $ +## $Id: loncapa_apache.conf,v 1.38 2003/03/08 01:44:04 www Exp $ ## # @@ -478,6 +478,7 @@ PerlAccessHandler Apache::lonacc SetHandler perl-script +PerlCleanupHandler Apache::coursedocs::untiehash PerlHandler Apache::londocs ErrorDocument 403 /adm/login ErrorDocument 500 /adm/errorhandler From lon-capa-cvs@mail.lon-capa.org Sat Mar 8 02:04:29 2003 From: lon-capa-cvs@mail.lon-capa.org (www) Date: Sat, 08 Mar 2003 02:04:29 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface mydesk.tab Message-ID: www Fri Mar 7 21:04:29 2003 EDT Modified files: /loncom/interface mydesk.tab Log: Bring up Search button for students. Index: loncom/interface/mydesk.tab diff -u loncom/interface/mydesk.tab:1.38 loncom/interface/mydesk.tab:1.39 --- loncom/interface/mydesk.tab:1.38 Mon Dec 9 11:54:40 2002 +++ loncom/interface/mydesk.tab Fri Mar 7 21:04:29 2003 @@ -55,6 +55,7 @@ 10:3:clear 10:3:course:any:bchat.gif:course:chat:go('/res/adm/pages/chatroom.html');:Enter the chatroom for the course 11:1:clear +11:1:course:any:src.gif:search:course:go('/adm/searchcat');:Search the contents of this course 11:1:pbre:$requested_domain:src.gif:search:library:go('/adm/searchcat');:Search the database of published resources 11:2:any:any:pref.gif:prefer-:ences:go('/adm/preferences');:Set my user preferences 11:3:any:any:logout.gif:exit::go('/adm/logout');:Exit LON-CAPA From lon-capa-cvs@mail.lon-capa.org Sat Mar 8 03:24:59 2003 From: lon-capa-cvs@mail.lon-capa.org (www) Date: Sat, 08 Mar 2003 03:24:59 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonsearchcat.pm Message-ID: www Fri Mar 7 22:24:59 2003 EDT Modified files: /loncom/interface lonsearchcat.pm Log: Continued work on course search Index: loncom/interface/lonsearchcat.pm diff -u loncom/interface/lonsearchcat.pm:1.167 loncom/interface/lonsearchcat.pm:1.168 --- loncom/interface/lonsearchcat.pm:1.167 Fri Mar 7 20:43:12 2003 +++ loncom/interface/lonsearchcat.pm Fri Mar 7 22:24:58 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Search Catalog # -# $Id: lonsearchcat.pm,v 1.167 2003/03/08 01:43:12 www Exp $ +# $Id: lonsearchcat.pm,v 1.168 2003/03/08 03:24:58 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -428,7 +428,7 @@ &tiehash(); foreach (keys %hash) { if (($_=~/^src\_(.+)$/) && (!$alreadyseen{$hash{$_}})) { - &checkonthis($r,$hash{$_},0,$hash{'title_'.$1},@allwords,$fulltext); + &checkonthis($r,$hash{$_},0,$hash{'title_'.$1},$fulltext,@allwords); } } &untiehash(); @@ -456,7 +456,7 @@ # =============================== This pulls up a resource and its dependencies sub checkonthis { - my ($r,$url,$level,$title,@allwords,$fulltext)=@_; + my ($r,$url,$level,$title,$fulltext,@allwords)=@_; $alreadyseen{$url}=1; $r->rflush(); my $result=&Apache::lonnet::metadata($url,'title').' '. @@ -464,7 +464,7 @@ &Apache::lonnet::metadata($url,'abstract').' '. &Apache::lonnet::metadata($url,'keywords'); if (($url) && ($fulltext)) { - $result.=&Apache::lonnet::ssibody($url); + $result.=&Apache::lonnet::ssi_body($url); } $result=~s/\s+/ /gs; my $applies=0; @@ -490,7 +490,7 @@ &Apache::lonnet::metadata($url,'dependencies'); foreach (split(/\,/,$dependencies)) { if (($_=~/^\/res\//) && (!$alreadyseen{$_})) { - &checkonthis($r,$_,$level+1,'',@allwords,$fulltext); + &checkonthis($r,$_,$level+1,'',$fulltext,@allwords); } } } From lon-capa-cvs@mail.lon-capa.org Sat Mar 8 20:12:33 2003 From: lon-capa-cvs@mail.lon-capa.org (bowersj2) Date: Sat, 08 Mar 2003 20:12:33 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonnavmaps.pm Message-ID: bowersj2 Sat Mar 8 15:12:33 2003 EDT Modified files: /loncom/interface lonnavmaps.pm Log: Fixes bug 1252, Course Navigation entries should not themselves appear on the navmap view. Fixes issue reported by H.K. and never filed as a bug with asking for parts multiple times. Index: loncom/interface/lonnavmaps.pm diff -u loncom/interface/lonnavmaps.pm:1.152 loncom/interface/lonnavmaps.pm:1.153 --- loncom/interface/lonnavmaps.pm:1.152 Tue Mar 4 17:30:10 2003 +++ loncom/interface/lonnavmaps.pm Sat Mar 8 15:12:32 2003 @@ -2,7 +2,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.152 2003/03/04 22:30:10 matthew Exp $ +# $Id: lonnavmaps.pm,v 1.153 2003/03/08 20:12:32 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -38,6 +38,8 @@ # YEAR=2002 # 1/1 Gerd Kortemeyer # Oct-Nov Jeremy Bowers +# YEAR=2003 +# Jeremy Bowers ... lots of days package Apache::lonnavmaps; @@ -189,7 +191,7 @@ # renderer call my $render = render({ 'cols' => [0,1,2,3], 'url' => '/adm/navmaps', - #'printKey' => 1, + 'suppressNavmap' => 1, 'r' => $r}); $navmap->untieHashes(); @@ -536,7 +538,9 @@ =item * B: If true, print the "Close all folders" or "open all folders" links. Default is true. -=item * B: A function that takes the resource object as its only parameter and returns a true or false value. If true, the resource is displayed. If false, it is simply skipped in the display. By default, all resources are showne. +=item * B: A function that takes the resource object as its only parameter and returns a true or false value. If true, the resource is displayed. If false, it is simply skipped in the display. By default, all resources are shown. + +=item * B: If true, will not display Navigate Content resources. Default to false. =back @@ -815,6 +819,7 @@ my $here; my $jump; my $currentJumpIndex = setDefault($args->{'currentJumpIndex'}, 0); + my $suppressNavmap = setDefault($args->{'suppressNavmap'}, 0); my $currentJumpDelta = 2; # change this to change how many resources are displayed # before the current resource when using #current @@ -1081,6 +1086,12 @@ next; } + # If we're suppressing navmaps and this is a navmap, continue on + if ($suppressNavmap && $curRes->src() =~ /^\/adm\/navmaps/) { + $curRes = $it->next(); + next; + } + # Does it have multiple parts? $args->{'multipart'} = 0; $args->{'condensed'} = 0; @@ -1192,7 +1203,7 @@ $result .= " \n"; $args->{'isNewBranch'} = 0; } - + if ($r && $rownum % 20 == 0) { $r->print($result); $result = ""; @@ -2691,7 +2702,7 @@ sub extractParts { my $self = shift; - return if ($self->{PARTS}); + return if (defined($self->{PARTS})); return if ($self->ext); $self->{PARTS} = []; From lon-capa-cvs@mail.lon-capa.org Sat Mar 8 20:52:41 2003 From: lon-capa-cvs@mail.lon-capa.org (bowersj2) Date: Sat, 08 Mar 2003 20:52:41 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonnavmaps.pm Message-ID: bowersj2 Sat Mar 8 15:52:41 2003 EDT Modified files: /loncom/interface lonnavmaps.pm Log: Should fix bug 1155; sometimes problems weren't returning the part '0', which should always exist as far as navmaps is concerned. Index: loncom/interface/lonnavmaps.pm diff -u loncom/interface/lonnavmaps.pm:1.153 loncom/interface/lonnavmaps.pm:1.154 --- loncom/interface/lonnavmaps.pm:1.153 Sat Mar 8 15:12:32 2003 +++ loncom/interface/lonnavmaps.pm Sat Mar 8 15:52:41 2003 @@ -2,7 +2,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.153 2003/03/08 20:12:32 bowersj2 Exp $ +# $Id: lonnavmaps.pm,v 1.154 2003/03/08 20:52:41 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -2728,6 +2728,11 @@ my @sortedParts = sort @{$self->{PARTS}}; $self->{PARTS} = \@sortedParts; + } + + # Ensure part 0 is included at the beginning. + if ($self->{PARTS}->[0] ne '0') { + unshift @{$self->{PARTS}}, '0'; } return; From lon-capa-cvs@mail.lon-capa.org Sat Mar 8 21:16:38 2003 From: lon-capa-cvs@mail.lon-capa.org (bowersj2) Date: Sat, 08 Mar 2003 21:16:38 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonnavmaps.pm Message-ID: bowersj2 Sat Mar 8 16:16:38 2003 EDT Modified files: /loncom/interface lonnavmaps.pm Log: Implement suggestion in bug 1103: If there is only one sequence on the highest level of the map, automatically open it. This satisfies the use case where someone uses a sequence to build a course on, then uses DOCS to add stuff in front and behind it. This demotes the sequence from "top level" (via redirection, since there was nothing else in the top-level sequence) to "just another sequence", but the users still want to see the sequence open, since it is the bulk of the course. Index: loncom/interface/lonnavmaps.pm diff -u loncom/interface/lonnavmaps.pm:1.154 loncom/interface/lonnavmaps.pm:1.155 --- loncom/interface/lonnavmaps.pm:1.154 Sat Mar 8 15:52:41 2003 +++ loncom/interface/lonnavmaps.pm Sat Mar 8 16:16:38 2003 @@ -2,7 +2,7 @@ # The LearningOnline Network with CAPA # Navigate Maps Handler # -# $Id: lonnavmaps.pm,v 1.154 2003/03/08 20:52:41 bowersj2 Exp $ +# $Id: lonnavmaps.pm,v 1.155 2003/03/08 21:16:38 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -186,6 +186,32 @@ $r->print('Coursemap undefined.' . ''); return OK; + } + + # See if there's only one map in the top-level... if so, + # automatically display it + my $iterator = $navmap->getIterator(undef, undef, undef, 0); + my $depth = 1; + $iterator->next(); + my $curRes = $iterator->next(); + my $sequenceCount = 0; + my $sequenceId; + while ($depth > 0) { + if ($curRes == $iterator->BEGIN_MAP()) { $depth++; } + if ($curRes == $iterator->END_MAP()) { $depth--; } + + if (ref($curRes) && $curRes->is_sequence()) { + $sequenceCount++; + $sequenceId = $curRes->map_pc(); + } + + $curRes = $iterator->next(); + } + + if ($sequenceCount == 1) { + # The automatic iterator creation in the render call + # will pick this up. + $ENV{'form.filter'} = "$sequenceId"; } # renderer call From lon-capa-cvs@mail.lon-capa.org Sun Mar 9 18:53:06 2003 From: lon-capa-cvs@mail.lon-capa.org (matthew) Date: Sun, 09 Mar 2003 18:53:06 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface/statistics lonstudentassessment.pm Message-ID: matthew Sun Mar 9 13:53:06 2003 EDT Modified files: /loncom/interface/statistics lonstudentassessment.pm Log: "Problem Sets" changed back to "Sequences and Folders" by request. Index: loncom/interface/statistics/lonstudentassessment.pm diff -u loncom/interface/statistics/lonstudentassessment.pm:1.40 loncom/interface/statistics/lonstudentassessment.pm:1.41 --- loncom/interface/statistics/lonstudentassessment.pm:1.40 Fri Mar 7 13:46:38 2003 +++ loncom/interface/statistics/lonstudentassessment.pm Sun Mar 9 13:53:06 2003 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentassessment.pm,v 1.40 2003/03/07 18:46:38 matthew Exp $ +# $Id: lonstudentassessment.pm,v 1.41 2003/03/09 18:53:06 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -224,7 +224,7 @@ $Str .= ''; $Str .= 'Sections'; $Str .= 'Student Data'; - $Str .= 'Problem Sets'; + $Str .= 'Sequences and Folders'; $Str .= 'Output Format'; $Str .= ''."\n"; #