version 1.401, 2007/06/11 21:36:18
|
version 1.402, 2007/06/13 15:22:38
|
Line 6082 GRADINGMENUJS
|
Line 6082 GRADINGMENUJS
|
# '<input type="button" onClick="javascript:checkChoice(this.form,\'6\',\'processclicker\');" value="'.&mt('Process').'" />'. |
# '<input type="button" onClick="javascript:checkChoice(this.form,\'6\',\'processclicker\');" value="'.&mt('Process').'" />'. |
# ' '.&mt('clicker file').' </td></tr>'."\n"; |
# ' '.&mt('clicker file').' </td></tr>'."\n"; |
|
|
|
|
$result.='<tr bgcolor="#ffffe6"valign="top"><td colspan="2">'. |
$result.='<tr bgcolor="#ffffe6"valign="top"><td colspan="2">'. |
'<input type="button" onClick="javascript:checkChoice(this.form,\'4\',\'scantron_selectphase\');'. |
'<input type="button" onClick="javascript:checkChoice(this.form,\'4\',\'scantron_selectphase\');'. |
'" value="'.&mt('Grade').'" /> scantron forms</td></tr>'."\n"; |
'" value="'.&mt('Grade').'" /> scantron forms</td></tr>'."\n"; |
Line 6156 sub gather_clicker_ids {
|
Line 6155 sub gather_clicker_ids {
|
return %clickerids; |
return %clickerids; |
} |
} |
|
|
|
sub gather_adv_clicker_ids { |
|
my %clickerids=(); |
|
my $cnum=$env{'course.'.$env{'request.course.id'}.'.num'}; |
|
my $cdom=$env{'course.'.$env{'request.course.id'}.'.domain'}; |
|
my %coursepersonnel=&Apache::lonnet::get_course_adv_roles($cdom.'/'.$cnum); |
|
foreach my $element (sort keys %coursepersonnel) { |
|
foreach my $person (split(/\,/,$coursepersonnel{$element})) { |
|
my ($puname,$pudom)=split(/\:/,$person); |
|
my $clickers = |
|
(&Apache::lonnet::userenvironment($pudom,$puname,'clickers'))[1]; |
|
foreach my $id (split(/\,/,$clickers)) { |
|
if (exists($clickerids{$id})) { |
|
$clickerids{$id}.=','.$puname.':'.$pudom; |
|
} else { |
|
$clickerids{$id}=$puname.':'.$pudom; |
|
} |
|
} |
|
} |
|
} |
|
return %clickerids; |
|
} |
|
|
sub process_clicker { |
sub process_clicker { |
my ($r)=@_; |
my ($r)=@_; |
my ($symb)=&get_symb($r); |
my ($symb)=&get_symb($r); |
Line 6171 sub process_clicker {
|
Line 6192 sub process_clicker {
|
$result.='<tr bgcolor=#ffffe6><td>'."\n"; |
$result.='<tr bgcolor=#ffffe6><td>'."\n"; |
my $upload=&mt("Upload File"); |
my $upload=&mt("Upload File"); |
my $type=&mt("Type"); |
my $type=&mt("Type"); |
|
my $attendance=&mt("Award points just for participation"); |
|
my $personnel=&mt("Correctness determined from response by course personnel"); |
|
my $specific=&mt("Correctness determind from response with clicker ID"); |
|
my $pcorrect=&mt("Percentage points for correct solution"); |
|
my $pincorrect=&mt("Percentage points for incorrect solution"); |
my $selectform=&Apache::loncommon::select_form('iclicker','upfiletype', |
my $selectform=&Apache::loncommon::select_form('iclicker','upfiletype', |
('iclicker' => 'iClicker')); |
('iclicker' => 'iClicker')); |
|
|
$result.=<<ENDUPFORM; |
$result.=<<ENDUPFORM; |
|
<script type="text/javascript"> |
|
function sanitycheck() { |
|
// Accept only integer percentages |
|
document.forms.gradesupload.pcorrect.value=Math.round(document.forms.gradesupload.pcorrect.value); |
|
document.forms.gradesupload.pincorrect.value=Math.round(document.forms.gradesupload.pincorrect.value); |
|
// Find out grading choice |
|
for (i=0; i<document.forms.gradesupload.gradingmechanism.length; i++) { |
|
if (document.forms.gradesupload.gradingmechanism[i].checked) { |
|
gradingchoice=document.forms.gradesupload.gradingmechanism[i].value; |
|
} |
|
} |
|
// By default, new choice equals user selection |
|
newgradingchoice=gradingchoice; |
|
// Not good to give more points for false answers than correct ones |
|
if (Math.round(document.forms.gradesupload.pcorrect.value)<Math.round(document.forms.gradesupload.pincorrect.value)) { |
|
document.forms.gradesupload.pcorrect.value=document.forms.gradesupload.pincorrect.value; |
|
} |
|
// If new choice is attendance only, and old choice was correctness-based, restore defaults |
|
if ((gradingchoice=='attendance') && (document.forms.gradesupload.waschecked.value!='attendance')) { |
|
document.forms.gradesupload.pcorrect.value=100; |
|
document.forms.gradesupload.pincorrect.value=100; |
|
} |
|
// If the values are different, cannot be attendance only |
|
if ((Math.round(document.forms.gradesupload.pcorrect.value)!=Math.round(document.forms.gradesupload.pincorrect.value)) && |
|
(gradingchoice=='attendance')) { |
|
newgradingchoice='personnel'; |
|
} |
|
// Change grading choice to new one |
|
for (i=0; i<document.forms.gradesupload.gradingmechanism.length; i++) { |
|
if (document.forms.gradesupload.gradingmechanism[i].value==newgradingchoice) { |
|
document.forms.gradesupload.gradingmechanism[i].checked=true; |
|
} else { |
|
document.forms.gradesupload.gradingmechanism[i].checked=false; |
|
} |
|
} |
|
// Remember the old state |
|
document.forms.gradesupload.waschecked.value=newgradingchoice; |
|
} |
|
</script> |
<form method="post" enctype="multipart/form-data" action="/adm/grades" name="gradesupload"> |
<form method="post" enctype="multipart/form-data" action="/adm/grades" name="gradesupload"> |
<input type="hidden" name="symb" value="$symb" /> |
<input type="hidden" name="symb" value="$symb" /> |
<input type="hidden" name="command" value="processclickerfile" /> |
<input type="hidden" name="command" value="processclickerfile" /> |
Line 6182 sub process_clicker {
|
Line 6247 sub process_clicker {
|
<input type="hidden" name="saveState" value="$env{'form.saveState'}" /> |
<input type="hidden" name="saveState" value="$env{'form.saveState'}" /> |
<input type="file" name="upfile" size="50" /> |
<input type="file" name="upfile" size="50" /> |
<br /><label>$type: $selectform</label> |
<br /><label>$type: $selectform</label> |
|
<br /><label>$attendance: <input type="radio" name="gradingmechanism" value="attendance" checked="checked" onClick="sanitycheck()" /></label> |
|
<br /><label>$personnel: <input type="radio" name="gradingmechanism" value="personnel" onClick="sanitycheck()" /></label> |
|
<br /><label>$specific: <input type="radio" name="gradingmechanism" value="specific" onClick="sanitycheck()" /></label> |
|
<input type="text" name="specificid" size="15" /> |
|
<input type="hidden" name="waschecked" value="attendance" /> |
|
<br /><label>$pcorrect: <input type="text" name="pcorrect" size="4" value="100" onChange="sanitycheck()" /></label> |
|
<br /><label>$pincorrect: <input type="text" name="pincorrect" size="4" value="100" onChange="sanitycheck()" /></label> |
<br /><input type="button" onClick="javascript:checkUpload(this.form);" value="$upload" /> |
<br /><input type="button" onClick="javascript:checkUpload(this.form);" value="$upload" /> |
</form> |
</form> |
ENDUPFORM |
ENDUPFORM |