Annotation of loncom/interface/statistics/lonproblemstatistics.pm, revision 1.122
1.1 stredwic 1: # The LearningOnline Network with CAPA
2: #
1.122 ! golterma 3: # $Id: lonproblemstatistics.pm,v 1.121 2012/03/15 20:53:18 www Exp $
1.1 stredwic 4: #
5: # Copyright Michigan State University Board of Trustees
6: #
7: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
8: #
9: # LON-CAPA is free software; you can redistribute it and/or modify
10: # it under the terms of the GNU General Public License as published by
11: # the Free Software Foundation; either version 2 of the License, or
12: # (at your option) any later version.
13: #
14: # LON-CAPA is distributed in the hope that it will be useful,
15: # but WITHOUT ANY WARRANTY; without even the implied warranty of
16: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17: # GNU General Public License for more details.
18: #
19: # You should have received a copy of the GNU General Public License
20: # along with LON-CAPA; if not, write to the Free Software
21: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22: #
23: # /home/httpd/html/adm/gpl.txt
24: #
25: # http://www.lon-capa.org/
26: #
27: # (Navigate problems for statistical reports
28: #
1.47 matthew 29: ###############################################
30: ###############################################
31:
32: =pod
33:
34: =head1 NAME
35:
36: lonproblemstatistics
37:
38: =head1 SYNOPSIS
39:
40: Routines to present problem statistics to instructors via tables,
41: Excel files, and plots.
42:
43: =over 4
44:
45: =cut
46:
47: ###############################################
48: ###############################################
1.1 stredwic 49:
1.36 minaeibi 50: package Apache::lonproblemstatistics;
1.1 stredwic 51:
52: use strict;
1.104 albertel 53: use Apache::lonnet;
1.62 matthew 54: use Apache::loncommon();
1.119 www 55: use Apache::lonquickgrades();
1.1 stredwic 56: use Apache::lonhtmlcommon;
57: use Apache::loncoursedata;
1.41 matthew 58: use Apache::lonstatistics;
1.84 matthew 59: use LONCAPA::lonmetadata();
1.59 matthew 60: use Apache::lonlocal;
1.44 matthew 61: use Spreadsheet::WriteExcel;
1.70 matthew 62: use Apache::lonstathelpers();
1.71 matthew 63: use Time::HiRes;
1.109 www 64: use LONCAPA;
65:
1.73 matthew 66:
67: my @StatsArray;
1.79 matthew 68: my %SeqStat; # keys are symbs, values are hash refs
1.73 matthew 69:
1.59 matthew 70: ##
71: ## Localization notes:
72: ##
73: ## in @Fields[0]->{'long_title'} is placed in Excel files and is used as the
74: ## header for plots created with Graph.pm, both of which more than likely do
75: ## not support localization.
76: ##
1.79 matthew 77: #
78: #
79: ##
80: ## Description of Field attributes
81: ##
82: ## Attribute Required Value Meaning or Use
83: ##
84: ## name yes any scalar Used to uniquely identify field
85: ## title yes any scalar This is what the user sees to identify
86: ## the field. Passed through &mt().
87: ## long_title yes any scalar Used as graph heading and in excel
88: ## output. NOT translated
89: ## align no (left|right|center) HTML cell contents alignment
90: ## color yes html color HTML cell background color
91: ## used to visually group statistics
92: ## special no (link) Indicates a link, target is name.link
93: ## Currently set in &get_statistics()
94: ## graphable no (yes|no) Can a bar graph of the field be
95: ## produced?
96: ## sortable no (yes|no) Should a sort link be put in the
97: ## column header?
98: ## selectable yes (yes|no) Can the column be removed from the
99: ## statistics display?
100: ## selected yes (yes|no) Is the column selected by default?
101: ##
1.85 matthew 102: ## format no sprintf format string
103: ##
104: ## excel_format no excel format type
105: ## (see &Apache::loncommon::define_excel_formats
1.49 matthew 106: my @Fields = (
107: { name => 'problem_num',
108: title => 'P#',
109: align => 'right',
1.76 matthew 110: color => '#FFFFE6',
111: selectable => 'no',
1.80 matthew 112: defaultselected => 'yes',
1.76 matthew 113: },
1.49 matthew 114: { name => 'container',
1.51 matthew 115: title => 'Sequence or Folder',
1.49 matthew 116: align => 'left',
117: color => '#FFFFE6',
1.76 matthew 118: sortable => 'yes',
119: selectable => 'no',
1.80 matthew 120: defaultselected => 'yes',
1.76 matthew 121: },
1.49 matthew 122: { name => 'title',
123: title => 'Title',
124: align => 'left',
125: color => '#FFFFE6',
126: special => 'link',
1.117 bisitz 127: sortable => 'yes',
1.76 matthew 128: selectable => 'no',
1.80 matthew 129: defaultselected => 'yes',
1.76 matthew 130: },
1.117 bisitz 131: { name => 'part',
1.49 matthew 132: title => 'Part',
133: align => 'left',
1.55 matthew 134: color => '#FFFFE6',
1.76 matthew 135: selectable => 'no',
1.80 matthew 136: defaultselected => 'yes',
1.76 matthew 137: },
1.49 matthew 138: { name => 'num_students',
139: title => '#Stdnts',
140: align => 'right',
141: color => '#EEFFCC',
142: format => '%d',
143: sortable => 'yes',
144: graphable => 'yes',
1.76 matthew 145: long_title => 'Number of Students Attempting Problem',
146: selectable => 'yes',
1.80 matthew 147: defaultselected => 'yes',
1.76 matthew 148: },
1.49 matthew 149: { name => 'tries',
150: title => 'Tries',
151: align => 'right',
152: color => '#EEFFCC',
153: format => '%d',
154: sortable => 'yes',
155: graphable => 'yes',
1.76 matthew 156: long_title => 'Total Number of Tries',
157: selectable => 'yes',
1.80 matthew 158: defaultselected => 'yes',
1.76 matthew 159: },
1.49 matthew 160: { name => 'max_tries',
161: title => 'Max Tries',
162: align => 'right',
163: color => '#DDFFFF',
164: format => '%d',
165: sortable => 'yes',
166: graphable => 'yes',
1.76 matthew 167: long_title => 'Maximum Number of Tries',
168: selectable => 'yes',
1.80 matthew 169: defaultselected => 'yes',
1.76 matthew 170: },
1.73 matthew 171: { name => 'min_tries',
172: title => 'Min Tries',
173: align => 'right',
174: color => '#DDFFFF',
175: format => '%d',
176: sortable => 'yes',
177: graphable => 'yes',
1.76 matthew 178: long_title => 'Minumum Number of Tries',
179: selectable => 'yes',
1.80 matthew 180: defaultselected => 'yes',
1.76 matthew 181: },
1.49 matthew 182: { name => 'mean_tries',
183: title => 'Mean Tries',
184: align => 'right',
185: color => '#DDFFFF',
186: format => '%5.2f',
187: sortable => 'yes',
188: graphable => 'yes',
1.76 matthew 189: long_title => 'Average Number of Tries',
190: selectable => 'yes',
1.80 matthew 191: defaultselected => 'yes',
1.76 matthew 192: },
1.49 matthew 193: { name => 'std_tries',
194: title => 'S.D. tries',
195: align => 'right',
196: color => '#DDFFFF',
197: format => '%5.2f',
198: sortable => 'yes',
199: graphable => 'yes',
1.76 matthew 200: long_title => 'Standard Deviation of Number of Tries',
201: selectable => 'yes',
1.80 matthew 202: defaultselected => 'yes',
1.76 matthew 203: },
1.49 matthew 204: { name => 'skew_tries',
205: title => 'Skew Tries',
206: align => 'right',
207: color => '#DDFFFF',
208: format => '%5.2f',
209: sortable => 'yes',
210: graphable => 'yes',
1.76 matthew 211: long_title => 'Skew of Number of Tries',
212: selectable => 'yes',
1.80 matthew 213: defaultselected => 'no',
1.76 matthew 214: },
1.49 matthew 215: { name => 'num_solved',
216: title => '#YES',
217: align => 'right',
218: color => '#FFDDDD',
1.63 matthew 219: format => '%4.1f',# format => '%d',
1.49 matthew 220: sortable => 'yes',
221: graphable => 'yes',
1.76 matthew 222: long_title => 'Number of Students able to Solve',
1.77 matthew 223: selectable => 'yes',
1.80 matthew 224: defaultselected => 'yes',
1.76 matthew 225: },
1.49 matthew 226: { name => 'num_override',
227: title => '#yes',
228: align => 'right',
229: color => '#FFDDDD',
1.63 matthew 230: format => '%4.1f',# format => '%d',
1.49 matthew 231: sortable => 'yes',
232: graphable => 'yes',
1.76 matthew 233: long_title => 'Number of Students given Override',
234: selectable => 'yes',
1.80 matthew 235: defaultselected => 'yes',
1.76 matthew 236: },
1.95 matthew 237: { name => 'tries_per_correct',
238: title => 'tries/correct',
239: align => 'right',
240: color => '#FFDDDD',
241: format => '%4.1f',
242: sortable => 'yes',
243: graphable => 'yes',
244: long_title => 'Tries per Correct Answer',
245: selectable => 'yes',
246: defaultselected => 'yes',
247: },
1.73 matthew 248: { name => 'num_wrong',
249: title => '#Wrng',
1.49 matthew 250: align => 'right',
1.73 matthew 251: color => '#FFDDDD',
1.49 matthew 252: format => '%4.1f',
253: sortable => 'yes',
254: graphable => 'yes',
1.93 matthew 255: long_title => 'Number of students whose final answer is wrong',
256: selectable => 'yes',
257: defaultselected => 'yes',
258: },
259: { name => 'per_wrong',
260: title => '%Wrng',
261: align => 'right',
262: color => '#FFDDDD',
263: format => '%4.1f',
264: sortable => 'yes',
265: graphable => 'yes',
1.76 matthew 266: long_title => 'Percent of students whose final answer is wrong',
267: selectable => 'yes',
1.80 matthew 268: defaultselected => 'yes',
1.76 matthew 269: },
1.73 matthew 270: { name => 'deg_of_diff',
271: title => 'DoDiff',
272: align => 'right',
273: color => '#FFFFE6',
274: format => '%5.2f',
275: sortable => 'yes',
276: graphable => 'yes',
277: long_title => 'Degree of Difficulty'.
1.76 matthew 278: '[ 1 - ((#YES+#yes) / Tries) ]',
279: selectable => 'yes',
1.80 matthew 280: defaultselected => 'yes',
1.76 matthew 281: },
1.71 matthew 282: { name => 'deg_of_disc',
1.73 matthew 283: title => 'DoDisc',
1.71 matthew 284: align => 'right',
285: color => '#FFFFE6',
286: format => '%4.2f',
287: sortable => 'yes',
288: graphable => 'yes',
1.76 matthew 289: long_title => 'Degree of Discrimination',
290: selectable => 'yes',
1.89 matthew 291: defaultselected => 'yes',
1.76 matthew 292: },
1.85 matthew 293: ## duedate included for research purposes. Commented out most of the time.
294: # { name => 'duedate',
295: # title => 'Due Date',
296: # align => 'left',
297: # color => '#FFFFFF',
298: # sortable => 'yes',
299: # graphable => 'no',
300: # long_title => 'Due date of resource for instructor',
301: # selectable => 'no',
302: # defaultselected => 'yes',
303: # },
304: ## opendate included for research purposes. Commented out most of the time.
305: # { name => 'opendate',
306: # title => 'Open Date',
307: # align => 'left',
308: # color => '#FFFFFF',
309: # sortable => 'yes',
310: # graphable => 'no',
311: # long_title => 'date resource became answerable',
312: # selectable => 'no',
313: # defaultselected => 'yes',
314: # },
315: ## symb included for research purposes. Commented out most of the time.
316: # { name => 'symb',
317: # title => 'Symb',
318: # align => 'left',
319: # color => '#FFFFFF',
320: # sortable => 'yes',
321: # graphable => 'no',
322: # long_title => 'Unique LON-CAPA identifier for problem',
323: # selectable => 'no',
324: # defaultselected => 'yes',
325: # },
1.86 matthew 326: ## resptypes included for research purposes. Commented out most of the time.
327: # { name => 'resptypes',
328: # title => 'Response Types',
329: # align => 'left',
330: # color => '#FFFFFF',
331: # sortable => 'no',
332: # graphable => 'no',
333: # long_title => 'Response Types used in this problem',
334: # selectable => 'no',
335: # defaultselected => 'yes',
336: # },
1.94 matthew 337: ## maxtries included for research purposes. Commented out most of the time.
338: # { name => 'maxtries',
339: # title => 'Maxtries',
340: # align => 'left',
341: # color => '#FFFFFF',
342: # sortable => 'no',
343: # graphable => 'no',
344: # long_title => 'Maximum number of tries',
345: # selectable => 'no',
346: # defaultselected => 'yes',
347: # },
348: ## hinttries included for research purposes. Commented out most of the time.
349: # { name => 'hinttries',
350: # title => 'hinttries',
351: # align => 'left',
352: # color => '#FFFFFF',
353: # sortable => 'no',
354: # graphable => 'no',
355: # long_title => 'Number of tries before a hint appears',
356: # selectable => 'no',
357: # defaultselected => 'yes',
358: # },
1.98 matthew 359: #
360: ## problem weight for instructor
361: { name => 'weight',
362: title => 'weight',
363: align => 'right',
364: color => '#FFFFFF',
365: sortable => 'no',
366: graphable => 'no',
367: long_title => 'Problem weight (for instructor)',
1.100 matthew 368: selectable => 'yes',
1.98 matthew 369: defaultselected => 'yes',
370: },
1.49 matthew 371: );
372:
1.79 matthew 373: my @SeqFields = (
374: { name => 'title',
375: title => 'Sequence',
376: align => 'left',
377: color => '#FFFFE6',
378: special => 'no',
1.117 bisitz 379: sortable => 'no',
1.79 matthew 380: selectable => 'yes',
1.80 matthew 381: defaultselected => 'no',
1.79 matthew 382: },
383: { name => 'items',
384: title => '#Items',
385: align => 'right',
386: color => '#FFFFE6',
387: format => '%4d',
388: sortable => 'no',
389: graphable => 'no',
390: long_title => 'Number of Items in Sequence',
391: selectable => 'yes',
1.80 matthew 392: defaultselected => 'no',
1.79 matthew 393: },
394: { name => 'scoremean',
395: title => 'Score Mean',
396: align => 'right',
397: color => '#FFFFE6',
398: format => '%4.2f',
399: sortable => 'no',
400: graphable => 'no',
401: long_title => 'Mean Sequence Score',
402: selectable => 'yes',
1.80 matthew 403: defaultselected => 'no',
1.79 matthew 404: },
405: { name => 'scorestd',
406: title => 'Score STD',
407: align => 'right',
408: color => '#FFFFE6',
409: format => '%4.2f',
410: sortable => 'no',
411: graphable => 'no',
412: long_title => 'Standard Deviation of Sequence Scores',
413: selectable => 'yes',
1.80 matthew 414: defaultselected => 'no',
1.79 matthew 415: },
416: { name => 'scoremax',
417: title => 'Score Max',
418: align => 'right',
419: color => '#FFFFE6',
420: format => '%4.2f',
421: sortable => 'no',
422: graphable => 'no',
423: long_title => 'Maximum Sequence Score',
424: selectable => 'yes',
1.80 matthew 425: defaultselected => 'no',
1.79 matthew 426: },
427: { name => 'scoremin',
428: title => 'Score Min',
429: align => 'right',
430: color => '#FFFFE6',
431: format => '%4.2f',
432: sortable => 'no',
433: graphable => 'no',
434: long_title => 'Minumum Sequence Score',
435: selectable => 'yes',
1.80 matthew 436: defaultselected => 'no',
1.79 matthew 437: },
438: { name => 'scorecount',
439: title => 'Score N',
440: align => 'right',
441: color => '#FFFFE6',
442: format => '%4d',
443: sortable => 'no',
444: graphable => 'no',
445: long_title => 'Number of Students in score computations',
446: selectable => 'yes',
1.80 matthew 447: defaultselected => 'no',
1.79 matthew 448: },
449: { name => 'countmean',
450: title => 'Count Mean',
451: align => 'right',
452: color => '#FFFFFF',
453: format => '%4.2f',
454: sortable => 'no',
455: graphable => 'no',
456: long_title => 'Mean Sequence Score',
457: selectable => 'yes',
1.80 matthew 458: defaultselected => 'no',
1.79 matthew 459: },
460: { name => 'countstd',
461: title => 'Count STD',
462: align => 'right',
463: color => '#FFFFFF',
464: format => '%4.2f',
465: sortable => 'no',
466: graphable => 'no',
467: long_title => 'Standard Deviation of Sequence Scores',
468: selectable => 'yes',
1.80 matthew 469: defaultselected => 'no',
1.79 matthew 470: },
471: { name => 'countmax',
472: title => 'Count Max',
473: align => 'right',
474: color => '#FFFFFF',
475: format => '%4.2f',
476: sortable => 'no',
477: graphable => 'no',
478: long_title => 'Maximum Number of Correct Problems',
479: selectable => 'yes',
1.80 matthew 480: defaultselected => 'no',
1.79 matthew 481: },
482: { name => 'countmin',
483: title => 'Count Min',
484: align => 'right',
485: color => '#FFFFFF',
486: format => '%4.2f',
487: sortable => 'no',
488: graphable => 'no',
489: long_title => 'Minumum Number of Correct Problems',
490: selectable => 'yes',
1.80 matthew 491: defaultselected => 'no',
1.79 matthew 492: },
493: { name => 'count',
494: title => 'Count N',
495: align => 'right',
496: color => '#FFFFFF',
497: format => '%4d',
498: sortable => 'no',
499: graphable => 'no',
500: long_title => 'Number of Students in score computations',
501: selectable => 'yes',
1.80 matthew 502: defaultselected => 'no',
1.79 matthew 503: },
504: { name => 'KR-21',
505: title => 'KR-21',
506: align => 'right',
507: color => '#FFAAAA',
508: format => '%4.2f',
509: sortable => 'no',
510: graphable => 'no',
511: long_title => 'KR-21 reliability statistic',
512: selectable => 'yes',
1.80 matthew 513: defaultselected => 'no',
1.117 bisitz 514: },
1.79 matthew 515: );
516:
1.76 matthew 517: my %SelectedFields;
518:
519: sub parse_field_selection {
520: #
521: # Pull out the defaults
1.104 albertel 522: if (! defined($env{'form.fieldselections'})) {
523: $env{'form.fieldselections'} = [];
1.76 matthew 524: foreach my $field (@Fields) {
525: next if ($field->{'selectable'} ne 'yes');
1.80 matthew 526: if ($field->{'defaultselected'} eq 'yes') {
1.104 albertel 527: push(@{$env{'form.fieldselections'}},$field->{'name'});
1.76 matthew 528: }
529: }
530: }
531: #
1.80 matthew 532: # Make sure the data we are plotting is there
533: my %NeededFields;
1.104 albertel 534: if (exists($env{'form.plot'}) && $env{'form.plot'} ne '' &&
535: $env{'form.plot'} ne 'none') {
536: if ($env{'form.plot'} eq 'degrees') {
1.80 matthew 537: $NeededFields{'deg_of_diff'}++;
538: $NeededFields{'deg_of_disc'}++;
1.104 albertel 539: } elsif ($env{'form.plot'} eq 'tries statistics') {
1.80 matthew 540: $NeededFields{'mean_tries'}++;
541: $NeededFields{'std_tries'}++;
542: $NeededFields{'problem_num'}++;
543: } else {
1.104 albertel 544: $NeededFields{$env{'form.plot'}}++;
1.80 matthew 545: }
546: }
547: #
1.76 matthew 548: # This should not happen, but in case it does...
1.104 albertel 549: if (ref($env{'form.fieldselections'}) ne 'ARRAY') {
550: $env{'form.fieldselections'} = [$env{'form.fieldselections'}];
1.76 matthew 551: }
552: #
553: # Set the field data and the selected fields (for easier checking)
554: undef(%SelectedFields);
555: foreach my $field (@Fields) {
1.80 matthew 556: if ($field->{'selectable'} ne 'yes') {
557: $field->{'selected'} = 'yes';
558: } else {
559: $field->{'selected'} = 'no';
560: }
561: if (exists($NeededFields{$field->{'name'}})) {
562: $field->{'selected'} = 'yes';
563: $SelectedFields{$field->{'name'}}++;
564: }
1.104 albertel 565: foreach my $selection (@{$env{'form.fieldselections'}}) {
1.76 matthew 566: if ($selection eq $field->{'name'} || $selection eq 'all') {
567: $field->{'selected'} = 'yes';
568: $SelectedFields{$field->{'name'}}++;
569: }
570: }
571: }
1.82 matthew 572: #
573: # Always show all the sequence statistics (for now)
574: foreach my $field (@SeqFields) {
575: $field->{'selected'} = 'yes';
576: }
1.76 matthew 577: return;
578: }
579:
580: sub field_selection_input {
1.116 bisitz 581: my $Str = '<select name="fieldselections" multiple="multiple" size="5">'."\n";
1.76 matthew 582: $Str .= '<option value="all">all</option>'."\n";
583: foreach my $field (@Fields) {
584: next if ($field->{'selectable'} ne 'yes');
585: $Str .= ' <option value="'.$field->{'name'}.'" ';
586: if ($field->{'selected'} eq 'yes') {
587: $Str .= 'selected ';
588: }
589: $Str .= '>'.$field->{'title'}.'</option>'."\n";
590: }
591: $Str .= "</select>\n";
592: }
593:
1.47 matthew 594: ###############################################
595: ###############################################
596:
597: =pod
598:
599: =item &CreateInterface()
600:
601: Create the main intereface for the statistics page. Allows the user to
602: select sections, maps, and output.
603:
604: =cut
1.1 stredwic 605:
1.47 matthew 606: ###############################################
607: ###############################################
1.41 matthew 608: sub CreateInterface {
1.87 matthew 609: my ($r) = @_;
1.80 matthew 610: #
1.76 matthew 611: &parse_field_selection();
1.80 matthew 612: #
1.41 matthew 613: my $Str = '';
1.115 bisitz 614: $Str .= '<p>';
615: $Str .= &Apache::loncommon::start_data_table();
616: $Str .= &Apache::loncommon::start_data_table_header_row();
617: $Str .= '<th>'.&mt('Sections').'</th>';
618: $Str .= '<th>'.&mt('Groups').'</th>';
619: $Str .= '<th>'.&mt('Access Status').'</th>';
620: $Str .= '<th>'.&mt('Sequences and Folders').'</th>';
621: $Str .= '<th>'.&mt('Statistics').'</th>';
622: $Str .= '<th>'.&mt('Plot Graph').'</th>';
623: $Str .= '<th>'.&mt('Time Period').'</th>';
624: $Str .= &Apache::loncommon::end_data_table_header_row();
1.41 matthew 625: #
1.115 bisitz 626: $Str .= &Apache::loncommon::start_data_table_row();
627: $Str .= '<td align="center" valign="top">'."\n";
1.41 matthew 628: $Str .= &Apache::lonstatistics::SectionSelect('Section','multiple',5);
1.115 bisitz 629: $Str .= '</td><td align="center" valign="top">';
1.108 raeburn 630: $Str .= &Apache::lonstatistics::GroupSelect('Group','multiple',5);
1.115 bisitz 631: $Str .= '</td><td align="center" valign="top">';
1.50 matthew 632: $Str .= &Apache::lonhtmlcommon::StatusOptions(undef,undef,5);
1.115 bisitz 633: $Str .= '</td><td align="center" valign="top">';
1.41 matthew 634: #
1.97 matthew 635: $Str .= &Apache::lonstatistics::map_select('Maps','multiple,all',5);
1.115 bisitz 636: $Str .= '</td><td align="center" valign="top">';
637: $Str .= &field_selection_input();
638: $Str .= '</td><td align="center" valign="top">';
639: $Str .= &plot_dropdown();
640: $Str .= '</td>'."\n";
641: $Str .= '</td><td align="center" valign="top">';
642: $Str .= &Apache::lonstathelpers::limit_by_time_form();
643: $Str .= '</td>'."\n";
644: $Str .= &Apache::loncommon::end_data_table_row();
645: $Str .= &Apache::loncommon::end_data_table();
1.87 matthew 646: #
1.115 bisitz 647: $Str .= '</p>';
1.59 matthew 648: $Str .= '<input type="submit" name="GenerateStatistics" value="'.
649: &mt('Generate Statistics').'" />';
1.115 bisitz 650: $Str .= (' 'x10);
1.87 matthew 651: #
1.73 matthew 652: return $Str;
1.41 matthew 653: }
1.25 stredwic 654:
1.41 matthew 655: ###############################################
656: ###############################################
1.28 stredwic 657:
1.47 matthew 658: =pod
659:
660: =item &BuildProblemStatisticsPage()
661:
662: Main interface to problem statistics.
663:
664: =cut
665:
1.41 matthew 666: ###############################################
667: ###############################################
1.97 matthew 668: my $navmap;
669: my @sequences;
670:
1.105 albertel 671: sub clean_up {
672: undef($navmap);
673: undef(@sequences);
674: }
675:
1.41 matthew 676: sub BuildProblemStatisticsPage {
677: my ($r,$c)=@_;
1.97 matthew 678: undef($navmap);
679: undef(@sequences);
1.61 matthew 680: #
681: my %Saveable_Parameters = ('Status' => 'scalar',
682: 'statsoutputmode' => 'scalar',
683: 'Section' => 'array',
1.108 raeburn 684: 'Groups' => 'array',
1.61 matthew 685: 'StudentData' => 'array',
1.77 matthew 686: 'Maps' => 'array',
687: 'fieldselections'=> 'array');
1.61 matthew 688: &Apache::loncommon::store_course_settings('statistics',
689: \%Saveable_Parameters);
690: &Apache::loncommon::restore_course_settings('statistics',
691: \%Saveable_Parameters);
692: #
693: &Apache::lonstatistics::PrepareClasslist();
1.41 matthew 694: #
1.73 matthew 695: # Clear the package variables
696: undef(@StatsArray);
1.79 matthew 697: undef(%SeqStat);
1.71 matthew 698: #
1.73 matthew 699: # Finally let the user know we are here
1.119 www 700: $r->print(&Apache::lonhtmlcommon::breadcrumbs('Overall Problem Statistics',
701: 'Statistics_Overall_Key'));
702: &Apache::lonquickgrades::startGradeScreen($r,'statistics');
703:
1.87 matthew 704: my $interface = &CreateInterface($r);
1.57 matthew 705: $r->print($interface);
1.104 albertel 706: $r->print('<input type="hidden" name="sortby" value="'.$env{'form.sortby'}.
1.41 matthew 707: '" />');
1.73 matthew 708: #
1.117 bisitz 709: my @CacheButtonHTML =
1.87 matthew 710: &Apache::lonstathelpers::manage_caches($r,'Statistics','stats_status');
711: my $Str;
712: foreach my $html (@CacheButtonHTML) {
713: $Str.=$html.(' 'x5);
714: }
715: #
716: $r->print($Str);
1.104 albertel 717: if (! exists($env{'form.firstrun'})) {
1.117 bisitz 718: $r->print('<p class="LC_info"><b>'.
1.73 matthew 719: &mt('Press "Generate Statistics" when you are ready.').
1.117 bisitz 720: '</b></p>'.
721: '<p class="LC_info">'.
1.73 matthew 722: &mt('It may take some time to update the student data '.
1.117 bisitz 723: 'for the first analysis. Future analysis this session '.
1.113 bisitz 724: 'will not have this delay.').
1.73 matthew 725: '</p>');
1.105 albertel 726: &clean_up();
1.41 matthew 727: return;
1.28 stredwic 728: }
1.73 matthew 729: $r->rflush();
1.41 matthew 730: #
1.73 matthew 731: # This probably does not need to be done each time we are called, but
732: # it does not slow things down noticably.
733: &Apache::loncoursedata::populate_weight_table();
1.75 matthew 734: #
1.117 bisitz 735: ($navmap,@sequences) =
1.99 matthew 736: &Apache::lonstatistics::selected_sequences_with_assessments();
737: if (! ref($navmap)) {
1.115 bisitz 738: $r->print('<div class="LC_error">'.&mt('A course-wide error occurred.').'</div>'.
1.99 matthew 739: '<h3>'.$navmap.'</h3>');
1.105 albertel 740: &clean_up();
1.99 matthew 741: return;
742: }
1.104 albertel 743: if (exists($env{'form.Excel'})) {
1.122 ! golterma 744: $r->print('<p>'.
1.102 matthew 745: &Apache::lonstatistics::section_and_enrollment_description().
1.122 ! golterma 746: '</p>');
1.73 matthew 747: &Excel_output($r);
1.117 bisitz 748: } else {
1.87 matthew 749: $r->print('<input type="submit" name="Excel" value="'.
750: &mt('Produce Excel Output').'" />'.' 'x5);
751: $r->rflush();
1.122 ! golterma 752: $r->print('<p>'.
1.102 matthew 753: &Apache::lonstatistics::section_and_enrollment_description().
1.122 ! golterma 754: '</p>');
1.75 matthew 755: my $count = 0;
1.97 matthew 756: foreach my $seq (@sequences) {
1.117 bisitz 757: my @resources =
1.97 matthew 758: &Apache::lonstathelpers::get_resources($navmap,$seq);
759: $count += scalar(@resources);
1.75 matthew 760: }
761: if ($count > 10) {
762: $r->print('<h2>'.
763: &mt('Compiling statistics for [_1] problems',$count).
764: '</h2>');
765: if ($count > 30) {
766: $r->print('<h3>'.&mt('This will take some time.').'</h3>');
767: }
768: $r->rflush();
769: }
770: #
1.104 albertel 771: my $sortby = $env{'form.sortby'};
1.73 matthew 772: $sortby = 'container' if (! defined($sortby) || $sortby =~ /^\s*$/);
1.104 albertel 773: my $plot = $env{'form.plot'};
1.75 matthew 774: if ($plot eq '' || $plot eq 'none') {
775: undef($plot);
776: }
1.73 matthew 777: if ($sortby eq 'container' && ! defined($plot)) {
1.79 matthew 778: &output_sequence_statistics($r);
1.73 matthew 779: &output_html_by_sequence($r);
780: } else {
781: if (defined($plot)) {
782: &make_plot($r,$plot);
783: }
784: &output_html_stats($r);
1.79 matthew 785: &output_sequence_statistics($r);
1.73 matthew 786: }
787: }
1.105 albertel 788: &clean_up();
1.73 matthew 789: return;
790: }
791:
1.79 matthew 792: sub output_sequence_statistics {
793: my ($r) = @_;
794: my $c=$r->connection();
1.90 matthew 795: $r->print('<h2>'.&mt('Sequence Statistics').
796: &Apache::loncommon::help_open_topic('Statistics_Sequence').
797: '</h2>');
1.122 ! golterma 798: $r->print(&Apache::loncommon::start_data_table().&Apache::loncommon::start_data_table_header_row());
1.79 matthew 799: $r->print(&sequence_html_header());
1.122 ! golterma 800: $r->print(&Apache::loncommon::end_data_table_header_row());
1.117 bisitz 801: foreach my $seq (@sequences) {
1.79 matthew 802: last if ($c->aborted);
803: &compute_sequence_statistics($seq);
804: $r->print(&sequence_html_output($seq));
805: }
1.122 ! golterma 806: $r->print(&Apache::loncommon::end_data_table());
1.79 matthew 807: $r->rflush();
808: return;
809: }
810:
811:
1.73 matthew 812: ##########################################################
813: ##########################################################
814: ##
815: ## HTML output routines
816: ##
817: ##########################################################
818: ##########################################################
819: sub output_html_by_sequence {
820: my ($r) = @_;
821: my $c = $r->connection();
1.122 ! golterma 822: $r->print('<br>'.&html_preamble());
1.41 matthew 823: #
1.97 matthew 824: foreach my $seq (@sequences) {
1.73 matthew 825: last if ($c->aborted);
1.97 matthew 826: $r->print("<h3>".$seq->compTitle."</h3>".
1.122 ! golterma 827: &Apache::loncommon::start_data_table().
! 828: &Apache::loncommon::start_data_table_header_row().
! 829: &statistics_table_header('no container').
! 830: &Apache::loncommon::end_data_table_header_row()."\n");
1.73 matthew 831: my @Data = &compute_statistics_on_sequence($seq);
832: foreach my $data (@Data) {
1.122 ! golterma 833: $r->print(&Apache::loncommon::start_data_table_row().
! 834: &statistics_html_table_data($data,'no container').
! 835: &Apache::loncommon::end_data_table_row()."\n");
1.70 matthew 836: }
1.122 ! golterma 837: $r->print(&Apache::loncommon::end_data_table()."\n");
1.41 matthew 838: $r->rflush();
1.28 stredwic 839: }
1.41 matthew 840: return;
841: }
1.21 stredwic 842:
1.73 matthew 843: sub output_html_stats {
844: my ($r)=@_;
845: &compute_all_statistics($r);
846: $r->print(&html_preamble());
1.104 albertel 847: &sort_data($env{'form.sortby'});
1.73 matthew 848: #
849: my $count=0;
850: foreach my $data (@StatsArray) {
851: if ($count++ % 50 == 0) {
1.122 ! golterma 852: $r->print(&Apache::loncommon::end_data_table());
! 853: $r->print(&Apache::loncommon::start_data_table().
! 854: &Apache::loncommon::start_data_table_row().
! 855: &statistics_table_header().
! 856: &Apache::loncommon::end_data_table_row());
! 857: }
! 858: $r->print(&Apache::loncommon::start_data_table_row().
! 859: &statistics_html_table_data($data).
! 860: &Apache::loncommon::end_data_table_row());
1.73 matthew 861: }
1.122 ! golterma 862: $r->print(&Apache::loncommon::end_data_table_row());
1.73 matthew 863: return;
864: }
1.47 matthew 865:
1.73 matthew 866: sub html_preamble {
867: my $Str='';
868: $Str .= "<h2>".
1.104 albertel 869: $env{'course.'.$env{'request.course.id'}.'.description'}.
1.73 matthew 870: "</h2>\n";
871: my ($starttime,$endtime) = &Apache::lonstathelpers::get_time_limits();
872: if (defined($starttime) || defined($endtime)) {
873: # Inform the user what the time limits on the data are.
874: $Str .= '<h3>'.&mt('Statistics on submissions from [_1] to [_2]',
875: &Apache::lonlocal::locallocaltime($starttime),
876: &Apache::lonlocal::locallocaltime($endtime)
877: ).'</h3>';
878: }
1.122 ! golterma 879: $Str .= "<p>".&mt('Compiled on [_1]',
! 880: &Apache::lonlocal::locallocaltime(time))."</p>";
1.73 matthew 881: return $Str;
882: }
1.47 matthew 883:
884:
1.44 matthew 885: ###############################################
886: ###############################################
1.73 matthew 887: ##
888: ## Misc HTML output routines
889: ##
890: ###############################################
891: ###############################################
892: sub statistics_html_table_data {
893: my ($data,$options) = @_;
894: my $row = '';
895: foreach my $field (@Fields) {
896: next if ($options =~ /no $field->{'name'}/);
1.76 matthew 897: next if ($field->{'selected'} ne 'yes');
1.122 ! golterma 898: $row .= '<td style="background-color:'.$field->{'color'}.'"';
1.73 matthew 899: if (exists($field->{'align'})) {
900: $row .= ' align="'.$field->{'align'}.'"';
1.41 matthew 901: }
1.73 matthew 902: $row .= '>';
903: if (exists($field->{'special'}) && $field->{'special'} eq 'link') {
904: $row .= '<a href="'.$data->{$field->{'name'}.'.link'}.'">';
1.41 matthew 905: }
1.92 matthew 906: if (exists($field->{'format'}) && $data->{$field->{'name'}} !~ /[A-Z]/i) {
1.73 matthew 907: $row .= sprintf($field->{'format'},$data->{$field->{'name'}});
908: } else {
909: $row .= $data->{$field->{'name'}};
910: }
911: if (exists($field->{'special'}) && $field->{'special'} eq 'link') {
912: $row.= '</a>';
913: }
914: $row .= '</td>';
1.21 stredwic 915: }
1.73 matthew 916: return $row;
1.41 matthew 917: }
1.25 stredwic 918:
1.73 matthew 919: sub statistics_table_header {
920: my ($options) = @_;
921: my $header_row;
922: foreach my $field (@Fields) {
923: next if ($options =~ /no $field->{'name'}/);
1.76 matthew 924: next if ($field->{'selected'} ne 'yes');
1.73 matthew 925: $header_row .= '<th>';
926: if (exists($field->{'sortable'}) && $field->{'sortable'} eq 'yes') {
927: $header_row .= '<a href="javascript:'.
928: 'document.Statistics.sortby.value='."'".$field->{'name'}."'".
929: ';document.Statistics.submit();">';
930: }
931: $header_row .= &mt($field->{'title'});
932: if ($options =~ /sortable/) {
933: $header_row.= '</a>';
934: }
935: if ($options !~ /no plots/ &&
936: exists($field->{'graphable'}) &&
937: $field->{'graphable'} eq 'yes') {
938: $header_row.=' (';
939: $header_row .= '<a href="javascript:'.
940: "document.Statistics.plot.value='$field->{'name'}'".
941: ';document.Statistics.submit();">';
942: $header_row .= &mt('plot').'</a>)';
943: }
944: $header_row .= '</th>';
945: }
946: return $header_row;
947: }
1.26 stredwic 948:
1.79 matthew 949: sub sequence_html_header {
950: my $Str .= '<tr>';
951: foreach my $field (@SeqFields) {
952: # next if ($field->{'selected'} ne 'yes');
953: $Str .= '<th bgcolor="'.$field->{'color'}.'"';
954: $Str .= '>'.$field->{'title'}.'</th>';
955: }
956: $Str .= '</tr>';
957: return $Str;
958: }
959:
960:
961: sub sequence_html_output {
962: my ($seq) = @_;
1.97 matthew 963: my $data = $SeqStat{$seq->symb};
1.79 matthew 964: my $row = '<tr>';
965: foreach my $field (@SeqFields) {
1.82 matthew 966: next if ($field->{'selected'} ne 'yes');
1.79 matthew 967: $row .= '<td bgcolor="'.$field->{'color'}.'"';
968: if (exists($field->{'align'})) {
969: $row .= ' align="'.$field->{'align'}.'"';
970: }
971: $row .= '>';
972: if (exists($field->{'format'})) {
973: $row .= sprintf($field->{'format'},$data->{$field->{'name'}});
974: } else {
975: $row .= $data->{$field->{'name'}};
976: }
977: $row .= '</td>';
978: }
979: $row .= '</tr>'."\n";
980: return $row;
981: }
982:
1.73 matthew 983: ####################################################
984: ####################################################
985: ##
986: ## Plotting Routines
987: ##
988: ####################################################
989: ####################################################
990: sub make_plot {
991: my ($r,$plot) = @_;
992: &compute_all_statistics($r);
1.104 albertel 993: &sort_data($env{'form.sortby'});
1.73 matthew 994: if ($plot eq 'degrees') {
995: °rees_plot($r);
1.74 matthew 996: } elsif ($plot eq 'tries statistics') {
997: &tries_data_plot($r);
1.73 matthew 998: } else {
999: &make_single_stat_plot($r,$plot);
1000: }
1001: return;
1002: }
1.47 matthew 1003:
1.73 matthew 1004: sub make_single_stat_plot {
1005: my ($r,$datafield) = @_;
1.41 matthew 1006: #
1.73 matthew 1007: my $title; my $yaxis;
1008: foreach my $field (@Fields) {
1009: next if ($field->{'name'} ne $datafield);
1010: $title = $field->{'long_title'};
1011: $yaxis = $field->{'title'};
1012: last;
1013: }
1014: if ($title eq '' || $yaxis eq '') {
1015: # datafield is something we do not know enough about to plot
1016: $r->print('<h3>'.
1017: &mt('Unable to plot the requested statistic.').
1018: '</h3>');
1019: return;
1.49 matthew 1020: }
1021: #
1.73 matthew 1022: # Build up the data sets to plot
1.117 bisitz 1023: my @Labels;
1.73 matthew 1024: my @Data;
1025: my $max = 1;
1026: foreach my $data (@StatsArray) {
1027: push(@Labels,$data->{'problem_num'});
1028: push(@Data,$data->{$datafield});
1029: if ($data->{$datafield}>$max) {
1030: $max = $data->{$datafield};
1031: }
1032: }
1033: foreach (1,2,3,4,5,10,15,20,25,40,50,75,100,150,200,250,300,500,600,750,
1034: 1000,1500,2000,2500,3000,3500,4000,5000,7500,10000,15000,20000) {
1035: if ($max <= $_) {
1036: $max = $_;
1037: last;
1.42 matthew 1038: }
1039: }
1.73 matthew 1040: if ($max > 20000) {
1041: $max = 10000*(int($max/10000)+1);
1.42 matthew 1042: }
1.73 matthew 1043: #
1044: $r->print("<p>".&Apache::loncommon::DrawBarGraph($title,
1045: 'Problem Number',
1046: $yaxis,
1047: $max,
1048: undef, # colors
1049: \@Labels,
1050: \@Data)."</p>\n");
1051: return;
1052: }
1053:
1054: sub degrees_plot {
1055: my ($r)=@_;
1056: my $count = scalar(@StatsArray);
1057: my $width = 50 + 10*$count;
1058: $width = 300 if ($width < 300);
1059: my $height = 300;
1060: my $plot = '';
1061: my $ymax = 0;
1062: my $ymin = 0;
1.117 bisitz 1063: my @Disc; my @Diff; my @Labels;
1.73 matthew 1064: foreach my $data (@StatsArray) {
1065: push(@Labels,$data->{'problem_num'});
1066: my $disc = $data->{'deg_of_disc'};
1067: my $diff = $data->{'deg_of_diff'};
1068: push(@Disc,$disc);
1069: push(@Diff,$diff);
1070: #
1071: $ymin = $disc if ($ymin > $disc);
1072: $ymin = $diff if ($ymin > $diff);
1073: $ymax = $disc if ($ymax < $disc);
1074: $ymax = $diff if ($ymax < $diff);
1075: }
1076: #
1077: # Make sure we show relevant information.
1078: if ($ymin < 0) {
1079: if (abs($ymin) < 0.05) {
1080: $ymin = 0;
1081: } else {
1082: $ymin = -1;
1.42 matthew 1083: }
1084: }
1.73 matthew 1085: if ($ymax > 0) {
1086: if (abs($ymax) < 0.05) {
1087: $ymax = 0;
1.42 matthew 1088: } else {
1.73 matthew 1089: $ymax = 1;
1.42 matthew 1090: }
1.43 matthew 1091: }
1.49 matthew 1092: #
1.73 matthew 1093: my $xmax = $Labels[-1];
1094: if ($xmax > 50) {
1095: if ($xmax % 10 != 0) {
1096: $xmax = 10 * (int($xmax/10)+1);
1097: }
1098: } else {
1099: if ($xmax % 5 != 0) {
1100: $xmax = 5 * (int($xmax/5)+1);
1.49 matthew 1101: }
1.26 stredwic 1102: }
1.41 matthew 1103: #
1.73 matthew 1104: my $discdata .= '<data>'.join(',',@Labels).'</data>'.$/.
1105: '<data>'.join(',',@Disc).'</data>'.$/;
1106: #
1107: my $diffdata .= '<data>'.join(',',@Labels).'</data>'.$/.
1108: '<data>'.join(',',@Diff).'</data>'.$/;
1109: #
1.81 matthew 1110: my $title = 'Degree of Discrimination\nand Degree of Difficulty';
1111: if ($xmax > 50) {
1112: $title = 'Degree of Discrimination and Degree of Difficulty';
1113: }
1114: #
1.73 matthew 1115: $plot=<<"END";
1116: <gnuplot
1117: texfont="10"
1118: fgcolor="x000000"
1119: plottype="Cartesian"
1120: font="large"
1121: grid="on"
1122: align="center"
1123: border="on"
1124: transparent="on"
1.81 matthew 1125: alttag="Degree of Discrimination and Degree of Difficulty Plot"
1.73 matthew 1126: samples="100"
1127: bgcolor="xffffff"
1128: height="$height"
1129: width="$width">
1130: <key
1131: pos="top right"
1132: title=""
1133: box="off" />
1.81 matthew 1134: <title>$title</title>
1.73 matthew 1135: <axis xmin="0" ymin="$ymin" xmax="$xmax" ymax="$ymax" color="x000000" />
1136: <xlabel>Problem Number</xlabel>
1137: <curve
1138: linestyle="linespoints"
1139: name="DoDisc"
1140: pointtype="0"
1141: color="x000000">
1142: $discdata
1143: </curve>
1144: <curve
1145: linestyle="linespoints"
1146: name="DoDiff"
1147: pointtype="0"
1148: color="xFF0000">
1149: $diffdata
1150: </curve>
1151: </gnuplot>
1152: END
1.117 bisitz 1153: my $plotresult =
1.73 matthew 1154: '<p>'.&Apache::lonxml::xmlparse($r,'web',$plot).'</p>'.$/;
1155: $r->print($plotresult);
1.41 matthew 1156: return;
1.42 matthew 1157: }
1158:
1.74 matthew 1159: sub tries_data_plot {
1160: my ($r)=@_;
1161: my $count = scalar(@StatsArray);
1162: my $width = 50 + 10*$count;
1163: $width = 300 if ($width < 300);
1164: my $height = 300;
1165: my $plot = '';
1166: my @STD; my @Mean; my @Max; my @Min;
1167: my @Labels;
1168: my $ymax = 5;
1169: foreach my $data (@StatsArray) {
1170: my $max = $data->{'mean_tries'} + $data->{'std_tries'};
1171: $ymax = $max if ($ymax < $max);
1172: $ymax = $max if ($ymax < $max);
1173: push(@Labels,$data->{'problem_num'});
1174: push(@STD,$data->{'std_tries'});
1175: push(@Mean,$data->{'mean_tries'});
1176: }
1177: #
1178: # Make sure we show relevant information.
1179: my $xmax = $Labels[-1];
1180: if ($xmax > 50) {
1181: if ($xmax % 10 != 0) {
1182: $xmax = 10 * (int($xmax/10)+1);
1183: }
1184: } else {
1185: if ($xmax % 5 != 0) {
1186: $xmax = 5 * (int($xmax/5)+1);
1187: }
1188: }
1189: $ymax = int($ymax)+1+2;
1190: #
1191: my $std_data .= '<data>'.join(',',@Labels).'</data>'.$/.
1192: '<data>'.join(',',@Mean).'</data>'.$/;
1193: #
1194: my $std_error_data .= '<data>'.join(',',@Labels).'</data>'.$/.
1195: '<data>'.join(',',@Mean).'</data>'.$/.
1196: '<data>'.join(',',@STD).'</data>'.$/;
1197: #
1.81 matthew 1198: my $title = 'Mean and S.D. of Tries';
1199: if ($xmax > 25) {
1200: $title = 'Mean and Standard Deviation of Tries';
1201: }
1202: #
1.74 matthew 1203: $plot=<<"END";
1204: <gnuplot
1205: texfont="10"
1206: fgcolor="x000000"
1207: plottype="Cartesian"
1208: font="large"
1209: grid="on"
1210: align="center"
1211: border="on"
1212: transparent="on"
1.81 matthew 1213: alttag="Mean and S.D of Tries Plot"
1.74 matthew 1214: samples="100"
1215: bgcolor="xffffff"
1216: height="$height"
1217: width="$width">
1.81 matthew 1218: <title>$title</title>
1.74 matthew 1219: <axis xmin="0" ymin="0" xmax="$xmax" ymax="$ymax" color="x000000" />
1220: <xlabel>Problem Number</xlabel>
1.81 matthew 1221: <ylabel>Number of Tries</ylabel>
1.74 matthew 1222: <curve
1223: linestyle="yerrorbars"
1224: name="S.D. Tries"
1225: pointtype="1"
1226: color="x666666">
1227: $std_error_data
1228: </curve>
1229: <curve
1230: linestyle="points"
1231: name="Mean Tries"
1232: pointtype="1"
1233: color="xCC4444">
1234: $std_data
1235: </curve>
1236: </gnuplot>
1237: END
1.117 bisitz 1238: my $plotresult =
1.74 matthew 1239: '<p>'.&Apache::lonxml::xmlparse($r,'web',$plot).'</p>'.$/;
1240: $r->print($plotresult);
1241: return;
1242: }
1243:
1.73 matthew 1244: sub plot_dropdown {
1245: my $current = '';
1246: #
1.104 albertel 1247: if (defined($env{'form.plot'})) {
1248: $current = $env{'form.plot'};
1.73 matthew 1249: }
1250: #
1251: my @Additional_Plots = (
1252: { graphable=>'yes',
1253: name => 'degrees',
1.81 matthew 1254: title => 'Difficulty Indexes' },
1.74 matthew 1255: { graphable=>'yes',
1256: name => 'tries statistics',
1.81 matthew 1257: title => 'Tries Statistics' });
1.73 matthew 1258: #
1259: my $Str= "\n".'<select name="plot" size="1">';
1260: $Str .= '<option name="none"></option>'."\n";
1261: $Str .= '<option name="none2">none</option>'."\n";
1.81 matthew 1262: foreach my $field (@Additional_Plots,@Fields) {
1.73 matthew 1263: if (! exists($field->{'graphable'}) ||
1264: $field->{'graphable'} ne 'yes') {
1265: next;
1266: }
1267: $Str .= '<option value="'.$field->{'name'}.'"';
1268: if ($field->{'name'} eq $current) {
1269: $Str .= ' selected ';
1270: }
1271: $Str.= '>'.&mt($field->{'title'}).'</option>'."\n";
1272: }
1273: $Str .= '</select>'."\n";
1274: return $Str;
1275: }
1276:
1.41 matthew 1277: ###############################################
1278: ###############################################
1.73 matthew 1279: ##
1280: ## Excel output routines
1281: ##
1.41 matthew 1282: ###############################################
1283: ###############################################
1.73 matthew 1284: sub Excel_output {
1.44 matthew 1285: my ($r) = @_;
1.73 matthew 1286: $r->print('<h2>'.&mt('Preparing Excel Spreadsheet').'</h2>');
1287: ##
1288: ## Compute the statistics
1289: &compute_all_statistics($r);
1290: my $c = $r->connection;
1291: return if ($c->aborted());
1.101 matthew 1292: #
1293: my ($starttime,$endtime) = &Apache::lonstathelpers::get_time_limits();
1.73 matthew 1294: ##
1295: ## Create the excel workbook
1.101 matthew 1296: my ($excel_workbook,$filename,$format) =
1297: &Apache::loncommon::create_workbook($r);
1298: return if (! defined($excel_workbook));
1.44 matthew 1299: #
1300: # Add a worksheet
1.104 albertel 1301: my $sheetname = $env{'course.'.$env{'request.course.id'}.'.description'};
1.44 matthew 1302: if (length($sheetname) > 31) {
1303: $sheetname = substr($sheetname,0,31);
1304: }
1.73 matthew 1305: my $excel_sheet = $excel_workbook->addworksheet(
1306: &Apache::loncommon::clean_excel_name($sheetname));
1307: ##
1308: ## Begin creating excel sheet
1309: ##
1310: my ($rows_output,$cols_output) = (0,0);
1.44 matthew 1311: #
1312: # Put the course description in the header
1313: $excel_sheet->write($rows_output,$cols_output++,
1.104 albertel 1314: $env{'course.'.$env{'request.course.id'}.'.description'},
1.82 matthew 1315: $format->{'h1'});
1.44 matthew 1316: $cols_output += 3;
1317: #
1318: # Put a description of the sections listed
1319: my $sectionstring = '';
1.82 matthew 1320: $excel_sheet->write($rows_output,$cols_output++,
1.103 matthew 1321: &Apache::lonstatistics::section_and_enrollment_description('plaintext'),
1.82 matthew 1322: $format->{'h3'});
1.102 matthew 1323: $cols_output += scalar(&Apache::lonstatistics::get_selected_sections());
1.108 raeburn 1324: $cols_output += scalar(&Apache::lonstatistics::get_selected_groups());
1.44 matthew 1325: #
1.70 matthew 1326: # Time restrictions
1327: my $time_string;
1328: if (defined($starttime)) {
1329: # call localtime but not lonlocal:locallocaltime because excel probably
1330: # cannot handle localized text. Probably.
1331: $time_string .= 'Data collected from '.localtime($time_string);
1332: if (defined($endtime)) {
1333: $time_string .= ' to '.localtime($endtime);
1334: }
1335: $time_string .= '.';
1336: } elsif (defined($endtime)) {
1337: # See note above about lonlocal:locallocaltime
1338: $time_string .= 'Data collected before '.localtime($endtime).'.';
1339: }
1.82 matthew 1340: if (defined($time_string)) {
1341: $excel_sheet->write($rows_output,$cols_output++,$time_string);
1342: $cols_output+= 5;
1343: }
1.70 matthew 1344: #
1.44 matthew 1345: # Put the date in there too
1346: $excel_sheet->write($rows_output,$cols_output++,
1347: 'Compiled on '.localtime(time));
1348: #
1.117 bisitz 1349: $rows_output++;
1.44 matthew 1350: $cols_output=0;
1.82 matthew 1351: ##
1352: ## Sequence Statistics
1.117 bisitz 1353: ##
1.82 matthew 1354: &write_headers($excel_sheet,$format,\$rows_output,\$cols_output,
1355: \@SeqFields);
1.97 matthew 1356: foreach my $seq (@sequences) {
1357: my $data = $SeqStat{$seq->symb};
1.82 matthew 1358: $cols_output=0;
1359: foreach my $field (@SeqFields) {
1360: next if ($field->{'selected'} ne 'yes');
1.85 matthew 1361: my $fieldformat = undef;
1362: if (exists($field->{'excel_format'})) {
1363: $fieldformat = $format->{$field->{'excel_format'}};
1364: }
1.55 matthew 1365: $excel_sheet->write($rows_output,$cols_output++,
1.85 matthew 1366: $data->{$field->{'name'}},$fieldformat);
1.55 matthew 1367: }
1.82 matthew 1368: $rows_output++;
1369: $cols_output=0;
1.55 matthew 1370: }
1.82 matthew 1371: ##
1372: ## Resource Statistics
1373: ##
1.55 matthew 1374: $rows_output++;
1375: $cols_output=0;
1.82 matthew 1376: &write_headers($excel_sheet,$format,\$rows_output,\$cols_output,
1377: \@Fields);
1378: #
1.73 matthew 1379: foreach my $data (@StatsArray) {
1380: $cols_output=0;
1381: foreach my $field (@Fields) {
1.76 matthew 1382: next if ($field->{'selected'} ne 'yes');
1.73 matthew 1383: next if ($field->{'name'} eq 'problem_num');
1.85 matthew 1384: my $fieldformat = undef;
1385: if (exists($field->{'excel_format'})) {
1386: $fieldformat = $format->{$field->{'excel_format'}};
1387: }
1.73 matthew 1388: $excel_sheet->write($rows_output,$cols_output++,
1.85 matthew 1389: $data->{$field->{'name'}},$fieldformat);
1.44 matthew 1390: }
1.73 matthew 1391: $rows_output++;
1.82 matthew 1392: $cols_output=0;
1.44 matthew 1393: }
1394: #
1395: $excel_workbook->close();
1.73 matthew 1396: #
1.44 matthew 1397: # Tell the user where to get their excel file
1398: $r->print('<br />'.
1.59 matthew 1399: '<a href="'.$filename.'">'.
1400: &mt('Your Excel Spreadsheet').'</a>'."\n");
1.44 matthew 1401: $r->rflush();
1402: return;
1403: }
1404:
1.82 matthew 1405: ##
1406: ## &write_headers
1407: ##
1408: sub write_headers {
1409: my ($excel_sheet,$format,$rows_output,$cols_output,$Fields) = @_;
1410: ##
1411: ## First the long titles
1412: foreach my $field (@{$Fields}) {
1413: next if ($field->{'name'} eq 'problem_num');
1414: next if ($field->{'selected'} ne 'yes');
1415: if (exists($field->{'long_title'})) {
1416: $excel_sheet->write($$rows_output,${$cols_output},
1417: $field->{'long_title'},
1418: $format->{'bold'});
1419: } else {
1420: $excel_sheet->write($$rows_output,${$cols_output},'');
1421: }
1422: ${$cols_output}+= 1;
1423: }
1424: ${$cols_output} =0;
1425: ${$rows_output}+=1;
1426: ##
1427: ## Then the short titles
1428: foreach my $field (@{$Fields}) {
1429: next if ($field->{'selected'} ne 'yes');
1430: next if ($field->{'name'} eq 'problem_num');
1.117 bisitz 1431: # Use english for excel as I am not sure how well excel handles
1.82 matthew 1432: # other character sets....
1433: $excel_sheet->write($$rows_output,$$cols_output,
1434: $field->{'title'},
1435: $format->{'bold'});
1436: $$cols_output+=1;
1437: }
1438: ${$cols_output} =0;
1439: ${$rows_output}+=1;
1440: return;
1441: }
1442:
1.73 matthew 1443: ##################################################
1444: ##################################################
1445: ##
1446: ## Statistics Gathering and Manipulation Routines
1447: ##
1448: ##################################################
1449: ##################################################
1450: sub compute_statistics_on_sequence {
1451: my ($seq) = @_;
1452: my @Data;
1.97 matthew 1453: foreach my $res (&Apache::lonstathelpers::get_resources($navmap,$seq)) {
1454: foreach my $part (@{$res->parts}) {
1.118 raeburn 1455: next if (($res->is_survey($part)) || ($res->is_anonsurvey($part))) ;
1.73 matthew 1456: #
1457: # This is where all the work happens
1458: my $data = &get_statistics($seq,$res,$part,scalar(@StatsArray)+1);
1459: push (@Data,$data);
1460: push (@StatsArray,$data);
1.49 matthew 1461: }
1.26 stredwic 1462: }
1.73 matthew 1463: return @Data;
1.41 matthew 1464: }
1.26 stredwic 1465:
1.73 matthew 1466: sub compute_all_statistics {
1467: my ($r) = @_;
1468: if (@StatsArray > 0) {
1469: # Assume we have already computed the statistics
1470: return;
1471: }
1472: my $c = $r->connection;
1.97 matthew 1473: foreach my $seq (@sequences) {
1.73 matthew 1474: last if ($c->aborted);
1.82 matthew 1475: &compute_sequence_statistics($seq);
1.73 matthew 1476: &compute_statistics_on_sequence($seq);
1.49 matthew 1477: }
1478: }
1479:
1.73 matthew 1480: sub sort_data {
1481: my ($sortkey) = @_;
1482: return if (! @StatsArray);
1.45 matthew 1483: #
1.73 matthew 1484: # Sort the data
1485: my $sortby = undef;
1.49 matthew 1486: foreach my $field (@Fields) {
1.73 matthew 1487: if ($sortkey eq $field->{'name'}) {
1488: $sortby = $field->{'name'};
1.45 matthew 1489: }
1.26 stredwic 1490: }
1.73 matthew 1491: if (! defined($sortby) || $sortby eq '' || $sortby eq 'problem_num') {
1492: $sortby = 'container';
1493: }
1494: if ($sortby ne 'container') {
1495: # $sortby is already defined, so we can charge ahead
1496: if ($sortby =~ /^(title|part)$/i) {
1497: # Alpha comparison
1498: @StatsArray = sort {
1499: lc($a->{$sortby}) cmp lc($b->{$sortby}) ||
1500: lc($a->{'title'}) cmp lc($b->{'title'}) ||
1501: lc($a->{'part'}) cmp lc($b->{'part'});
1502: } @StatsArray;
1.24 stredwic 1503: } else {
1.73 matthew 1504: # Numerical comparison
1505: @StatsArray = sort {
1506: my $retvalue = 0;
1507: if ($b->{$sortby} eq 'nan') {
1508: if ($a->{$sortby} ne 'nan') {
1509: $retvalue = -1;
1510: } else {
1511: $retvalue = 0;
1512: }
1513: }
1514: if ($a->{$sortby} eq 'nan') {
1515: if ($b->{$sortby} ne 'nan') {
1516: $retvalue = 1;
1517: }
1518: }
1519: if ($retvalue eq '0') {
1520: $retvalue = $b->{$sortby} <=> $a->{$sortby} ||
1521: lc($a->{'title'}) <=> lc($b->{'title'}) ||
1522: lc($a->{'part'}) <=> lc($b->{'part'});
1523: }
1524: $retvalue;
1525: } @StatsArray;
1.24 stredwic 1526: }
1527: }
1.45 matthew 1528: #
1.73 matthew 1529: # Renumber the data set
1530: my $count;
1531: foreach my $data (@StatsArray) {
1532: $data->{'problem_num'} = ++$count;
1533: }
1.24 stredwic 1534: return;
1.48 matthew 1535: }
1536:
1.70 matthew 1537: ########################################################
1538: ########################################################
1539:
1540: =pod
1541:
1542: =item &get_statistics()
1543:
1.117 bisitz 1544: Wrapper routine from the call to loncoursedata::get_problem_statistics.
1.73 matthew 1545: Calls lonstathelpers::get_time_limits() to limit the data set by time
1546: and &compute_discrimination_factor
1.70 matthew 1547:
1548: Inputs: $sequence, $resource, $part, $problem_num
1549:
1.117 bisitz 1550: Returns: Hash reference with statistics data from
1.70 matthew 1551: loncoursedata::get_problem_statistics.
1552:
1553: =cut
1554:
1555: ########################################################
1556: ########################################################
1.48 matthew 1557: sub get_statistics {
1.49 matthew 1558: my ($sequence,$resource,$part,$problem_num) = @_;
1.48 matthew 1559: #
1.70 matthew 1560: my ($starttime,$endtime) = &Apache::lonstathelpers::get_time_limits();
1.97 matthew 1561: my $symb = $resource->symb;
1.104 albertel 1562: my $courseid = $env{'request.course.id'};
1.48 matthew 1563: #
1.49 matthew 1564: my $data = &Apache::loncoursedata::get_problem_statistics
1.102 matthew 1565: ([&Apache::lonstatistics::get_selected_sections()],
1.108 raeburn 1566: [&Apache::lonstatistics::get_selected_groups()],
1.66 matthew 1567: $Apache::lonstatistics::enrollment_status,
1.70 matthew 1568: $symb,$part,$courseid,$starttime,$endtime);
1.85 matthew 1569: $data->{'symb'} = $symb;
1.49 matthew 1570: $data->{'part'} = $part;
1571: $data->{'problem_num'} = $problem_num;
1.97 matthew 1572: $data->{'container'} = $sequence->compTitle;
1573: $data->{'title'} = $resource->compTitle;
1574: $data->{'title.link'} = $resource->src.'?symb='.
1.109 www 1575: &escape($resource->symb);
1.49 matthew 1576: #
1.76 matthew 1577: if ($SelectedFields{'deg_of_disc'}) {
1.117 bisitz 1578: $data->{'deg_of_disc'} =
1.76 matthew 1579: &compute_discrimination_factor($resource,$part,$sequence);
1580: }
1.83 matthew 1581: #
1582: # Store in metadata if computations were done for all students
1.84 matthew 1583: if ($data->{'num_students'} > 1) {
1.102 matthew 1584: my @Sections = &Apache::lonstatistics::get_selected_sections();
1.84 matthew 1585: my $sections = '"'.join(' ',@Sections).'"';
1586: $sections =~ s/&+/_/g; # Ensure no special characters
1587: $data->{'sections'}=$sections;
1.104 albertel 1588: $data->{'course'} = $env{'request.course.id'};
1.97 matthew 1589: my $urlres=(&Apache::lonnet::decode_symb($resource->symb))[2];
1.117 bisitz 1590: my %storestats =
1.84 matthew 1591: &LONCAPA::lonmetadata::dynamic_metadata_storage($data);
1.117 bisitz 1592: my ($dom,$user) = ($urlres=~m{^($LONCAPA::domain_re)/($LONCAPA::username_re)});
1.83 matthew 1593: &Apache::lonnet::put('nohist_resevaldata',\%storestats,$dom,$user);
1594: }
1.85 matthew 1595: #
1.95 matthew 1596: $data->{'tries_per_correct'} = $data->{'tries'} /
1597: ($data->{'num_solved'}+0.1);
1598: #
1.85 matthew 1599: # Get the due date for research purposes (commented out most of the time)
1.112 raeburn 1600: # my $duedate = &Apache::lonnet::EXT('resource.'.$part.'.duedate',$symb);;
1601: # my $opendate = &Apache::lonnet::EXT('resource.'.$part.'.opendate',$symb);
1602: # my $maxtries = &Apache::lonnet::EXT('resource.'.$part.'.maxtries',$symb);
1603: # my $hinttries = &Apache::lonnet::EXT('resource.'.$part.'.hinttries',$symb);
1604: my $weight = &Apache::lonnet::EXT('resource.'.$part.'.weight',$symb);
1605: $data->{'weight'} = $weight;
1.117 bisitz 1606: # $data->{'duedate'} = $duedate;
1.112 raeburn 1607: # $data->{'opendate'} = $opendate;
1608: # $data->{'maxtries'} = $maxtries;
1609: # $data->{'hinttries'} = $hinttries;
1.86 matthew 1610: # $data->{'resptypes'} = join(',',@{$resource->{'partdata'}->{$part}->{'ResponseTypes'}});
1.49 matthew 1611: return $data;
1.71 matthew 1612: }
1613:
1614: ###############################################
1615: ###############################################
1616:
1617: =pod
1618:
1619: =item &compute_discrimination_factor()
1620:
1621: Inputs: $Resource, $Sequence
1622:
1623: Returns: integer between -1 and 1
1624:
1625: =cut
1626:
1627: ###############################################
1628: ###############################################
1629: sub compute_discrimination_factor {
1.97 matthew 1630: my ($resource,$part,$seq) = @_;
1631: my $symb = $resource->symb;
1.71 matthew 1632: my @Resources;
1.97 matthew 1633: foreach my $res (&Apache::lonstathelpers::get_resources($navmap,$seq)){
1634: next if ($res->symb eq $symb);
1635: push (@Resources,$res->symb);
1.71 matthew 1636: }
1637: #
1638: # rank
1.83 matthew 1639: my ($starttime,$endtime) = &Apache::lonstathelpers::get_time_limits();
1.117 bisitz 1640: my $ranking =
1.71 matthew 1641: &Apache::loncoursedata::rank_students_by_scores_on_resources
1642: (\@Resources,
1.102 matthew 1643: [&Apache::lonstatistics::get_selected_sections()],
1.108 raeburn 1644: [&Apache::lonstatistics::get_selected_groups()],
1.83 matthew 1645: $Apache::lonstatistics::enrollment_status,undef,
1.106 bowersj2 1646: $starttime,$endtime, $symb);
1.71 matthew 1647: #
1648: # compute their percent scores on the problems in the sequence,
1649: my $number_to_grab = int(scalar(@{$ranking})/4);
1650: my $num_students = scalar(@{$ranking});
1.117 bisitz 1651: my @BottomSet = map { $_->[&Apache::loncoursedata::RNK_student()];
1.71 matthew 1652: } @{$ranking}[0..$number_to_grab];
1.117 bisitz 1653: my @TopSet =
1654: map {
1655: $_->[&Apache::loncoursedata::RNK_student()];
1.106 bowersj2 1656: } @{$ranking}[-$number_to_grab..0];
1.91 matthew 1657: if (! @BottomSet || (@BottomSet == 1 && $BottomSet[0] eq '') ||
1658: ! @TopSet || (@TopSet == 1 && $TopSet[0] eq '')) {
1659: return 'nan';
1660: }
1.117 bisitz 1661: my ($bottom_sum,$bottom_max) =
1.97 matthew 1662: &Apache::loncoursedata::get_sum_of_scores($symb,$part,\@BottomSet,
1.83 matthew 1663: undef,$starttime,$endtime);
1.117 bisitz 1664: my ($top_sum,$top_max) =
1.97 matthew 1665: &Apache::loncoursedata::get_sum_of_scores($symb,$part,\@TopSet,
1.83 matthew 1666: undef,$starttime,$endtime);
1.71 matthew 1667: my $deg_of_disc;
1668: if ($top_max == 0 || $bottom_max==0) {
1669: $deg_of_disc = 'nan';
1670: } else {
1671: $deg_of_disc = ($top_sum/$top_max) - ($bottom_sum/$bottom_max);
1672: }
1673: #&Apache::lonnet::logthis(' '.$top_sum.'/'.$top_max.
1674: # ' - '.$bottom_sum.'/'.$bottom_max);
1675: return $deg_of_disc;
1.1 stredwic 1676: }
1.12 minaeibi 1677:
1.45 matthew 1678: ###############################################
1679: ###############################################
1.79 matthew 1680: ##
1681: ## Compute KR-21
1682: ##
1683: ## To compute KR-21, you need the following information:
1684: ##
1685: ## K=the number of items in your test
1686: ## M=the mean score on the test
1.117 bisitz 1687: ## s=the standard deviation of the scores on your test
1.79 matthew 1688: ##
1689: ## then:
1.117 bisitz 1690: ##
1.79 matthew 1691: ## KR-21 rk= [K/(K-1)] * [1- (M*(K-M))/(K*s^2))]
1692: ##
1693: ###############################################
1694: ###############################################
1695: sub compute_sequence_statistics {
1696: my ($seq) = @_;
1.97 matthew 1697: my $symb = $seq->symb;
1.79 matthew 1698: my @Resources;
1.97 matthew 1699: my $part_count;
1700: foreach my $res (&Apache::lonstathelpers::get_resources($navmap,$seq)) {
1701: push (@Resources,$res->symb);
1702: $part_count += scalar(@{$res->parts});
1.79 matthew 1703: }
1704: my ($starttime,$endtime) = &Apache::lonstathelpers::get_time_limits();
1705: #
1706: # First compute statistics based on student scores
1.117 bisitz 1707: my ($smin,$smax,$sMean,$sSTD,$scount,$sMAX) =
1.79 matthew 1708: &Apache::loncoursedata::score_stats
1.102 matthew 1709: ([&Apache::lonstatistics::get_selected_sections()],
1.108 raeburn 1710: [&Apache::lonstatistics::get_selected_groups()],
1.79 matthew 1711: $Apache::lonstatistics::enrollment_status,
1712: \@Resources,$starttime,$endtime,undef);
1.97 matthew 1713: $SeqStat{$symb}->{'title'} = $seq->compTitle;
1.79 matthew 1714: $SeqStat{$symb}->{'scoremax'} = $smax;
1715: $SeqStat{$symb}->{'scoremin'} = $smin;
1716: $SeqStat{$symb}->{'scoremean'} = $sMean;
1717: $SeqStat{$symb}->{'scorestd'} = $sSTD;
1718: $SeqStat{$symb}->{'scorecount'} = $scount;
1719: $SeqStat{$symb}->{'max_possible'} = $sMAX;
1720: #
1721: # Compute statistics based on the number of correct problems
1.117 bisitz 1722: # 'correct' is taken to mean
1.79 matthew 1723: my ($cmin,$cmax,$cMean,$cSTD,$ccount)=
1724: &Apache::loncoursedata::count_stats
1.102 matthew 1725: ([&Apache::lonstatistics::get_selected_sections()],
1.108 raeburn 1726: [&Apache::lonstatistics::get_selected_groups()],
1.79 matthew 1727: $Apache::lonstatistics::enrollment_status,
1728: \@Resources,$starttime,$endtime,undef);
1.97 matthew 1729: my $K = $part_count;
1.79 matthew 1730: my $kr_21;
1731: if ($K > 1 && $cSTD > 0) {
1732: $kr_21 = ($K/($K-1)) * (1 - $cMean*($K-$cMean)/($K*$cSTD**2));
1733: } else {
1734: $kr_21 = 'nan';
1735: }
1736: $SeqStat{$symb}->{'countmax'} = $cmax;
1737: $SeqStat{$symb}->{'countmin'} = $cmin;
1738: $SeqStat{$symb}->{'countstd'} = $cSTD;
1.82 matthew 1739: $SeqStat{$symb}->{'countmean'} = $cMean;
1.79 matthew 1740: $SeqStat{$symb}->{'count'} = $ccount;
1741: $SeqStat{$symb}->{'items'} = $K;
1742: $SeqStat{$symb}->{'KR-21'}=$kr_21;
1743: return;
1744: }
1745:
1746:
1.47 matthew 1747:
1748: =pod
1749:
1.73 matthew 1750: =item ProblemStatisticsLegend
1751:
1752: =over 4
1753:
1754: =item #Stdnts
1755: Total number of students attempted the problem.
1756:
1757: =item Tries
1758: Total number of tries for solving the problem.
1.59 matthew 1759:
1.73 matthew 1760: =item Max Tries
1761: Largest number of tries for solving the problem by a student.
1762:
1763: =item Mean
1764: Average number of tries. [ Tries / #Stdnts ]
1765:
1766: =item #YES
1767: Number of students solved the problem correctly.
1768:
1769: =item #yes
1770: Number of students solved the problem by override.
1771:
1772: =item %Wrong
1773: Percentage of students who tried to solve the problem
1774: but is still incorrect. [ 100*((#Stdnts-(#YES+#yes))/#Stdnts) ]
1775:
1776: =item DoDiff
1777: Degree of Difficulty of the problem.
1778: [ 1 - ((#YES+#yes) / Tries) ]
1779:
1780: =item S.D.
1781: Standard Deviation of the tries.
1782: [ sqrt(sum((Xi - Mean)^2)) / (#Stdnts-1)
1783: where Xi denotes every student\'s tries ]
1784:
1785: =item Skew.
1786: Skewness of the students tries.
1787: [(sqrt( sum((Xi - Mean)^3) / #Stdnts)) / (S.D.^3)]
1788:
1789: =item Dis.F.
1790: Discrimination Factor: A Standard for evaluating the
1791: problem according to a Criterion<br>
1792:
1793: =item [Criterion to group students into %27 Upper Students -
1794: and %27 Lower Students]
1795: 1st Criterion for Sorting the Students:
1796: Sum of Partial Credit Awarded / Total Number of Tries
1797: 2nd Criterion for Sorting the Students:
1798: Total number of Correct Answers / Total Number of Tries
1799:
1800: =item Disc.
1801: Number of Students had at least one discussion.
1802:
1803: =back
1.47 matthew 1804:
1805: =cut
1.73 matthew 1806:
1807: ############################################################
1808: ############################################################
1.4 minaeibi 1809:
1.1 stredwic 1810: 1;
1811: __END__
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>