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

www www@source.lon-capa.org
Fri, 11 Mar 2011 02:39:53 -0000


www		Fri Mar 11 02:39:53 2011 EDT

  Modified files:              
    /loncom/interface	lonparmset.pm lonquickgrades.pm 
  Log:
  Pick particular user.
  
  
Index: loncom/interface/lonparmset.pm
diff -u loncom/interface/lonparmset.pm:1.510 loncom/interface/lonparmset.pm:1.511
--- loncom/interface/lonparmset.pm:1.510	Sat Jan 15 21:49:37 2011
+++ loncom/interface/lonparmset.pm	Fri Mar 11 02:39:53 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Handler to set parameters for assessments
 #
-# $Id: lonparmset.pm,v 1.510 2011/01/15 21:49:37 www Exp $
+# $Id: lonparmset.pm,v 1.511 2011/03/11 02:39:53 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -2244,7 +2244,7 @@
         # Update Display Button
         $r->print('<p>'
              .'<input type="submit" name="dis"'
-             .' value="'.&mt('Update Parameter Display').'" />'
+             .' value="'.&mt('Update Display').'" />'
              .'<input type="hidden" name="hideparmsel" value="hidden" />'
              .'</p>');
         $r->print('</div>');
@@ -2280,7 +2280,7 @@
         $r->print(&Apache::lonhtmlcommon::end_pick_box());
         $r->print('<p>'
              .'<input type="submit" name="dis"'
-             .' value="'.&mt('Update Parameter Display').'" />'
+             .' value="'.&mt('Update Display').'" />'
              .'<input type="hidden" name="hideparmsel" value="hidden" />'
              .'</p>');
     }
Index: loncom/interface/lonquickgrades.pm
diff -u loncom/interface/lonquickgrades.pm:1.73 loncom/interface/lonquickgrades.pm:1.74
--- loncom/interface/lonquickgrades.pm:1.73	Wed Mar  9 01:46:08 2011
+++ loncom/interface/lonquickgrades.pm	Fri Mar 11 02:39:53 2011
@@ -1,7 +1,7 @@
 # The LearningOnline Network with CAPA
 # Quick Student Grades Display
 #
-# $Id: lonquickgrades.pm,v 1.73 2011/03/09 01:46:08 www Exp $
+# $Id: lonquickgrades.pm,v 1.74 2011/03/11 02:39:53 www Exp $
 #
 # Copyright Michigan State University Board of Trustees
 #
@@ -80,13 +80,31 @@
 
     &startGradeScreen($r,'quick');
 
-    $r->rflush();
-
-#    my $uname='korte';
-#    my $udom='gerd';
-
+    my $cangrade=&Apache::lonnet::allowed('mgr');
+#
+# Pick student
+#
     my $uname;
     my $udom;
+    my $stdid;
+    if ($cangrade) {
+        if ($env{'form.uname'}) { $uname=$env{'form.uname'}; }
+        if ($env{'form.udom'}) { $udom=$env{'form.udom'}; }
+        if ($env{'form.id'}) { $stdid=$env{'form.id'}; }
+        if (($stdid) && ($udom)) {
+            $uname=(&Apache::lonnet::idget($udom,$stdid))[1];
+        }
+        $r->print('<form method="post" name="quickform" action="/adm/quickgrades">');
+        my $chooseopt=&Apache::loncommon::select_dom_form($udom,'udom').' '.
+           &Apache::loncommon::selectstudent_link('quickform','uname','udom');
+        $r->print("<p>\n".&Apache::loncommon::studentbrowser_javascript()."\n");
+        $r->print(&mt('For User [_1] or Student/Employee ID [_2] at Domain [_3]'
+                 ,'<input type="text" value="'.$uname.'" size="12" name="uname" />'
+                 ,'<input type="text" value="'.$stdid.'" size="12" name="id" /> '
+                 ,$chooseopt).'<br />'.
+                 '<input type="submit" name="display" value="'.&mt('Update Display').'" /></p>');
+    }
+    $r->rflush();
 
     my ($navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts,$topLevelRight,$topLevelAttempted)=
        &getData($showPoints,$uname,$udom);
@@ -98,6 +116,7 @@
        &outputTable($r,$showPoints,$notshowTotals,
                  $navmap,$totalParts,$totalPossible,$totalRight,$totalAttempted,$topLevelParts,$topLevelRight,$topLevelAttempted);
     }
+    if ($cangrade) { $r->print("\n</form>\n"); }
     &endGradeScreen($r);
     return OK;
 
@@ -430,19 +449,13 @@
         &Apache::lonnet::put('grading_categories',\%categories,$cdom,$cnum);
     }
 # new categories loaded now
-# Form only generated if user can change the grading categories
-    if ($cangrade) {
-        $r->print('<form method="post" name="quickform" action="/adm/quickgrades">');
-    }
-#
     &output_category_table($r,$cangrade,$navmap,%categories);
 #
     if ($cangrade) {
         $r->print('<input type="hidden" name="storemove" value="" />'.
                   '<input type="hidden" name="cmd" value="" />'.
                   '<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>'.
-                  '</form>');
+                  '<script>function storecmd (cmd) { document.quickform.cmd.value=cmd; document.quickform.submit(); }</script>');
     }
 }