From intelligencesoftware@163.com Tue Apr 29 02:53:55 2003 From: intelligencesoftware@163.com (intelligencesoftware@163.com) Date: Tue, 29 Apr 03 01:53:55 中国标准时间 Subject: [LON-CAPA-cvs] 我们专业研究:智能排班考勤管理软件系统 Message-ID: <200304281756.h3SHubp19722@zaphod.lite.msu.edu> ------=_NextPart_000_0032_54215555.FC640000 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0033_54215555.FC640000" ------=_NextPart_001_0033_54215555.FC640000 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_0033_54215555.FC640000 Content-Type: text/html; charset=gb2312 Content-Transfer-Encoding: quoted-printable Untitled Document =

=A1=A1=A1=A1Kqwins=D6=C7=C4=DC=C5=C5= =B0=E0=BF=BC=C7=DA=B9=DC=C0=ED=C8=ED=BC=FE=CF=B5=CD=B3=CA=C7=D2=BB=CC=D7= =B9=A6=C4=DC=C7=BF=B4=F3,=D4=CB=D0=D0=CE=C8=B6=A8,=B2=D9=D7=F7=BC=F2=B5=A5=B7= =BD=B1=E3,=D3=C3=BB=A7=BD=E7=C3=E6=C3=C0=B9=DB=A3=AC=CD=B3=BC=C6=CA=FD=BE=DD= =D5=FD=C8=B7=B5=C4=B8=D0=D3=A6=BF=A8=BF=BC=C7=DA=C8=ED=BC=FE.=C0=FA=BE=AD=BC= =B8=C4=EA=D4=DA=D6=E9=BD=AD=C8=FD=BD=C7=D6=DE=BC=B8=B0=D9=BC=D2=CD=E2=D7=CA= (=B8=DB=D7=CA,=CC=A8=D7=CA,=C8=D5=D7=CA,=C3=C0=D7=CA)=BA=CD=B9=FA=C4=DA=C9=CF= =B0=D9=BC=D2=C6=F3=D2=B5=B5=C4=B3=C9=B9=A6=D4=CB=D0=D0,=C0=FB=D3=C3=D7=EE=D0= =C2=B5=C4SQL SERVER=BC=BC=CA=F5,=B2=C9=D3=C3B/S=BD=E1=B9=B9,=CA=B9=D3=C3=CA=F7=D0=CE=BD= =DA=B5=E3=B9=A6=C4=DC,=D6=D8=D0=C2=C9=E8=BC=C6=BF=AA=B7=A2=B3=F6=D5=E2=CC=D7= =BE=DF=D3=D0=D6=C7=C4=DC=C5=C5=B0=E0=B9=A6=C4=DC=BF=BC=C7=DA=C8=ED=BC=FE,=D0= =C2=B0=E6=B5=C4=BF=BC=C7=DA=C8=ED=BC=FEkqwins=C8=C3=B2=D9=D7=F7=C8=CB=D4=B1= =B9=A4=D7=F7=C6=F0=C0=B4=B8=FC=B5=C3=D0=C4=D3=A6=CA=D6,=B5=B1=C4=FA=B9=AB=CB= =BE=CA=B9=D3=C3=B1=F0=B5=C4=BF=BC=C7=DA=CF=B5=CD=B3=C8=ED=BC=FE=BE=F5=B5=C3= =BA=DC=C2=E9=B7=B3=BB=F2=B2=BB=BA=C3=D3=C3=CA=B1,=C7=EB=CF=C2=D4=D8=CA=D4=D3= =C3Kqwins8.0=BA=C3=B4=A6,=B1=A3=D6=A4=C8=C3=C4=FA=D3=D0=B6=FA=C4=BF=D2=BB=D0= =C2,=CF=E0=BC=FB=BA=DE=CD=ED=B5=C4=B8=D0=BE=F5.=D5=E6=D5=FD=B5=C4=D6=C7=C4=DC= =C5=C5=B0=E0=BF=BC=C7=DA=B9=DC=C0=ED=CF=B5=CD=B3.
=A1=A1=A1=A1=CF=EA=C7=E9=C7=EB=BD=F8=A3=BAhttp://mere.cn.gs/kqwins

=A1=A1=A1=A1"The intelligence= of arranges team of work to manage the software system" is a set of functions st= rong, circulate the stability, operate simple convenience, customer interface = beautiful, the covariance data responds rightly the card intelligence arranges team= of work to manage the software.Experience successively several years at Pea= rl Rever Delta several 100 foreign capitals( Hong Kong, Taiwan, Japan, the United= States)s with domestic up to 100 the success movement of business enterprises, ma= ke use of the latest the technique of SQL SERVER, adopt the the construction of= B/S, use the tree form node function, design to develop a this set of managem= ent softwares that have afresh the intelligence arrange team of work the fun= ction, the intelligence of the new version arranges team of work to manage the = software kqwins lets operate the personnel works wither proficiency, be the anoth= er intelligence in usage in your company arrange team of work to manage the software fee= ls troublesome or does not like to use, please download to try out the advantage of Kqw= ins8.0, guarantee to let that you have a pleasant change of atmosphere, the fell= ing that wish had met earlier.The real intelligence arranges team of work to= manage the software system.

=A1=A1=A1=A1The detail pleases enter: http://mere.cn.gs/kqwins


=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

------=_NextPart_001_0033_54215555.FC640000-- ------=_NextPart_000_0032_54215555.FC640000-- From intelligencesoftware@163.com Tue Apr 29 09:12:11 2003 From: intelligencesoftware@163.com (intelligencesoftware@163.com) Date: Tue, 29 Apr 03 08:12:11 中国标准时间 Subject: [LON-CAPA-cvs] 我们专业研究:智能排班考勤管理软件系统 Message-ID: <200304290014.h3T0Ewp25162@zaphod.lite.msu.edu> ------=_NextPart_000_0032_54215555.FC640000 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0033_54215555.FC640000" ------=_NextPart_001_0033_54215555.FC640000 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_0033_54215555.FC640000 Content-Type: text/html; charset=gb2312 Content-Transfer-Encoding: quoted-printable Untitled Document =

=A1=A1=A1=A1Kqwins=D6=C7=C4=DC=C5=C5= =B0=E0=BF=BC=C7=DA=B9=DC=C0=ED=C8=ED=BC=FE=CF=B5=CD=B3=CA=C7=D2=BB=CC=D7= =B9=A6=C4=DC=C7=BF=B4=F3,=D4=CB=D0=D0=CE=C8=B6=A8,=B2=D9=D7=F7=BC=F2=B5=A5=B7= =BD=B1=E3,=D3=C3=BB=A7=BD=E7=C3=E6=C3=C0=B9=DB=A3=AC=CD=B3=BC=C6=CA=FD=BE=DD= =D5=FD=C8=B7=B5=C4=B8=D0=D3=A6=BF=A8=BF=BC=C7=DA=C8=ED=BC=FE.=C0=FA=BE=AD=BC= =B8=C4=EA=D4=DA=D6=E9=BD=AD=C8=FD=BD=C7=D6=DE=BC=B8=B0=D9=BC=D2=CD=E2=D7=CA= (=B8=DB=D7=CA,=CC=A8=D7=CA,=C8=D5=D7=CA,=C3=C0=D7=CA)=BA=CD=B9=FA=C4=DA=C9=CF= =B0=D9=BC=D2=C6=F3=D2=B5=B5=C4=B3=C9=B9=A6=D4=CB=D0=D0,=C0=FB=D3=C3=D7=EE=D0= =C2=B5=C4SQL SERVER=BC=BC=CA=F5,=B2=C9=D3=C3B/S=BD=E1=B9=B9,=CA=B9=D3=C3=CA=F7=D0=CE=BD= =DA=B5=E3=B9=A6=C4=DC,=D6=D8=D0=C2=C9=E8=BC=C6=BF=AA=B7=A2=B3=F6=D5=E2=CC=D7= =BE=DF=D3=D0=D6=C7=C4=DC=C5=C5=B0=E0=B9=A6=C4=DC=BF=BC=C7=DA=C8=ED=BC=FE,=D0= =C2=B0=E6=B5=C4=BF=BC=C7=DA=C8=ED=BC=FEkqwins=C8=C3=B2=D9=D7=F7=C8=CB=D4=B1= =B9=A4=D7=F7=C6=F0=C0=B4=B8=FC=B5=C3=D0=C4=D3=A6=CA=D6,=B5=B1=C4=FA=B9=AB=CB= =BE=CA=B9=D3=C3=B1=F0=B5=C4=BF=BC=C7=DA=CF=B5=CD=B3=C8=ED=BC=FE=BE=F5=B5=C3= =BA=DC=C2=E9=B7=B3=BB=F2=B2=BB=BA=C3=D3=C3=CA=B1,=C7=EB=CF=C2=D4=D8=CA=D4=D3= =C3Kqwins8.0=BA=C3=B4=A6,=B1=A3=D6=A4=C8=C3=C4=FA=D3=D0=B6=FA=C4=BF=D2=BB=D0= =C2,=CF=E0=BC=FB=BA=DE=CD=ED=B5=C4=B8=D0=BE=F5.=D5=E6=D5=FD=B5=C4=D6=C7=C4=DC= =C5=C5=B0=E0=BF=BC=C7=DA=B9=DC=C0=ED=CF=B5=CD=B3.
=A1=A1=A1=A1=CF=EA=C7=E9=C7=EB=BD=F8=A3=BAhttp://mere.cn.gs/kqwins

=A1=A1=A1=A1"The intelligence= of arranges team of work to manage the software system" is a set of functions st= rong, circulate the stability, operate simple convenience, customer interface = beautiful, the covariance data responds rightly the card intelligence arranges team= of work to manage the software.Experience successively several years at Pea= rl Rever Delta several 100 foreign capitals( Hong Kong, Taiwan, Japan, the United= States)s with domestic up to 100 the success movement of business enterprises, ma= ke use of the latest the technique of SQL SERVER, adopt the the construction of= B/S, use the tree form node function, design to develop a this set of managem= ent softwares that have afresh the intelligence arrange team of work the fun= ction, the intelligence of the new version arranges team of work to manage the = software kqwins lets operate the personnel works wither proficiency, be the anoth= er intelligence in usage in your company arrange team of work to manage the software fee= ls troublesome or does not like to use, please download to try out the advantage of Kqw= ins8.0, guarantee to let that you have a pleasant change of atmosphere, the fell= ing that wish had met earlier.The real intelligence arranges team of work to= manage the software system.

=A1=A1=A1=A1The detail pleases enter: http://mere.cn.gs/kqwins


=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

