version 1.57, 2002/10/17 14:35:34
|
version 1.58, 2002/11/10 15:44:38
|
Line 339 LISTJAVASCRIPT
|
Line 339 LISTJAVASCRIPT
|
my $checklastsub = $ENV{'form.handgrade'} eq 'yes' ? '' : 'checked'; |
my $checklastsub = $ENV{'form.handgrade'} eq 'yes' ? '' : '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: </b><input type="radio" name="vProb" value="no" > no '."\n". |
' <b>View Problem: </b><input type="radio" name="vProb" value="no" /> no '."\n". |
'<input type="radio" name="vProb" value="yes" checked > yes <br />'."\n". |
'<input type="radio" name="vProb" value="yes" checked /> one student '."\n". |
|
'<input type="radio" name="vProb" value="all" /> all students <br />'."\n". |
' <b>Submissions: </b>'."\n"; |
' <b>Submissions: </b>'."\n"; |
if ($ENV{'form.handgrade'} eq 'yes') { |
if ($ENV{'form.handgrade'} eq 'yes') { |
$gradeTable.='<input type="radio" name="lastSub" value="hdgrade" '.$checkhdgrade.' /> handgrade only'."\n"; |
$gradeTable.='<input type="radio" name="lastSub" value="hdgrade" '.$checkhdgrade.' /> handgrade only'."\n"; |
Line 795 SUBJAVASCRIPT
|
Line 796 SUBJAVASCRIPT
|
} |
} |
|
|
|
|
|
sub show_problem { |
|
my ($request,$symb,$uname,$udom,$removeform) = @_; |
|
my $rendered=&Apache::loncommon::get_student_view($symb,$uname,$udom, |
|
$ENV{'request.course.id'}); |
|
if ($removeform) { |
|
$rendered=~s|<form(.*?)>||g; |
|
$rendered=~s|</form>||g; |
|
$rendered=~s|name="submit"|name="would_have_been_submit"|g; |
|
} |
|
my $companswer=&Apache::loncommon::get_student_answers($symb,$uname,$udom, |
|
$ENV{'request.course.id'}); |
|
if ($removeform) { |
|
$companswer=~s|<form(.*?)>||g; |
|
$companswer=~s|</form>||g; |
|
$rendered=~s|name="submit"|name="would_have_been_submit"|g; |
|
} |
|
my $result.='<table border="0" width="100%"><tr><td bgcolor="#777777">'; |
|
$result.='<table border="0" width="100%"><tr><td bgcolor="#e6ffff">'; |
|
$result.='<b> View of the problem - '.$ENV{'form.fullname'}. |
|
'</b></td></tr><tr><td bgcolor="#ffffff">'.$rendered.'<br />'; |
|
$result.='<b>Correct answer:</b><br />'.$companswer; |
|
$result.='</td></tr></table>'; |
|
$result.='</td></tr></table><br />'; |
|
$request->print($result); |
|
} |
|
|
# --------------------------- show submissions of a student, option to grade |
# --------------------------- show submissions of a student, option to grade |
sub submission { |
sub submission { |
my ($request,$counter,$total) = @_; |
my ($request,$counter,$total) = @_; |
Line 809 sub submission {
|
Line 836 sub submission {
|
my $symb=($ENV{'form.symb'} ne '' ? $ENV{'form.symb'} : (&Apache::lonnet::symbread($url))); |
my $symb=($ENV{'form.symb'} ne '' ? $ENV{'form.symb'} : (&Apache::lonnet::symbread($url))); |
if ($symb eq '') { $request->print("Unable to handle ambiguous references:$url:."); return ''; } |
if ($symb eq '') { $request->print("Unable to handle ambiguous references:$url:."); return ''; } |
my $last = ($ENV{'form.lastSub'} eq 'last' ? 'last' : ''); |
my $last = ($ENV{'form.lastSub'} eq 'last' ? 'last' : ''); |
$ENV{'form.vProb'} = $ENV{'form.vProb'} ne '' ? $ENV{'form.vProb'} : 'yes'; |
# $ENV{'form.vProb'} = $ENV{'form.vProb'} ne '' ? $ENV{'form.vProb'} : 'yes'; |
|
|
# header info |
# header info |
if ($counter == 0) { |
if ($counter == 0) { |
Line 820 sub submission {
|
Line 847 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') { |
if ($ENV{'form.vProb'} eq 'yes') { |
my $rendered=&Apache::loncommon::get_student_view($symb,$uname,$udom, |
&show_problem($request,$symb,$uname,$udom,0); |
$ENV{'request.course.id'}); |
|
my $companswer=&Apache::loncommon::get_student_answers($symb,$uname,$udom, |
|
$ENV{'request.course.id'}); |
|
my $result.='<table border="0" width="100%"><tr><td bgcolor="#777777">'; |
|
$result.='<table border="0" width="100%"><tr><td bgcolor="#e6ffff">'; |
|
$result.='<b> View of the problem - '.$ENV{'form.fullname'}. |
|
'</b></td></tr><tr><td bgcolor="#ffffff">'.$rendered.'<br />'; |
|
$result.='<b>Correct answer:</b><br />'.$companswer; |
|
$result.='</td></tr></table>'; |
|
$result.='</td></tr></table><br />'; |
|
$request->print($result); |
|
} |
} |
|
|
# 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 894 KEYWORDS
|
Line 910 KEYWORDS
|
} |
} |
} |
} |
|
|
|
if ($ENV{'form.vProb'} eq 'all') { |
|
$request->print('<br /><br /><br />'); |
|
&show_problem($request,$symb,$uname,$udom,1); |
|
} |
|
|
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); |
my ($partlist,$handgrade) = &response_type($url); |
|
|
Line 1088 KEYWORDS
|
Line 1109 KEYWORDS
|
'onChange="javascript:clearRadBox(this.form.RADVAL'.$counter.'_'.$partid. |
'onChange="javascript:clearRadBox(this.form.RADVAL'.$counter.'_'.$partid. |
',this.form.GD_BOX'.$counter.'_'.$partid. |
',this.form.GD_BOX'.$counter.'_'.$partid. |
',this.form.GD_SEL'.$counter.'_'.$partid. |
',this.form.GD_SEL'.$counter.'_'.$partid. |
',this.form.stores'.$counter.'_'.$partid.')" />'."\n". |
',this.form.stores'.$counter.'_'.$partid.')" >'."\n"; |
'<option selected="on"> </option>'. |
if ($record{'resource.'.$partid.'.solved'} eq 'excused') { |
'<option>excused</option></select>'."  \n"; |
$result.='<option> </option>'. |
|
'<option selected="on">excused</option></select>'; |
|
} else { |
|
$result.='<option selected="on"> </option>'. |
|
'<option>excused</option></select>'; |
|
} |
|
$result.="  \n"; |
$result.='<input type="hidden" name="stores'.$counter.'_'.$partid.'" value="0" />'; |
$result.='<input type="hidden" name="stores'.$counter.'_'.$partid.'" value="0" />'; |
$result.='</td></tr></table>'."\n"; |
$result.='</td></tr></table>'."\n"; |
$request->print($result); |
$request->print($result); |
Line 1349 sub saveHandGrade {
|
Line 1376 sub saveHandGrade {
|
my %newrecord; |
my %newrecord; |
foreach (split(/:/,$ENV{'form.partlist'.$newflg})) { |
foreach (split(/:/,$ENV{'form.partlist'.$newflg})) { |
if ($ENV{'form.GD_SEL'.$newflg.'_'.$_} eq 'excused') { |
if ($ENV{'form.GD_SEL'.$newflg.'_'.$_} eq 'excused') { |
$newrecord{'resource.'.$_.'.solved'} = 'excused' |
if ($record{'resource.'.$_.'.solved'} ne 'excused') { |
if ($record{'resource.'.$_.'.solved'} ne 'excused'); |
$newrecord{'resource.'.$_.'.solved'} = 'excused'; |
|
if (exists($record{'resource.'.$_.'.awarded'})) { |
|
$newrecord{'resource.'.$_.'.awarded'} = ''; |
|
} |
|
} |
} else { |
} else { |
my $pts = ($ENV{'form.GD_BOX'.$newflg.'_'.$_} ne '' ? |
my $pts = ($ENV{'form.GD_BOX'.$newflg.'_'.$_} ne '' ? |
$ENV{'form.GD_BOX'.$newflg.'_'.$_} : |
$ENV{'form.GD_BOX'.$newflg.'_'.$_} : |