Diff for /capa/capa51/GUITools/capastats.tcl between versions 1.14 and 1.18

version 1.14, 2000/03/22 21:08:02 version 1.18, 2000/10/17 18:28:24
Line 1 Line 1
   # capastatistics generator
   #  Copyright (C) 1992-2000 Michigan State University
   #
   #  The CAPA system 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.
   #
   #  The CAPA system 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 the CAPA system; see the file COPYING.  If not,
   #  write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   #  Boston, MA 02111-1307, USA.
   #
   #  As a special exception, you have permission to link this program
   #  with the TtH/TtM library and distribute executables, as long as you
   #  follow the requirements of the GNU GPL in regard to all of the
   #  software in the executable aside from TtH/TtM.
   
 ###########################################################  ###########################################################
 # runCapaTools  # runCapaTools
 ###########################################################  ###########################################################
Line 28  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 Record" -command \
  "CTstartStudentCourseProfile $num"   "CTstartStudentCourseProfile $num"
     $utilsMenu add command -label "CAPA IDs for one student" \      $utilsMenu add command -label "CAPA IDs for one student" \
  -command "CToneStudentCapaID $num"   -command "CToneStudentCapaID $num"
Line 100  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 2856  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 2869  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 2881  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 2944  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.14  
changed lines
  Added in v.1.18


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