[LON-CAPA-cvs] cvs: loncom(version_2_11_X) /interface lonwhatsnew.pm

raeburn raeburn at source.lon-capa.org
Tue Sep 1 18:30:58 EDT 2020


raeburn		Tue Sep  1 22:30:58 2020 EDT

  Modified files:              (Branch: version_2_11_X)
    /loncom/interface	lonwhatsnew.pm 
  Log:
  - For 2.11
    Backport rev. 1.128
  
  
Index: loncom/interface/lonwhatsnew.pm
diff -u loncom/interface/lonwhatsnew.pm:1.105.2.17 loncom/interface/lonwhatsnew.pm:1.105.2.18
--- loncom/interface/lonwhatsnew.pm:1.105.2.17	Mon Mar 30 16:30:47 2020
+++ loncom/interface/lonwhatsnew.pm	Tue Sep  1 22:30:58 2020
@@ -1,5 +1,7 @@
+# The LearningOnline Network
+# What's New in a course
 #
-# $Id: lonwhatsnew.pm,v 1.105.2.17 2020/03/30 16:30:47 raeburn Exp $
+# $Id: lonwhatsnew.pm,v 1.105.2.18 2020/09/01 22:30:58 raeburn Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -1121,12 +1123,23 @@
 sub check_handgraded {
     my ($resource,$symb,$title,$cdom,$cnum,$ungraded,$tograde) = @_;
     if ($resource->is_problem()) {
-        my ($map,$ind,$url)=&Apache::lonnet::decode_symb($symb);
+        my ($handgradeable,$is_task);
         my $partlist=$resource->parts();
-        my $handgradeable;
-        foreach my $part (@$partlist) {
-            if ($resource->handgrade($part) eq 'yes') {
-                $handgradeable=1; last;
+        if ($resource->is_task()) {
+            $is_task = 1;
+            foreach my $part (@$partlist) {
+                if ($resource->handgrade($part) eq 'yes') {
+                    $handgradeable=1;
+                    last;
+                }
+            }
+        } else {
+            foreach my $part (@$partlist) {
+                my @types = $resource->responseType($part);
+                if (grep(/^essay$/, at types)) {
+                    $handgradeable=1;
+                    last;
+                }
             }
         }
         if ($handgradeable) {
@@ -1135,6 +1148,7 @@
             if (@ungraded > 0) {
                 $$ungraded{$symb}{count} = scalar(@ungraded);
                 $$ungraded{$symb}{title} = $title;
+                $$ungraded{$symb}{is_task} = $is_task;
                 if ($resource->encrypted()) {
                     $$ungraded{$symb}{'enclink'} = $resource->link();
                     $$ungraded{$symb}{'encsymb'} = $resource->shown_symb();
@@ -1800,12 +1814,23 @@
         foreach my $res (@{$tograde}) {
             $rowNum ++;
             my $css_class = $rowNum%2?' class="LC_odd_row"':'';
-            my ($map,$id,$url)=&Apache::lonnet::decode_symb($res);
-            my $linkurl=&Apache::lonnet::clutter($url);
-            $linkurl .= '?symb='.&escape($res);
-            if ($$ungraded{$res}{'enclink'}) {
-                $linkurl =
-                    $$ungraded{$res}{'enclink'}.'?symb='.$$ungraded{$res}{'encsymb'};
+            my $linkurl;
+            if ($$ungraded{$res}{'is_task'}) {
+                my ($map,$id,$url)=&Apache::lonnet::decode_symb($res);
+                $linkurl=&Apache::lonnet::clutter($url);
+                $linkurl .= '?symb='.&escape($res);
+                if ($$ungraded{$res}{'enclink'}) {
+                    $linkurl =
+                        $$ungraded{$res}{'enclink'}.'?symb='.$$ungraded{$res}{'encsymb'};
+                }
+            } else {
+                $linkurl='/adm/grades';
+                if ($$ungraded{$res}{'enclink'}) {
+                    $linkurl.='?symb='.$$ungraded{$res}{'encsymb'};
+                } else {
+                    $linkurl.='?symb='.&escape($res);
+                }
+                $linkurl.='&command=ungraded';
             }
             $r->print('<tr'.$css_class.'><td><a href="'.$linkurl.'">'.$$ungraded{$res}{title}.'</a></td><td class="LC_right_item">'.$$ungraded{$res}{count}.'</td></tr>');
         }




More information about the LON-CAPA-cvs mailing list