------=_NextPart_001_0033_54215555.FC640000-- ------=_NextPart_000_0032_54215555.FC640000-- From lon-capa-cvs@mail.lon-capa.org Tue Apr 29 04:24:52 2003 From: lon-capa-cvs@mail.lon-capa.org (foxr) Date: Tue, 29 Apr 2003 03:24:52 -0000 Subject: [LON-CAPA-cvs] cvs: loncom / loncnew Message-ID: foxr Mon Apr 28 23:24:52 2003 EDT Modified files: /loncom loncnew Log: - Add a bit more error checking on write fails. - Write pid file. - If a tick goes by and there's work to do but no connections attempt to start connections to process the work (can happen on initial connection fail.. this retries once per second). Index: loncom/loncnew diff -u loncom/loncnew:1.4 loncom/loncnew:1.5 --- loncom/loncnew:1.4 Thu Apr 24 06:56:55 2003 +++ loncom/loncnew Mon Apr 28 23:24:51 2003 @@ -2,7 +2,7 @@ # The LearningOnline Network with CAPA # lonc maintains the connections to remote computers # -# $Id: loncnew,v 1.4 2003/04/24 10:56:55 foxr Exp $ +# $Id: loncnew,v 1.5 2003/04/29 03:24:51 foxr Exp $ # # Copyright Michigan State University Board of Trustees # @@ -155,15 +155,28 @@ =pod +=head2 ShowStatus + + Place some text as our pid status. + +=cut +sub ShowStatus { + my $status = shift; + $0 = "lonc: ".$status; +} + +=pod + =head2 Tick Invoked each timer tick. =cut + sub Tick { my $client; - $0 = 'lonc: '.GetServerHost()." Connection count: ".$ConnectionCount; + ShowStatus(GetServerHost()." Connection count: ".$ConnectionCount); Debug(6, "Tick"); Debug(6, " Current connection count: ".$ConnectionCount); foreach $client (keys %ActiveClients) { @@ -182,6 +195,21 @@ } else { $IdleSeconds = 0; # Reset idle count if not idle. } + + # Do we have work in the queue, but no connections to service them? + # If so, try to make some new connections to get things going again. + # + + my $Requests = $WorkQueue->Count(); + if (($ConnectionCount == 0) && ($Requests > 0)) { + my $Connections = ($Requests <= $MaxConnectionCount) ? + $Requests : $MaxConnectionCount; + Debug(1,"Work but no connections, starting ".$Connections." of them"); + for ($i =0; $i < $Connections; $i++) { + MakeLondConnection(); + } + + } } =pod @@ -654,10 +682,7 @@ if ($Socket->Writable() != 0) { # The write resulted in an error. # We'll treat this as if the socket got disconnected: - if(exists($ActiveTransactions{$Socket})) { - Debug(3, "Lond connection lost, failing transactions"); - FailTransaction($ActiveTransactions{$Socket}); - } + $Watcher->cancel(); KillSocket($Socket, 1); return; @@ -679,7 +704,10 @@ # we're waiting for the state to change if($Socket->Writable() != 0) { - # Write of the next chunk resulted in an error. + + $Watcher->cancel(); + KillSocket($Socket, 1); + return; } } elsif ($State eq "ChallengeReplied") { @@ -697,8 +725,12 @@ if($Socket->Writable() != 0) { # Write resulted in an error. - } + $Watcher->cancel(); + KillSocket($Socket, 1); + return; + + } } elsif ($State eq "ReceivingKey") { # Now we need to wait for the key # to come back from the peer: @@ -711,8 +743,15 @@ # peer... write the next chunk: if($Socket->Writable() != 0) { - # Write resulted in an error. + if(exists($ActiveTransactions{$Socket})) { + Debug(3, "Lond connection lost, failing transactions"); + FailTransaction($ActiveTransactions{$Socket}); + } + $Watcher->cancel(); + KillSocket($Socket, 1); + return; + } } elsif ($State eq "ReceivingReply") { @@ -753,31 +792,30 @@ &GetServerPort()); if($Connection == undef) { # Needs to be more robust later. - die "Failed to make a connection!!".$!."\n"; + Debug(0,"Failed to make a connection with lond."); + } else { + # The connection needs to have writability + # monitored in order to send the init sequence + # that starts the whole authentication/key + # exchange underway. + # + my $Socket = $Connection->GetSocket(); + if($Socket == undef) { + die "did not get a socket from the connection"; + } else { + &Debug(9,"MakeLondConnection got socket: ".$Socket); + } - } - # The connection needs to have writability - # monitored in order to send the init sequence - # that starts the whole authentication/key - # exchange underway. - # - my $Socket = $Connection->GetSocket(); - if($Socket == undef) { - die "did not get a socket from the connection"; - } else { - &Debug(9,"MakeLondConnection got socket: ".$Socket); + + $event = Event->io(fd => $Socket, + poll => 'w', + cb => \&LondWritable, + data => ($Connection, undef), + desc => 'Connection to lond server'); + $ActiveConnections{$Connection} = $event; + + $ConnectionCount++; } - - - $event = Event->io(fd => $Socket, - poll => 'w', - cb => \&LondWritable, - data => ($Connection, undef), - desc => 'Connection to lond server'); - $ActiveConnections{$Connection} = $event; - - $ConnectionCount++; - } @@ -1043,7 +1081,11 @@ # Setup the initial server connection: &MakeLondConnection(); - + + if($ConnectionCount == 0) { + Debug(1,"Could not make initial connection..\n"); + Debug(1,"Will retry when there's work to do\n"); + } Debug(9,"Entering event loop"); my $ret = Event::loop(); # Start the main event loop. @@ -1062,6 +1104,7 @@ if($pid) { # Parent $ChildHash{$pid} = $RemoteHost; } else { # child. + ShowStatus("Connected to ".$RemoteHost); ChildProcess; } @@ -1076,6 +1119,20 @@ # Each exit gets logged and the child gets restarted. # +# +# Fork and start in new session so hang-up isn't going to +# happen without intent. +# + + +ShowStatus("Parent writing pid file:"); +$execdir = $perlvar{'lonDaemons'}; +open (PIDSAVE, ">$execdir/logs/lonc.pid"); +print PIDSAVE "$$\n"; +close(PIDSAVE); + +ShowStatus("Forking node servers"); + my $HostIterator = LondConnection::GetHostIterator; while (! $HostIterator->end()) { @@ -1085,6 +1142,8 @@ } # Maintain the population: + +ShowStatus("Parent keeping the flock"); while(1) { $deadchild = wait(); From intelligencesoftware@163.com Tue Apr 29 19:05:22 2003 From: intelligencesoftware@163.com (intelligencesoftware@163.com) Date: Tue, 29 Apr 03 18:05:22 中国标准时间 Subject: [LON-CAPA-cvs] 我们专业研究:智能排班考勤管理软件系统 Message-ID: <200304291008.h3TA81p27828@zaphod.lite.msu.edu> ------=_NextPart_000_0001_2B00AAAC.81020005 Content-Type: multipart/alternative; boundary="----=_NextPart_001_0002_2B00AAAC.81020005" ------=_NextPart_001_0002_2B00AAAC.81020005 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_0002_2B00AAAC.81020005 Content-Type: text/html; charset=gb2312 Content-Transfer-Encoding: quoted-printable Untitled Document =

=A1=A1=A1=A1Kqwins=D6=C7=C4=DC=C5=C5= =B0=E0=BF=BC=C7=DA=B9=DC=C0=ED=C8=ED=BC=FE=CF=B5=CD=B3=CA=C7=D2=BB=CC=D7= =B9=A6=C4=DC=C7=BF=B4=F3,=D4=CB=D0=D0=CE=C8=B6=A8,=B2=D9=D7=F7=BC=F2=B5=A5=B7= =BD=B1=E3,=D3=C3=BB=A7=BD=E7=C3=E6=C3=C0=B9=DB=A3=AC=CD=B3=BC=C6=CA=FD=BE=DD= =D5=FD=C8=B7=B5=C4=B8=D0=D3=A6=BF=A8=BF=BC=C7=DA=C8=ED=BC=FE.=C0=FA=BE=AD=BC= =B8=C4=EA=D4=DA=D6=E9=BD=AD=C8=FD=BD=C7=D6=DE=BC=B8=B0=D9=BC=D2=CD=E2=D7=CA= (=B8=DB=D7=CA,=CC=A8=D7=CA,=C8=D5=D7=CA,=C3=C0=D7=CA)=BA=CD=B9=FA=C4=DA=C9=CF= =B0=D9=BC=D2=C6=F3=D2=B5=B5=C4=B3=C9=B9=A6=D4=CB=D0=D0,=C0=FB=D3=C3=D7=EE=D0= =C2=B5=C4SQL SERVER=BC=BC=CA=F5,=B2=C9=D3=C3B/S=BD=E1=B9=B9,=CA=B9=D3=C3=CA=F7=D0=CE=BD= =DA=B5=E3=B9=A6=C4=DC,=D6=D8=D0=C2=C9=E8=BC=C6=BF=AA=B7=A2=B3=F6=D5=E2=CC=D7= =BE=DF=D3=D0=D6=C7=C4=DC=C5=C5=B0=E0=B9=A6=C4=DC=BF=BC=C7=DA=C8=ED=BC=FE,=D0= =C2=B0=E6=B5=C4=BF=BC=C7=DA=C8=ED=BC=FEkqwins=C8=C3=B2=D9=D7=F7=C8=CB=D4=B1= =B9=A4=D7=F7=C6=F0=C0=B4=B8=FC=B5=C3=D0=C4=D3=A6=CA=D6,=B5=B1=C4=FA=B9=AB=CB= =BE=CA=B9=D3=C3=B1=F0=B5=C4=BF=BC=C7=DA=CF=B5=CD=B3=C8=ED=BC=FE=BE=F5=B5=C3= =BA=DC=C2=E9=B7=B3=BB=F2=B2=BB=BA=C3=D3=C3=CA=B1,=C7=EB=CF=C2=D4=D8=CA=D4=D3= =C3Kqwins8.0=BA=C3=B4=A6,=B1=A3=D6=A4=C8=C3=C4=FA=D3=D0=B6=FA=C4=BF=D2=BB=D0= =C2,=CF=E0=BC=FB=BA=DE=CD=ED=B5=C4=B8=D0=BE=F5.=D5=E6=D5=FD=B5=C4=D6=C7=C4=DC= =C5=C5=B0=E0=BF=BC=C7=DA=B9=DC=C0=ED=CF=B5=CD=B3.
=A1=A1=A1=A1=CF=EA=C7=E9=C7=EB=BD=F8=A3=BAhttp://mere.cn.gs/kqwins

=A1=A1=A1=A1"The intelligence= of arranges team of work to manage the software system" is a set of functions st= rong, circulate the stability, operate simple convenience, customer interface = beautiful, the covariance data responds rightly the card intelligence arranges team= of work to manage the software.Experience successively several years at Pea= rl Rever Delta several 100 foreign capitals( Hong Kong, Taiwan, Japan, the United= States)s with domestic up to 100 the success movement of business enterprises, ma= ke use of the latest the technique of SQL SERVER, adopt the the construction of= B/S, use the tree form node function, design to develop a this set of managem= ent softwares that have afresh the intelligence arrange team of work the fun= ction, the intelligence of the new version arranges team of work to manage the = software kqwins lets operate the personnel works wither proficiency, be the anoth= er intelligence in usage in your company arrange team of work to manage the software fee= ls troublesome or does not like to use, please download to try out the advantage of Kqw= ins8.0, guarantee to let that you have a pleasant change of atmosphere, the fell= ing that wish had met earlier.The real intelligence arranges team of work to= manage the software system.

=A1=A1=A1=A1The detail pleases enter: http://mere.cn.gs/kqwins


=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

