[system] / trunk / webwork / system / cgi / cgi-scripts / studentSummary.pl Repository: Repository Listing bbplugincoursesdistsnplrochestersystemwww

# Annotation of /trunk/webwork/system/cgi/cgi-scripts/studentSummary.pl

136 :

Homework summary for \$User

137 :
138 : For each problem a period (.) indicates the problem has not been attempted, a "C" indicates the problem has been answered 139 : 100% correctly, and a number from 0 to 99 indicates the percentage of partial credit earned. 140 : An "X" indicates the database contains invalid information.

141 : !; 142 : 143 : # Dump the contents of the DBM files: 144 : 145 : my (\$setNum,\$psvn,\$percentRight,@setList); 146 : 147 : 148 : 149 : my (\$key,@problems,\$string,\$twoString,@tempSort, 150 : \$total,\$totalRight,\$status,\$longStatus,\$valid_status,\$msg,\$attempted,\$probValue,\$num,\$i); 151 : 152 : 153 : print < 155 :
SetStatusScoreOut
of
Problem
'; 165 : \$twoString = ''; 166 : for (\$i=1; \$i <= \$maxNoOfProbs;\$i++) { 167 : \$twoString .= &threeSpaceFill(\$i); 168 : } 169 : \$string .= "
\$twoString
\$SetNumber\$msg\$totalRight\$total
229 :           \$string
156 : 157 : 158 : 159 : 160 : EOF 161 : 162 : ##get number of problems 163 : 164 : \$string = '"; 170 : print "\$string"; 171 : 172 : print < 175 : EOF 176 : 177 : @setList = sort by_due_date @SetNumberKeys; 178 : 179 : foreach \$SetNumber (@setList) { 180 : \$key = \$setNumberHash{\$SetNumber}; 181 : &attachProbSetRecord(\$key)|| print "no Record \$key\n"; 182 : \$timeNow = time; 183 : \$msg = 'NOT OPEN YET'; 184 : if ((\$timeNow >= \$openTimes{\$SetNumber}) and \$timeNow < \$dueTimes{\$SetNumber}) { 185 : \$msg = 'OPEN'; 186 : } 187 : elsif (\$timeNow >= \$dueTimes{\$SetNumber}) { 188 : \$msg = 'CLOSED'; 189 : } 190 : @problems = &getAllProblemsForProbSetRecord(\$key); 191 : \$string = ''; 192 : @tempSort = sort( { \$a <=> \$b } @problems); 193 : \$total=0; \$totalRight = 0; 194 : foreach \$num (@tempSort) { 195 : \$valid_status = 0; 196 : \$status = &getProblemStatus(\$num,\$key); 197 : \$attempted = getProblemAttempted(\$num,\$key); 198 : 199 : if (!\$attempted){ 200 : \$longStatus = '. '; 201 : } 202 : elsif (\$status >= 0 and \$status <=1 ) { 203 : \$valid_status = 1; 204 : \$longStatus = int(100*\$status+.5); 205 : if (\$longStatus == 100) { 206 : \$longStatus = 'C '; 207 : } 208 : else { 209 : \$longStatus = &threeSpaceFill(\$longStatus); 210 : } 211 : } 212 : else { 213 : \$longStatus = 'X '; 214 : } 215 : 216 : \$string .= \$longStatus; 217 : \$probValue = &getProblemValue(\$num,\$key); 218 : \$total += \$probValue; 219 : \$totalRight += round_score(\$status*\$probValue) if \$valid_status; 220 : } 221 : 222 : print < 224 : 225 : 226 : 227 : 228 : 230 : 231 : 232 : EOF 233 : 234 : } 235 : 236 : print '
'; 237 : 238 : print &htmlBOTTOM('studentSummary.pl', \%inputs); 239 : 240 : exit(0); 241 : 242 : ## subroutines 243 : sub threeSpaceFill { 244 : my \$num = shift @_; 245 : if (\$num < 10) {return "\$num".' ';} 246 : elsif (\$num < 100) {return "\$num".' ';} 247 : else {return "\$num";} 248 : }