';
+ my $display_part=&get_display_part($partID,$symb);
+ $result.='
Part: '.$display_part.' '.
+ $resID.'
'.
+ '
Type: '.$responsetype.'
';
# '
Handgrade: '.$handgrade.'
';
+ }
}
$result.=''."\n";
return $result,$responseType,$hdgrade,$partlist,$handgrade;
@@ -589,7 +589,7 @@ sub verifyreceipt {
my $receipt = &Apache::lonnet::recprefix($courseid).'-'.
$env{'form.receipt'};
$receipt =~ s/[^\-\d]//g;
- my $symb = &Apache::lonnet::symbread();
+ my ($symb) = &get_symb($request);
my $title.='
Verifying Submission Receipt '.
$receipt.'
'."\n".
@@ -1470,7 +1470,8 @@ sub get_increment {
#--- displays the grading box, used in essay type problem and grading by page/sequence
sub gradeBox {
my ($request,$symb,$uname,$udom,$counter,$partid,$record) = @_;
- my $checkIcon = '';
my $wgt = &Apache::lonnet::EXT('resource.'.$partid.'.weight',$symb,$udom,$uname);
my $wgtmsg = ($wgt > 0 ? '(problem weight)' :
@@ -1493,10 +1494,10 @@ sub gradeBox {
my $increment = &get_increment();
$result.='
'."\n"; # display radio buttons in a nice table 10 across
while ($thisweight<=$wgt) {
- $result.= '
' : '');
$thisweight += $increment;
$ctr++;
@@ -1513,14 +1514,14 @@ sub gradeBox {
$result.=''."\n";
- $result.="  \n";
+ $result.=" \n";
$result.=''."\n".
''."\n".
''.$file_disp.'');
- $result.=''."\n";
- $result.=' ';
- $file_counter++;
+ if ($file =~ /\/portfolio\//) {
+ my ($file_path, $file_disp) = ($file =~ m|(.+/)(.+)$|);
+ my ($name,$version,$ext) = &file_name_version_ext($file_disp);
+ $file_disp = "$name.$ext";
+ $file = $file_path.$file_disp;
+ $result.=&mt('Return commented version of [_1] to student.',
+ ''.$file_disp.'');
+ $result.=''."\n";
+ $result.=' ';
+ $result.='(File will be uploaded when you click on Save & Next below.) ';
+ $file_counter++;
+ }
}
}
return $result;
}
sub show_problem {
- my ($request,$symb,$uname,$udom,$removeform,$viewon,$mode) = @_;
+ my ($request,$symb,$uname,$udom,$removeform,$viewon,$mode,$form) = @_;
my $rendered;
+ my %form = ((ref($form) eq 'HASH')? %{$form} : ());
&Apache::lonxml::remember_problem_counter();
if ($mode eq 'both' or $mode eq 'text') {
$rendered=&Apache::loncommon::get_student_view($symb,$uname,$udom,
- $env{'request.course.id'});
+ $env{'request.course.id'},
+ undef,\%form);
}
if ($removeform) {
$rendered=~s|||g;
- $rendered=~s|name="submit"|name="would_have_been_submit"|g;
+ $rendered=~s|(]*name\s*=\s*"?)(\w+)("?)|$1would_have_been_$2$3|g;
}
my $companswer;
if ($mode eq 'both' or $mode eq 'answer') {
&Apache::lonxml::restore_problem_counter();
- $companswer=&Apache::loncommon::get_student_answers($symb,$uname,$udom,
- $env{'request.course.id'});
+ $companswer=
+ &Apache::loncommon::get_student_answers($symb,$uname,$udom,
+ $env{'request.course.id'},
+ %form);
}
if ($removeform) {
$companswer=~s|
'."\n";
+ $studentTable.='
' if ($ptr%2 == 0);
+ $studentTable.=''."\n";
$studentTable.='" />'."\n";
@@ -3797,9 +3879,10 @@ sub getSymbMap {
1,0,1);
for my $sequence ($navmap->getById('0.0'), @sequences) {
if ($navmap->hasResource($sequence, sub { shift->is_problem(); }, 0) ) {
- my $title = $minder.'.'.$sequence->compTitle();
- push @titles, $title; # minder in case two titles are identical
- $symbx{$title} = $sequence->symb();
+ my $title = $minder.'.'.
+ &HTML::Entities::encode($sequence->compTitle(),'"\'&');
+ push(@titles, $title); # minder in case two titles are identical
+ $symbx{$title} = &HTML::Entities::encode($sequence->symb(),'"\'&');
$minder++;
}
}
@@ -3835,6 +3918,11 @@ sub displayPage {
my $result='