--- capa/capa51/GUITools/scorer.tcl 2000/02/08 22:18:11 1.11 +++ capa/capa51/GUITools/scorer.tcl 2000/02/22 18:10:27 1.12 @@ -800,7 +800,7 @@ proc oneResponse { response max which } ########################################################### ########################################################### proc parseLine { num answerLine answerStruct } { - global gScorer + global gScorer gMult upvar $answerStruct parsedIn set result "" @@ -853,7 +853,14 @@ proc parseLine { num answerLine answerSt set parsedIn(answer.$i) [string index $array $which] } else { if { $howmany > 1 } { - set parsedIn(answer.$i) " " + set options "" + foreach possible $which { + append options "[string index $array $possible] " + } + set selected [multipleChoice . "There were multiple marks on\nPaper Number $parsedIn(SerialNumber)\nStudentNumber $parsedIn(StudentNumber)\nProblem Number [expr $i+1]" $options] + #puts ":$parsedIn(StudentNumber):$parsedIn(SerialNumber):[format %2d [expr $i+1]]:$selected:$options" + set parsedIn(answer.$i) $selected + #puts $parsedIn(answer.$i) incr parsedIn(multiplemarks) } else { if { $howmany < 1 } { @@ -881,7 +888,14 @@ proc parseLine { num answerLine answerSt [expr {$start + $which}]] } else { if { $howmany > 1 } { - append parsedIn(answer.$i) " " + set options "" + foreach possible $which { + append options "[string index $array [expr {$start + $possible}]] " + } + set selected [multipleChoice . "There were multiple marks on\nPaper Number $parsedIn(SerialNumber)\nStudentNumber $parsedIn(StudentNumber)\nProblem Number [expr $i+1]" $options] + #puts ":$parsedIn(StudentNumber):$parsedIn(SerialNumber):[format %2d [expr $i+1]]:$selected:$options" + append parsedIn(answer.$i) $selected + #puts $parsedIn(answer.$i) incr parsedIn(multiplemarks) } else { if { $howmany < 1 } { @@ -933,6 +947,10 @@ proc parseLine { num answerLine answerSt if { $result != "" } { error "$result" } + if { [catch {incr gMult $parsedIn(multiplemarks)}] } { + set gMult $parsedIn(multiplemarks) + } +# puts $gMult } proc getAnswers2 { PID set maxQuest num } { @@ -1247,8 +1265,9 @@ proc setOutput { num answerStructVar} { ########################################################### ########################################################### proc finishScoring { num answerStructVar} { - global gScorer + global gScorer gMult scorerMessage $num "Finishing . . ." + #puts $gMult # puts "errors:" # puts "$gScorer(errors.$num)" scorerMessage $num "Finished, Feel free to Update .sb" @@ -1294,7 +1313,8 @@ proc scorerStudent { num } { set gScorer(needToUpdateDB) 1 #parseanswerline if { [catch {parseLine $num $answer answerStruct} errorMsg ] } { - displayError "Error parsing line: $errorMsg" + global errorInfo + displayError "Error parsing line: $errorMsg $errorInfo" } else { #parse the set and grades it for any possiblely matching student if { ! [ catch { set result [handleStudent $num answerStruct]} errorMsg ] } { @@ -1360,6 +1380,7 @@ proc unpauseScorer { num } { proc finalScorer { num method studentNumber numRight } { global gScorer + #puts ":$numRight:" set answers "" for { set i 0 } { $i < $gScorer(numQuest.$num) } { incr i } { switch $gScorer(quest.$i.type.$num) {