version 1.46, 2005/04/07 06:56:24
|
version 1.52, 2006/02/14 16:05:46
|
Line 132 Skips 'survey' problems.
|
Line 132 Skips 'survey' problems.
|
#################################################### |
#################################################### |
#################################################### |
#################################################### |
sub problem_selector { |
sub problem_selector { |
my ($AcceptedResponseTypes) = @_; |
my ($AcceptedResponseTypes,$sequence_addendum) = @_; |
my $Str; |
my $Str; |
$Str = "\n<table>\n"; |
$Str = "\n<table>\n"; |
my $rb_count =0; |
my $rb_count =0; |
Line 179 sub problem_selector {
|
Line 179 sub problem_selector {
|
} |
} |
} |
} |
if ($seq_str ne '') { |
if ($seq_str ne '') { |
$Str .= '<tr><td> </td><td colspan="2"><b>'.$seq->compTitle.'</b></td>'. |
$Str .= '<tr><td> </td>'. |
|
'<td colspan="2"><b>'.$seq->compTitle.'</b></td>'. |
"</tr>\n".$seq_str; |
"</tr>\n".$seq_str; |
|
if (defined($sequence_addendum)) { |
|
$Str .= '<tr>'. |
|
('<td> </td>'x2). |
|
'<td align="right">'.$sequence_addendum.'</td>'. |
|
"</tr>\n"; |
|
} |
} |
} |
} |
} |
$Str .= "</table>\n"; |
$Str .= "</table>\n"; |
Line 338 sub new_accumulator {
|
Line 345 sub new_accumulator {
|
sub get_selected_symbs { |
sub get_selected_symbs { |
my ($inputfield) = @_; |
my ($inputfield) = @_; |
my $field = 'form.'.$inputfield; |
my $field = 'form.'.$inputfield; |
my @Symbs; |
my @symbs = (map { |
if (exists($env{$field})) { |
&Apache::lonnet::unescape($_); |
if (! ref($env{$field})) { |
} &Apache::loncommon::get_env_multiple($field)); |
@Symbs = (&Apache::lonnet::unescape($env{$field})); |
return @symbs; |
} else { |
|
@Symbs = (map {&Apache::lonnet::unescape($_);} @{$env{$field}}); |
|
} |
|
} |
|
return @Symbs; |
|
} |
} |
|
|
#################################################### |
#################################################### |
Line 429 current resource.
|
Line 431 current resource.
|
Inputs: $target (see &Apache::lonstathelpers::get_target_from_id()) |
Inputs: $target (see &Apache::lonstathelpers::get_target_from_id()) |
$AcceptableResponseTypes, regular expression matching acceptable |
$AcceptableResponseTypes, regular expression matching acceptable |
response types, |
response types, |
$granularity, either 'part', 'response', or 'part_survey' |
$granularity, either 'part', 'response', 'part_survey', or 'part_task' |
|
|
Returns: three hash references, $prev, $curr, $next, which refer to the |
Returns: three hash references, $prev, $curr, $next, which refer to the |
preceeding, current, or following problem parts or responses, depending |
preceeding, current, or following problem parts or responses, depending |
Line 465 sub get_prev_curr_next {
|
Line 467 sub get_prev_curr_next {
|
part => $part, |
part => $part, |
resource => $res, |
resource => $res, |
} ); |
} ); |
|
} elsif ($res->is_task($part) && ($granularity eq 'part_task')){ |
|
push (@Resource, |
|
{ symb => $res->symb, |
|
part => $part, |
|
resource => $res, |
|
} ); |
} elsif ($granularity eq 'part') { |
} elsif ($granularity eq 'part') { |
push (@Resource, |
push (@Resource, |
{ symb => $res->symb, |
{ symb => $res->symb, |
Line 497 sub get_prev_curr_next {
|
Line 505 sub get_prev_curr_next {
|
my $curr_idx; |
my $curr_idx; |
for ($curr_idx=0;$curr_idx<$#Resource;$curr_idx++) { |
for ($curr_idx=0;$curr_idx<$#Resource;$curr_idx++) { |
my $curr_item = $Resource[$curr_idx]; |
my $curr_item = $Resource[$curr_idx]; |
if ($granularity eq 'part' || $granularity eq 'part_survey') { |
if ($granularity =~ /^(part|part_survey|part_task)$/) { |
if ($curr_item->{'symb'} eq $target->{'symb'} && |
if ($curr_item->{'symb'} eq $target->{'symb'} && |
$curr_item->{'part'} eq $target->{'part'}) { |
$curr_item->{'part'} eq $target->{'part'}) { |
last; |
last; |
Line 512 sub get_prev_curr_next {
|
Line 520 sub get_prev_curr_next {
|
} |
} |
} |
} |
my $curr_item = $Resource[$curr_idx]; |
my $curr_item = $Resource[$curr_idx]; |
if ($granularity eq 'part' || $granularity eq 'part_survey') { |
if ($granularity =~ /^(part|part_survey|part_task)$/) { |
if ($curr_item->{'symb'} ne $target->{'symb'} || |
if ($curr_item->{'symb'} ne $target->{'symb'} || |
$curr_item->{'part'} ne $target->{'part'}) { |
$curr_item->{'part'} ne $target->{'part'}) { |
# bogus symb - return nothing |
# bogus symb - return nothing |
Line 1133 sub get_problem_data {
|
Line 1141 sub get_problem_data {
|
} |
} |
} |
} |
# End of logging code |
# End of logging code |
next if ($key !~ /^$part/); |
next if ($key !~ /^\Q$part\E/); |
$key =~ s/^$part\.//; |
$key =~ s/^\Q$part\E\.//; |
if (ref($value) eq 'ARRAY') { |
if (ref($value) eq 'ARRAY') { |
if ($key eq 'options') { |
if ($key eq 'options') { |
$Partdata{$part}->{'_Options'}=$value; |
$Partdata{$part}->{'_Options'}=$value; |
Line 1257 sub limit_by_time_form {
|
Line 1265 sub limit_by_time_form {
|
} |
} |
$timecheckbox .= 'OnChange="javascript:toggle_limitby_activity(this.checked);" '; |
$timecheckbox .= 'OnChange="javascript:toggle_limitby_activity(this.checked);" '; |
$timecheckbox .= ' />'; |
$timecheckbox .= ' />'; |
$Str .= '<legend>'.&mt('[_1] Limit by time',$timecheckbox).'</legend>'; |
$Str .= '<legend><label>'.&mt('[_1] Limit by time',$timecheckbox).'</label></legend>'; |
$Str .= &mt('Start Time: [_1]',$startdateform).'<br />'; |
$Str .= &mt('Start Time: [_1]',$startdateform).'<br />'; |
$Str .= &mt(' End Time: [_1]',$enddateform).'<br />'; |
$Str .= &mt(' End Time: [_1]',$enddateform).'<br />'; |
$Str .= '</fieldset>'; |
$Str .= '</fieldset>'; |