Diff for /capa/capa51/GUITools/capastats.tcl between versions 1.16 and 1.17

version 1.16, 2000/08/07 20:47:29 version 1.17, 2000/09/20 19:01:53
Line 51  proc runCapaTools { classDirConfigFile } Line 51  proc runCapaTools { classDirConfigFile }
   
     $utilsMenu add command -label "Change Class path" -command "CTchangePath $num"      $utilsMenu add command -label "Change Class path" -command "CTchangePath $num"
     $utilsMenu add command -label "Run capastat" -command "CTcapaStat $num"      $utilsMenu add command -label "Run capastat" -command "CTcapaStat $num"
     $utilsMenu add command -label "Run capastat2" -command "CTcapaStat2 $num"      $utilsMenu add command -label "Time Range capastat" -command "CTcapaStat2 $num"
     $utilsMenu add command -label "Summarize Log files" -command "CTlogAnalysis $num"      $utilsMenu add command -label "Summarize Log files" -command "CTlogAnalysis $num"
     $utilsMenu add command -label "Student Course Profile" -command \      $utilsMenu add command -label "Student Course Profile" -command \
  "CTstartStudentCourseProfile $num"   "CTstartStudentCourseProfile $num"
Line 123  proc CTcapaStat2 { num } { Line 123  proc CTcapaStat2 { num } {
   set start [lindex $day 0]    set start [lindex $day 0]
   set startf [clock format [lindex $day 0] -format "%b %d %R %Y"]    set startf [clock format [lindex $day 0] -format "%b %d %R %Y"]
   set end [lindex $day 1]    set end [lindex $day 1]
   set endf [clock format [lindex $day 0] -format "%b %d %R %Y"]    set endf [clock format [lindex $day 1] -format "%b %d %R %Y"]
   set file [file join $gFile($num) records "subset$setId.db"]    set file [file join $gFile($num) records "subset$setId.db"]
   displayStatus "Generating [file tail $file]" both $cmdnum        displayStatus "Generating [file tail $file]" both $cmdnum    
   CTcreateSubset $num $cmdnum $start $end $setId    CTcreateSubset $num $cmdnum $start $end $setId
Line 2879  proc updateDate { type cmdnum args } { Line 2879  proc updateDate { type cmdnum args } {
 proc CTgetWhen { num cmdnum setId } {  proc CTgetWhen { num cmdnum setId } {
     global gFile gCT gPromptGDR      global gFile gCT gPromptGDR
   
     set firstsection [exec head [file join $gFile($num) records log$setId.db]]      catch {set firstsection [exec head [file join $gFile($num) records log$setId.db]]}
     append firstsection [exec head [file join $gFile($num) records weblog$setId.db]]      catch {append firstsection [exec head [file join $gFile($num) records weblog$setId.db]]}
     set lastsection [exec tail [file join $gFile($num) records log$setId.db]]      catch {set lastsection [exec tail [file join $gFile($num) records log$setId.db]]}
     append lastsection [exec tail [file join $gFile($num) records weblog$setId.db]]      catch {append lastsection [exec tail [file join $gFile($num) records weblog$setId.db]]}
   
     set earliest -1      set earliest -1
     foreach line [split $firstsection \n] {      foreach line [split $firstsection \n] {
Line 2892  proc CTgetWhen { num cmdnum setId } { Line 2892  proc CTgetWhen { num cmdnum setId } {
  if { $date < $earliest } { set earliest $date }   if { $date < $earliest } { set earliest $date }
     }      }
     if { $earliest == -1 } {       if { $earliest == -1 } { 
  file stat [file join $gFile($num) records log$setId.db] stat   catch {
  set earliest $stat(ctime)      file stat [file join $gFile($num) records log$setId.db] stat
       set earliest $stat(ctime)
    }
    catch {
       file stat [file join $gFile($num) records log$setId.db] stat
       if {($earliest ==-1) || ($stat(ctime) < $earliest)} {
    set earliest $stat(ctime)
       }
    }
     }      }
   
     set latest 0       set latest 0 
     foreach line [split $lastsection \n] {      foreach line [split $lastsection \n] {
  if { [catch {set date [clock scan [string range $line 10 33]]}]} {set date 0}   if { [catch {set date [clock scan [string range $line 10 33]]}]} {set date 0}
Line 2904  proc CTgetWhen { num cmdnum setId } { Line 2911  proc CTgetWhen { num cmdnum setId } {
  if { $date > $latest } { set latest $date }   if { $date > $latest } { set latest $date }
     }      }
     if { $latest == 0 } {       if { $latest == 0 } { 
  file stat [file join $gFile($num) records log$setId.db] stat   catch {
  set latest $stat(mtime)      file stat [file join $gFile($num) records log$setId.db] stat
       set latest $stat(mtime)
    }
    catch {
       file stat [file join $gFile($num) records log$setId.db] stat
       if { $latest == 0 } { set latest $date }
       if { $stat(mtime) > $latest } { set latest $date }
    }
     }      }
     #puts "$latest $earliest"      #puts "$latest $earliest"
   
Line 2967  proc CTgetWhen { num cmdnum setId } { Line 2981  proc CTgetWhen { num cmdnum setId } {
 ###########################################################  ###########################################################
 proc CTscanDB { num file outId startdate enddate } {  proc CTscanDB { num file outId startdate enddate } {
     global answerArray exist      global answerArray exist
     if {[catch {set fileId [open $file r]}]} { retun 0 }      if {[catch {set fileId [open $file r]}]} { return 0 }
     set Yes_cnt 0       set Yes_cnt 0 
     set No_cnt 0      set No_cnt 0
     set line_cnt 0      set line_cnt 0

Removed from v.1.16  
changed lines
  Added in v.1.17


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>