version 1.61, 2006/09/06 19:20:04
|
version 1.67, 2006/12/20 23:02:33
|
Line 286 sub display_actions_box {
|
Line 286 sub display_actions_box {
|
$result = &store_courseinit_setting($uname,$udom,$cid,$initpage); |
$result = &store_courseinit_setting($uname,$udom,$cid,$initpage); |
} |
} |
|
|
my %threshold = ( |
my %threshold = (); |
av_attempts => 2, |
|
degdiff => 0.5, |
|
numstudents => 2, |
|
); |
|
my %pagedesc = &Apache::lonlocal::texthash ( |
my %pagedesc = &Apache::lonlocal::texthash ( |
firstres => 'First resource', |
firstres => 'First resource', |
whatsnew => "What's New? page", |
whatsnew => "What's New? page", |
Line 468 sub display_threshold_config {
|
Line 464 sub display_threshold_config {
|
my $rowColor; |
my $rowColor; |
|
|
my @thresholditems = ("av_attempts","degdiff","numstudents"); |
my @thresholditems = ("av_attempts","degdiff","numstudents"); |
foreach my $item (@thresholditems) { |
|
$threshold{$item} = ''; |
|
} |
|
my %threshold_titles = &Apache::lonlocal::texthash( |
my %threshold_titles = &Apache::lonlocal::texthash( |
av_attempts => 'Average number of attempts', |
av_attempts => 'Average number of attempts', |
degdiff => 'Degree of difficulty', |
degdiff => 'Degree of difficulty', |
Line 747 sub getitems {
|
Line 740 sub getitems {
|
%{$$ungraded{$symb}} = (); |
%{$$ungraded{$symb}} = (); |
%{$$triggered{$symb}} = (); |
%{$$triggered{$symb}} = (); |
$$triggered{$symb}{numparts} = 0; |
$$triggered{$symb}{numparts} = 0; |
|
if ($resource->encrypted()) { |
|
$$triggered{$symb}{'enclink'} = $resource->link(); |
|
$$triggered{$symb}{'encsymb'} = $resource->shown_symb(); |
|
} |
my $title = $resource->compTitle(); |
my $title = $resource->compTitle(); |
$$res_title{$symb} = $title; |
$$res_title{$symb} = $title; |
my $ressymb = $resource->wrap_symb(); |
my $ressymb = $resource->wrap_symb(); |
Line 788 sub check_discussions {
|
Line 785 sub check_discussions {
|
%{$$unread{$ressymb}} = (); |
%{$$unread{$ressymb}} = (); |
$$unread{$ressymb}{'title'} = $title; |
$$unread{$ressymb}{'title'} = $title; |
$$unread{$ressymb}{'symb'} = $symb; |
$$unread{$ressymb}{'symb'} = $symb; |
|
if ($resource->encrypted()) { |
|
$$unread{$ressymb}{'enclink'} = $resource->link(); |
|
$$unread{$ressymb}{'encsymb'} = $resource->shown_symb(); |
|
} |
push(@{$newdiscussions}, $ressymb); |
push(@{$newdiscussions}, $ressymb); |
|
|
$$unread{$ressymb}{'lastpost'} = $resource->last_post_time(); |
$$unread{$ressymb}{'lastpost'} = $resource->last_post_time(); |
|
|
if ($countunread eq 'on') { |
if ($countunread eq 'on') { |
$$unread{$ressymb}{'unreadcount'} = $resource->unread_discussion(); |
$$unread{$ressymb}{'unreadcount'} = |
|
$resource->discussion_info('unread'); |
} |
} |
} |
} |
|
|
Line 814 sub check_handgraded {
|
Line 816 sub check_handgraded {
|
if (@ungraded > 0) { |
if (@ungraded > 0) { |
$$ungraded{$symb}{count} = scalar(@ungraded); |
$$ungraded{$symb}{count} = scalar(@ungraded); |
$$ungraded{$symb}{title} = $title; |
$$ungraded{$symb}{title} = $title; |
push(@{$tograde}, $symb); |
if ($resource->encrypted()) { |
|
$$ungraded{$symb}{'enclink'} = $resource->link(); |
|
$$ungraded{$symb}{'encsymb'} = $resource->shown_symb(); |
|
} |
|
push(@{$tograde},$symb); |
} |
} |
} |
} |
} |
} |
Line 883 sub check_thresholds {
|
Line 889 sub check_thresholds {
|
} |
} |
if ($warning) { |
if ($warning) { |
$$triggered{$symb}{title} = $resource->title; |
$$triggered{$symb}{title} = $resource->title; |
|
my $partcount = 0; |
|
@{$$triggered{$symb}{text}} = (); |
foreach my $part (@parts) { |
foreach my $part (@parts) { |
if (exists($stats{$part}{users})) { |
if (exists($stats{$part}{users})) { |
my $resetname = 'reset_'.&escape($symb."\0".$part); |
my $resetname = 'reset_'.&escape($symb."\0".$part); |
my $resettitle = 'title_'.&escape($symb."\0".$part); |
my $resettitle = 'title_'.&escape($symb."\0".$part); |
if ($$triggered{$symb}{numparts}) { |
|
$$triggered{$symb}{text} .= '<tr>'."\n"; |
|
} |
|
if (@parts > 1) { |
if (@parts > 1) { |
$$triggered{$symb}{text} .= ' |
$$triggered{$symb}{text}[$partcount] = ' |
<td>part - '.$part.'</td>'; |
<td>part - '.$part.'</td>'; |
} else { |
} else { |
$$triggered{$symb}{text} .= ' |
$$triggered{$symb}{text}[$partcount] = ' |
<td>single part</td>'; |
<td>single part</td>'; |
} |
} |
$$triggered{$symb}{text} .= ' |
$$triggered{$symb}{text}[$partcount] .= ' |
<td>'.$stats{$part}{users}.'</td> |
<td>'.$stats{$part}{users}.'</td> |
<td>'.$stats{$part}{attempts}.'</td> |
<td>'.$stats{$part}{attempts}.'</td> |
<td>'.$stats{$part}{degdiff}.'</td> |
<td>'.$stats{$part}{degdiff}.'</td> |
<td>'.$lastreset{$part}.'</td> |
<td>'.$lastreset{$part}.'</td> |
<td><input type="checkbox" name="'.$resetname.'" /><input type="hidden" name="'.$resettitle.'" value="'.&escape($$triggered{$symb}{title}).'" /></td> |
<td><input type="checkbox" name="'.$resetname.'" /><input type="hidden" name="'.$resettitle.'" value="'.&escape($$triggered{$symb}{title}).'" /></td>'; |
</tr>'; |
$partcount ++; |
$$triggered{$symb}{numparts} ++; |
|
} |
} |
|
$$triggered{$symb}{numparts} = $partcount; |
} |
} |
push(@{$warnings},$symb); |
push(@{$warnings},$symb); |
} |
} |
Line 914 sub check_thresholds {
|
Line 919 sub check_thresholds {
|
|
|
sub get_curr_thresholds { |
sub get_curr_thresholds { |
my ($threshold,$uname,$udom,$cid,$cdom,$crs) = @_; |
my ($threshold,$uname,$udom,$cid,$cdom,$crs) = @_; |
|
# set default values |
|
%$threshold = (av_attempts => 2, |
|
degdiff => 0.5, |
|
numstudents => 2 |
|
); |
my %thresholdsettings = &Apache::lonnet::dump('nohist_whatsnew',$udom, |
my %thresholdsettings = &Apache::lonnet::dump('nohist_whatsnew',$udom, |
$uname,$cid.':threshold'); |
$uname,$cid.':threshold'); |
my $thresholdcount = 0; |
my $thresholdcount = 0; |
Line 1005 sub process_update {
|
Line 1015 sub process_update {
|
next if ($_!~/^form\.(.+)\_setparmval$/); |
next if ($_!~/^form\.(.+)\_setparmval$/); |
my $name = $1; |
my $name = $1; |
my $value = $env{'form.'.$name.'_value'}; |
my $value = $env{'form.'.$name.'_value'}; |
if ($name && defined($value)) { |
if ($name && defined($value) && ($value ne '')) { |
my $put_result = &Apache::lonnet::put('nohist_whatsnew', |
my $put_result = &Apache::lonnet::put('nohist_whatsnew', |
{$name=>$value},$udom,$uname); |
{$name=>$value},$udom,$uname); |
|
|
Line 1148 sub display_handgrade {
|
Line 1158 sub display_handgrade {
|
my ($map,$id,$url)=&Apache::lonnet::decode_symb($res); |
my ($map,$id,$url)=&Apache::lonnet::decode_symb($res); |
my $linkurl=&Apache::lonnet::clutter($url); |
my $linkurl=&Apache::lonnet::clutter($url); |
$linkurl .= '?symb='.&escape($res); |
$linkurl .= '?symb='.&escape($res); |
|
if ($$ungraded{$res}{'enclink'}) { |
|
$linkurl = |
|
$$ungraded{$res}{'enclink'}.'?symb='.$$ungraded{$res}{'encsymb'}; |
|
} |
$r->print('<tr bgcolor="'.$rowColor.'"><td><a href="'.$linkurl.'"><small>'.$$ungraded{$res}{title}.'</small></a></td><td align="right"><small>'.$$ungraded{$res}{count}.'</small></td></tr>'); |
$r->print('<tr bgcolor="'.$rowColor.'"><td><a href="'.$linkurl.'"><small>'.$$ungraded{$res}{title}.'</small></a></td><td align="right"><small>'.$$ungraded{$res}{count}.'</small></td></tr>'); |
$rowNum ++; |
$rowNum ++; |
} |
} |
Line 1218 sub display_abovethreshold {
|
Line 1231 sub display_abovethreshold {
|
$rowspan = 'rowspan="'.$$triggered{$res}{numparts}.'"'; |
$rowspan = 'rowspan="'.$$triggered{$res}{numparts}.'"'; |
} |
} |
$linkurl .= '?symb='.&escape($res); |
$linkurl .= '?symb='.&escape($res); |
$r->print('<tr class="'.($row%2?'LC_odd_row':'').'">'. |
if ($$triggered{$res}{'enclink'}) { |
|
$linkurl = |
|
$$triggered{$res}{'enclink'}.'?symb='.$$triggered{$res}{'encsymb'}; |
|
} |
|
my $css_class = $row%2?'LC_odd_row':''; |
|
$r->print('<tr class="'.$css_class.'">'. |
'<td class="LC_first_item" '.$rowspan.'><a href="'.$linkurl.'">'. |
'<td class="LC_first_item" '.$rowspan.'><a href="'.$linkurl.'">'. |
$$triggered{$res}{title}.'</a></td>'. |
$$triggered{$res}{title}.'</a></td>'); |
$$triggered{$res}{text}); |
if (ref($$triggered{$res}{text}) eq 'ARRAY') { |
|
$r->print($$triggered{$res}{text}[0]); |
|
} |
|
$r->print('</tr>'); |
|
if (ref($$triggered{$res}{text}) eq 'ARRAY') { |
|
if (@{$$triggered{$res}{text}} > 1) { |
|
for (my $i=1; $i<@{$$triggered{$res}{text}}; $i++) { |
|
$r->print('<tr class="'.$css_class.'">'. |
|
$$triggered{$res}{text}[$i].'</tr>'); |
|
} |
|
} |
|
} |
} |
} |
$r->print('<tr class="LC_info_row"><td colspan="7"><br /><input type="submit" name="counters" value="'.$lt{'rese'}.'" /></td></tr></form>'); |
$r->print('<tr class="LC_info_row"><td colspan="7"><br /><input type="submit" name="counters" value="'.$lt{'rese'}.'" /></td></tr></form>'); |
} else { |
} else { |
$r->print('<tr class="LC_empty_row"><br />'.$lt{'nopr'}.'<br /></td></tr>'); |
$r->print('<tr class="LC_empty_row"><td>'.$lt{'nopr'}.'</td></tr>'); |
} |
} |
} |
} |
|
|
Line 1296 sub display_coursediscussion {
|
Line 1325 sub display_coursediscussion {
|
my $forum_title = $$unread{$ressymb}{'title'}; |
my $forum_title = $$unread{$ressymb}{'title'}; |
my $type = 'Resource'; |
my $type = 'Resource'; |
my $feedurl=&Apache::lonfeedback::get_feedurl($ressymb); |
my $feedurl=&Apache::lonfeedback::get_feedurl($ressymb); |
|
my $disclink = $feedurl.'?symb='.$$unread{$ressymb}{symb}; |
if ($feedurl =~ /bulletinboard/) { |
if ($feedurl =~ /bulletinboard/) { |
$type = 'Bulletin Board'; |
$type = 'Bulletin Board'; |
} |
} |
|
if ($$unread{$ressymb}{'enclink'}) { |
|
$disclink = $$unread{$ressymb}{'enclink'}.'?symb='.$$unread{$ressymb}{'encsymb'}; |
|
} |
if ($rowNum %2 == 1) { |
if ($rowNum %2 == 1) { |
$rowColor = $rowColor1; |
$rowColor = $rowColor1; |
} else { |
} else { |
Line 1306 sub display_coursediscussion {
|
Line 1339 sub display_coursediscussion {
|
} |
} |
my $lastpost = &Apache::lonnavmaps::timeToHumanString( |
my $lastpost = &Apache::lonnavmaps::timeToHumanString( |
$$unread{$ressymb}{'lastpost'}); |
$$unread{$ressymb}{'lastpost'}); |
$r->print('<tr bgcolor="'.$rowColor.'"><td><small><a href="'.$feedurl.'?symb='.$$unread{$ressymb}{symb}.'">'.$forum_title.'</a> </td><td><small>'.$type.' </small></td>'); |
$r->print('<tr bgcolor="'.$rowColor.'"><td><small><a href="'.$disclink.'">'.$forum_title.'</a> </td><td><small>'.$type.' </small></td>'); |
if ($countunread eq 'on') { |
if ($countunread eq 'on') { |
my $unreadnum = $$unread{$ressymb}{'unreadcount'}; |
my $unreadnum = $$unread{$ressymb}{'unreadcount'}; |
$r->print('<td><small>'.$lastpost.'<small></td><td align="right">'. |
$r->print('<td><small>'.$lastpost.'<small></td><td align="right">'. |