version 1.399, 2007/05/10 16:06:09
|
version 1.400, 2007/05/20 21:10:46
|
Line 6078 GRADINGMENUJS
|
Line 6078 GRADINGMENUJS
|
'<input type="button" onClick="javascript:checkChoice(this.form,\'3\',\'csvform\');" value="'.&mt('Upload').'" />'. |
'<input type="button" onClick="javascript:checkChoice(this.form,\'3\',\'csvform\');" value="'.&mt('Upload').'" />'. |
' '.&mt('scores from file').' </td></tr>'."\n"; |
' '.&mt('scores from file').' </td></tr>'."\n"; |
|
|
|
# $result.='<tr bgcolor="#ffffe6"><td>'. |
|
# '<input type="button" onClick="javascript:checkChoice(this.form,\'6\',\'processclicker\');" value="'.&mt('Process').'" />'. |
|
# ' '.&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 6125 sub init_perm {
|
Line 6130 sub init_perm {
|
} |
} |
} |
} |
|
|
|
sub gather_clicker_ids { |
|
my %clickerids=(); |
|
|
|
my $classlist = &Apache::loncoursedata::get_classlist(); |
|
|
|
# Set up a couple variables. |
|
my $usernameidx = &Apache::loncoursedata::CL_SNAME(); |
|
my $domainidx = &Apache::loncoursedata::CL_SDOM(); |
|
|
|
foreach my $student (keys %$classlist) { |
|
|
|
my $username = $classlist->{$student}->[$usernameidx]; |
|
my $domain = $classlist->{$student}->[$domainidx]; |
|
my $clickers = |
|
(&Apache::lonnet::userenvironment($domain,$username,'clickers'))[1]; |
|
foreach my $id (split(/\,/,$clickers)) { |
|
if (exists($clickerids{$id})) { |
|
$clickerids{$id}.=','.$username.':'.$domain; |
|
} else { |
|
$clickerids{$id}=$username.':'.$domain; |
|
} |
|
} |
|
} |
|
return %clickerids; |
|
} |
|
|
|
sub process_clicker { |
|
my ($r)=@_; |
|
my ($symb)=&get_symb($r); |
|
if (!$symb) {return '';} |
|
my $result=&checkforfile_js(); |
|
$env{'form.probTitle'} = &Apache::lonnet::gettitle($symb); |
|
my ($table) = &showResourceInfo($symb,$env{'form.probTitle'}); |
|
$result.=$table; |
|
$result.='<br /><table width="100%" border="0"><tr><td bgcolor="#777777">'."\n"; |
|
$result.='<table width="100%" border="0"><tr bgcolor="#e6ffff"><td>'."\n"; |
|
$result.=' <b>'.&mt('Specify a file containing the clicker information for this resource'). |
|
'.</b></td></tr>'."\n"; |
|
$result.='<tr bgcolor=#ffffe6><td>'."\n"; |
|
my $upload=&mt("Upload File"); |
|
my $type=&mt("Type"); |
|
my $selectform=&Apache::loncommon::select_form('iclicker','upfiletype', |
|
('iclicker' => 'iClicker')); |
|
|
|
$result.=<<ENDUPFORM; |
|
<form method="post" enctype="multipart/form-data" action="/adm/grades" name="gradesupload"> |
|
<input type="hidden" name="symb" value="$symb" /> |
|
<input type="hidden" name="command" value="processclickerfile" /> |
|
<input type="hidden" name="probTitle" value="$env{'form.probTitle'}" /> |
|
<input type="hidden" name="saveState" value="$env{'form.saveState'}" /> |
|
<input type="file" name="upfile" size="50" /> |
|
<br /><label>$type: $selectform</label> |
|
<br /><input type="button" onClick="javascript:checkUpload(this.form);" value="$upload" /> |
|
</form> |
|
ENDUPFORM |
|
$result.='</td></tr></table>'."\n". |
|
'</td></tr></table><br /><br />'."\n"; |
|
$result.=&show_grading_menu_form($symb); |
|
return $result; |
|
} |
|
|
|
sub process_clicker_file { |
|
my ($r)=@_; |
|
my ($symb)=&get_symb($r); |
|
if (!$symb) {return '';} |
|
my ($result) = &showResourceInfo($symb,$env{'form.probTitle'}); |
|
$result.=&show_grading_menu_form($symb); |
|
my %clickerids=&gather_clicker_ids(); |
|
foreach my $key (keys %clickerids) { |
|
$result.='<br />'.$key.' - '.$clickerids{$key}; |
|
} |
|
return $result; |
|
} |
|
|
sub handler { |
sub handler { |
my $request=$_[0]; |
my $request=$_[0]; |
|
|
Line 6192 sub handler {
|
Line 6271 sub handler {
|
$request->print(&editgrades($request)); |
$request->print(&editgrades($request)); |
} elsif ($command eq 'verify' && $perm{'vgr'}) { |
} elsif ($command eq 'verify' && $perm{'vgr'}) { |
$request->print(&verifyreceipt($request)); |
$request->print(&verifyreceipt($request)); |
|
} elsif ($command eq 'processclicker' && $perm{'mgr'}) { |
|
$request->print(&process_clicker($request)); |
|
} elsif ($command eq 'processclickerfile' && $perm{'mgr'}) { |
|
$request->print(&process_clicker_file($request)); |
} elsif ($command eq 'csvform' && $perm{'mgr'}) { |
} elsif ($command eq 'csvform' && $perm{'mgr'}) { |
$request->print(&upcsvScores_form($request)); |
$request->print(&upcsvScores_form($request)); |
} elsif ($command eq 'csvupload' && $perm{'mgr'}) { |
} elsif ($command eq 'csvupload' && $perm{'mgr'}) { |