Diff for /capa/capa51/GUITools/capastats.tcl between versions 1.3 and 1.8

version 1.3, 1999/10/18 20:58:33 version 1.8, 2000/01/05 21:11:15
Line 41  proc runCapaTools { classDirConfigFile } Line 41  proc runCapaTools { classDirConfigFile }
 #    $utilsMenu add command -label "Email" -command ""  #    $utilsMenu add command -label "Email" -command ""
 #    $utilsMenu add command -label "View Score File" -command ""  #    $utilsMenu add command -label "View Score File" -command ""
     $utilsMenu add command -label "View Submissions" -command "CTsubmissions $num"      $utilsMenu add command -label "View Submissions" -command "CTsubmissions $num"
       $utilsMenu add command -label "Create a Class Report" -command "CTcreateReport $num"
     $utilsMenu add command -label "Analyze Class Report" -command "CTanalyzeReport $num"      $utilsMenu add command -label "Analyze Class Report" -command "CTanalyzeReport $num"
     $utilsMenu add command -label "Analyze Responses" -command "CTanalyzeScorer $num"      $utilsMenu add command -label "Analyze Responses" -command "CTanalyzeScorer $num"
     $utilsMenu add command -label "Graph a Responses Analysis" -command "CTgraphAnalyzeScorer $num"      $utilsMenu add command -label "Graph a Responses Analysis" -command "CTgraphAnalyzeScorer $num"
Line 300  proc CTitemAnalysisStart { num } { Line 301  proc CTitemAnalysisStart { num } {
     unset gCT(cmd.$cmdnum)      unset gCT(cmd.$cmdnum)
  return   return
     }      }
     if { [set sets [getSetRange $gCT($num) $gFile($num)]] == "" } {       if { [set sets [getSetRange $gCT($num) [lindex $select 1]]] == "" } { 
  unset gCT(cmd.$cmdnum)   unset gCT(cmd.$cmdnum)
  return    return 
     }      }
Line 338  proc CTitemCorrelationStart { num } { Line 339  proc CTitemCorrelationStart { num } {
     unset gCT(cmd.$cmdnum)      unset gCT(cmd.$cmdnum)
  return   return
     }      }
     if { [set setId [getOneSet $gCT($num) $gFile($num)]] == "" } {       if { [set setId [getOneSet $gCT($num) [lindex $select 1]]] == "" } { 
  unset gCT(cmd.$cmdnum)   unset gCT(cmd.$cmdnum)
  return    return 
     }      }
Line 371  proc CTsubmissions { num } { Line 372  proc CTsubmissions { num } {
 }  }
   
 ###########################################################  ###########################################################
   # CTcreateReport
   ###########################################################
   ###########################################################
   ###########################################################
   proc CTcreateReport { num } {
       global gUniqueNumber gCT gFile
   
       set cmdnum [incr gUniqueNumber]
       set gCT(cmd.$cmdnum) createreport
       CTcreateReportDialog $num $cmdnum
   }
   
   ###########################################################
 # CTanalyzeReport  # CTanalyzeReport
 ###########################################################  ###########################################################
 ###########################################################  ###########################################################