------=_NextPart_001_0002_2B00AAAC.81020005-- ------=_NextPart_000_0001_2B00AAAC.81020005-- From lon-capa-cvs@mail.lon-capa.org Tue Apr 29 20:09:56 2003 From: lon-capa-cvs@mail.lon-capa.org (matthew) Date: Tue, 29 Apr 2003 19:09:56 -0000 Subject: [LON-CAPA-cvs] cvs: doc /install/redhat7.3 configure_mysql_db.pl Message-ID: matthew Tue Apr 29 15:09:56 2003 EDT Added files: /doc/install/redhat7.3 configure_mysql_db.pl Log: Little program to do the initialization of the mysql database. This is a complete initialization (sets the www password, creates the loncapa database, creates the metadata table), not a partial one. If you just need to have your metadata table re-created, run the searchcat.pl script. This is untested at this time but is based on code that works. Index: doc/install/redhat7.3/configure_mysql_db.pl +++ doc/install/redhat7.3/configure_mysql_db.pl #!/usr/bin/perl -w # The LearningOnline Network # Red Hat 7.3 installation script # # $Id: configure_mysql_db.pl,v 1.1 2003/04/29 19:09:56 matthew Exp $ # # Copyright Michigan State University Board of Trustees # # This file is part of the LearningOnline Network with CAPA (LON-CAPA). # # LON-CAPA is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # LON-CAPA is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with LON-CAPA; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # http://www.lon-capa.org/ # ## ## Set up mysql ## print("Setting mysqld to start on boot up.\n"); system("/sbin/chkconfig --add mysqld"); system("/sbin/chkconfig mysqld on"); print(`/sbin/chkconfig --list mysqld`); print("mysql links created successfully\n"); print(`/etc/rc.d/init.d/mysqld start`); print("Waiting for mysql daemon to start.\n"); sleep 5; my $status = system("/etc/rc.d/init.d/mysqld status"); if ($status != 0) { die "Unable to start mysql daemon\nHalting\n"; } else { print("Mysql daemon is running.\n"); } print("\n"); ## ## Get root password for mysql client ## print <; chomp $rootpass; print("\n"); ## ## Run the damn thing (mysql, not LON-CAPA) ## print("Starting mysql client.\n"); open MYSQL, "|mysql -u root mysql" || die "Unable to start mysql\n"; print MYSQL <<"ENDMYSQL"; CREATE DATABASE loncapa; INSERT INTO user (Host, User, Password) VALUES ('localhost','www',password('localhostkey')); INSERT INTO db VALUES ('localhost','loncapa','www', 'Y','Y','Y','Y','Y','Y','N','Y','Y','Y'); SET PASSWORD FOR root\@localhost=PASSWORD('$rootpass'); DELETE FROM user WHERE host<>'localhost'; FLUSH PRIVILEGES; USE loncapa; CREATE TABLE IF NOT EXISTS metadata (title TEXT, author TEXT, subject TEXT, url TEXT, keywords TEXT, version TEXT, notes TEXT, abstract TEXT, mime TEXT, language TEXT, creationdate DATETIME, lastrevisiondate DATETIME, owner TEXT, copyright TEXT, FULLTEXT idx_title (title), FULLTEXT idx_author (author), FULLTEXT idx_subject (subject), FULLTEXT idx_url (url), FULLTEXT idx_keywords (keywords), FULLTEXT idx_version (version), FULLTEXT idx_notes (notes), FULLTEXT idx_abstract (abstract), FULLTEXT idx_mime (mime), FULLTEXT idx_language (language), FULLTEXT idx_owner (owner), FULLTEXT idx_copyright (copyright)) TYPE=MYISAM; EXIT ENDMYSQL close MYSQL; From lon-capa-cvs@mail.lon-capa.org Tue Apr 29 20:46:24 2003 From: lon-capa-cvs@mail.lon-capa.org (matthew) Date: Tue, 29 Apr 2003 19:46:24 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface/statistics lonstudentassessment.pm Message-ID: matthew Tue Apr 29 15:46:24 2003 EDT Modified files: /loncom/interface/statistics lonstudentassessment.pm Log: Add output of 'Maximum' "student" to list the maximum scores available on the sequences when we output Excel. Index: loncom/interface/statistics/lonstudentassessment.pm diff -u loncom/interface/statistics/lonstudentassessment.pm:1.44 loncom/interface/statistics/lonstudentassessment.pm:1.45 --- loncom/interface/statistics/lonstudentassessment.pm:1.44 Thu Mar 27 14:22:31 2003 +++ loncom/interface/statistics/lonstudentassessment.pm Tue Apr 29 15:46:24 2003 @@ -1,6 +1,6 @@ # The LearningOnline Network with CAPA # -# $Id: lonstudentassessment.pm,v 1.44 2003/03/27 19:22:31 matthew Exp $ +# $Id: lonstudentassessment.pm,v 1.45 2003/04/29 19:46:24 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -820,6 +820,26 @@ $rows_output += 2; } else { $rows_output += 1; + } + # + # Output a row for MAX + if ($show ne 'totals') { + $cols_output = 0; + foreach my $field (&get_student_fields_to_show()) { + if ($field eq 'username' || $field eq 'fullname' || + $field eq 'id') { + $excel_sheet->write($rows_output,$cols_output++,'Maximum'); + } else { + $excel_sheet->write($rows_output,$cols_output++,''); + } + } + # + # Add the Sequence Headers + foreach my $seq (&Apache::lonstatistics::Sequences_with_Assess()) { + $excel_sheet->write($rows_output,$cols_output++, + $seq->{'num_assess_parts'}); + } + $rows_output++; } # # Let the user know what we are doing From lon-capa-cvs@mail.lon-capa.org Tue Apr 29 21:32:21 2003 From: lon-capa-cvs@mail.lon-capa.org (www) Date: Tue, 29 Apr 2003 20:32:21 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /homework essayresponse.pm Message-ID: www Tue Apr 29 16:32:21 2003 EDT Modified files: /loncom/homework essayresponse.pm Log: Bug 108: start archiving answers. Index: loncom/homework/essayresponse.pm diff -u loncom/homework/essayresponse.pm:1.31 loncom/homework/essayresponse.pm:1.32 --- loncom/homework/essayresponse.pm:1.31 Mon Apr 21 16:59:02 2003 +++ loncom/homework/essayresponse.pm Tue Apr 29 16:32:21 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # essay (ungraded) style responses # -# $Id: essayresponse.pm,v 1.31 2003/04/21 20:59:02 albertel Exp $ +# $Id: essayresponse.pm,v 1.32 2003/04/29 20:32:21 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -130,6 +130,24 @@ $Apache::lonhomework::results{"resource.$part.$id.awarddetail"}=$award; my %previous=&Apache::response::check_for_previous($response,$part,$id); unless ($uploadedflag) { &Apache::response::handle_previous(\%previous,$award); } +# +# Store with resource author for similarity testing +# + if ($award eq 'SUBMITTED') { + my ($symb,$crsid,$domain,$name)= + &Apache::lonxml::whichuser(); + if ($crsid) { + my $akey=$name.'.'.$domain.'.'.$crsid; + my $essayurl= + &Apache::lonnet::declutter($ENV{'REQUEST_URI'}); + my ($adom,$aname,$apath)= + ($essayurl=~/^(\w+)\/(\w+)\/(.*)$/); + $apath=&Apache::lonnet::escape($apath); + $apath=~s/\W/\_/gs; + &Apache::lonnet::put('nohist_essay_'.$apath, + { $akey => $response },$adom,$aname); + } + } } } } elsif ($target eq 'edit') { From lon-capa-cvs@mail.lon-capa.org Tue Apr 29 23:00:31 2003 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Tue, 29 Apr 2003 22:00:31 -0000 Subject: [LON-CAPA-cvs] cvs: loncom / loncapa_apache.conf Message-ID: albertel Tue Apr 29 18:00:31 2003 EDT Modified files: /loncom loncapa_apache.conf Log: - fixed for mod_perl 2, still not loading startup.pl Index: loncom/loncapa_apache.conf diff -u loncom/loncapa_apache.conf:1.46 loncom/loncapa_apache.conf:1.47 --- loncom/loncapa_apache.conf:1.46 Fri Apr 18 16:44:07 2003 +++ loncom/loncapa_apache.conf Tue Apr 29 18:00:31 2003 @@ -1,7 +1,7 @@ ## ## loncapa_apache.conf -- Apache HTTP LON-CAPA configuration file ## -## $Id: loncapa_apache.conf,v 1.46 2003/04/18 20:44:07 www Exp $ +## $Id: loncapa_apache.conf,v 1.47 2003/04/29 22:00:31 albertel Exp $ ## # @@ -18,8 +18,10 @@ # ======================================================= Shared Object Modules -LoadModule perl_module modules/libperl.so +LoadModule perl_module modules/mod_perl.so + AddModule mod_perl.c + # =============================================================== Miscellaneous @@ -781,4 +783,6 @@ # ================================================== Initiate mod_perl starting PerlRequire conf/startup.pl + PerlFreshRestart On + From lon-capa-cvs@mail.lon-capa.org Wed Apr 30 14:44:30 2003 From: lon-capa-cvs@mail.lon-capa.org (sakharuk) Date: Wed, 30 Apr 2003 13:44:30 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /homework inputtags.pm Message-ID: sakharuk Wed Apr 30 09:44:30 2003 EDT Modified files: /loncom/homework inputtags.pm Log: Problem with 2mm has solved. I've added spce (exactly 2 mm) before printing number of tries. You can not just add this amount of space before because you have to separate number of tries (which appears earlier) with box for the input of data. Index: loncom/homework/inputtags.pm diff -u loncom/homework/inputtags.pm:1.96 loncom/homework/inputtags.pm:1.97 --- loncom/homework/inputtags.pm:1.96 Thu Apr 24 08:44:54 2003 +++ loncom/homework/inputtags.pm Wed Apr 30 09:44:30 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # input definitons # -# $Id: inputtags.pm,v 1.96 2003/04/24 12:44:54 sakharuk Exp $ +# $Id: inputtags.pm,v 1.97 2003/04/30 13:44:30 sakharuk Exp $ # # Copyright Michigan State University Board of Trustees # @@ -530,8 +530,8 @@ if ( $maxtries eq 'con_lost' ) { $maxtries = '0'; } if ( $showbutton ) { if ($target eq 'tex') { - if ($ENV{'request.state'} ne "construct") { - $trystr = ' {\vskip -1 mm \small \textit{Tries} '.$tries.'/'.$maxtries.'} \vskip 2 mm '; + if ($ENV{'request.state'} ne "construct" && $Apache::lonhomework::type ne 'exam') { + $trystr = ' {\vskip 1 mm \small \textit{Tries} '.$tries.'/'.$maxtries.'} \vskip 2 mm '; } else { $trystr = '\vskip 0 mm '; } From lon-capa-cvs@mail.lon-capa.org Wed Apr 30 16:12:29 2003 From: lon-capa-cvs@mail.lon-capa.org (matthew) Date: Wed, 30 Apr 2003 15:12:29 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonpreferences.pm Message-ID: matthew Wed Apr 30 11:12:29 2003 EDT Modified files: /loncom/interface lonpreferences.pm Log: Better to sort the color selection stuff so they appear in a consistent order. Index: loncom/interface/lonpreferences.pm diff -u loncom/interface/lonpreferences.pm:1.21 loncom/interface/lonpreferences.pm:1.22 --- loncom/interface/lonpreferences.pm:1.21 Sat Apr 19 11:34:06 2003 +++ loncom/interface/lonpreferences.pm Wed Apr 30 11:12:29 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.21 2003/04/19 15:34:06 www Exp $ +# $Id: lonpreferences.pm,v 1.22 2003/04/30 15:12:29 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -295,7 +295,7 @@ 'vlink' => 'Visited Link', 'alink' => 'Active Link'); my $chtable=''; - foreach my $item (keys %colortypes) { + foreach my $item (sort(keys(%colortypes))) { my $curcol=&Apache::loncommon::designparm($function.'.'.$item,$domain); $chtable.=''.$colortypes{$item}.'      ("Helper Title"); + +Next you'll need to manually add states to the helper: + + Apache::lonhelper::state->new("STATE_NAME", "State's Human Title"); + +You don't need to save a reference to it because all elements up until +the next state creation will automatically be added to this state. + +Elements are created by populating the $paramHash in +Apache::lonhelper::paramhash. To prevent namespace issues, retrieve +a reference to that has with getParamHash: + + my $paramHash = Apache::lonhelper::getParamHash(); + +You will need to do this for each state you create. + +Populate the $paramHash with the parameters for the element you wish +to add next; the easiest way to find out what those entries are is +to read the code. Some common ones are 'variable' to record the variable +to store the results in, and NEXTSTATE to record a next state transition. + +Then create your element: + + $paramHash->{MESSAGETEXT} = "This is a message."; + Apache::lonhelper::message->new(); + +The creation will take the $paramHash and bless it into a +Apache::lonhelper::message object. To create the next element, you need +to get a reference to the new, empty $paramHash: + + $paramHash = Apache::lonhelper::getParamHash(); + +and you can repeat creating elements that way. You can add states +and elements as needed. + +See lonprintout.pm, subroutine printHelper for an example of this, where +we dynamically add some states to prevent security problems, for instance. + +Normally the machinery in the XML format is sufficient; dynamically +adding states can easily be done by wrapping the state in a +tag. This should only be used when the code dominates the XML content, +the code is so complicated that it is difficult to get access to +all of the information you need because of scoping issues, or so much +of the information used is persistent because would-be or + blocks that using the {DATA} mechanism results in hard-to-read +and -maintain code. + +It is possible to do some of the work with an XML fragment parsed by +lonxml; again, see lonprintout.pm for an example. + =cut package Apache::lonhelper; @@ -122,10 +189,15 @@ # end of the element tag is located. my $paramHash; +# For debugging purposes, one can send a second parameter into this +# function, the 'uri' of the helper you wish to have rendered, and +# call this from other handlers. sub handler { my $r = shift; - $ENV{'request.uri'} = $r->uri(); - my $filename = '/home/httpd/html' . $r->uri(); + my $uri = shift; + if (!defined($uri)) { $uri = $r->uri(); } + $ENV{'request.uri'} = $uri; + my $filename = '/home/httpd/html' . $uri; my $fh = Apache::File->new($filename); my $file; read $fh, $file, 100000000; @@ -154,10 +226,24 @@ # xml parsing &Apache::lonxml::xmlparse($r, 'helper', $file); + $helper->process(); + $r->print($helper->display()); return OK; } +sub registerHelperTags { + for my $tagList (@helperTags) { + Apache::lonxml::register($tagList->[0], $tagList->[1]); + } +} + +sub unregisterHelperTags { + for my $tagList (@helperTags) { + Apache::lonxml::deregister($tagList->[0], $tagList->[1]); + } +} + sub start_helper { my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; @@ -165,11 +251,9 @@ return ''; } - for my $tagList (@helperTags) { - Apache::lonxml::register($tagList->[0], $tagList->[1]); - } - - $helper = Apache::lonhelper::helper->new($token->[2]{'title'}); + registerHelperTags(); + + Apache::lonhelper::helper->new($token->[2]{'title'}); return ''; } @@ -180,9 +264,7 @@ return ''; } - for my $tagList (@helperTags) { - Apache::lonxml::deregister($tagList->[0], $tagList->[1]); - } + unregisterHelperTags(); return ''; } @@ -194,11 +276,22 @@ return ''; } - $state = Apache::lonhelper::state->new($token->[2]{'name'}, - $token->[2]{'title'}); + Apache::lonhelper::state->new($token->[2]{'name'}, + $token->[2]{'title'}); return ''; } +# Use this to get the param hash from other files. +sub getParamHash { + return $paramHash; +} + +# Use this to get the helper, if implementing elements in other files +# (like lonprintout.pm) +sub getHelper { + return $helper; +} + # don't need this, so ignore it sub end_state { return ''; @@ -287,6 +380,11 @@ # for an example. $self->{DATA} = {}; + $helper = $self; + + # Establish the $paramHash + $paramHash = {}; + bless($self, $class); return $self; } @@ -347,23 +445,15 @@ $self->{STATES}{$stateName} = $state; } -# Done in four phases -# 1: Do the post processing for the previous state. -# 2: Do the preprocessing for the current state. -# 3: Check to see if state changed, if so, postprocess current and move to next. -# Repeat until state stays stable. -# 4: Render the current state to the screen as an HTML page. -sub display { +sub process { my $self = shift; - my $result = ""; - # Phase 1: Post processing for state of previous screen (which is actually # the "current state" in terms of the helper variables), if it wasn't the # beginning state. if ($self->{STATE} ne "START" || $ENV{"form.SUBMIT"} eq "Next ->") { my $prevState = $self->{STATES}{$self->{STATE}}; - $prevState->postprocess(); + $prevState->postprocess(); } # Note, to handle errors in a state's input that a user must correct, @@ -374,11 +464,10 @@ my $startState = $self->{STATE}; my $state = $self->{STATES}{$startState}; - # Error checking; it is intended that the developer will have - # checked all paths and the user can't see this! + # For debugging, print something here to determine if you're going + # to an undefined state. if (!defined($state)) { - $result .="Error! The state ". $startState ." is not defined."; - return $result; + return; } $state->preprocess(); @@ -391,6 +480,21 @@ $state->preprocess(); } + return; +} + +# 1: Do the post processing for the previous state. +# 2: Do the preprocessing for the current state. +# 3: Check to see if state changed, if so, postprocess current and move to next. +# Repeat until state stays stable. +# 4: Render the current state to the screen as an HTML page. +sub display { + my $self = shift; + + my $state = $self->{STATES}{$self->{STATE}}; + + my $result = ""; + # Phase 4: Display. my $stateTitle = $state->title(); my $bodytag = &Apache::loncommon::bodytag("$self->{TITLE}",'',''); @@ -430,9 +534,9 @@ $result .= "\n"; } - foreach my $key (keys %{$self->{VARS}}) { - $result .= "|$key| -> " . $self->{VARS}->{$key} . "
"; - } + #foreach my $key (keys %{$self->{VARS}}) { + # $result .= "|$key| -> " . $self->{VARS}->{$key} . "
"; + #} $result .= < @@ -474,6 +578,8 @@ $helper->registerState($self); + $state = $self; + return $self; } @@ -517,7 +623,16 @@ } } +# Override the form if any element wants to. +# two elements overriding the form will make a mess, but that should +# be considered helper author error ;-) sub overrideForm { + my $self = shift; + for my $element (@{$self->{ELEMENTS}}) { + if ($element->overrideForm()) { + return 1; + } + } return 0; } @@ -616,6 +731,10 @@ return ''; } +sub overrideForm { + return 0; +} + sub process_multiple_choices { my $self = shift; my $formname = shift; @@ -766,6 +885,11 @@ For example, Bobby McDormik. + can take a parameter "eval", which if set to + a true value, will cause the contents of the tag to be + evaluated as it would be in an tag; see tag + below. + may optionally contain a 'nextstate' attribute, which will be the state transisitoned to if the choice is made, if the choice is not multichoice. @@ -846,7 +970,9 @@ my $human = &Apache::lonxml::get_all_text('/choice', $parser); my $nextstate = $token->[2]{'nextstate'}; - push @{$paramHash->{CHOICES}}, [$human, $computer, $nextstate]; + my $evalFlag = $token->[2]{'eval'}; + push @{$paramHash->{CHOICES}}, [$human, $computer, $nextstate, + $evalFlag]; return ''; } @@ -900,7 +1026,14 @@ $result .= " checked "; $checked = 1; } - $result .= "/> " . $choice->[0] . "\n"; + my $choiceLabel = $choice->[0]; + if ($choice->[4]) { # if we need to evaluate this choice + $choiceLabel = "sub { my $helper = shift; my $state = shift;" . + $choiceLabel . "}"; + $choiceLabel = eval($choiceLabel); + $choiceLabel = &$choiceLabel($helper, $self); + } + $result .= "/> " . $choiceLabel . "\n"; } $result .= "\n\n\n"; $result .= $buttons; @@ -1192,6 +1325,9 @@ "}" returns a string representing what you want to have as the value. By default, the value will be the resource ID of the object ($res->{ID}). +=item * : If the URL of a map is given here, only that map + will be displayed, instead of the whole course. + =back =cut @@ -1203,7 +1339,8 @@ BEGIN { &Apache::lonhelper::register('Apache::lonhelper::resource', ('resource', 'filterfunc', - 'choicefunc', 'valuefunc')); + 'choicefunc', 'valuefunc', + 'mapurl')); } sub new { @@ -1288,6 +1425,20 @@ sub end_valuefunc { return ''; } +sub start_mapurl { + my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; + + if ($target ne 'helper') { + return ''; + } + + my $contents = Apache::lonxml::get_all_text('/mapurl', + $parser); + $paramHash->{MAP_URL} = eval $contents; +} + +sub end_mapurl { return ''; } + # A note, in case I don't get to this before I leave. # If someone complains about the "Back" button returning them # to the previous folder state, instead of returning them to @@ -1313,6 +1464,7 @@ my $filterFunc = $self->{FILTER_FUNC}; my $choiceFunc = $self->{CHOICE_FUNC}; my $valueFunc = $self->{VALUE_FUNC}; + my $mapUrl = $self->{MAP_URL}; # Create the composite function that renders the column on the nav map # have to admit any language that lets me do this can't be all bad @@ -1341,9 +1493,9 @@ &Apache::lonnavmaps::render( { 'cols' => [$renderColFunc, Apache::lonnavmaps::resource()], 'showParts' => 0, - 'url' => $helper->{URL}, 'filterFunc' => $filterFunc, - 'resource_no_folder_link' => 1 } + 'resource_no_folder_link' => 1, + 'iterator_map' => $mapUrl } ); return $result; @@ -1929,7 +2081,148 @@ Apache::lonhelper::message->new(); } +1; + +package Apache::lonhelper::parmwizfinal; + +# This is the final state for the parmwizard. It is not generally useful, +# so it is not perldoc'ed. It does its own processing. +# It is represented with , and +# should later be moved to lonparmset.pm . + +no strict; +@ISA = ('Apache::lonhelper::element'); +use strict; +BEGIN { + &Apache::lonhelper::register('Apache::lonhelper::parmwizfinal', + ('parmwizfinal')); +} + +use Time::localtime; + +sub new { + my $ref = Apache::lonhelper::choices->new(); + bless ($ref); +} + +sub start_parmwizfinal { return ''; } + +sub end_parmwizfinal { + my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_; + + if ($target ne 'helper') { + return ''; + } + Apache::lonhelper::parmwizfinal->new(); +} + +# Renders a form that, when submitted, will form the input to lonparmset.pm +sub render { + my $self = shift; + my $vars = $helper->{VARS}; + + # FIXME: Unify my designators with the standard ones + my %dateTypeHash = ('open_date' => "Opening Date", + 'due_date' => "Due Date", + 'answer_date' => "Answer Date"); + my %parmTypeHash = ('open_date' => "0_opendate", + 'due_date' => "0_duedate", + 'answer_date' => "0_answerdate"); + + my $result = "
\n"; + $result .= '

