[LON-CAPA-cvs] cvs: loncom /interface lonquickgrades.pm

www www@source.lon-capa.org
Sat, 26 Mar 2011 22:37:47 -0000


www		Sat Mar 26 22:37:47 2011 EDT

  Modified files:              
    /loncom/interface	lonquickgrades.pm 
  Log:
  Collecting point information
  
  
Index: loncom/interface/lonquickgrades.pm
diff -u loncom/interface/lonquickgrades.pm:1.81 loncom/interface/lonquickgrades.pm:1.82
--- loncom/interface/lonquickgrades.pm:1.81	Sat Mar 26 20:04:15 2011
+++ loncom/interface/lonquickgrades.pm	Sat Mar 26 22:37:47 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Quick Student Grades Display
 #
-# $Id: lonquickgrades.pm,v 1.81 2011/03/26 20:04:15 www Exp $
+# $Id: lonquickgrades.pm,v 1.82 2011/03/26 22:37:47 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -464,6 +464,39 @@
                   '<input type="submit" name="storechanges" value="'.&mt("Save changes to grading categories").'" />'.
                   '<script>function storecmd (cmd) { document.quickform.cmd.value=cmd; document.quickform.submit(); }</script>');
     }
+#
+# Debug
+#
+#    my %data=&dumpdata($navmap);
+#    foreach (keys(%data)) {
+#        $r->print("\n<br />".$_.'='.$data{$_});
+#     }
+}
+
+#
+# Get data for all symbs
+#
+
+sub dumpdata {
+    my ($navmap)=@_;
+    my %returndata=();
+
+# Run through the map and get all data
+
+    my $iterator = $navmap->getIterator(undef, undef, undef, 1);
+    my $depth = 1;
+    $iterator->next(); # ignore first BEGIN_MAP
+    my $curRes = $iterator->next();
+
+    while ($depth > 0) {
+        if ($curRes == $iterator->BEGIN_MAP()) {$depth++;}
+        if ($curRes == $iterator->END_MAP()) { $depth--; }
+        if (ref($curRes) && $curRes->is_map()) {
+            $returndata{$curRes->symb()}=$curRes->{DATA}->{CHILD_PARTS}.':'.$curRes->{DATA}->{CHILD_ATTEMPTED}.':'.$curRes->{DATA}->{CHILD_CORRECT};
+        }
+        $curRes = $iterator->next();
+    }
+    return %returndata;
 }
 
 #
@@ -610,7 +643,7 @@
     }
     $r->print('</ul>');
     if ($cangrade) {
-        $r->print('<br />'.&mt('Add Problem or Sequence').'<br />'.
+        $r->print('<br />'.&mt('Add Problem or Folder').'<br />'.
                   &Apache::lonstathelpers::problem_selector('.',undef,1,1,'addcont_'.$id.'_',1,'this.form.cmd.value="addcont_'.$id.'";this.form.submit();'));
     }
     $r->print('</td>');