Line 1511  proc CTitemCorrelation { num classpath s Line 1525  proc CTitemCorrelation { num classpath s
     updateStatusBar [expr {$line_cnt/double($maxLine)}] $num      updateStatusBar [expr {$line_cnt/double($maxLine)}] $num
  }   }
  if { $line_cnt == 2 } {    if { $line_cnt == 2 } { 
     set aline [string trim $aline]      set aline [string trimright $aline]
     set weights [split $aline {}]      set weights [split $aline {}]
  }    } 
  if { $line_cnt > 3} {   if { $line_cnt > 3} {
     set aline [string trim $aline]      set aline [string trimright $aline]
     set data  [string range $aline 10 end]      set data  [string range $aline 10 end]
     set ans_str [lindex [split $data ","] 0]      set ans_str [lindex [split $data ","] 0]
     set ans_char_list [split $ans_str {} ]      set ans_char_list [split $ans_str {} ]
Line 1576  proc CTitemCorrelation { num classpath s Line 1590  proc CTitemCorrelation { num classpath s
     close $fileId      close $fileId
     removeStatus $num      removeStatus $num
     # print out the correlation matrix      # print out the correlation matrix
 #    parray sum_x      #parray sum_x
 #    parray sum_y      #parray sum_y
 #    parray prod_xy      #parray prod_xy
       #puts $question_cnt
     CTputs $num "   "      CTputs $num "   "
     for { set ii 1 } { $ii < $question_cnt } { incr ii } {      for { set ii 1 } { $ii < $question_cnt } { incr ii } {
  CTputs $num [format "    %2d" [expr {$ii+1}] ]   CTputs $num [format "    %2d" [expr {$ii+1}] ]
Line 1938  proc CToutput { num cmdnum } { Line 1953  proc CToutput { num cmdnum } {
  pack $buttonFrame.wrap $buttonFrame.save $buttonFrame.print \   pack $buttonFrame.wrap $buttonFrame.save $buttonFrame.print \
     $buttonFrame.dismiss -side left      $buttonFrame.dismiss -side left
     }      }
     set index [$gCT($num.output) index end]      set index [$gCT($num.output) index end-1c]
     foreach line $gCT(output.$cmdnum) {      foreach line $gCT(output.$cmdnum) {
  eval $gCT($num.output) insert end $line   eval $gCT($num.output) insert end $line
     }      }
Line 2208  proc CTdrawBargraph { num } { Line 2223  proc CTdrawBargraph { num } {
  if { [set color [lindex $datum 3]] == "" } {set color $gBarGraph($num.color)}   if { [set color [lindex $datum 3]] == "" } {set color $gBarGraph($num.color)}
  if { $gBarGraph($num.bucketscores) && ($i % $howoften == $when) } {   if { $gBarGraph($num.bucketscores) && ($i % $howoften == $when) } {
     if { $i == $when } {      if { $i == $when } {
  puts "$value-$which-$howoften"  # puts "$value-$which-$howoften"
  $canvas create rectangle $textwidth \   $canvas create rectangle $textwidth \
     $y1 $x2 $y2 -fill $color -tag $tag      $y1 $x2 $y2 -fill $color -tag $tag
     } else {      } else {
  puts "$value:$which:$howoften"  # puts "$value:$which:$howoften"
  $canvas create rectangle [expr {$eachwidth*($i-$howoften+1)+$textwidth}]\   $canvas create rectangle [expr {$eachwidth*($i-$howoften+1)+$textwidth}]\
     $y1 $x2 $y2 -fill $color -tag $tag      $y1 $x2 $y2 -fill $color -tag $tag
     }      }
Line 2728  proc CTputsDiscussResults { num resultsV Line 2743  proc CTputsDiscussResults { num resultsV
  }   }
     }      }
     CTputs $num "Overall Unique #viewers: $result($num.viewers)\n"      CTputs $num "Overall Unique #viewers: $result($num.viewers)\n"
   }
   
   ###########################################################
   # CTcreateReportDialog
   ###########################################################
   ###########################################################
   ###########################################################
   proc CTcreateReportDialog { num cmdnum } {
       global gCT gFile
   
       
       set gCT(summary.section.$cmdnum) 1
       set gCT(summary.set.$cmdnum) 1
   
       set summary [toplevel $gCT($num).summary]
       set whoFrame [frame $summary.whoFrame -borderwidth 4 -relief groove]
       set whichFrame [frame $summary.whichFrame -borderwidth 4 -relief groove]
       set sortFrame [frame $summary.sortFrame]
       set file2Frame [frame $summary.file2Frame]
       set buttonFrame [frame $summary.buttonFrame]
       pack $whoFrame $whichFrame $sortFrame $file2Frame $buttonFrame -side top
       pack configure $whoFrame $whichFrame -padx 10 -pady 10
   
       set sectionFrame [frame $whoFrame.section]
       set allFrame [frame $whoFrame.all]
       pack $sectionFrame $allFrame -side top
   
       set gCT(summary.who.$cmdnum) section
   
       radiobutton $sectionFrame.section -text \
       "For students in default section:" -variable gCT(summary.who.$cmdnum) \
       -value section 
       entry $sectionFrame.entry -textvariable gCT(summary.section.$cmdnum) -width 3 
       pack $sectionFrame.section $sectionFrame.entry -side left
   
       radiobutton $allFrame.all -text "For all students in the class" \
       -variable gCT(summary.who.$cmdnum) -value all 
       pack $allFrame.all
   
       set sectionFrame [frame $whichFrame.section]
       set allFrame [frame $whichFrame.all]
       pack $sectionFrame $allFrame -side top
   
       set gCT(summary.which.$cmdnum) specific
   
       radiobutton $sectionFrame.section -text "For set:" \
       -variable gCT(summary.which.$cmdnum) -value specific 
       entry $sectionFrame.entry -textvariable gCT(summary.set.$cmdnum) -width 3 
       pack $sectionFrame.section $sectionFrame.entry -side left
   
       radiobutton $allFrame.all -text "For all sets up to:" -variable \
       gCT(summary.which.$cmdnum) -value upto 
       entry $allFrame.entry -textvariable gCT(summary.set.$cmdnum) -width 3 
       pack $allFrame.all $allFrame.entry -side left
   
       set firstFrame [frame $sortFrame.firstFrame -borderwidth 4 -relief groove]
       set secondFrame [frame $sortFrame.secondFrame -borderwidth 4 \
       -relief groove]
       pack $firstFrame $secondFrame -side left
   
       set gCT(summary.first.$cmdnum) name
   
       label $firstFrame.label -text "Sorting Order - Primary"
       radiobutton $firstFrame.name -text "Student Name" -variable \
       gCT(summary.first.$cmdnum) -value name
       radiobutton $firstFrame.number -text "Student Number" -variable \
       gCT(summary.first.$cmdnum) -value number
       radiobutton $firstFrame.section -text "Section" -variable \
       gCT(summary.first.$cmdnum) -value section
       radiobutton $firstFrame.grade -text "Grade" -variable gCT(summary.first.$cmdnum) \
       -value grade
       pack $firstFrame.label $firstFrame.name $firstFrame.number \
       $firstFrame.section $firstFrame.grade -side top -anchor w
   
       set gCT(summary.second.$cmdnum) number
   
       label $secondFrame.label -text "Sorting Order - Secondary"
       radiobutton $secondFrame.name -text "Student Name" -variable \
       gCT(summary.second.$cmdnum) -value name
       radiobutton $secondFrame.number -text "Student Number" -variable \
       gCT(summary.second.$cmdnum) -value number
       radiobutton $secondFrame.section -text "Section" -variable \
       gCT(summary.second.$cmdnum) -value section
       radiobutton $secondFrame.grade -text "Grade" -variable gCT(summary.second.$cmdnum) \
       -value grade
       pack $secondFrame.label $secondFrame.name $secondFrame.number \
       $secondFrame.section $secondFrame.grade -side top -anchor w
   
       set defaultFrame [frame $file2Frame.defaultFrame]
       set fileFrame [frame $file2Frame.fileFrame]
       pack $defaultFrame $fileFrame -side top
   
       set gCT(summary.filename.$cmdnum) default 
   
       radiobutton $defaultFrame.default -text "Grader Chooses File Name" \
    -variable gCT(summary.filename.$cmdnum) -value default
       pack $defaultFrame.default
   
       radiobutton $fileFrame.label -text "Specified Output File:" \
    -variable gCT(summary.filename.$cmdnum) -value specified
       set entryFrame [frame $fileFrame.entryFrame]
       button $fileFrame.select -text "Select File" \
       -command "CTselectOutputFile $cmdnum"
       pack $fileFrame.label $entryFrame $fileFrame.select -side left
       entry $entryFrame.entry -textvariable gCT(summary.file.$cmdnum) \
    -xscrollcommand "$entryFrame.scroll set"
       scrollbar $entryFrame.scroll -orient h -command \
       "$entryFrame.entry xview"
       pack $entryFrame.entry $entryFrame.scroll
       pack configure $entryFrame.scroll -fill x
   
       button $buttonFrame.create -text "Create" -command \
       "removeWindowEntry Summary
                destroy $summary
                CTcreateSummaryReport $num $cmdnum"
       button $buttonFrame.cancel -text "Cancel" -command \
       "removeWindowEntry Summary
                destroy $summary"
       pack $buttonFrame.create $buttonFrame.cancel -side left
   
       Centre_Dialog $summary default
   }
   
   ###########################################################
   # CTselectOutputFile
   ###########################################################
   ###########################################################
   ###########################################################
   proc CTselectOutputFile { num } {
       global gCT
       set gCT(summary.filename.$num) specified
       if { "" != [ set temp [tk_getSaveFile] ] } {set gCT(summary.file.$num) $temp}
   }    
   
   ###########################################################
   # CTcreateSummaryReport
   ###########################################################
   ###########################################################
   ###########################################################
   proc CTcreateSummaryReport { num cmdnum } {
       global gCT gFile
   
       displayStatus "Opening File" both $cmdnum
   
       switch $gCT(summary.who.$cmdnum) {
    all {
       set file ClassSet$gCT(summary.set.$cmdnum).rpt
    }
    section {
       set file Sec$gCT(summary.section.$cmdnum)Set$gCT(summary.set.$cmdnum).rpt 
    }
    default {
       displayError "An error has occured while creating a summary \
       report $gCT(summary.section.$cmdnum)"
       return
    }
       }
   
       if { $gCT(summary.filename.$cmdnum) == "specified" } { 
    set file $gCT(summary.file.$cmdnum)
       }
       if { $file == "" } { 
    removeStatus
    displayError "Must specify a valid filename"
    return
       }
       updateStatusMessage "Creating Summary" $cmdnum
   
       set cwd [pwd]
       cd $gFile($num)
       set error [ catch {CTcreateSummary $file $cmdnum} ]
       cd $cwd
   
       removeStatus $cmdnum
   
       if {!$error && "Yes" == [makeSure "Created summary file $file, would you like to see it?"]} {
    set fileId [open [file join $gFile($num) $file] r]
    CTputs $cmdnum [read $fileId]
    CToutput $num $cmdnum 
       }
   }
   
   ###########################################################
   # CTsetList
   ###########################################################
   ###########################################################
   ###########################################################
   proc CTsetList { num } {
       global gCT gFile
       set list ""
       for { set i 0 } { $i < 1000 } { incr i } {
    if { [file readable [file join $gFile($num) records set$i.db]] } {
       lappend list 
       }
 }  }
   

Removed from v.1.3  
changed lines
  Added in v.1.8


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