Annotation of loncom/homework/matchresponse.pm, revision 1.91
1.1 albertel 1: # The LearningOnline Network with CAPA
2: # Full matching style response
3: #
1.91 ! bisitz 4: # $Id: matchresponse.pm,v 1.90 2014/02/27 14:41:34 bisitz Exp $
1.1 albertel 5: #
6: # Copyright Michigan State University Board of Trustees
7: #
8: # This file is part of the LearningOnline Network with CAPA (LON-CAPA).
9: #
10: # LON-CAPA is free software; you can redistribute it and/or modify
11: # it under the terms of the GNU General Public License as published by
12: # the Free Software Foundation; either version 2 of the License, or
13: # (at your option) any later version.
14: #
15: # LON-CAPA is distributed in the hope that it will be useful,
16: # but WITHOUT ANY WARRANTY; without even the implied warranty of
17: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18: # GNU General Public License for more details.
19: #
20: # You should have received a copy of the GNU General Public License
21: # along with LON-CAPA; if not, write to the Free Software
22: # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23: #
24: # /home/httpd/html/adm/gpl.txt
25: #
26: # http://www.lon-capa.org/
27: #
28:
29: package Apache::matchresponse;
30: use strict;
31: use HTML::Entities();
32: use Math::Random();
1.37 albertel 33: use Apache::optionresponse();
34: use Apache::lonlocal;
1.52 albertel 35: use Apache::lonnet;
1.71 onken 36: use Apache::lonxml;
1.87 raeburn 37: use POSIX qw(ceil);
1.6 sakharuk 38:
1.1 albertel 39: BEGIN {
40: &Apache::lonxml::register('Apache::matchresponse',('matchresponse'));
41: }
42:
43: sub start_matchresponse {
44: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
45: my $result;
46: #when in a matchresponse use these
47: &Apache::lonxml::register('Apache::matchresponse',
48: ('foilgroup','foil','conceptgroup','item',
49: 'itemgroup'));
50: push (@Apache::lonxml::namespace,'matchresponse');
51: my $id = &Apache::response::start_response($parstack,$safeeval);
52: %Apache::hint::match=();
1.37 albertel 53: undef(%Apache::response::foilnames);
1.1 albertel 54: if ($target eq 'meta') {
55: $result=&Apache::response::meta_package_write('matchresponse');
56: } elsif ($target eq 'edit' ) {
57: $result.=&Apache::edit::start_table($token).
1.73 raeburn 58: '<tr><td>'.&Apache::lonxml::description($token).'</td>'
1.72 bisitz 59: .'<td><span class="LC_nobreak">'.&mt('Delete?').' '
60: .&Apache::edit::deletelist($target,$token)
61: .'</span></td>'
1.73 raeburn 62: .'<td> '.&Apache::edit::end_row()
1.72 bisitz 63: .&Apache::edit::start_spanning_row();
1.1 albertel 64:
65: $result.=
66: &Apache::edit::text_arg('Max Number Of Shown Foils:','max',$token,'4').
1.72 bisitz 67: &Apache::edit::select_arg('Randomize Foil Order:','randomize',
1.1 albertel 68: ['yes','no'],$token).
69: &Apache::edit::end_row().&Apache::edit::start_spanning_row()."\n";
70: } elsif ($target eq 'modified') {
71: my $constructtag=&Apache::edit::get_new_args($token,$parstack,
72: $safeeval,'max',
73: 'randomize');
74: if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
1.28 albertel 75: } elsif ($target eq 'analyze') {
76: my $part_id="$Apache::inputtags::part.$id";
1.69 raeburn 77: $Apache::lonhomework::analyze{"$part_id.type"} = 'matchresponse';
1.28 albertel 78: push (@{ $Apache::lonhomework::analyze{"parts"} },$part_id);
1.68 raeburn 79: push (@{ $Apache::lonhomework::analyze{"$part_id.bubble_lines"} },
1.65 foxr 80: 1);
1.1 albertel 81: }
82: return $result;
83: }
84:
85: sub end_matchresponse {
86: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
87: my $result;
88: if ($target eq 'edit') { $result=&Apache::edit::end_table(); }
89: &Apache::response::end_response;
90: pop @Apache::lonxml::namespace;
91: &Apache::lonxml::deregister('Apache::matchresponse',
92: ('foilgroup','foil','conceptgroup'));
1.37 albertel 93: undef(%Apache::response::foilnames);
1.1 albertel 94: return $result;
95: }
96:
97: %Apache::response::itemgroup=();
98: sub start_itemgroup {
99: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
100: my $result;
101: %Apache::response::itemgroup=();
1.4 albertel 102: %Apache::matchresponse::itemtable=();
1.15 albertel 103:
1.1 albertel 104: if ($target eq 'edit') {
105: $result=&Apache::edit::tag_start($target,$token);
106: $result.=&Apache::edit::select_arg('Randomize Order:','randomize',
1.88 bisitz 107: ['yes','no'],$token);
1.4 albertel 108: $result.=&Apache::edit::select_arg('Items Display Location:',
109: 'location',
110: ['top','bottom','left','right'],
1.88 bisitz 111: $token);
1.73 raeburn 112: $result.=&Apache::edit::select_arg('Items Display Direction:',
1.51 albertel 113: 'direction',
114: ['vertical','horizontal'],
1.88 bisitz 115: $token);
1.87 raeburn 116: $result.=&Apache::edit::select_arg('Items Columns:',
117: 'columns',
118: [['','default'],'1','2','3','4'],
119: $token);
1.1 albertel 120: $result.=&Apache::edit::end_row().&Apache::edit::start_spanning_row();
1.4 albertel 121: } elsif ($target eq 'modified') {
122: my $constructtag=&Apache::edit::get_new_args($token,$parstack,
123: $safeeval,'randomize',
1.87 raeburn 124: 'location','direction',
125: 'columns');
1.4 albertel 126: if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
1.21 sakharuk 127: } elsif ($target eq 'web' or $target eq 'tex') {
1.4 albertel 128: $Apache::matchresponse::itemtable{'location'}=
129: &Apache::lonxml::get_param('location',$parstack,$safeeval);
1.43 sakharuk 130: $Apache::matchresponse::TeXitemgroupwidth=&Apache::lonxml::get_param('TeXitemgroupwidth',$parstack,$safeeval,undef,0);
1.1 albertel 131: }
132: return $result;
133: }
134:
135: sub end_itemgroup {
136: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
137: my $result;
138:
1.17 albertel 139: if ($target eq 'edit') { $result=&Apache::edit::end_table(); }
1.84 raeburn 140: if (ref($Apache::response::itemgroup{'names'}) eq 'ARRAY') {
141: if(!@{ $Apache::response::itemgroup{'names'} }) { return; }
142: } else {
143: return;
144: }
1.1 albertel 145: my @names=@{ $Apache::response::itemgroup{'names'} };
146: my $randomize =&Apache::lonxml::get_param('randomize',$parstack,$safeeval);
1.2 albertel 147: if ($randomize ne 'no' ) {
1.18 albertel 148: @names=&Apache::response::whichorder($#names+1,$randomize,0,
149: \%Apache::response::itemgroup);
1.1 albertel 150: }
1.30 albertel 151: if ($target eq 'analyze') {
152: my $partid="$Apache::inputtags::part.$Apache::inputtags::response[-1]";
153: push (@{ $Apache::lonhomework::analyze{"$partid.items"} }, @names);
154: }
1.1 albertel 155: my %letter_name_map;
156: my %name_letter_map;
157: my @alphabet=('A'..'Z');
158: my $i=0;
159: foreach my $name (@names) {
160: $letter_name_map{$alphabet[$i]}=$name;
161: $name_letter_map{$name}=$alphabet[$i];
162: $i++;
163: }
1.15 albertel 164: $Apache::response::itemgroup{'letter_name_map'}=\%letter_name_map;
1.1 albertel 165: $Apache::response::itemgroup{'name_letter_map'}=\%name_letter_map;
1.51 albertel 166: my $direction=&Apache::lonxml::get_param('direction',$parstack,$safeeval);
1.87 raeburn 167: my $columns=&Apache::lonxml::get_param('columns',$parstack,$safeeval);
168:
169: unless ($columns =~ /^\d+$/) {
170: undef($columns);
171: }
1.1 albertel 172: if ($target eq 'web') {
1.58 foxr 173:
174: my $table='<br /><table>'; # extra space to match what latex does.
1.87 raeburn 175: if ((!$columns) || ($columns < 0)) {
176: if ($direction eq 'horizontal') {
177: if (@names > 0) {
178: $columns = scalar(@names);
179: } else {
180: $columns = 1;
181: }
182: } else {
183: $columns = 1;
184: }
185: }
186: my $rows=ceil(scalar(@names)/$columns);
187: my $endloop = $columns*$rows;
188: for (my $i=0; $i<$endloop; $i++) {
189: my $label = ' ';
190: my $item = ' ';
191: my $index;
192: if ($direction eq 'horizontal') {
193: $index = $i;
194: } else {
195: $index = ($i % $columns)*$rows+int($i/$columns);
196: }
197: if ($index < scalar(@names)) {
198: $label = $alphabet[$index];
199: $item = $Apache::response::itemgroup{$names[$index].'.text'};
200: }
201: if ($i % $columns == 0) {
202: $table.='<tr>';
203: }
204: $table.= '<td>'.$label.'</td><td>'.$item.'</td>';
205: if ($columns > 1) {
206: $table .= '<td> </td>';
207: }
208: if ( ! (($i+1) % $columns) ) {
209: $table.='</tr>';
210: }
211: }
1.4 albertel 212: $table.='</table>';
213: $Apache::matchresponse::itemtable{'display'}=$table;
1.60 albertel 214: $Apache::lonxml::post_evaluate=0;
1.5 sakharuk 215: } elsif ($target eq 'tex') {
1.58 foxr 216: my $table=' \begin{description}\setlength{\leftmargin}{2em}\setlength{\labelwidth}{1em}\setlength{\itemsep}{0.5pt plus1pt minus2pt}\setlength{\listparindent}{0em} ';
1.5 sakharuk 217: my $i=0;
1.82 raeburn 218: my ($numrows,$bubbles_per_row);
219: if ($Apache::lonhomework::type eq 'exam') {
220: ($numrows,$bubbles_per_row) =
221: &Apache::optionresponse::getnumrows(scalar(@names));
222: } else {
223: $numrows = 1;
224: }
1.5 sakharuk 225: foreach my $name (@names) {
1.59 foxr 226: # $Apache::response::itemgroup{$name.'.text'}=~s/\$\$/\$/g;
1.82 raeburn 227: my $item;
228: if (($numrows > 1) && ($bubbles_per_row > 0)) {
229: my $num = 1+int($i/$bubbles_per_row);
230: my $idx = int($i % $bubbles_per_row);
231: if ($idx == 0) {
232: if ($num == 1) {
233: $table .= '\item[\footnotesize {'.&mt('(first line)').'}]';
234: } else {
235: $table .= '\item[\footnotesize {'.&mt('(next line)').'}]';
236: }
237: }
238: $item = $alphabet[$idx];
239: } else {
240: $item = $alphabet[$i];
241: }
242: $table.='\item['.$item.'] '.
1.58 foxr 243: $Apache::response::itemgroup{$name.'.text'};
1.5 sakharuk 244: $i++;
245: }
1.58 foxr 246: $table.=' \end{description} \strut ';
1.77 foxr 247: if ($Apache::lonhomework::type eq 'exam') {$table.='\vskip -13 mm \strut ';}
1.5 sakharuk 248: $Apache::matchresponse::itemtable{'display'}=$table;
1.60 albertel 249: $Apache::lonxml::post_evaluate=0;
1.17 albertel 250: }
1.1 albertel 251: return $result;
252: }
253:
254: sub start_item {
255: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
256: my $result='';
1.30 albertel 257: if ($target eq 'web' || $target eq 'tex' || $target eq 'analyze') {
1.1 albertel 258: &Apache::lonxml::startredirection;
259: } elsif ($target eq 'edit') {
1.3 albertel 260: my $randomize=&Apache::lonxml::get_param('randomize',$parstack,
261: $safeeval,'-2');
1.1 albertel 262: $result=&Apache::edit::tag_start($target,$token,"Item");
263: $result.=&Apache::edit::text_arg('Name:','name',$token);
1.3 albertel 264: if ($randomize ne 'no') {
1.88 bisitz 265: $result.=
1.73 raeburn 266: &Apache::edit::select_arg('Location:','location',
1.3 albertel 267: ['random','top','bottom'],
268: $token);
269: }
270: $result.=&Apache::edit::end_row().&Apache::edit::start_spanning_row();
1.1 albertel 271: } elsif ($target eq 'modified') {
272: my $constructtag=&Apache::edit::get_new_args($token,$parstack,
1.3 albertel 273: $safeeval,'name',
274: 'location');
1.1 albertel 275: if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
276: }
277: return $result;
278: }
279:
280: sub end_item {
281: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
282: my $text ='';
283: my $result = '';
1.30 albertel 284: if ($target eq 'web' || $target eq 'tex' || $target eq 'analyze') {
1.1 albertel 285: $text=&Apache::lonxml::endredirection;
286: }
287: if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
1.30 albertel 288: $target eq 'edit' || $target eq 'tex' || $target eq 'analyze') {
1.1 albertel 289: my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval);
1.3 albertel 290: my $location=&Apache::lonxml::get_param('location',$parstack,
291: $safeeval);
1.1 albertel 292: &Apache::lonxml::debug("Got a name of :$name:");
1.55 albertel 293: if ($name eq "") { $name=$Apache::lonxml::curdepth; }
1.1 albertel 294: &Apache::lonxml::debug("Using a name of :$name:");
295: push @{ $Apache::response::itemgroup{'names'} }, $name;
296: $Apache::response::itemgroup{"$name.text"} = $text;
1.3 albertel 297: $Apache::response::itemgroup{"$name.location"} = $location;
1.1 albertel 298: }
299: if ($target eq 'edit') {
300: $result.= &Apache::edit::tag_end($target,$token,'');
301: }
302: return $result;
303: }
304:
305: sub insert_item {
306: return '
307: <item name="">
308: <startouttext />
309: <endouttext />
310: </item>';
311: }
312:
313: %Apache::response::foilgroup=();
314: sub start_foilgroup {
315: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
316: my $result;
317: %Apache::response::foilgroup=();
318: $Apache::matchresponse::conceptgroup=0;
1.81 raeburn 319: &Apache::response::pushrandomnumber(undef,$target);
1.1 albertel 320: if ($target eq 'edit') {
321: $result.=&Apache::edit::start_table($token)
1.73 raeburn 322: .'<tr><td>'.&mt('Collection Of Foils').'</td>'
1.72 bisitz 323: .'<td><span class="LC_nobreak">'.&mt('Delete?')
1.1 albertel 324: .&Apache::edit::deletelist($target,$token)
1.72 bisitz 325: .'</span></td>'
1.73 raeburn 326: .'<td> '.&Apache::edit::end_row()
1.1 albertel 327: .&Apache::edit::start_spanning_row()."\n";
328: }
329: return $result;
330: }
331:
332: sub end_foilgroup {
333: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
334: my $result;
1.67 foxr 335: my $part = $Apache::inputtags::part;
1.68 raeburn 336: my $response_id = $Apache::inputtags::response[-1];
1.67 foxr 337:
1.28 albertel 338: if ($target eq 'grade' || $target eq 'web' || $target eq 'answer' || $target eq 'tex' || $target eq 'analyze') {
1.1 albertel 339: my $max = &Apache::lonxml::get_param('max',$parstack,$safeeval,'-2');
340: my $randomize = &Apache::lonxml::get_param('randomize',$parstack,
341: $safeeval,'-2');
1.5 sakharuk 342: if ($target eq 'web' || $target eq 'tex') {
1.1 albertel 343: $result=&displayfoils($target,$max,$randomize);
1.60 albertel 344: $Apache::lonxml::post_evaluate=0;
1.1 albertel 345: } elsif ($target eq 'answer' ) {
346: $result=&displayanswers($max,$randomize);
347: } elsif ( $target eq 'grade') {
348: &grade_response($max,$randomize);
1.28 albertel 349: } elsif ( $target eq 'analyze') {
350: my @shown=&whichfoils($max,$randomize);
351: &Apache::response::analyze_store_foilgroup(\@shown,
1.29 albertel 352: ['text','value','location']);
1.28 albertel 353: #FIXME need to store options in some way
1.1 albertel 354: }
1.82 raeburn 355: my ($numrows,$bubbles_per_row);
356: if (($target eq 'tex') && ($Apache::lonhomework::type eq 'exam')) {
357: my $numitems;
358: if (ref($Apache::response::itemgroup{'names'}) eq 'ARRAY') {
359: $numitems = scalar(@{ $Apache::response::itemgroup{'names'} });
360: ($numrows,$bubbles_per_row) =
361: &Apache::optionresponse::getnumrows($numitems);
362: }
363: }
364: if ($numrows < 1) {
365: $numrows = 1;
366: }
367: my $increment = &getfoilcounts($max) * $numrows;
368: &Apache::lonxml::increment_counter($increment,"$part.$response_id");
1.66 foxr 369: if ($target eq 'analyze') {
370: &Apache::lonhomework::set_bubble_lines();
371: }
372:
1.1 albertel 373: } elsif ($target eq 'edit') {
374: $result=&Apache::edit::end_table();
375: }
1.41 albertel 376: &Apache::response::poprandomnumber();
1.1 albertel 377: return $result;
1.29 albertel 378: }
379:
380: sub whichfoils {
381: my ($max,$randomize)=@_;
382: return &Apache::response::whichorder(&getfoilcounts($max),
383: $randomize,
384: &Apache::response::showallfoils(),
385: \%Apache::response::foilgroup);
1.1 albertel 386: }
387:
388: sub displayanswers {
389: my ($max,$randomize,@opt)=@_;
1.84 raeburn 390: if (ref($Apache::response::foilgroup{'names'}) eq 'ARRAY') {
391: if (!@{ $Apache::response::foilgroup{'names'} }) { return; }
392: } else {
393: return;
394: }
1.1 albertel 395: my @names = @{ $Apache::response::foilgroup{'names'} };
1.18 albertel 396: my @whichfoils = &Apache::response::whichorder(&getfoilcounts($max),
397: $randomize,
398: &Apache::response::showallfoils(),
399: \%Apache::response::foilgroup);
1.1 albertel 400: my %name_letter_map;
1.84 raeburn 401: if (ref($Apache::response::itemgroup{'name_letter_map'}) eq 'HASH') {
402: if (%{$Apache::response::itemgroup{'name_letter_map'}}) {
403: %name_letter_map=
404: %{ $Apache::response::itemgroup{'name_letter_map'} };
405: }
1.1 albertel 406: }
1.56 albertel 407: my $result;
408: if ($Apache::lonhomework::type eq 'exam') {
409: my $i=0;
410: foreach my $name (@whichfoils) {
411: $result.=&Apache::response::answer_header('matchresponse',$i++);
412: my $value_name=$Apache::response::foilgroup{$name.'.value'};
413: my $letter=$name_letter_map{$value_name};
414: $result.=&Apache::response::answer_part('matchresponse',$letter);
415: $result.=&Apache::response::answer_footer('matchresponse');
416: }
417: } else {
418: $result=&Apache::response::answer_header('matchresponse');
419: foreach my $name (@whichfoils) {
420: my $value_name=$Apache::response::foilgroup{$name.'.value'};
421: my $letter=$name_letter_map{$value_name};
422: $result.=&Apache::response::answer_part('matchresponse',$letter);
423: }
424: $result.=&Apache::response::answer_footer('matchresponse');
1.1 albertel 425: }
426: return $result;
427: }
428:
429:
430: sub grade_response {
431: my ($max,$randomize)=@_;
1.18 albertel 432: my (@whichfoils)=&Apache::response::whichorder(&getfoilcounts($max),
433: $randomize,
434: &Apache::response::showallfoils(),
435: \%Apache::response::foilgroup);
1.50 albertel 436: if (!&Apache::response::submitted()) { return; }
1.1 albertel 437: my %responsehash;
438: my %grade;
1.81 raeburn 439: my %answerhash;
1.33 albertel 440: my ($temp,$right,$wrong,$ignored)=(1,0,0,0);
1.1 albertel 441: my %letter_name_map;
1.84 raeburn 442: if (ref($Apache::response::itemgroup{'letter_name_map'}) eq 'HASH') {
443: if (%{$Apache::response::itemgroup{'letter_name_map'}}) {
444: %letter_name_map=
445: %{ $Apache::response::itemgroup{'letter_name_map'} };
446: }
1.1 albertel 447: }
1.30 albertel 448: my @items;
1.82 raeburn 449: my $numitems = scalar(@{ $Apache::response::itemgroup{'names'} });
450: my ($numrows,$bubbles_per_row);
451: if ($Apache::lonhomework::scantronmode) {
452: my $numitems = scalar(@{ $Apache::response::itemgroup{'names'} });
453: ($numrows,$bubbles_per_row) =
454: &Apache::optionresponse::getnumrows($numitems);
455: }
456: if ($numrows < 1) {
457: $numrows = 1;
458: }
459: my @alphabet=('A'..'Z');
460: my %nums_from_letters;
461: for (my $i=0; $i<@alphabet; $i++) {
462: $nums_from_letters{$alphabet[$i]} = $i;
463: }
1.1 albertel 464: foreach my $name (@whichfoils) {
1.82 raeburn 465: my $response;
466: if ($numrows > 1) {
467: my $num = $temp;
468: my $totalnum;
469: for (my $i=0; $i<$numrows; $i++) {
470: my $item = &Apache::response::getresponse($num,'letter');
471: if ($item =~ /^\w$/) {
472: $totalnum = $i*$bubbles_per_row + $nums_from_letters{$item};
473: }
474: $num ++;
475: }
476: if ($totalnum =~ /^\d+$/) {
477: $response = $alphabet[$totalnum];
478: }
479: $temp += $numrows;
480: } else {
481: $response = &Apache::response::getresponse($temp,'letter');
482: $temp ++;
483: }
1.30 albertel 484: push(@items,$response);
1.1 albertel 485: my $responsename = $letter_name_map{$response};
486: my $value=$Apache::response::foilgroup{$name.'.value'};
1.81 raeburn 487: if ($Apache::lonhomework::type eq 'randomizetry') {
488: $answerhash{$name} = $value;
489: }
1.1 albertel 490: if ( $response =~ /[^\s]/) {
1.31 albertel 491: $responsehash{$name}=$responsename;
1.33 albertel 492: &Apache::lonxml::debug("submitted a $response($responsename) for $value<br />\n");
1.1 albertel 493: if ($value eq $responsename) {
494: $grade{$name}='1'; $right++;
495: } else {
496: $grade{$name}='0'; $wrong++;
497: }
498: } else {
499: $ignored++;
500: }
501: }
502: my $part=$Apache::inputtags::part;
1.86 raeburn 503: my $nonlenient=&Apache::optionresponse::grading_is_nonlenient($part);
1.1 albertel 504: my $id = $Apache::inputtags::response['-1'];
505: my $responsestr=&Apache::lonnet::hash2str(%responsehash);
1.30 albertel 506: my $itemstr =&Apache::lonnet::array2str(@items);
1.1 albertel 507: my $gradestr =&Apache::lonnet::hash2str(%grade);
1.30 albertel 508: my %previous=&Apache::response::check_for_previous($responsestr,$part,$id);
1.1 albertel 509: &Apache::lonxml::debug("Got $right right and $wrong wrong, and $ignored were ignored ");
510: $Apache::lonhomework::results{"resource.$part.$id.submission"}=
511: $responsestr;
1.30 albertel 512: $Apache::lonhomework::results{"resource.$part.$id.submissionitems"}=
513: $itemstr;
1.1 albertel 514: $Apache::lonhomework::results{"resource.$part.$id.submissiongrading"}=
515: $gradestr;
1.81 raeburn 516: if ($Apache::lonhomework::type eq 'randomizetry') {
517: $Apache::lonhomework::results{"resource.$part.$id.foilorder"} = &Apache::lonnet::array2str(@whichfoils);
518: }
1.79 raeburn 519: if (($Apache::lonhomework::type eq 'survey') ||
520: ($Apache::lonhomework::type eq 'surveycred') ||
521: ($Apache::lonhomework::type eq 'anonsurvey') ||
522: ($Apache::lonhomework::type eq 'anonsurveycred')) {
1.47 albertel 523: if ($ignored == 0) {
1.79 raeburn 524: my $ad;
525: if ($Apache::lonhomework::type eq 'anonsurvey') {
526: $ad=$Apache::lonhomework::results{"resource.$part.$id.awarddetail"}='ANONYMOUS';
527: } elsif ($Apache::lonhomework::type eq 'anonsurveycred') {
528: $ad=$Apache::lonhomework::results{"resource.$part.$id.awarddetail"}='ANONYMOUS_CREDIT';
529: } elsif ($Apache::lonhomework::type eq 'surveycred') {
530: $ad=$Apache::lonhomework::results{"resource.$part.$id.awarddetail"}='SUBMITTED_CREDIT';
531: } else {
532: $ad=$Apache::lonhomework::results{"resource.$part.$id.awarddetail"}='SUBMITTED';
533: }
1.47 albertel 534: &Apache::response::handle_previous(\%previous,$ad);
535: } elsif ($wrong==0 && $right==0) {
536: } else {
537: my $ad=$Apache::lonhomework::results{"resource.$part.$id.awarddetail"}='MISSING_ANSWER';
538: &Apache::response::handle_previous(\%previous,$ad);
539: }
1.83 raeburn 540: } elsif ($nonlenient) {
541: my $ad;
542: if ($wrong==0 && $ignored==0) {
543: $ad='EXACT_ANS';
544: } elsif ($wrong==0 && $right==0) {
545: #nothing submitted
546: } else {
547: if ($ignored==0) {
548: $ad='INCORRECT';
549: } else {
550: $ad='MISSING_ANSWER';
551: }
552: }
553: $Apache::lonhomework::results{"resource.$part.$id.awarddetail"}=$ad;
554: &Apache::response::handle_previous(\%previous,$ad);
1.34 albertel 555: } else {
1.83 raeburn 556: my $ad;
557: if ($wrong==0 && $right==0) {
558: #nothing submitted only assign a score if we
559: #need to override a previous grade
560: if (defined($Apache::lonhomework::history{"resource.$part.$id.awarddetail"})) {
561: $ad='ASSIGNED_SCORE';
562: }
563: } else {
564: $ad='ASSIGNED_SCORE';
565: }
566: $Apache::lonhomework::results{"resource.$part.$id.awarddetail"}=$ad;
567: $Apache::lonhomework::results{"resource.$part.$id.awarded"}=
568: $right/(scalar(@whichfoils));
569: $Apache::lonhomework::results{"resource.$part.$id.numfoils"}=
570: scalar(@whichfoils);
1.34 albertel 571: }
1.1 albertel 572: }
573:
1.64 albertel 574: sub format_prior_answer {
575: my ($mode,$answer,$other_data) = @_;
576: my %answer =&Apache::lonnet::str2hash($answer);
577: my $foil_order =$other_data->[0];
578: my %grading =&Apache::lonnet::str2hash($other_data->[1]);
579: my @items =&Apache::lonnet::str2array($other_data->[2]);
580: my $output;
581:
582: foreach my $name (@{ $foil_order }) {
1.90 bisitz 583: my $item = &HTML::Entities::encode(shift(@items),'<>&"');
1.91 ! bisitz 584: if ($item eq '') {
! 585: $item = ' ';
! 586: }
1.64 albertel 587: $output .= '<tr><td>'.$item.'</td></tr>';
588: }
589: return if (!defined($output));
590:
591: $output = '<table class="LC_prior_match">'.$output.'</table>';
592: return $output;
593: }
594:
1.4 albertel 595: sub itemdisplay {
596: my ($location)=@_;
597: if ($location eq 'top' &&
598: !defined($Apache::matchresponse::itemtable{'location'})) {
599: return $Apache::matchresponse::itemtable{'display'};
600: }
601: if ($Apache::matchresponse::itemtable{'location'} eq $location) {
602: return $Apache::matchresponse::itemtable{'display'};
603: }
604: return undef;
605: }
1.64 albertel 606:
1.1 albertel 607: sub displayfoils {
608: my ($target,$max,$randomize)=@_;
1.62 foxr 609: my ($tabsize, $lefttabsize, $righttabsize);
610:
1.1 albertel 611: my $result;
1.4 albertel 612: my $question;
1.18 albertel 613: my (@whichfoils)=&Apache::response::whichorder(&getfoilcounts($max),
614: $randomize,
615: &Apache::response::showallfoils(),
616: \%Apache::response::foilgroup);
1.1 albertel 617: my $part=$Apache::inputtags::part;
618: my $solved=$Apache::lonhomework::history{"resource.$part.solved"};
619: my %letter_name_map;
1.84 raeburn 620: if (ref($Apache::response::itemgroup{'letter_name_map'}) eq 'HASH') {
621: if (%{$Apache::response::itemgroup{'letter_name_map'}}) {
622: %letter_name_map=
623: %{ $Apache::response::itemgroup{'letter_name_map'} };
624: }
1.1 albertel 625: }
626: my %name_letter_map;
1.84 raeburn 627: if (ref($Apache::response::itemgroup{'name_letter_map'}) eq 'HASH') {
628: if (%{$Apache::response::itemgroup{'name_letter_map'}}) {
629: %name_letter_map=
630: %{ $Apache::response::itemgroup{'name_letter_map'} };
631: }
1.1 albertel 632: }
1.25 albertel 633: if ( &Apache::response::show_answer() && ($target ne 'tex')) {
1.1 albertel 634: foreach my $name (@whichfoils) {
635: my $text=$Apache::response::foilgroup{$name.'.text'};
636: my $value=$Apache::response::foilgroup{$name.'.value'};
637: my $letter=$name_letter_map{$value};
1.5 sakharuk 638: if ($target eq 'tex') {
639: $question.=' \\\\ '.$letter.':'.$text;
640: } else {
1.53 albertel 641: $question.='<br /><b>'.$letter.':</b> '.$text;
1.5 sakharuk 642: }
1.1 albertel 643: }
644: } else {
645: my $i = 0;
1.36 albertel 646: my $temp=1;
1.1 albertel 647: my $id=$Apache::inputtags::response[-1];
648: my $part=$Apache::inputtags::part;
1.81 raeburn 649: my ($lastresponse,$newvariation);
650: if ((($Apache::lonhomework::history{"resource.$part.type"} eq 'randomizetry') ||
651: ($Apache::lonhomework::type eq 'randomizetry')) &&
652: ($Apache::inputtags::status[-1] eq 'CAN_ANSWER')) {
653: if ($env{'form.'.$part.'.rndseed'} ne
654: $Apache::lonhomework::history{"resource.$part.rndseed"}) {
655: $newvariation = 1;
656: }
657: }
1.89 raeburn 658: unless ($newvariation) {
659: if ((($env{'form.grade_username'} eq '') && ($env{'form.grade_domain'} eq '')) ||
660: (($env{'form.grade_username'} eq $env{'user.name'}) &&
661: ($env{'form.grade_domain'} eq $env{'user.domain'}))) {
662: $lastresponse=$Apache::lonhomework::history{"resource.$part.$id.submission"};
663: } else {
664: unless (($Apache::lonhomework::history{"resource.$part.type"} eq 'anonsurvey') ||
665: ($Apache::lonhomework::history{"resource.$part.type"} eq 'anonsurveycred')) {
666: $lastresponse=$Apache::lonhomework::history{"resource.$part.$id.submission"};
667: }
668: }
1.79 raeburn 669: }
1.89 raeburn 670:
1.9 sakharuk 671: my %lastresponse=&Apache::lonnet::str2hash($lastresponse);
672: my @alphabet=('A'..'Z');
1.15 albertel 673: my @used_letters=sort(keys(%letter_name_map));
1.20 sakharuk 674: my $internal_counter=$Apache::lonxml::counter;
1.82 raeburn 675: my ($numrows,$bubbles_per_row);
676: if (($target eq 'tex') && ($Apache::lonhomework::type eq 'exam')) {
677: ($numrows,$bubbles_per_row) =
678: &Apache::optionresponse::getnumrows(scalar(@used_letters));
679: } else {
680: $numrows = 1;
681: }
1.1 albertel 682: foreach my $name (@whichfoils) {
683: my $lastopt=$lastresponse{$name};
684: my $last_letter=$name_letter_map{$lastopt};
1.5 sakharuk 685: my $optionlist = '';
1.7 sakharuk 686: if ($target ne 'tex') {
687: $optionlist="<option></option>\n";
688: } else {
689: if ($Apache::lonhomework::type ne 'exam') {
1.76 onken 690: if($env{'form.pdfFormFields'} eq 'yes'
691: && $Apache::inputtags::status['-1'] eq 'CAN_ANSWER') {
1.75 raeburn 692: my $fieldname = $env{'request.symb'} . '&part_'. $Apache::inputtags::part .'&matchresponse'. '&HWVAL_' . $Apache::inputtags::response['-1'] . ':' . $temp . '&submit_' . $Apache::inputtags::part . '&';
693: $optionlist = &Apache::lonxml::print_pdf_start_combobox($fieldname);
694: } else {
1.77 foxr 695:
1.75 raeburn 696: $optionlist='\framebox[10 mm][s]{\tiny\strut}';
697: }
1.74 raeburn 698: }
1.7 sakharuk 699: }
1.1 albertel 700: my $option;
1.15 albertel 701: foreach $option (@used_letters) {
1.1 albertel 702: if ($option eq $last_letter) {
1.71 onken 703: if ($target ne 'tex') {
1.81 raeburn 704: $optionlist.="<option selected=\"selected\">$option</option>\n";
1.76 onken 705: } elsif ($target eq 'tex' && $env{'form.pdfFormFields'} eq 'yes'
1.80 onken 706: && $Apache::inputtags::status['-1'] eq 'CAN_ANSWER'
707: && $Apache::lonhomework::type ne 'exam') {
1.75 raeburn 708: $optionlist .= &Apache::lonxml::print_pdf_add_combobox_option($option);
1.71 onken 709: }
1.1 albertel 710: } else {
1.71 onken 711: if ($target ne 'tex') {
712: $optionlist.="<option>$option</option>\n";
1.76 onken 713: } elsif ($target eq 'tex' && $env{'form.pdfFormFields'} eq 'yes'
1.80 onken 714: && $Apache::inputtags::status['-1'] eq 'CAN_ANSWER'
715: && $Apache::lonhomework::type ne 'exam') {
1.75 raeburn 716: $optionlist .= &Apache::lonxml::print_pdf_add_combobox_option($option);
1.71 onken 717: }
1.1 albertel 718: }
719: }
1.19 sakharuk 720: if ($target ne 'tex' && $Apache::lonhomework::type ne 'exam') {
1.61 albertel 721: $optionlist='<select onchange="javascript:setSubmittedPart(\''.
722: $part.'\');" name="HWVAL_'.
1.5 sakharuk 723: $Apache::inputtags::response[-1].':'.$temp.'">'.
724: $optionlist."</select>\n";
725: }
1.1 albertel 726: my $text=$Apache::response::foilgroup{$name.'.text'};
1.62 foxr 727: #
728: # Factor out the tex computations of the left/right 1/2 minipage
729: # widths for left or right positioning. This allows us
730: # to, if necessary constrain the bubble widths:
731: #
732: if ($target eq 'tex' &&
733: (&itemdisplay('left') || &itemdisplay('right'))) {
734: $tabsize=&Apache::londefdef::recalc($env{'form.textwidth'});
735: ($lefttabsize,$righttabsize)=(0,0);
736: if ($Apache::matchresponse::TeXitemgroupwidth ne '') {
737: $Apache::matchresponse::TeXitemgroupwidth=~/(\d*.?\d*)/;
738: $lefttabsize=$tabsize*$1/100;
739: $righttabsize=0.95*($tabsize-$lefttabsize);
740: } else {
741: $tabsize=~/(\d+\.?\d*)/;
742: $lefttabsize=$1/2.1;
743: $righttabsize=0.95*($1-$lefttabsize);
744: }
745: }
1.5 sakharuk 746: if ($target ne 'tex') {
1.19 sakharuk 747: if ($Apache::lonhomework::type ne 'exam') {
1.45 albertel 748: $question.="<br />\n".$optionlist.$text;
1.19 sakharuk 749: } else {
1.45 albertel 750: $question.="<br />\n".$text;
1.19 sakharuk 751: }
1.6 sakharuk 752: if ($Apache::lonhomework::type eq 'exam') {
1.42 albertel 753: my @blank;
754: $question.=&Apache::optionresponse::webbubbles(\@used_letters,\@blank,$temp,$last_letter);
1.6 sakharuk 755: }
756: } else {
1.62 foxr 757: # Note that if left or right positioned, we must
758: # confine the bubbles to righttabsize:
759: #
1.80 onken 760: if ($Apache::lonhomework::type eq 'exam') {
1.6 sakharuk 761: $question.=' '.$optionlist.$text."\n";
1.13 sakharuk 762: my @emptyItems = ();
1.16 albertel 763: for (my $i=0;$i<=$#used_letters;$i++) {push @emptyItems, ' ';}
1.62 foxr 764: $question.='\vskip -1 mm\noindent\begin{list}{}{\setlength{\listparindent}{0mm}\setlength{\leftmargin}{2mm}}'
1.82 raeburn 765: .'\item \hskip -3mm ';
766: if ($numrows == 1) {
767: $question .= '\textbf{'.$internal_counter.'}';
768: } else {
769: my $linetext;
770: for (my $i=0; $i<$numrows; $i++) {
771: $linetext .= $internal_counter+$i.', ';
772: }
773: $linetext =~ s/,\s$//;
774: $question .= '\small {\textbf{'.$linetext.'}} '.
775: '\hskip 2 mm {\footnotesize '.
776: &mt('(Bubble once in [_1] lines)',$numrows).
777: '} \vskip 3 mm';
778: }
779: my $max_width;
1.62 foxr 780: if (&itemdisplay('left') || &itemdisplay('right')) {
1.82 raeburn 781: $max_width = $righttabsize;
782: }
783: $question .= '\vskip -4 mm' . &Apache::optionresponse::bubbles(\@used_letters,\@emptyItems,'',$max_width,$numrows,$bubbles_per_row,$internal_counter);
1.62 foxr 784: $question .= '\end{list} \vskip -8 mm \strut ';
1.82 raeburn 785: $internal_counter += $numrows;
1.6 sakharuk 786: } else {
1.76 onken 787: if($env{'form.pdfFormFields'} eq 'yes'
788: && $Apache::inputtags::status['-1'] eq 'CAN_ANSWER') {
1.75 raeburn 789: $question .= " $optionlist ". &Apache::lonxml::print_pdf_end_combobox($text).'\strut';
790: } else {
791: $question.=' '.$optionlist.$text.'\strut\\\\\strut '."\n";
792: }
1.6 sakharuk 793: }
1.5 sakharuk 794: }
1.1 albertel 795: $temp++;
796: }
1.4 albertel 797: }
798: if ($result=&itemdisplay('top')) {
799: $result.=$question;
800: } elsif ($result=&itemdisplay('bottom')) {
801: $result=$question.$result;
802: } elsif ($result=&itemdisplay('right')) {
1.32 sakharuk 803: if ($target ne 'tex') {
1.45 albertel 804: #remove the first <br />
805: $question=~s|<br />||;
806: $result='<table><tr><td valign="top">'.$question.
807: '</td><td valign="top">'.$result.'</td></tr></table>';
1.32 sakharuk 808: } else {
1.43 sakharuk 809: $lefttabsize.=' mm ';
810: $righttabsize.=' mm ';
811: $result='\setlength{\tabcolsep}{1 mm}\begin{tabular}{p{'.$righttabsize.'}p{'.$lefttabsize.'}}\begin{minipage}{'.$righttabsize.'}'.$question.'\end{minipage}&\begin{minipage}{'.$lefttabsize.'}'.$result.'\end{minipage}\end{tabular}';
1.32 sakharuk 812: }
1.4 albertel 813: } elsif ($result=&itemdisplay('left')) {
1.32 sakharuk 814: if ($target ne 'tex') {
1.45 albertel 815: #remove the first <br />
816: $question=~s|<br />||;
817: $result='<table><tr><td valign="top">'.$result.
818: '</td><td valign="top">'.$question.'</td></tr></table>';
1.32 sakharuk 819: } else {
1.43 sakharuk 820: $lefttabsize.=' mm ';
821: $righttabsize.=' mm ';
822: $result='\setlength{\tabcolsep}{1 mm}\begin{tabular}{p{'.$lefttabsize.'}p{'.$righttabsize.'}}\begin{minipage}{'.$lefttabsize.'}'.$result.'\end{minipage}&\begin{minipage}{'.$righttabsize.'}'.$question.'\end{minipage}\end{tabular}';
1.32 sakharuk 823: }
1.1 albertel 824: }
1.64 albertel 825: if ($target eq 'web') {
1.81 raeburn 826: my $questiontype;
827: if ($Apache::lonhomework::type eq 'randomizetry') {
828: $questiontype = $Apache::lonhomework::type;
829: }
1.64 albertel 830: &Apache::response::setup_prior_tries_hash(\&format_prior_answer,
831: [\@whichfoils,
832: 'submissiongrading',
1.81 raeburn 833: 'submissionitems'],
834: $questiontype);
1.64 albertel 835: }
1.5 sakharuk 836: if ($target ne 'tex') {$result.="<br />";} else {$result.=' \\\\ ';}
1.1 albertel 837: return $result;
838: }
839:
840: sub getfoilcounts {
841: my ($max)=@_;
842: # +1 since instructors will count from 1
843: my $count = $#{ $Apache::response::foilgroup{'names'} }+1;
844: if (&Apache::response::showallfoils()) { $max=$count; }
845: if ($count>$max) { $count=$max }
846: &Apache::lonxml::debug("Count is $count from $max");
847: return $count;
848: }
849:
850:
851: sub start_conceptgroup {
852: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
853: $Apache::matchresponse::conceptgroup=1;
854: %Apache::response::conceptgroup=();
855: my $result;
856: if ($target eq 'edit') {
857: $result.=&Apache::edit::tag_start($target,$token,
858: "Concept Grouped Foils");
859: $result.=&Apache::edit::text_arg('Concept:','concept',$token,'50').
860: &Apache::edit::end_row().&Apache::edit::start_spanning_row();
861: }
862: if ($target eq 'modified') {
863: my $constructtag=&Apache::edit::get_new_args($token,$parstack,
864: $safeeval,'concept');
865: if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
866: }
867: return $result;
868: }
869:
870: sub end_conceptgroup {
871: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
872: $Apache::matchresponse::conceptgroup=0;
873: my $result='';
1.28 albertel 874: if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
875: $target eq 'tex' || $target eq 'analyze') {
876: &Apache::response::pick_foil_for_concept($target,
877: ['value','text','location'],
878: \%Apache::hint::match,
879: $parstack,$safeeval);
1.1 albertel 880: } elsif ($target eq 'edit') {
881: $result=&Apache::edit::end_table();
882: }
883: return $result;
884: }
885:
886: sub insert_conceptgroup {
887: my $result="\n\t\t<conceptgroup concept=\"\">".&insert_foil()."\n\t\t</conceptgroup>\n";
888: return $result;
889: }
890:
891: sub start_foil {
892: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
893: my $result='';
1.28 albertel 894: if ($target eq 'web' || $target eq 'tex' || $target eq 'analyze') {
1.1 albertel 895: &Apache::lonxml::startredirection;
1.46 albertel 896: if ($target eq 'analyze') {
897: &Apache::response::check_if_computed($token,$parstack,$safeeval,'value');
898: }
1.1 albertel 899: } elsif ($target eq 'edit') {
900: $result=&Apache::edit::tag_start($target,$token,"Foil");
901: my $level='-2';
902: if ($$tagstack[-2] eq 'conceptgroup') { $level = '-3'; }
903: $result.=&Apache::edit::text_arg('Name:','name',$token);
904: my @names;
1.84 raeburn 905: if (ref($Apache::response::itemgroup{'names'}) eq 'ARRAY') {
906: if (@{ $Apache::response::itemgroup{'names'} }) {
907: @names=@{ $Apache::response::itemgroup{'names'} };
908: }
1.1 albertel 909: }
910: $result.= &Apache::edit::select_or_text_arg('Correct Option:','value',['unused',@names],$token,'15');
911: my $randomize=&Apache::lonxml::get_param('randomize',$parstack,
912: $safeeval,'-3');
913: if ($randomize ne 'no') {
914: $result.=&Apache::edit::select_arg('Location:','location',
915: ['random','top','bottom'],$token);
916: }
917: $result .=&Apache::edit::end_row().&Apache::edit::start_spanning_row();
918: } elsif ($target eq 'modified') {
919: my $constructtag=&Apache::edit::get_new_args($token,$parstack,
920: $safeeval,'value',
921: 'name','location');
922: if ($constructtag) { $result = &Apache::edit::rebuild_tag($token); }
923: }
924: return $result;
925: }
926:
927: sub end_foil {
928: my ($target,$token,$tagstack,$parstack,$parser,$safeeval,$style)=@_;
929: my $text ='';
930: my $result = '';
1.28 albertel 931: if ($target eq 'web' || $target eq 'tex' || $target eq 'analyze') {
1.1 albertel 932: $text=&Apache::lonxml::endredirection;
933: }
1.48 albertel 934:
1.28 albertel 935: if ($target eq 'web' || $target eq 'grade' || $target eq 'answer' ||
936: $target eq 'tex' || $target eq 'analyze') {
1.48 albertel 937: if ($target eq 'tex' && $Apache::lonhomework::type eq 'exam') {
938: $text='\vskip 5mm $\triangleright$ '.$text;
939: }
1.1 albertel 940: my $value = &Apache::lonxml::get_param('value',$parstack,$safeeval);
941: if ($value ne 'unused') {
942: my $name = &Apache::lonxml::get_param('name',$parstack,$safeeval);
943: &Apache::lonxml::debug("Got a name of :$name:");
1.49 albertel 944: if (!$name) {
1.70 bisitz 945: &Apache::lonxml::warning(&mt('Foils without names exist. This can cause problems to malfunction.'));
1.49 albertel 946: $name=$Apache::lonxml::curdepth;
947: }
1.1 albertel 948: &Apache::lonxml::debug("Using a name of :$name:");
1.37 albertel 949: if (defined($Apache::response::foilnames{$name})) {
1.70 bisitz 950: &Apache::lonxml::error(&mt("Foil name [_1] appears more than once. Foil names need to be unique.",'<b><tt>'.$name.'</tt></b>'));
1.37 albertel 951: }
1.38 albertel 952: $Apache::response::foilnames{$name}++;
1.37 albertel 953: my $location =&Apache::lonxml::get_param('location',$parstack,
954: $safeeval);
1.1 albertel 955: if ( $Apache::matchresponse::conceptgroup
956: && !&Apache::response::showallfoils() ) {
1.77 foxr 957:
1.1 albertel 958: push @{ $Apache::response::conceptgroup{'names'} }, $name;
959: $Apache::response::conceptgroup{"$name.value"} = $value;
1.48 albertel 960: $Apache::response::conceptgroup{"$name.text"} = $text;
1.1 albertel 961: $Apache::response::conceptgroup{"$name.location"} = $location;
962: } else {
1.77 foxr 963:
1.1 albertel 964: push @{ $Apache::response::foilgroup{'names'} }, $name;
965: $Apache::response::foilgroup{"$name.value"} = $value;
1.48 albertel 966: $Apache::response::foilgroup{"$name.text"} = $text;
1.1 albertel 967: $Apache::response::foilgroup{"$name.location"} = $location;
968: }
969: }
970: }
971: if ($target eq 'edit') {
972: $result.= &Apache::edit::tag_end($target,$token,'');
973: }
974: return $result;
975: }
976:
977: sub insert_foil {
978: return '
979: <foil name="" value="unused">
980: <startouttext />
981: <endouttext />
982: </foil>';
983: }
1.82 raeburn 984:
1.1 albertel 985: 1;
986: __END__
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>