'.
''.
' | '.
- ''.$res->{'title'}.' ';
+ ''.$resptype.' '.$res->{'title'}.' ';
if ($partdata->{'option'} > 1) {
$seq_str .= &mt('response').' '.$respid;
}
@@ -1297,8 +1338,9 @@ sub ProblemSelector {
#########################################################
sub get_problem_symb {
my $problemstring = shift();
- my ($symb,$partid,$resid) = ($problemstring=~ /^(.*):([^:]*):([^:]*)$/);
- return ($symb,$partid,$resid);
+ my ($symb,$partid,$resid,$resptype) =
+ ($problemstring=~ /^(.*):([^:]*):([^:]*):([^:]*)$/);
+ return ($symb,$partid,$resid,$resptype);
}
sub get_resource_from_symb {
@@ -1313,18 +1355,26 @@ sub get_resource_from_symb {
return undef;
}
-sub get_time_from_OR_row {
+
+#########################################################
+#########################################################
+##
+## Misc Option Response functions
+##
+#########################################################
+#########################################################
+sub get_time_from_row {
my ($row) = @_;
if (ref($row)) {
- return $row->[4];
+ return $row->[&Apache::loncoursedata::RD_timestamp()];
}
return undef;
}
-sub get_tries_from_OR_row {
+sub get_tries_from_row {
my ($row) = @_;
if (ref($row)) {
- return $row->[5];
+ return $row->[&Apache::loncoursedata::RD_tries()];
}
return undef;
}
@@ -1332,7 +1382,12 @@ sub get_tries_from_OR_row {
sub Process_OR_Row {
my ($row) = @_;
my %RowData;
- my ($student_id,$award,$grading,$submission,$time,$tries) = @$row;
+ my $student_id = $row->[&Apache::loncoursedata::RD_student_id()];
+ my $award = $row->[&Apache::loncoursedata::RD_awarddetail()];
+ my $grading = $row->[&Apache::loncoursedata::RD_response_eval()];
+ my $submission = $row->[&Apache::loncoursedata::RD_submission()];
+ my $time = $row->[&Apache::loncoursedata::RD_timestamp()];
+ my $tries = $row->[&Apache::loncoursedata::RD_tries()];
return undef if ($award eq 'MISSING_ANSWER');
if ($award =~ /(APPROX_ANS|EXACT_ANS)/) {
$RowData{'_correct'} = 1;
@@ -1359,7 +1414,7 @@ sub Process_OR_Row {
## note: we must force each foil and option to not begin or end with
## spaces as they are stored without such data.
##
-sub get_problem_data {
+sub get_OR_problem_data {
my ($url) = @_;
my $Answ=&Apache::lonnet::ssi($url,('grade_target' => 'analyze'));
(my $garbage,$Answ)=split(/_HASH_REF__/,$Answ,2);
@@ -1395,6 +1450,50 @@ sub get_problem_data {
}
}
}
+ return %Partdata;
+}
+
+#########################################################
+#########################################################
+##
+## Misc Radio Response functions
+##
+#########################################################
+#########################################################
+sub get_Radio_problem_student_data {
+ my ($row) = @_;
+}
+
+sub get_Radio_problem_data {
+ my ($url) = @_;
+ my $Answ=&Apache::lonnet::ssi($url,('grade_target' => 'analyze'));
+ (my $garbage,$Answ)=split(/_HASH_REF__/,$Answ,2);
+ my %Answer;
+ %Answer=&Apache::lonnet::str2hash($Answ);
+ my %Partdata;
+ &Apache::lonnet::logthis('url = '.$url);
+ foreach my $part (@{$Answer{'parts'}}) {
+ while (my($key,$value) = each(%Answer)) {
+ if (ref($value) eq 'ARRAY') {
+ &Apache::lonnet::logthis('is ref part:'.$part.' '.$key.'='.join(',',@$value));
+ } else {
+ &Apache::lonnet::logthis('notref part:'.$part.' '.$key.'='.$value);
+ }
+ next if ($key !~ /^$part/);
+ $key =~ s/^$part\.//;
+ if ($key eq 'foils') {
+ $Partdata{$part}->{'_Foils'}=$value;
+ } elsif ($key eq 'options') {
+ $Partdata{$part}->{'_Options'}=$value;
+ } elsif ($key eq 'shown') {
+ $Partdata{$part}->{'_Shown'}=$value;
+ } elsif ($key =~ /^foil.value.(.*)$/) {
+ $Partdata{$part}->{$1}->{'value'}=$value;
+ } elsif ($key =~ /^foil.text.(.*)$/) {
+ $Partdata{$part}->{$1}->{'text'}=$value;
+ }
+ }
+ }
return %Partdata;
}
|