Part: '.
- $display_part.' ( ID '.$respid.
+ $lastsubonly.='Debug -'.'Part: '.
+ $display_part.' ( hhhh ID '.$respid.
' ) ';
my $files=&get_submitted_files($udom,$uname,$partid,$respid,\%record);
if (@$files) {
@@ -2170,10 +2169,18 @@ sub processHandGrade {
}
my $includemsg = $env{'form.includemsg'.$ctr};
my ($subject,$message,$msgstatus) = ('','','');
- my $restitle = &Apache::lonnet::gettitle($symb);
- my ($feedurl,$showsymb) =
- &get_feedurl_and_symb($symb,$uname,$udom);
- my $messagetail;
+ my $restitle = &Apache::lonnet::gettitle($symb);
+ my $encrypturl=&Apache::lonnet::EXT('resource.0.encrypturl',
+ $symb,$udom,$uname);
+ my ($feedurl,$baseurl,$showsymb,$messagetail);
+ $feedurl = &Apache::lonnet::clutter($url);
+ if ($encrypturl =~ /^yes$/i) {
+ $baseurl = &Apache::lonenc::encrypted($feedurl,1);
+ $showsymb = &Apache::lonenc::encrypted($symb,1);
+ } else {
+ $baseurl = $feedurl;
+ $showsymb = $symb;
+ }
if ($includemsg =~ /savemsg|newmsg\Q$ctr\E/) {
$subject = $env{'form.msgsub'} if ($includemsg =~ /msgsub/);
unless ($subject=~/\w/) { $subject=&mt('Grading Feedback'); }
@@ -2186,12 +2193,12 @@ sub processHandGrade {
if ($env{'form.withgrades'.$ctr}) {
$message.="\n\nPoint".($pts > 1 ? 's':'').' awarded = '.$pts.' out of '.$wgt;
$messagetail = " for $env{'form.probTitle'}";
+ $baseurl."?symb=$showsymb\">$env{'form.probTitle'}";
}
$msgstatus =
&Apache::lonmsg::user_normal_msg($uname,$udom,$subject,
$message.$messagetail,
- undef,$feedurl,undef,
+ undef,$baseurl,undef,
undef,undef,$showsymb,
$restitle);
$request->print(' '.&mt('Sending message to [_1]:[_2]',$uname,$udom).': '.
@@ -2208,16 +2215,26 @@ sub processHandGrade {
if ($errorflag eq 'not_allowed') {
$request->print("".&mt('Not allowed to modify grades for [_1]',"$collaborator:$udom")."");
next;
- } elsif ($message ne '') {
- my ($baseurl,$showsymb) =
- &get_feedurl_and_symb($symb,$collaborator,
- $udom);
- if ($env{'form.withgrades'.$ctr}) {
- $messagetail = " for $env{'form.probTitle'}";
+
+ }
+ $msgstatus =
+ &Apache::lonmsg::user_normal_msg($collaborator,$udom,$subject,$message.$messagetail,undef,$baseurl,undef,undef,undef,$showsymb,$restitle);
}
- $msgstatus =
- &Apache::lonmsg::user_normal_msg($collaborator,$udom,$subject,$message.$messagetail,undef,$baseurl,undef,undef,undef,$showsymb,$restitle);
}
}
}
@@ -2571,31 +2588,28 @@ sub handback_files {
$message .= "".&Apache::lonnet::gettitle($symb)." ";
$message .= ' The returned file(s) are named: '. $file_msg;
$message .= " and can be found in your portfolio space.";
- my ($feedurl,$showsymb) =
- &get_feedurl_and_symb($symb,$domain,$stuname);
+ my $url = (&Apache::lonnet::decode_symb($symb))[2];
+ my $feedurl = &Apache::lonnet::clutter($url);
+ my $encrypturl=&Apache::lonnet::EXT('resource.0.encrypturl',
+ $symb,$domain,$stuname);
+ my ($baseurl,$showsymb);
+ if ($encrypturl =~ /^yes$/i) {
+ $baseurl = &Apache::lonenc::encrypted($feedurl,1);
+ $showsymb = &Apache::lonenc::encrypted($symb,1);
+ } else {
+ $baseurl = $feedurl;
+ $showsymb = $symb;
+ }
my $restitle = &Apache::lonnet::gettitle($symb);
my $msgstatus =
&Apache::lonmsg::user_normal_msg($stuname,$domain,$subject.
' (File Returned) ['.$restitle.']',$message,undef,
- $feedurl,undef,undef,undef,$showsymb,$restitle);
+ $baseurl,undef,undef,undef,$showsymb,$restitle);
}
}
return;
}
-sub get_feedurl_and_symb {
- my ($symb,$uname,$udom) = @_;
- my (undef,undef,$url) = &Apache::lonnet::decode_symb($symb);
- $url = &Apache::lonnet::clutter($url);
- my $encrypturl=&Apache::lonnet::EXT('resource.0.encrypturl',
- $symb,$udom,$uname);
- if ($encrypturl =~ /^yes$/i) {
- &Apache::lonenc::encrypted(\$url,1);
- &Apache::lonenc::encrypted(\$symb,1);
- }
- return ($url,$symb);
-}
-
sub get_submitted_files {
my ($udom,$uname,$partid,$respid,$record) = @_;
my @files;
@@ -2956,7 +2970,7 @@ sub viewgrades {
#beginning of class grading form
$result.= ' | '."\n";
+# $result.=''.
+# ''.
+# ' '.&mt('clicker file').' | '."\n";
+
+
$result.=''.
' scantron forms | '."\n";
@@ -6113,6 +6130,80 @@ 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.='
'."\n";
+ $result.=''."\n".
+ ' |
'."\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.=' '.$key.' - '.$clickerids{$key};
+ }
+ return $result;
+}
+
sub handler {
my $request=$_[0];
@@ -6180,6 +6271,10 @@ sub handler {
$request->print(&editgrades($request));
} elsif ($command eq 'verify' && $perm{'vgr'}) {
$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'}) {
$request->print(&upcsvScores_form($request));
} elsif ($command eq 'csvupload' && $perm{'mgr'}) {
|