Confirm that this information is correct, then click "Finish Wizard" to complete setting the parameter.

    '; + my $affectedResourceId = ""; + my $parm_name = $parmTypeHash{$vars->{ACTION_TYPE}}; + my $level = ""; + + # Print the type of manipulation: + $result .= '
  • Setting the ' . $dateTypeHash{$vars->{ACTION_TYPE}} + . "
  • \n"; + if ($vars->{ACTION_TYPE} eq 'due_date' || + $vars->{ACTION_TYPE} eq 'answer_date') { + # for due dates, we default to "date end" type entries + $result .= "\n"; + $result .= "\n"; + $result .= "\n"; + } elsif ($vars->{ACTION_TYPE} eq 'open_date') { + $result .= "\n"; + $result .= "\n"; + $result .= "\n"; + } + + # Print the granularity, depending on the action + if ($vars->{GRANULARITY} eq 'whole_course') { + $result .= '
  • for all resources in the course
  • '; + $level = 9; # general course, see lonparmset.pm perldoc + $affectedResourceId = "0.0"; + } elsif ($vars->{GRANULARITY} eq 'map') { + my $navmap = Apache::lonnavmaps::navmap->new( + $ENV{"request.course.fn"}.".db", + $ENV{"request.course.fn"}."_parms.db", 0, 0); + my $res = $navmap->getById($vars->{RESOURCE_ID}); + my $title = $res->compTitle(); + $navmap->untieHashes(); + $result .= "
  • for the map named $title
  • "; + $level = 8; + $affectedResourceId = $vars->{RESOURCE_ID}; + } else { + my $navmap = Apache::lonnavmaps::navmap->new( + $ENV{"request.course.fn"}.".db", + $ENV{"request.course.fn"}."_parms.db", 0, 0); + my $res = $navmap->getById($vars->{RESOURCE_ID}); + my $title = $res->compTitle(); + $navmap->untieHashes(); + $result .= "
  • for the resource named $title
  • "; + $level = 7; + $affectedResourceId = $vars->{RESOURCE_ID}; + } + + # Print targets + if ($vars->{TARGETS} eq 'course') { + $result .= '
  • for all students in course
  • '; + } elsif ($vars->{TARGETS} eq 'section') { + my $section = $vars->{SECTION_NAME}; + $result .= "
  • for section $section
  • "; + $level -= 3; + $result .= "\n"; + } else { + # FIXME: This is probably wasteful! Store the name! + my $classlist = Apache::loncoursedata::get_classlist(); + my $name = $classlist->{$vars->{USER_NAME}}->[6]; + $result .= "
  • for $name
  • "; + $level -= 6; + my ($uname, $udom) = split /:/, $vars->{USER_NAME}; + $result .= "\n"; + $result .= "\n"; + } + + # Print value + $result .= "
  • to " . ctime($vars->{PARM_DATE}) . " (" . + Apache::lonnavmaps::timeToHumanString($vars->{PARM_DATE}) + . ")
  • \n"; + + # print pres_marker + $result .= "\n\n"; + + $result .= "

    \n"; + + return $result; +} + +sub overrideForm { + return 1; +} 1; --bowersj21051715916-- From lon-capa-cvs@mail.lon-capa.org Wed Apr 30 16:49:45 2003 From: lon-capa-cvs@mail.lon-capa.org (matthew) Date: Wed, 30 Apr 2003 15:49:45 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonannounce.pm loncreateuser.pm londropadd.pm lonhtmlcommon.pm lonparmset.pm lonpreferences.pm Message-ID: This is a MIME encoded message --matthew1051717785 Content-Type: text/plain matthew Wed Apr 30 11:49:45 2003 EDT Modified files: /loncom/interface lonannounce.pm loncreateuser.pm londropadd.pm lonhtmlcommon.pm lonparmset.pm lonpreferences.pm Log: Added &Apache::lonhtmlcommon::pjump_javascript_definition() because the javascript function pjump was cut and pasted five times in the source code and I just could not sleep at night if I had made it six. --matthew1051717785 Content-Type: text/plain Content-Disposition: attachment; filename="matthew-20030430114945.txt" Index: loncom/interface/lonannounce.pm diff -u loncom/interface/lonannounce.pm:1.7 loncom/interface/lonannounce.pm:1.8 --- loncom/interface/lonannounce.pm:1.7 Wed Sep 11 11:01:43 2002 +++ loncom/interface/lonannounce.pm Wed Apr 30 11:49:45 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network # Announce # -# $Id: lonannounce.pm,v 1.7 2002/09/11 15:01:43 matthew Exp $ +# $Id: lonannounce.pm,v 1.8 2003/04/30 15:49:45 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -31,6 +31,7 @@ use strict; use Apache::Constants qw(:common); use Apache::loncommon; +use Apache::lonhtmlcommon(); sub readcalendar { my $courseid=shift; @@ -120,6 +121,7 @@ 'dlsav' => $todayhash{'dlsav'} )); my $weekday=$firstday{'weekday'}; # ------------------------------------------------------------ Print the screen + my $pjump_function = &Apache::lonhtmlcommon::pjump_javascript_definition(); $r->print(< @@ -131,14 +133,7 @@ parmwin.close(); } - function pjump(type,dis,value,marker,ret,call) { - parmwin=window.open("/adm/rat/parameter.html?type="+escape(type) - +"&value="+escape(value)+"&marker="+escape(marker) - +"&return="+escape(ret) - +"&call="+escape(call)+"&name="+escape(dis),"LONCAPAparms", - "height=350,width=350,scrollbars=no,menubar=no"); - - } + $pjump_function function dateset() { if (document.anno.pres_marker.value=='end') { Index: loncom/interface/loncreateuser.pm diff -u loncom/interface/loncreateuser.pm:1.51 loncom/interface/loncreateuser.pm:1.52 --- loncom/interface/loncreateuser.pm:1.51 Sun Mar 23 04:06:08 2003 +++ loncom/interface/loncreateuser.pm Wed Apr 30 11:49:45 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Create a user # -# $Id: loncreateuser.pm,v 1.51 2003/03/23 09:06:08 albertel Exp $ +# $Id: loncreateuser.pm,v 1.52 2003/04/30 15:49:45 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -46,7 +46,7 @@ # 05/10,10/16 Gerd Kortemeyer # 02/11/02 Matthew Hall # -# $Id: loncreateuser.pm,v 1.51 2003/03/23 09:06:08 albertel Exp $ +# $Id: loncreateuser.pm,v 1.52 2003/04/30 15:49:45 matthew Exp $ ### package Apache::loncreateuser; @@ -149,6 +149,7 @@ $ccuname=~s/\W//g; $ccdomain=~s/\W//g; + my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition(); my $dochead =<<"ENDDOCHEAD"; @@ -161,14 +162,7 @@ parmwin.close(); } - function pjump(type,dis,value,marker,ret,call) { - parmwin=window.open("/adm/rat/parameter.html?type="+escape(type) - +"&value="+escape(value)+"&marker="+escape(marker) - +"&return="+escape(ret) - +"&call="+escape(call)+"&name="+escape(dis),"LONCAPAparms", - "height=350,width=350,scrollbars=no,menubar=no"); - - } + $pjump_def function dateset() { eval("document.cu."+document.cu.pres_marker.value+ Index: loncom/interface/londropadd.pm diff -u loncom/interface/londropadd.pm:1.64 loncom/interface/londropadd.pm:1.65 --- loncom/interface/londropadd.pm:1.64 Thu Feb 13 16:35:50 2003 +++ loncom/interface/londropadd.pm Wed Apr 30 11:49:45 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Handler to drop and add students in courses # -# $Id: londropadd.pm,v 1.64 2003/02/13 21:35:50 albertel Exp $ +# $Id: londropadd.pm,v 1.65 2003/04/30 15:49:45 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -213,6 +213,7 @@ my %param = ( formname => 'studentform', kerb_def_dom => $krbdefdom ); my $authheader = &Apache::loncommon::authform_header(%param); + my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition(); return (<print(< @@ -304,15 +305,7 @@ parmwin.close(); } - function pjump(type,dis,value,marker,ret,call) { - document.parmform.pres_marker.value=''; - parmwin=window.open("/adm/rat/parameter.html?type="+escape(type) - +"&value="+escape(value)+"&marker="+escape(marker) - +"&return="+escape(ret) - +"&call="+escape(call)+"&name="+escape(dis),"LONCAPAparms", - "height=350,width=350,scrollbars=no,menubar=no"); - - } + $pjump_def function psub() { pclose(); Index: loncom/interface/lonpreferences.pm diff -u loncom/interface/lonpreferences.pm:1.22 loncom/interface/lonpreferences.pm:1.23 --- loncom/interface/lonpreferences.pm:1.22 Wed Apr 30 11:12:29 2003 +++ loncom/interface/lonpreferences.pm Wed Apr 30 11:49:45 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network # Preferences # -# $Id: lonpreferences.pm,v 1.22 2003/04/30 15:12:29 matthew Exp $ +# $Id: lonpreferences.pm,v 1.23 2003/04/30 15:49:45 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -50,6 +50,7 @@ use Crypt::DES; use DynaLoader; # for Crypt::DES version use Apache::loncommon(); +use Apache::lonhtmlcommon(); # # Write lonnet::passwd to do the call below. @@ -304,6 +305,7 @@ "','".$curcol."','" .$item."','parmform.pres','psub'".');">Select'; } + my $pjump_def = &Apache::lonhtmlcommon::pjump_javascript_definition(); $r->print(< @@ -1455,10 +1455,35 @@ my $var = $self->{'variable'}; my $curVal = $helper->{VARS}->{$var}; + my $buttons = ''; + + if ($self->{'multichoice'}) { + $result = < + function checkall(value) { + for (i=0; i +SCRIPT + $buttons = <   + + +
      +BUTTONS + } + if (defined $self->{ERROR_MSG}) { $result .= '
    ' . $self->{ERROR_MSG} . '

    '; } + $result .= $buttons; + my $filterFunc = $self->{FILTER_FUNC}; my $choiceFunc = $self->{CHOICE_FUNC}; my $valueFunc = $self->{VALUE_FUNC}; @@ -1500,6 +1525,8 @@ 'resource_no_folder_link' => 1, 'iterator_map' => $mapUrl } ); + + $result .= $buttons; return $result; } @@ -1591,8 +1618,8 @@ $result = < function checkall(value) { - for (i=0; i @@ -1792,16 +1819,16 @@ $result = < function checkall(value) { - for (i=0; i SCRIPT - my $buttons = <   From lon-capa-cvs@mail.lon-capa.org Wed Apr 30 20:18:37 2003 From: lon-capa-cvs@mail.lon-capa.org (bowersj2) Date: Wed, 30 Apr 2003 19:18:37 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm Message-ID: bowersj2 Wed Apr 30 15:18:37 2003 EDT Modified files: /loncom/interface lonprintout.pm Log: More fixing the page layout thingy. Index: loncom/interface/lonprintout.pm diff -u loncom/interface/lonprintout.pm:1.134 loncom/interface/lonprintout.pm:1.135 --- loncom/interface/lonprintout.pm:1.134 Wed Apr 30 15:07:29 2003 +++ loncom/interface/lonprintout.pm Wed Apr 30 15:18:37 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.134 2003/04/30 19:07:29 bowersj2 Exp $ +# $Id: lonprintout.pm,v 1.135 2003/04/30 19:18:37 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1524,10 +1524,11 @@ sub new { my $self = Apache::lonhelper::element->new(); + shift; + $self->{'variable'} = shift; my $helper = Apache::lonhelper::getHelper(); - my $paramHash = Apache::lonhelper::getParamHash(); - $helper->declareVar($paramHash->{'variable'}); + $helper->declareVar($self->{'variable'}); bless($self); return $self; } @@ -1583,6 +1584,16 @@ $result .= ""; return $result; +} + +sub postprocess { + my $self = shift; + + my $var = $self->{'variable'}; + $helper->{VARS}->{$var} = + $ENV{'form.$var.layout'} . '|' . $ENV{'form.$var.cols'} . '|' . + $ENV{'form.$var.paper'}; + return 1; } 1; From lon-capa-cvs@mail.lon-capa.org Wed Apr 30 20:23:48 2003 From: lon-capa-cvs@mail.lon-capa.org (bowersj2) Date: Wed, 30 Apr 2003 19:23:48 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonhelper.pm Message-ID: bowersj2 Wed Apr 30 15:23:48 2003 EDT Modified files: /loncom/interface lonhelper.pm Log: Makes the paper state work on my machine. Index: loncom/interface/lonhelper.pm diff -u loncom/interface/lonhelper.pm:1.15 loncom/interface/lonhelper.pm:1.16 --- loncom/interface/lonhelper.pm:1.15 Wed Apr 30 15:08:15 2003 +++ loncom/interface/lonhelper.pm Wed Apr 30 15:23:48 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # .helper XML handler to implement the LON-CAPA helper # -# $Id: lonhelper.pm,v 1.15 2003/04/30 19:08:15 bowersj2 Exp $ +# $Id: lonhelper.pm,v 1.16 2003/04/30 19:23:48 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1002,7 +1002,7 @@ BUTTONS } - if (defined $self->{ERRO_MSG}) { + if (defined $self->{ERROR_MSG}) { $result .= '
    ' . $self->{ERROR_MSG} . '
    '; } From lon-capa-cvs@mail.lon-capa.org Wed Apr 30 20:25:47 2003 From: lon-capa-cvs@mail.lon-capa.org (bowersj2) Date: Wed, 30 Apr 2003 19:25:47 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm Message-ID: bowersj2 Wed Apr 30 15:25:47 2003 EDT Modified files: /loncom/interface lonprintout.pm Log: Makes the paper selection state work. Index: loncom/interface/lonprintout.pm diff -u loncom/interface/lonprintout.pm:1.135 loncom/interface/lonprintout.pm:1.136 --- loncom/interface/lonprintout.pm:1.135 Wed Apr 30 15:18:37 2003 +++ loncom/interface/lonprintout.pm Wed Apr 30 15:25:47 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.135 2003/04/30 19:18:37 bowersj2 Exp $ +# $Id: lonprintout.pm,v 1.136 2003/04/30 19:25:47 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1590,9 +1590,10 @@ my $self = shift; my $var = $self->{'variable'}; + my $helper = Apache::lonhelper->getHelper(); $helper->{VARS}->{$var} = - $ENV{'form.$var.layout'} . '|' . $ENV{'form.$var.cols'} . '|' . - $ENV{'form.$var.paper'}; + $ENV{"form.$var.layout"} . '|' . $ENV{"form.$var.cols"} . '|' . + $ENV{"form.$var.paper"}; return 1; } From lon-capa-cvs@mail.lon-capa.org Wed Apr 30 20:40:47 2003 From: lon-capa-cvs@mail.lon-capa.org (matthew) Date: Wed, 30 Apr 2003 19:40:47 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /homework edit.pm Message-ID: matthew Wed Apr 30 15:40:47 2003 EDT Modified files: /loncom/homework edit.pm Log: Added &html_element_name() to return a name for new elements. This makes it easier for those of us who are forced to write javascript to reference elements on the edit page. Index: loncom/homework/edit.pm diff -u loncom/homework/edit.pm:1.46 loncom/homework/edit.pm:1.47 --- loncom/homework/edit.pm:1.46 Thu Feb 13 18:53:33 2003 +++ loncom/homework/edit.pm Wed Apr 30 15:40:47 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # edit mode helpers # -# $Id: edit.pm,v 1.46 2003/02/13 23:53:33 albertel Exp $ +# $Id: edit.pm,v 1.47 2003/04/30 19:40:47 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -481,12 +481,17 @@ return $result; } +sub html_element_name { + my ($name) = @_; + return $Apache::lonxml::curdepth.'.'.$name; +} + sub text_arg { my ($description,$name,$token,$size) = @_; my $result; if (!defined $size) { $size=20; } my $arg=$token->[2]{$name}; - $result=$description.' '; return $result; } @@ -510,8 +515,8 @@ $optionlist.="\n"; } } - $result.=$description.'  '.$optionlist.' '; return $result; @@ -540,7 +545,8 @@ } $optionlist.="\n"; if (($found) || (!$selected)) { - $result.=$description.'  '.$optionlist.' '; } else { From lon-capa-cvs@mail.lon-capa.org Wed Apr 30 21:03:14 2003 From: lon-capa-cvs@mail.lon-capa.org (bowersj2) Date: Wed, 30 Apr 2003 20:03:14 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface lonprintout.pm Message-ID: bowersj2 Wed Apr 30 16:03:14 2003 EDT Modified files: /loncom/interface lonprintout.pm Log: Should make sure we can get at the PRINT_TYPE variable. Index: loncom/interface/lonprintout.pm diff -u loncom/interface/lonprintout.pm:1.136 loncom/interface/lonprintout.pm:1.137 --- loncom/interface/lonprintout.pm:1.136 Wed Apr 30 15:25:47 2003 +++ loncom/interface/lonprintout.pm Wed Apr 30 16:03:14 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network # Printout # -# $Id: lonprintout.pm,v 1.136 2003/04/30 19:25:47 bowersj2 Exp $ +# $Id: lonprintout.pm,v 1.137 2003/04/30 20:03:14 bowersj2 Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1457,6 +1457,7 @@ Apache::lonhelper::message->new(); $paramHash = Apache::lonhelper::getParamHash(); $paramHash->{'variable'} = 'PRINT_TYPE'; + $helper->declareVar('PRINT_TYPE'); $paramHash->{CHOICES} = $printChoices; Apache::lonhelper::choices->new(); Apache::lonprintout::page_format_state->new("FORMAT"); From lon-capa-cvs@mail.lon-capa.org Wed Apr 30 21:16:03 2003 From: lon-capa-cvs@mail.lon-capa.org (www) Date: Wed, 30 Apr 2003 20:16:03 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /homework grades.pm Message-ID: www Wed Apr 30 16:16:03 2003 EDT Modified files: /loncom/homework grades.pm Log: Bug 108: Plagiarism check on essay responses. Index: loncom/homework/grades.pm diff -u loncom/homework/grades.pm:1.87 loncom/homework/grades.pm:1.88 --- loncom/homework/grades.pm:1.87 Wed Apr 30 11:52:28 2003 +++ loncom/homework/grades.pm Wed Apr 30 16:16:02 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # The LON-CAPA Grading handler # -# $Id: grades.pm,v 1.87 2003/04/30 15:52:28 www Exp $ +# $Id: grades.pm,v 1.88 2003/04/30 20:16:02 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -237,7 +237,7 @@ $uessay=~s/\W+/ /gs; # these will be returned. Do not care if not at least 50 percent similar - my $limit=0.5; + my $limit=0.6; my $sname=''; my $sdom=''; my $scrsid=''; @@ -246,22 +246,22 @@ foreach my $tkey (keys %oldessays) { my ($tname,$tdom,$tcrsid)=split(/\./,$tkey); # ... except the same student - if (($tname ne $uname) && ($tdom ne $udom)) { + if (($tname ne $uname) || ($tdom ne $udom)) { my $tessay=$oldessays{$tkey}; $tessay=~s/\W+/ /gs; # String similarity gives up if not even limit - my $tsimilar=&String::Similarity::similar($uessay,$tessay,$limit); + my $tsimilar=&String::Similarity::similarity($uessay,$tessay,$limit); # Found one if ($tsimilar>$limit) { $limit=$tsimilar; $sname=$tname; - $sdom=$sdom; + $sdom=$tdom; $scrsid=$tcrsid; $sessay=$oldessays{$tkey}; } } } - if ($limit>0.5) { + if ($limit>0.6) { return ($sname,$sdom,$scrsid,$sessay,$limit); } else { return ('','','','',0); @@ -1122,6 +1122,9 @@ $request->print($prnmsg); if ($ENV{'form.handgrade'} eq 'yes' && $ENV{'form.showgrading'} eq 'yes') { +# +# Print out the keyword options line +# $request->print(<Keyword Options:  List    @@ -1129,6 +1132,14 @@ CLASS="page">Paste Selection to List    Highlight Attribute

    KEYWORDS +# +# Load the other essays for similarity check +# + my $essayurl=&Apache::lonnet::declutter($url); + my ($adom,$aname,$apath)=($essayurl=~/^(\w+)\/(\w+)\/(.*)$/); + $apath=&Apache::lonnet::escape($apath); + $apath=~s/\W/\_/gs; + %oldessays=&Apache::lonnet::dump('nohist_essay_'.$apath,$adom,$aname); } } @@ -1236,6 +1247,15 @@ my ($partid,$respid) = /^resource\.(\d+)\.(\d+)\.submission/; if ($part eq ($partid.'_'.$respid)) { my ($ressub,$subval) = split(/:/,$_,2); +# Similarity check + my $similar=''; + my ($oname,$odom,$ocrsid,$oessay,$osim)=&most_similar($uname,$udom,$subval); + if ($osim) { + $osim=int($osim*100.0); + $similar='

    Essay is '.$osim.'% similar to an essay by '.&Apache::loncommon::plainname($oname,$odom). + '

    '. + &keywords_highlight($oessay).'

    '; + } $lastsubonly.='Part '. $partid.' ( ID '.$respid. ' )   '. @@ -1243,8 +1263,8 @@ ' File uploaded by student Like all files provided by users, this file may contain virusses
    ':''). - 'Answer: '. - &keywords_highlight($subval).''."\n" + 'Answer:
    '. + &keywords_highlight($subval).'

     '.$similar.''."\n" if ($ENV{'form.lastSub'} eq 'lastonly' || ($ENV{'form.lastSub'} eq 'hdgrade' && $$handgrade{$part} =~ /:yes$/)); From lon-capa-cvs@mail.lon-capa.org Wed Apr 30 21:59:57 2003 From: lon-capa-cvs@mail.lon-capa.org (matthew) Date: Wed, 30 Apr 2003 20:59:57 -0000 Subject: [LON-CAPA-cvs] cvs: doc /install/redhat7.3 install.pl Message-ID: matthew Wed Apr 30 16:59:57 2003 EDT Modified files: /doc/install/redhat7.3 install.pl Log: Removed mention of the version of LON-CAPA being installed. Index: doc/install/redhat7.3/install.pl diff -u doc/install/redhat7.3/install.pl:1.19 doc/install/redhat7.3/install.pl:1.20 --- doc/install/redhat7.3/install.pl:1.19 Sun Jan 12 14:07:28 2003 +++ doc/install/redhat7.3/install.pl Wed Apr 30 16:59:57 2003 @@ -2,7 +2,7 @@ # The LearningOnline Network # Red Hat 7.3 installation script # -# $Id: install.pl,v 1.19 2003/01/12 19:07:28 matthew Exp $ +# $Id: install.pl,v 1.20 2003/04/30 20:59:57 matthew Exp $ # # Copyright Michigan State University Board of Trustees # @@ -147,7 +147,7 @@ print <<"END"; ******************************************************************** - Welcome to LON-CAPA 0.6.0 + Welcome to LON-CAPA This script will install the base software that LON-CAPA needs to run properly. From lon-capa-cvs@mail.lon-capa.org Wed Apr 30 22:09:12 2003 From: lon-capa-cvs@mail.lon-capa.org (www) Date: Wed, 30 Apr 2003 21:09:12 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /interface londocs.pm Message-ID: www Wed Apr 30 17:09:12 2003 EDT Modified files: /loncom/interface londocs.pm Log: Working on bug 1395 - loading a map into a folder. Not done yet. Index: loncom/interface/londocs.pm diff -u loncom/interface/londocs.pm:1.51 loncom/interface/londocs.pm:1.52 --- loncom/interface/londocs.pm:1.51 Sat Apr 12 11:56:42 2003 +++ loncom/interface/londocs.pm Wed Apr 30 17:09:12 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network # Documents # -# $Id: londocs.pm,v 1.51 2003/04/12 15:56:42 www Exp $ +# $Id: londocs.pm,v 1.52 2003/04/30 21:09:12 www Exp $ # # Copyright Michigan State University Board of Trustees # @@ -663,7 +663,12 @@ "javascript:document.forms.simpleedit.folder.value='$folder';groupsearch()" value="Search"> -$help{'Importing_LON-CAPA_Resource'} +$help{'Importing_LON-CAPA_Resource'}
    + + +
    From lon-capa-cvs@mail.lon-capa.org Wed Apr 30 22:09:55 2003 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Wed, 30 Apr 2003 21:09:55 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /lonnet/perl lonnet.pm Message-ID: albertel Wed Apr 30 17:09:55 2003 EDT Modified files: /loncom/lonnet/perl lonnet.pm Log: - new rndseed functions, 64bit looks pretty tasty - let me know if you see any issues with this (should be backward compatible I have seen no fluxes) Index: loncom/lonnet/perl/lonnet.pm diff -u loncom/lonnet/perl/lonnet.pm:1.365 loncom/lonnet/perl/lonnet.pm:1.366 --- loncom/lonnet/perl/lonnet.pm:1.365 Thu Apr 24 18:08:47 2003 +++ loncom/lonnet/perl/lonnet.pm Wed Apr 30 17:09:55 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network # TCP networking package # -# $Id: lonnet.pm,v 1.365 2003/04/24 22:08:47 albertel Exp $ +# $Id: lonnet.pm,v 1.366 2003/04/30 21:09:55 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -3762,29 +3762,88 @@ $txt=~tr/u-z/0-5/; $txt=~s/\D//g; return int($txt); -} +} sub rndseed { my ($symb,$courseid,$domain,$username)=@_; + + my ($wsymb,$wcourseid,$wdomain,$wusername)=&Apache::lonxml::whichuser(); if (!$symb) { - unless ($symb=&symbread()) { return time; } + unless ($symb=$wsymb) { return time; } + } + if (!$courseid) { $courseid=$wcourseid; } + if (!$domain) { $domain=$wdomain; } + if (!$username) { $username=$wusername } + my $which=$ENV{"course.$courseid.rndseed"}; + my $CODE=$ENV{'scantron.CODE'}; + if (defined($CODE)) { + &rndseed_CODE_64bit($symb,$courseid,$domain,$username); + } elsif ($which eq '64bit') { + return &rndseed_64bit($symb,$courseid,$domain,$username); + } + return &rndseed_32bit($symb,$courseid,$domain,$username); +} + +sub rndseed_32bit { + my ($symb,$courseid,$domain,$username)=@_; + { + use integer; + my $symbchck=unpack("%32C*",$symb) << 27; + my $symbseed=numval($symb) << 22; + my $namechck=unpack("%32C*",$username) << 17; + my $nameseed=numval($username) << 12; + my $domainseed=unpack("%32C*",$domain) << 7; + my $courseseed=unpack("%32C*",$courseid); + my $num=$symbseed+$nameseed+$domainseed+$courseseed+$namechck+$symbchck; + #&Apache::lonxml::debug("$symbseed:$nameseed;$domainseed|$courseseed;$namechck:$symbchck"); + #&Apache::lonxml::debug("rndseed :$num:$symb"); + return $num; + } +} + +sub rndseed_64bit { + my ($symb,$courseid,$domain,$username)=@_; + { + use integer; + my $symbchck=unpack("%32S*",$symb) << 21; + my $symbseed=numval($symb) << 10; + my $namechck=unpack("%32S*",$username); + + my $nameseed=numval($username) << 21; + my $domainseed=unpack("%32S*",$domain) << 10; + my $courseseed=unpack("%32S*",$courseid); + + my $num1=$symbchck+$symbseed+$namechck; + my $num2=$nameseed+$domainseed+$courseseed; + #&Apache::lonxml::debug("$symbseed:$nameseed;$domainseed|$courseseed;$namechck:$symbchck"); + #&Apache::lonxml::debug("rndseed :$num:$symb"); + return "$num1,$num2"; } - if (!$courseid) { $courseid=$ENV{'request.course.id'};} - if (!$domain) {$domain=$ENV{'user.domain'};} - if (!$username) {$username=$ENV{'user.name'};} +} + +sub rndseed_CODE_64bit { + my ($symb,$courseid,$domain,$username)=@_; { - use integer; - my $symbchck=unpack("%32C*",$symb) << 27; - my $symbseed=numval($symb) << 22; - my $namechck=unpack("%32C*",$username) << 17; - my $nameseed=numval($username) << 12; - my $domainseed=unpack("%32C*",$domain) << 7; - my $courseseed=unpack("%32C*",$courseid); - my $num=$symbseed+$nameseed+$domainseed+$courseseed+$namechck+$symbchck; - #uncommenting these lines can break things! - #&Apache::lonxml::debug("$symbseed:$nameseed;$domainseed|$courseseed;$namechck:$symbchck"); - #&Apache::lonxml::debug("rndseed :$num:$symb"); - return $num; + use integer; + my $symbchck=unpack("%32S*",$symb) << 16; + my $symbseed=numval($symb); + my $CODEseed=numval($ENV{'scantron.CODE'}) << 16; + my $courseseed=unpack("%32S*",$courseid); + my $num1=$symbseed+$CODEseed; + my $num2=$courseseed+$symbchck; + #&Apache::lonxml::debug("$symbseed:$CODEseed|$courseseed:$symbchck"); + #&Apache::lonxml::debug("rndseed :$num1:$num2:$symb"); + return "$num1,$num2"; + } +} + +sub setup_random_from_rndseed { + my ($rndseed)=@_; + if ($rndseed =~/,/) { + my ($num1,$num2)=split(/,/,$rndseed); + &Math::Random::random_set_seed(abs($num1),abs($num2)); + } else { + &Math::Random::random_set_seed_from_phrase($rndseed); } } From lon-capa-cvs@mail.lon-capa.org Wed Apr 30 22:10:51 2003 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Wed, 30 Apr 2003 21:10:51 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /homework default_homework.lcpm Message-ID: albertel Wed Apr 30 17:10:51 2003 EDT Modified files: /loncom/homework default_homework.lcpm Log: - understadns new rndseed returns Index: loncom/homework/default_homework.lcpm diff -u loncom/homework/default_homework.lcpm:1.60 loncom/homework/default_homework.lcpm:1.61 --- loncom/homework/default_homework.lcpm:1.60 Tue Mar 25 18:05:03 2003 +++ loncom/homework/default_homework.lcpm Wed Apr 30 17:10:50 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # used by lonxml::xmlparse() as input variable $safeinit to Apache::run::run() # -# $Id: default_homework.lcpm,v 1.60 2003/03/25 23:05:03 albertel Exp $ +# $Id: default_homework.lcpm,v 1.61 2003/04/30 21:10:50 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -82,7 +82,7 @@ #formula type setup the sample points if ($type eq '8') { ($id_list,$points)=split(/@/,$samples); - $message.="Found :$points: points\n"; + $message.="Found :$id_list:$points: points in $samples\n"; } if ($tol eq '') { $tol=0.0; @@ -238,17 +238,22 @@ } sub random { - my ($start,$end,$step)=@_; - if ( ! $hidden::RANDOMINIT ) { - if ($external::randomseed == 0) { $external::randomseed=1; } - &random_set_seed(1,int(abs($external::randomseed))); - &math_random_uniform(); - $hidden::RANDOMINIT=1; - } - if (!defined($step)) { $step=1; } - my $num=1+int(($end-$start)/$step); - my $result=$start + int(&math_random_uniform() * $num)*$step; - return $result; + my ($start,$end,$step)=@_; + if ( ! $hidden::RANDOMINIT ) { + if ($external::randomseed == 0) { $external::randomseed=1; } + if ($external::randomseed =~/,/) { + my ($num1,$num2)=split(/,/,$seed); + &random_set_seed(abs($num1),abs($num2)); + } else { + &random_set_seed(1,int(abs($external::randomseed))); + } + &math_random_uniform(); + $hidden::RANDOMINIT=1; + } + if (!defined($step)) { $step=1; } + my $num=1+int(($end-$start)/$step); + my $result=$start + int(&math_random_uniform() * $num)*$step; + return $result; } sub random_normal { From lon-capa-cvs@mail.lon-capa.org Wed Apr 30 22:13:57 2003 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Wed, 30 Apr 2003 21:13:57 -0000 Subject: [LON-CAPA-cvs] cvs: rat / lonuserstate.pm Message-ID: albertel Wed Apr 30 17:13:57 2003 EDT Modified files: /rat lonuserstate.pm Log: - understands new rndseed setup Index: rat/lonuserstate.pm diff -u rat/lonuserstate.pm:1.57 rat/lonuserstate.pm:1.58 --- rat/lonuserstate.pm:1.57 Tue Mar 25 17:50:14 2003 +++ rat/lonuserstate.pm Wed Apr 30 17:13:57 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # Construct and maintain state and binary representation of course for user # -# $Id: lonuserstate.pm,v 1.57 2003/03/25 22:50:14 albertel Exp $ +# $Id: lonuserstate.pm,v 1.58 2003/04/30 21:13:57 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -443,7 +443,7 @@ my (undef,$id)=split(/\./,$rid); if ($randompickseed{$rid}) { $id=$randompickseed{$rid}; } my $rndseed=&Apache::lonnet::rndseed($id); # use id instead of symb - &Math::Random::random_set_seed_from_phrase($rndseed); + &Apache::lonnet::setup_random_from_rndseed($rndseed); my @whichids=&Math::Random::random_permuted_index($#currentrids+1); for (my $i=1;$i<=$rndpick;$i++) { $currentrids[$whichids[$i]]=''; } #&Apache::lonnet::logthis("$id,$rndseed,".join(':',@whichids)); From lon-capa-cvs@mail.lon-capa.org Wed Apr 30 22:19:13 2003 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Wed, 30 Apr 2003 21:19:13 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /homework response.pm Message-ID: This is a MIME encoded message --albertel1051737553 Content-Type: text/plain albertel Wed Apr 30 17:19:13 2003 EDT Modified files: /loncom/homework response.pm Log: - retabinate --albertel1051737553 Content-Type: text/plain Content-Disposition: attachment; filename="albertel-20030430171913.txt" Index: loncom/homework/response.pm diff -u loncom/homework/response.pm:1.72 loncom/homework/response.pm:1.73 --- loncom/homework/response.pm:1.72 Mon Apr 21 16:59:02 2003 +++ loncom/homework/response.pm Wed Apr 30 17:19:13 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # various response type definitons response definition # -# $Id: response.pm,v 1.72 2003/04/21 20:59:02 albertel Exp $ +# $Id: response.pm,v 1.73 2003/04/30 21:19:13 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -33,70 +33,70 @@ use strict; BEGIN { - &Apache::lonxml::register('Apache::response',('responseparam','parameter','dataresponse')); + &Apache::lonxml::register('Apache::response',('responseparam','parameter','dataresponse')); } sub start_response { - my ($parstack,$safeeval)=@_; - my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval); - if ($id eq '') { $id = $Apache::lonxml::curdepth; } - if ($#Apache::inputtags::import > -1) { - &Apache::lonxml::debug("Turning :$id: into"); - $id = join('_',@Apache::inputtags::import).'_'.$id; - &Apache::lonxml::debug("New :$id:"); - } - push (@Apache::inputtags::response,$id); - push (@Apache::inputtags::responselist,$id); - @Apache::inputtags::inputlist=(); - return $id; + my ($parstack,$safeeval)=@_; + my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval); + if ($id eq '') { $id = $Apache::lonxml::curdepth; } + if ($#Apache::inputtags::import > -1) { + &Apache::lonxml::debug("Turning :$id: into"); + $id = join('_',@Apache::inputtags::import).'_'.$id; + &Apache::lonxml::debug("New :$id:"); + } + push (@Apache::inputtags::response,$id); + push (@Apache::inputtags::responselist,$id); + @Apache::inputtags::inputlist=(); + return $id; } sub end_response { - pop @Apache::inputtags::response; - @Apache::inputtags::inputlist=(); - return ''; + pop @Apache::inputtags::response; + @Apache::inputtags::inputlist=(); + return ''; } sub start_hintresponse { - my ($parstack,$safeeval)=@_; - my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval); - if ($id eq '') { $id = $Apache::lonxml::curdepth; } - push (@Apache::inputtags::response,$id); - push (@Apache::inputtags::paramstack,[%Apache::inputtags::params]); - return $id; + my ($parstack,$safeeval)=@_; + my $id= &Apache::lonxml::get_param('id',$parstack,$safeeval); + if ($id eq '') { $id = $Apache::lonxml::curdepth; } + push (@Apache::inputtags::response,$id); + push (@Apache::inputtags::paramstack,[%Apache::inputtags::params]); + return $id; } sub end_hintresponse { - pop @Apache::inputtags::response; - if (defined($Apache::inputtags::paramstack[-1])) { - %Apache::inputtags::params= - @{ pop(@Apache::inputtags::paramstack) }; - } - return ''; + pop @Apache::inputtags::response; + if (defined($Apache::inputtags::paramstack[-1])) { + %Apache::inputtags::params= + @{ pop(@Apache::inputtags::paramstack) }; + } + return ''; } # used by response to set the non-safe space random number generator to something # that is stable and unique based on the part number and response number sub setrandomnumber { - my $rndseed; - if ($ENV{'request.state'} eq "construct") { - $rndseed=$ENV{'form.rndseed'}; - if (!$rndseed) { $rndseed=time; } - } else { - my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser(); - $rndseed=&Apache::lonnet::rndseed($symb,$courseid,$domain,$name); - } - &Apache::lonxml::debug("randseed $rndseed"); -# $rndseed=unpack("%32i",$rndseed); - $rndseed=$rndseed - +(&Apache::lonnet::numval($Apache::inputtags::part) << 10); - if (defined($Apache::inputtags::response['-1'])) { + my $rndseed; + if ($ENV{'request.state'} eq "construct") { + $rndseed=$ENV{'form.rndseed'}; + if (!$rndseed) { $rndseed=time; } + } else { + my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser(); + $rndseed=&Apache::lonnet::rndseed($symb,$courseid,$domain,$name); + } + &Apache::lonxml::debug("randseed $rndseed"); + # $rndseed=unpack("%32i",$rndseed); $rndseed=$rndseed - +&Apache::lonnet::numval($Apache::inputtags::response['-1']); - } - &Math::Random::random_set_seed_from_phrase($rndseed); - &Apache::lonxml::debug("randseed $rndseed"); - return ''; + +(&Apache::lonnet::numval($Apache::inputtags::part) << 10); + if (defined($Apache::inputtags::response['-1'])) { + $rndseed=$rndseed + +&Apache::lonnet::numval($Apache::inputtags::response['-1']); + } + &Math::Random::random_set_seed_from_phrase($rndseed); + &Apache::lonxml::debug("randseed $rndseed"); + return ''; } sub meta_parameter_write { @@ -104,8 +104,8 @@ my $partref=$Apache::inputtags::part; my $result=''."\n"; return $result; @@ -131,8 +131,8 @@ my $partref=$Apache::inputtags::part; my $result = ' skip here @@ -172,157 +172,153 @@ } sub check_for_previous { - my ($curresponse,$partid,$id) = @_; - my %previous; - $previous{'used'} = 0; - foreach my $key (sort(keys(%Apache::lonhomework::history))) { - if ($key =~ /resource\.$partid\.$id\.submission/) { - &Apache::lonxml::debug("Trying $key"); - my $pastresponse=$Apache::lonhomework::history{$key}; - if ($pastresponse eq $curresponse) { - $previous{'used'} = 1; - my $history; - if ( $key =~ /^(\d+):/ ) { - $history=$1; - $previous{'award'} = $Apache::lonhomework::history{"$history:resource.$partid.$id.awarddetail"}; - $previous{'last'}='0'; - push(@{ $previous{'version'} },$history); - } else { - $previous{'award'} = $Apache::lonhomework::history{"resource.$partid.$id.awarddetail"}; - $previous{'last'}='1'; + my ($curresponse,$partid,$id) = @_; + my %previous; + $previous{'used'} = 0; + foreach my $key (sort(keys(%Apache::lonhomework::history))) { + if ($key =~ /resource\.$partid\.$id\.submission/) { + &Apache::lonxml::debug("Trying $key"); + my $pastresponse=$Apache::lonhomework::history{$key}; + if ($pastresponse eq $curresponse) { + $previous{'used'} = 1; + my $history; + if ( $key =~ /^(\d+):/ ) { + $history=$1; + $previous{'award'} = $Apache::lonhomework::history{"$history:resource.$partid.$id.awarddetail"}; + $previous{'last'}='0'; + push(@{ $previous{'version'} },$history); + } else { + $previous{'award'} = $Apache::lonhomework::history{"resource.$partid.$id.awarddetail"}; + $previous{'last'}='1'; + } + if (! $previous{'award'} ) { $previous{'award'} = 'UNKNOWN'; } + &Apache::lonxml::debug("got a match :$previous{'award'}:$previous{'used'}:"); + } } - if (! $previous{'award'} ) { $previous{'award'} = 'UNKNOWN'; } - &Apache::lonxml::debug("got a match :$previous{'award'}:$previous{'used'}:"); - } - } - } - &Apache::lonhomework::showhash(%previous); - return %previous; + } + &Apache::lonhomework::showhash(%previous); + return %previous; } sub handle_previous { - my ($previous,$ad)=@_; - if ($$previous{'used'} && ($$previous{'award'} eq $ad) ) { - if ($$previous{'last'}) { - push(@Apache::inputtags::previous,'PREVIOUSLY_LAST'); - } else { - push(@Apache::inputtags::previous,'PREVIOUSLY_USED'); + my ($previous,$ad)=@_; + if ($$previous{'used'} && ($$previous{'award'} eq $ad) ) { + if ($$previous{'last'}) { + push(@Apache::inputtags::previous,'PREVIOUSLY_LAST'); + } else { + push(@Apache::inputtags::previous,'PREVIOUSLY_USED'); + } + push(@Apache::inputtags::previous_version,$$previous{'version'}); } - push(@Apache::inputtags::previous_version,$$previous{'version'}); - } } sub view_or_modify { - my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser(); - my $myself=0; - if ( ($name eq $ENV{'user.name'}) && ($domain eq $ENV{'user.domain'}) ) { - $myself=1; - } - my $vgr=&Apache::lonnet::allowed('vgr',$courseid); - my $mgr=&Apache::lonnet::allowed('vgr',$courseid); - if ($mgr) { return "M"; } - if ($vgr) { return "V"; } - if ($myself) { return "V"; } - return ''; + my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser(); + my $myself=0; + if ( ($name eq $ENV{'user.name'}) && ($domain eq $ENV{'user.domain'}) ) { + $myself=1; + } + my $vgr=&Apache::lonnet::allowed('vgr',$courseid); + my $mgr=&Apache::lonnet::allowed('vgr',$courseid); + if ($mgr) { return "M"; } + if ($vgr) { return "V"; } + if ($myself) { return "V"; } + return ''; } sub start_dataresponse { - my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; - my $id = &Apache::response::start_response($parstack,$safeeval); - my $result; - if ($target eq 'web') { - $result = $token->[2]->{'display'}.':'; - } elsif ($target eq 'meta') { - $result = &Apache::response::meta_stores_write($token->[2]->{'name'}, - $token->[2]->{'type'}, - $token->[2]->{'display'}); - $result .= &Apache::response::meta_package_write('dataresponse'); - } - return $result; + my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; + my $id = &Apache::response::start_response($parstack,$safeeval); + my $result; + if ($target eq 'web') { + $result = $token->[2]->{'display'}.':'; + } elsif ($target eq 'meta') { + $result = &Apache::response::meta_stores_write($token->[2]->{'name'}, + $token->[2]->{'type'}, + $token->[2]->{'display'}); + $result .= &Apache::response::meta_package_write('dataresponse'); + } + return $result; } sub end_dataresponse { - my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; - my $result; - if ( $target eq 'web' ) { - } elsif ($target eq 'grade' ) { - if ( defined $ENV{'form.submitted'}) { - my ($symb,$courseid,$domain,$name)=&Apache::lonxml::whichuser(); - my $allowed=&Apache::lonnet::allowed('mgr',$courseid); - if ($allowed) { - &Apache::response::setup_params('dataresponse'); - my $partid = $Apache::inputtags::part; - my $id = $Apache::inputtags::response['-1']; - my $response = $ENV{'form.HWVAL_'.$id}; - my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval); - if ( $response =~ /[^\s]/) { - $Apache::lonhomework::results{"resource.$partid.$id.$name"}= - $response; - $Apache::lonhomework::results{ - "resource.$partid.$id.submission"}= - $response; - $Apache::lonhomework::results{ - "resource.$partid.$id.awarddetail"}= - 'SUBMITTED'; + my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; + my $result; + if ( $target eq 'web' ) { + } elsif ($target eq 'grade' ) { + if ( defined $ENV{'form.submitted'}) { + my ($symb,$courseid,$domain,$name)=&Apache::lonxml::whichuser(); + my $allowed=&Apache::lonnet::allowed('mgr',$courseid); + if ($allowed) { + &Apache::response::setup_params('dataresponse'); + my $partid = $Apache::inputtags::part; + my $id = $Apache::inputtags::response['-1']; + my $response = $ENV{'form.HWVAL_'.$id}; + my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval); + if ( $response =~ /[^\s]/) { + $Apache::lonhomework::results{"resource.$partid.$id.$name"}=$response; + $Apache::lonhomework::results{"resource.$partid.$id.submission"}=$response; + $Apache::lonhomework::results{"resource.$partid.$id.awarddetail"}='SUBMITTED'; + } + } else { + $result='Not Permitted to change values.' + } } - } else { - $result='Not Permitted to change values.' - } - } - } - &Apache::response::end_response; - return $result; + } + &Apache::response::end_response; + return $result; } sub start_responseparam { - my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; - my $result=''; - if ($target eq 'meta') { - $result = &meta_parameter_write($token->[2]->{'name'}, - $token->[2]->{'type'}, - $token->[2]->{'default'}, - $token->[2]->{'description'}); - } elsif ($target eq 'edit') { - $result.=&Apache::edit::tag_start($target,$token); - $result.=&Apache::edit::text_arg('Name:','name',$token). - &Apache::edit::text_arg('Type:','type',$token). - &Apache::edit::text_arg('Description:','description',$token). - &Apache::edit::text_arg('Default:','default',$token). - ""; - $result.=&Apache::edit::end_table; - } elsif ($target eq 'modified') { - my $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval, - 'name','type','description', - 'default'); - if ($constructtag) { - $result = &Apache::edit::rebuild_tag($token); - $result.=&Apache::edit::handle_insert(); - } - } elsif ($target eq 'grade' || $target eq 'answer' || $target eq 'web' || - $target eq 'tex' || $target eq 'analyze' ) { - if ($ENV{'request.state'} eq 'construct') { - my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval); - my $default = &Apache::lonxml::get_param('default',$parstack,$safeeval); - if ($name) {$Apache::inputtags::params{$name}=$default;} + my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; + my $result=''; + if ($target eq 'meta') { + $result = &meta_parameter_write($token->[2]->{'name'}, + $token->[2]->{'type'}, + $token->[2]->{'default'}, + $token->[2]->{'description'}); + } elsif ($target eq 'edit') { + $result.=&Apache::edit::tag_start($target,$token); + $result.=&Apache::edit::text_arg('Name:','name',$token). + &Apache::edit::text_arg('Type:','type',$token). + &Apache::edit::text_arg('Description:','description',$token). + &Apache::edit::text_arg('Default:','default',$token). + ""; + $result.=&Apache::edit::end_table; + } elsif ($target eq 'modified') { + my $constructtag=&Apache::edit::get_new_args($token,$parstack,$safeeval, + 'name','type','description', + 'default'); + if ($constructtag) { + $result = &Apache::edit::rebuild_tag($token); + $result.=&Apache::edit::handle_insert(); + } + } elsif ($target eq 'grade' || $target eq 'answer' || $target eq 'web' || + $target eq 'tex' || $target eq 'analyze' ) { + if ($ENV{'request.state'} eq 'construct') { + my $name =&Apache::lonxml::get_param('name',$parstack,$safeeval); + my $default=&Apache::lonxml::get_param('default',$parstack, + $safeeval); + if ($name) {$Apache::inputtags::params{$name}=$default;} + } } - } - return $result; + return $result; } sub end_responseparam { - my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; - if ($target eq 'edit') { return ('','no'); } - return ''; + my ($target,$token,$tagstack,$parstack,$parser,$safeeval)=@_; + if ($target eq 'edit') { return ('','no'); } + return ''; } sub start_parameter { - my $result = &start_responseparam(@_); - return $result; + my $result = &start_responseparam(@_); + return $result; } sub end_parameter { - my $result = &end_responseparam(@_); - return $result; + my $result = &end_responseparam(@_); + return $result; } sub reset_params { @@ -330,77 +326,77 @@ } sub setup_params { - my ($tag) = @_; + my ($tag) = @_; - if ($ENV{'request.state'} eq 'construct') { return; } - my %paramlist=(); - foreach my $key (keys(%Apache::lonnet::packagetab)) { - if ($key =~ /^$tag/) { - my ($package,$name) = split(/&/,$key); - $paramlist{$name}=1; - } - } - foreach my $key (keys(%paramlist)) { - my $entry= 'resource.'.$Apache::inputtags::part; - if (defined($Apache::inputtags::response[-1])) { - $entry.='_'.$Apache::inputtags::response[-1]; + if ($ENV{'request.state'} eq 'construct') { return; } + my %paramlist=(); + foreach my $key (keys(%Apache::lonnet::packagetab)) { + if ($key =~ /^$tag/) { + my ($package,$name) = split(/&/,$key); + $paramlist{$name}=1; + } } - $entry.='.'.$key; - &Apache::lonxml::debug("looking for $entry"); - my $value = &Apache::lonnet::EXT("$entry"); - &Apache::lonxml::debug("$key has value :$value:"); - if ($value eq 'con_lost' || $value =~ /^error:/) { - &Apache::lonxml::debug("using nothing"); - $Apache::inputtags::params{$key}=''; - } else { - &Apache::lonxml::debug("using value"); - $Apache::inputtags::params{$key}=$value; + foreach my $key (keys(%paramlist)) { + my $entry= 'resource.'.$Apache::inputtags::part; + if (defined($Apache::inputtags::response[-1])) { + $entry.='_'.$Apache::inputtags::response[-1]; + } + $entry.='.'.$key; + &Apache::lonxml::debug("looking for $entry"); + my $value = &Apache::lonnet::EXT("$entry"); + &Apache::lonxml::debug("$key has value :$value:"); + if ($value eq 'con_lost' || $value =~ /^error:/) { + &Apache::lonxml::debug("using nothing"); + $Apache::inputtags::params{$key}=''; + } else { + &Apache::lonxml::debug("using value"); + $Apache::inputtags::params{$key}=$value; + } } - } } sub answer_header { - my ($type) = @_; - my $result; - if ($type eq 'optionresponse' || $type eq 'radiobuttonresponse' ) { - $result = ''."\n"; - } else { - $result = '
    Answer for Part:'. - $Apache::inputtags::part. '
    '."\n"; - } - return $result; + my ($type) = @_; + my $result; + if ($type eq 'optionresponse' || $type eq 'radiobuttonresponse' ) { + $result = '
    Answer for Part:'. - $Apache::inputtags::part. '
    '."\n"; + } else { + $result = '
    Answer for Part:'. + $Apache::inputtags::part. '
    '."\n"; + } + return $result; } sub answer_part { - my ($type,$answer) = @_; - my $result; - if ($type eq 'optionresponse' || $type eq 'radiobuttonresponse') { - $result = ''; - } else { - $result = ''; - } - return $result; + my ($type,$answer) = @_; + my $result; + if ($type eq 'optionresponse' || $type eq 'radiobuttonresponse') { + $result = ''; + } else { + $result = ''; + } + return $result; } sub answer_footer { - my ($type) = @_; - my $result; - if ($type eq 'optionresponse' || $type eq 'radiobuttonresponse') { - $result = '
    Answer for Part:'. + $Apache::inputtags::part. ''.$answer.''.$answer.''.$answer.''.$answer.'
    '; - } else { - $result = ''; - } - return $result; + my ($type) = @_; + my $result; + if ($type eq 'optionresponse' || $type eq 'radiobuttonresponse') { + $result = ''; + } else { + $result = ''; + } + return $result; } sub showallfoils { - my $return=0; - if (defined($ENV{'form.showallfoils'}) && - $ENV{'request.state'} eq 'construct') { - $return=1; - } - return $return; + my $return=0; + if (defined($ENV{'form.showallfoils'}) && + $ENV{'request.state'} eq 'construct') { + $return=1; + } + return $return; } sub getresponse { --albertel1051737553-- From lon-capa-cvs@mail.lon-capa.org Wed Apr 30 22:23:45 2003 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Wed, 30 Apr 2003 21:23:45 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /homework response.pm Message-ID: albertel Wed Apr 30 17:23:45 2003 EDT Modified files: /loncom/homework response.pm Log: - response uses/understands new larger seed Index: loncom/homework/response.pm diff -u loncom/homework/response.pm:1.73 loncom/homework/response.pm:1.74 --- loncom/homework/response.pm:1.73 Wed Apr 30 17:19:13 2003 +++ loncom/homework/response.pm Wed Apr 30 17:23:45 2003 @@ -1,7 +1,7 @@ # The LearningOnline Network with CAPA # various response type definitons response definition # -# $Id: response.pm,v 1.73 2003/04/30 21:19:13 albertel Exp $ +# $Id: response.pm,v 1.74 2003/04/30 21:23:45 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -83,18 +83,23 @@ $rndseed=$ENV{'form.rndseed'}; if (!$rndseed) { $rndseed=time; } } else { - my ($symb,$courseid,$domain,$name) = &Apache::lonxml::whichuser(); - $rndseed=&Apache::lonnet::rndseed($symb,$courseid,$domain,$name); + $rndseed=&Apache::lonnet::rndseed(); } &Apache::lonxml::debug("randseed $rndseed"); # $rndseed=unpack("%32i",$rndseed); - $rndseed=$rndseed - +(&Apache::lonnet::numval($Apache::inputtags::part) << 10); + my $rndmod=(&Apache::lonnet::numval($Apache::inputtags::part) << 10); if (defined($Apache::inputtags::response['-1'])) { - $rndseed=$rndseed - +&Apache::lonnet::numval($Apache::inputtags::response['-1']); + $rndmod+=&Apache::lonnet::numval($Apache::inputtags::response[-1]); } - &Math::Random::random_set_seed_from_phrase($rndseed); + if ($rndseed =~/,/) { + my ($num1,$num2)=split(/,/,$rndseed); + $num1+=$rndmod; + $num2+=$rndmod; + $rndseed="$num1,$num2"; + } else { + $rndseed+=$rndmod; + } + &Apache::lonnet::setup_random_from_rndseed($rndseed); &Apache::lonxml::debug("randseed $rndseed"); return ''; } From lon-capa-cvs@mail.lon-capa.org Wed Apr 30 22:26:47 2003 From: lon-capa-cvs@mail.lon-capa.org (albertel) Date: Wed, 30 Apr 2003 21:26:47 -0000 Subject: [LON-CAPA-cvs] cvs: loncom /html/res/adm/pages menu.html Message-ID: This is a MIME encoded message --albertel1051738007 Content-Type: text/plain albertel Wed Apr 30 17:26:47 2003 EDT Modified files: /loncom/html/res/adm/pages menu.html Log: - now w3c valid --albertel1051738007 Content-Type: text/plain Content-Disposition: attachment; filename="albertel-20030430172647.txt" Index: loncom/html/res/adm/pages/menu.html diff -u loncom/html/res/adm/pages/menu.html:1.95 loncom/html/res/adm/pages/menu.html:1.96 --- loncom/html/res/adm/pages/menu.html:1.95 Sat Apr 12 11:58:43 2003 +++ loncom/html/res/adm/pages/menu.html Wed Apr 30 17:26:47 2003 @@ -4,7 +4,7 @@ Remote Control // -// $Id: menu.html,v 1.95 2003/04/12 15:58:43 www Exp $ +// $Id: menu.html,v 1.96 2003/04/30 21:26:47 albertel Exp $ // // Copyright Michigan State University Board of Trustees // @@ -39,7 +39,6 @@ onUnload="collapse();" onLoad="activate();" > - @@ -98,8 +111,33 @@ $molecule=&Apache::lonxml::get_param('molecule',$parstack, $safeeval); } - $result=&seperate_jme_window($id,$molecule); + $result=&seperate_jme_window("HWVAL_$id","MOLECULE_$id",$molecule); $result.= ''; + } elsif ($target eq 'edit') { + $result .=&Apache::edit::tag_start($target,$token); + $result .=&Apache::edit::text_arg('Starting Molecule:','molecule', + $token,40); + my $molecule=&Apache::lonxml::get_param('molecule',$parstack, + $safeeval); + $result .=&seperate_jme_window(undef, + &Apache::edit::html_element_name('molecule'), + $molecule); + $result .='
    '; + $result .=&Apache::edit::text_arg('Correct Answer:','answer', + $token,40); + $result .=&Apache::edit::hidden_arg('jmeanswer',$token); + my $jmeanswer=&Apache::lonxml::get_param('jmeanswer',$parstack, + $safeeval); + $result .=&seperate_jme_window( + &Apache::edit::html_element_name('answer'), + &Apache::edit::html_element_name('jmeanswer'), + $jmeanswer); + $result .=&Apache::edit::end_row().&Apache::edit::start_spanning_row(); + } elsif ($target eq 'modified') { + my $constructtag=&Apache::edit::get_new_args($token,$parstack, + $safeeval,'molecule', + 'answer','jmeanswer'); + if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); } } return $result; } @@ -127,6 +165,8 @@ $Apache::lonhomework::results{"resource.$partid.$id.awarddetail"}=$ad; $Apache::lonhomework::results{"resource.$partid.$id.molecule"}=$ENV{"form.MOLECULE_$id"}; } + } elsif ($target eq "edit") { + $result.= &Apache::edit::tag_end($target,$token,''); } &Apache::response::end_response; return $result;