version 1.13, 2005/05/23 23:06:23
|
version 1.15, 2005/06/01 19:24:50
|
Line 85 sub handler {
|
Line 85 sub handler {
|
(undef,'Course Action Items','Course_Action_Items_Display')); |
(undef,'Course Action Items','Course_Action_Items_Display')); |
} |
} |
&display_main_box($r,$command); |
&display_main_box($r,$command); |
|
return OK; |
} |
} |
|
|
#------------------------------ |
#------------------------------ |
Line 104 sub display_main_box {
|
Line 105 sub display_main_box {
|
degdiff => 'Degree of difficulty', |
degdiff => 'Degree of difficulty', |
numstudents => 'Total number of students with submissions', |
numstudents => 'Total number of students with submissions', |
); |
); |
|
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
|
if ($command eq 'chgthreshold') { |
if ($command eq 'chgthreshold') { |
&display_config_box($r,$command,$tabbg,\%threshold_titles); |
&display_config_box($r,$command,$tabbg,\%threshold_titles,$cdom,$crs); |
} else { |
} else { |
&display_actions_box($r,$command,\%threshold_titles); |
&display_actions_box($r,$command,\%threshold_titles,$cdom,$crs); |
} |
} |
$r->print(<<END_OF_BLOCK); |
$r->print(<<END_OF_BLOCK); |
</td> |
</td> |
Line 145 ENDHEAD
|
Line 149 ENDHEAD
|
#------------------------------- |
#------------------------------- |
|
|
sub display_actions_box() { |
sub display_actions_box() { |
my ($r,$command,$threshold_titles) = @_; |
my ($r,$command,$threshold_titles,$cdom,$crs) = @_; |
|
|
my $rowColor1 = "#ffffff"; |
my $rowColor1 = "#ffffff"; |
my $rowColor2 = "#eeeeee"; |
my $rowColor2 = "#eeeeee"; |
Line 186 sub display_actions_box() {
|
Line 190 sub display_actions_box() {
|
} |
} |
|
|
my $result; |
my $result; |
my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my $crs = $env{'course.'.$env{'request.course.id'}.'.num'}; |
|
|
|
if ($command eq 'reset') { |
if ($command eq 'reset') { |
$result = &process_reset($cdom,$crs); |
$result = &process_reset($cdom,$crs); |
Line 288 END
|
Line 290 END
|
if (@warnings > 0) { |
if (@warnings > 0) { |
# @warnings = sort { &cmp_title($a,$b) } @warnings; |
# @warnings = sort { &cmp_title($a,$b) } @warnings; |
$r->print('<form name="reset_tracking" method="post">'. |
$r->print('<form name="reset_tracking" method="post">'. |
' <input type="hidden" name="action" value="reset"'."\n"); |
' <input type="hidden" name="action" value="reset" />'."\n"); |
$r->print('<tr bgcolor="#cccccc"><td><b><small>Resource</small></b></td><td align="right"><b><small>Part</small></b></td><td align="right"><b><small>Num. students</small></b></td><td align="right"><b><small>Av. Attempts</small></b></td><td align="right"><b><small>Deg. Diff</small></b></td><td align="right"><b><small>Last Reset</small></b></td><td align="right"><b><small>Reset Count?</small></b></td></tr>'); |
$r->print('<tr bgcolor="#cccccc"><td><b><small>Resource</small></b></td><td align="right"><b><small>Part</small></b></td><td align="right"><b><small>Num. students</small></b></td><td align="right"><b><small>Av. Attempts</small></b></td><td align="right"><b><small>Deg. Diff</small></b></td><td align="right"><b><small>Last Reset</small></b></td><td align="right"><b><small>Reset Count?</small></b></td></tr>'); |
foreach my $res (@warnings) { |
foreach my $res (@warnings) { |
if ($warningnum %2 == 1) { |
if ($warningnum %2 == 1) { |
Line 436 END
|
Line 438 END
|
#------------------------------- |
#------------------------------- |
|
|
sub display_config_box() { |
sub display_config_box() { |
my ($r,$command,$tabbg,$threshold_titles) = @_; |
my ($r,$command,$tabbg,$threshold_titles,$cdom,$crs) = @_; |
my %threshold = (); |
my %threshold = (); |
my $rowColor1 = "#ffffff"; |
my $rowColor1 = "#ffffff"; |
my $rowColor2 = "#eeeeee"; |
my $rowColor2 = "#eeeeee"; |
Line 448 sub display_config_box() {
|
Line 450 sub display_config_box() {
|
degdiff => 'Degree of difficulty', |
degdiff => 'Degree of difficulty', |
numstudents => 'Total number of students with submissions', |
numstudents => 'Total number of students with submissions', |
); |
); |
&get_curr_thresholds(\%threshold); |
&get_curr_thresholds(\%threshold,$cdom,$crs); |
|
|
$r->print('<br /><form name="thresholdform" method="post"><table border="0" cellpadding="2" cellspacing="4"><tr><td align="left" valign="top" width="45%"> |
$r->print('<br /><form name="thresholdform" method="post"><table border="0" cellpadding="2" cellspacing="4"><tr><td align="left" valign="top" width="45%"> |
<table border="0" cellpadding="0" cellspacing="0" bgcolor="#000000"> |
<table border="0" cellpadding="0" cellspacing="0" bgcolor="#000000"> |
Line 667 sub get_counter_resets {
|
Line 669 sub get_counter_resets {
|
my $lastreset = 'None'; |
my $lastreset = 'None'; |
if ($$resethash{'version'}) { |
if ($$resethash{'version'}) { |
for (my $version=1;$version<=$$resethash{'version'};$version++) { |
for (my $version=1;$version<=$$resethash{'version'};$version++) { |
if (exists($$resethash{$version.':'.$part.'prev_attempts'})) { |
if (exists($$resethash{$version.':'.$part."\0".'prev_attempts'})) { |
$lastreset = $$resethash{$version.':timestamp'}; |
$lastreset = $$resethash{$version.':timestamp'}; |
} |
} |
} |
} |
} |
} |
Line 728 sub process_reset {
|
Line 730 sub process_reset {
|
$result =~ s/; $//; |
$result =~ s/; $//; |
$result .= '<br />'; |
$result .= '<br />'; |
} else { |
} else { |
$result = $title.' -part '.$part.': '.&mt('Unable to reset counters to zero due to ').$putresult.'.<br />'."\n"; |
$result = $title.' -part '.$part.': '.&mt('Unable to reset counters to zero due to [_1]',$putresult).'.<br />'."\n"; |
} |
} |
} |
} |
return $result; |
return $result; |
Line 736 sub process_reset {
|
Line 738 sub process_reset {
|
|
|
sub process_update { |
sub process_update { |
my ($dom,$crs,$threshold_titles) = @_; |
my ($dom,$crs,$threshold_titles) = @_; |
my $setoutput = '<b>Changes to threshold(s):</b><br />'; |
my $setoutput = '<b>Changes to threshold(s) for problem tracking:</b><br />'; |
foreach (keys %env) { |
foreach (keys %env) { |
next if ($_!~/^form\.(.+)\_setparmval$/); |
next if ($_!~/^form\.(.+)\_setparmval$/); |
my $name = $1; |
my $name = $1; |
Line 747 sub process_update {
|
Line 749 sub process_update {
|
|
|
my ($shortname) = ($name =~ /^internal\.threshold_(.+)$/); |
my ($shortname) = ($name =~ /^internal\.threshold_(.+)$/); |
if ($put_result eq 'ok') { |
if ($put_result eq 'ok') { |
$setoutput.=&mt('Set threshold for').' <b>'.$$threshold_titles{$shortname}.'</b> '.&mt('to').' <b>'.$value.'</b>.<br />'; |
$setoutput.=&mt('Set threshold for [_1] to [_2]', |
} else { |
'<b>'.$$threshold_titles{$shortname}.'</b>', |
$setoutput.=&mt('Unable to set threshold for').' <b>'.$name.'</b> '.&mt('to'). |
'<b>'.$value.'</b>').'<br />'; |
' <b>'.$value.'</b> '.&mt('due to').' '.$put_result.'.<br />'; |
} else { |
|
$setoutput.=&mt('Unable to set threshold for [_1] to [_2] due to [_3].', |
|
'<b>'.$name.'</b>','<b>'.$value.'</b>', |
|
'<tt>'.$put_result.'</tt>').'<br />'; |
} |
} |
} |
} |
} |
} |