version 1.143, 2003/10/08 18:25:18
|
version 1.144, 2003/10/21 21:46:15
|
Line 507 LISTJAVASCRIPT
|
Line 507 LISTJAVASCRIPT
|
my $checkhdgrade = ($ENV{'form.handgrade'} eq 'yes' && scalar(@$partlist) > 1 ) ? 'checked' : ''; |
my $checkhdgrade = ($ENV{'form.handgrade'} eq 'yes' && scalar(@$partlist) > 1 ) ? 'checked' : ''; |
my $checklastsub = $checkhdgrade eq '' ? 'checked' : ''; |
my $checklastsub = $checkhdgrade eq '' ? 'checked' : ''; |
my $gradeTable='<form action="/adm/grades" method="post" name="gradesub">'."\n". |
my $gradeTable='<form action="/adm/grades" method="post" name="gradesub">'."\n". |
' <b>View Problem Text: </b><input type="radio" name="vProb" value="no" checked /> no '."\n". |
' <b>View Problem Text: </b><input type="radio" name="vProb" value="no" checked="on" /> no '."\n". |
'<input type="radio" name="vProb" value="yes" /> one student '."\n". |
'<input type="radio" name="vProb" value="yes" /> one student '."\n". |
'<input type="radio" name="vProb" value="all" /> all students <br />'."\n". |
'<input type="radio" name="vProb" value="all" /> all students <br />'."\n". |
|
' <b>View Answer: </b><input type="radio" name="vAns" value="no" /> no '."\n". |
|
'<input type="radio" name="vAns" value="yes" /> one student '."\n". |
|
'<input type="radio" name="vAns" value="all" checked="on" /> all students <br />'."\n". |
' <b>Submissions: </b>'."\n"; |
' <b>Submissions: </b>'."\n"; |
if ($ENV{'form.handgrade'} eq 'yes' && scalar(@$partlist) > 1) { |
if ($ENV{'form.handgrade'} eq 'yes' && scalar(@$partlist) > 1) { |
$gradeTable.='<input type="radio" name="lastSub" value="hdgrade" '.$checkhdgrade.' /> essay part only'."\n"; |
$gradeTable.='<input type="radio" name="lastSub" value="hdgrade" '.$checkhdgrade.' /> essay part only'."\n"; |
Line 1196 sub gradeBox {
|
Line 1199 sub gradeBox {
|
} |
} |
|
|
sub show_problem { |
sub show_problem { |
my ($request,$symb,$uname,$udom,$removeform,$viewon) = @_; |
my ($request,$symb,$uname,$udom,$removeform,$viewon,$mode) = @_; |
my $rendered=&Apache::loncommon::get_student_view($symb,$uname,$udom, |
my $rendered; |
$ENV{'request.course.id'}); |
if ($mode eq 'both' or $mode eq 'text') { |
|
$rendered=&Apache::loncommon::get_student_view($symb,$uname,$udom, |
|
$ENV{'request.course.id'}); |
|
} |
if ($removeform) { |
if ($removeform) { |
$rendered=~s|<form(.*?)>||g; |
$rendered=~s|<form(.*?)>||g; |
$rendered=~s|</form>||g; |
$rendered=~s|</form>||g; |
$rendered=~s|name="submit"|name="would_have_been_submit"|g; |
$rendered=~s|name="submit"|name="would_have_been_submit"|g; |
} |
} |
my $companswer=&Apache::loncommon::get_student_answers($symb,$uname,$udom, |
my $companswer; |
$ENV{'request.course.id'}); |
if ($mode eq 'both' or $mode eq 'answer') { |
|
$companswer=&Apache::loncommon::get_student_answers($symb,$uname,$udom, |
|
$ENV{'request.course.id'}); |
|
} |
if ($removeform) { |
if ($removeform) { |
$companswer=~s|<form(.*?)>||g; |
$companswer=~s|<form(.*?)>||g; |
$companswer=~s|</form>||g; |
$companswer=~s|</form>||g; |
$rendered=~s|name="submit"|name="would_have_been_submit"|g; |
$companswer=~s|name="submit"|name="would_have_been_submit"|g; |
} |
} |
my $result.='<table border="0" width="100%"><tr><td bgcolor="#777777">'; |
my $result.='<table border="0" width="100%"><tr><td bgcolor="#777777">'; |
$result.='<table border="0" width="100%">'; |
$result.='<table border="0" width="100%">'; |
$result.='<tr><td bgcolor="#e6ffff"><b> View of the problem - '.$ENV{'form.fullname'}. |
if ($viewon) { |
'</b></td></tr>' if ($viewon); |
$result.='<tr><td bgcolor="#e6ffff"><b> '; |
$result.='<tr><td bgcolor="#ffffff">'.$rendered.'<br />'; |
if ($mode eq 'both' or $mode eq 'text') { |
$result.='<b>Correct answer:</b><br />'.$companswer; |
$result.='View of the problem - '; |
|
} else { |
|
$result.='Correct answer: '; |
|
} |
|
$result.=$ENV{'form.fullname'}.'</b></td></tr>'; |
|
} |
|
if ($mode eq 'both') { |
|
$result.='<tr><td bgcolor="#ffffff">'.$rendered.'<br />'; |
|
$result.='<b>Correct answer:</b><br />'.$companswer; |
|
} elsif ($mode eq 'text') { |
|
$result.='<tr><td bgcolor="#ffffff">'.$rendered; |
|
} elsif ($mode eq 'answer') { |
|
$result.='<tr><td bgcolor="#ffffff">'.$companswer; |
|
} |
$result.='</td></tr></table>'; |
$result.='</td></tr></table>'; |
$result.='</td></tr></table><br />'; |
$result.='</td></tr></table><br />'; |
return $result; |
return $result; |
Line 1265 sub submission {
|
Line 1287 sub submission {
|
|
|
# option to display problem, only once else it cause problems |
# option to display problem, only once else it cause problems |
# with the form later since the problem has a form. |
# with the form later since the problem has a form. |
if ($ENV{'form.vProb'} eq 'yes' or !$ENV{'form.vProb'}) { |
if ($ENV{'form.vProb'} eq 'yes' or $ENV{'form.vAns'} eq 'yes') { |
$request->print(&show_problem($request,$symb,$uname,$udom,0,1)); |
my $mode; |
|
if ($ENV{'form.vProb'} eq 'yes' && $ENV{'form.vAns'} eq 'yes') { |
|
$mode='both'; |
|
} elsif ($ENV{'form.vProb'} eq 'yes') { |
|
$mode='text'; |
|
} elsif ($ENV{'form.vAns'} eq 'yes') { |
|
$mode='answer'; |
|
} |
|
$request->print(&show_problem($request,$symb,$uname,$udom,0,1,$mode)); |
} |
} |
|
|
# kwclr is the only variable that is guaranteed to be non blank |
# kwclr is the only variable that is guaranteed to be non blank |
Line 1301 sub submission {
|
Line 1331 sub submission {
|
'<input type="hidden" name="url" value="'.$url.'" />'."\n". |
'<input type="hidden" name="url" value="'.$url.'" />'."\n". |
'<input type="hidden" name="showgrading" value="'.$ENV{'form.showgrading'}.'" />'."\n". |
'<input type="hidden" name="showgrading" value="'.$ENV{'form.showgrading'}.'" />'."\n". |
'<input type="hidden" name="vProb" value="'.$ENV{'form.vProb'}.'" />'."\n". |
'<input type="hidden" name="vProb" value="'.$ENV{'form.vProb'}.'" />'."\n". |
|
'<input type="hidden" name="vAns" value="'.$ENV{'form.vAns'}.'" />'."\n". |
'<input type="hidden" name="lastSub" value="'.$ENV{'form.lastSub'}.'" />'."\n". |
'<input type="hidden" name="lastSub" value="'.$ENV{'form.lastSub'}.'" />'."\n". |
'<input type="hidden" name="section" value="'.$ENV{'form.section'}.'">'."\n". |
'<input type="hidden" name="section" value="'.$ENV{'form.section'}.'">'."\n". |
'<input type="hidden" name="submitonly" value="'.$ENV{'form.submitonly'}.'">'."\n". |
'<input type="hidden" name="submitonly" value="'.$ENV{'form.submitonly'}.'">'."\n". |
Line 1351 KEYWORDS
|
Line 1382 KEYWORDS
|
} |
} |
} |
} |
|
|
if ($ENV{'form.vProb'} eq 'all') { |
if ($ENV{'form.vProb'} eq 'all' or $ENV{'form.vAns'} eq 'all') { |
$request->print('<br /><br /><br />') if ($counter > 0); |
$request->print('<br /><br /><br />') if ($counter > 0); |
$request->print(&show_problem($request,$symb,$uname,$udom,1,1)); |
my $mode; |
|
if ($ENV{'form.vProb'} eq 'all' && $ENV{'form.vAns'} eq 'all') { |
|
$mode='both'; |
|
} elsif ($ENV{'form.vProb'} eq 'all' ) { |
|
$mode='text'; |
|
} elsif ($ENV{'form.vAns'} eq 'all') { |
|
$mode='answer'; |
|
} |
|
$request->print(&show_problem($request,$symb,$uname,$udom,1,1,$mode)); |
} |
} |
|
|
my %record = &Apache::lonnet::restore($symb,$ENV{'request.course.id'},$udom,$uname); |
my %record = &Apache::lonnet::restore($symb,$ENV{'request.course.id'},$udom,$uname); |
|
|
my ($partlist,$handgrade) = &response_type($url,$symb); |
my ($partlist,$handgrade) = &response_type($url,$symb); |
Line 2755 LISTJAVASCRIPT
|
Line 2795 LISTJAVASCRIPT
|
$result.='<input type="hidden" name="page" />'."\n". |
$result.='<input type="hidden" name="page" />'."\n". |
'<input type="hidden" name="title" />'."\n"; |
'<input type="hidden" name="title" />'."\n"; |
|
|
$result.=' <b>View Problems Text: </b><input type="radio" name="vProb" value="no" checked /> no '."\n". |
$result.=' <b>View Problems Text: </b><input type="radio" name="vProb" value="no" checked="on" /> no '."\n". |
'<input type="radio" name="vProb" value="yes" /> yes '."<br>\n"; |
'<input type="radio" name="vProb" value="yes" /> yes '."<br>\n"; |
|
|
$result.=' <b>Submission Details: </b>'. |
$result.=' <b>Submission Details: </b>'. |
Line 2894 sub displayPage {
|
Line 2934 sub displayPage {
|
$studentTable.='<tr bgcolor="#ffffe6"><td align="center" valign="top" >'.$question. |
$studentTable.='<tr bgcolor="#ffffe6"><td align="center" valign="top" >'.$question. |
(scalar(@{$parts}) == 1 ? '' : '<br>('.scalar(@{$parts}).' parts)').'</td>'; |
(scalar(@{$parts}) == 1 ? '' : '<br>('.scalar(@{$parts}).' parts)').'</td>'; |
$studentTable.='<td valign="top">'; |
$studentTable.='<td valign="top">'; |
if ($ENV{'form.vProb'} eq 'yes') { |
if ($ENV{'form.vProb'} eq 'yes' ) { |
$studentTable.=&show_problem($request,$symbx,$uname,$udom,1); |
$studentTable.=&show_problem($request,$symbx,$uname,$udom,1, |
|
undef,'both'); |
} else { |
} else { |
my $companswer = &Apache::loncommon::get_student_answers($symbx,$uname,$udom,$ENV{'request.course.id'}); |
my $companswer = &Apache::loncommon::get_student_answers($symbx,$uname,$udom,$ENV{'request.course.id'}); |
$companswer =~ s|<form(.*?)>||g; |
$companswer =~ s|<form(.*?)>||g; |