<?cs include:"util.cs" ?>


<?cs def:print_list() ?>
  <?cs if:grade_action == "grade_book_std" ?>
  <select name="username"  id="username" size="10" title="<?cs var:lang.grades_view_form.select_help ?>" >
  <?cs else ?>
  <select name="student_id"  id="student_id" size="10" title="<?cs var:lang.grades_view_form.select_help ?>" >
  <?cs /if ?>

  <?cs each:this = std ?>
    <?cs if:grade_action == "grade_book_std" ?>
      <option value="<?cs var:this.username ?>" ><?cs var:this.realname ?></option>
    <?cs else ?>
      <option value="<?cs var:this.id ?>" ><?cs var:this.realname ?></option>
    <?cs /if ?>
  <?cs /each ?>
  </select>
<?cs /def ?>

<?cs def:print_table() ?>
   <tr>
    <td><?cs call:print_list() ?></td><td>&nbsp;&nbsp;</td>
    <td valign="middle" align="center"  class="regheading"><?cs var:lang.grades_view_form.select ?>
    <br /><input type="submit" value="<?cs var:lang.grades_view_form.click ?>" title="<?cs var:lang.grades_view_form.help ?>" onclick="return check()" />
    <br /><?cs var:lang.grades_view_form.view ?>
    </td>
   </tr>
<?cs /def ?>
 
<?cs ###########################
     # HTML starts here
     ###########################
?>
<?cs call:html_heading() ?>
   <head>
      <title><?cs var:course_title ?></title>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
   <link rel="StyleSheet" href="<?cs var:image_path ?>common.css" type="text/css"  />
   <link rel="StyleSheet" href="<?cs var:image_path ?>grades.css" type="text/css"  />
   <script type="text/javascript">
    function check()
    {
      <?cs if:grade_action == "grade_book_std" ?>
         var index = document.getElementById('username').selectedIndex;
      <?cs else ?>
         var index = document.getElementById('student_id').selectedIndex;
      <?cs /if ?> 
         if(index < 0)
         {
            window.alert('<?cs var:lang.grades_view_form.select_one ?>');
            return false;
         }
          
    }
   </script>
  </head>
<?cs call:define_body() ?> 
<?cs call:print_course_heading(back_url, lang.grades_view_form.goback) ?>
<table width="100%">
<tr><td align="center">
<br ?><br />
<fieldset style="width: 50%">
<legend class="fieldset_legend"><?cs var:lang.grades_view_form.title ?></legend>
<div>
<form method="post" action="<?cs var:grade_action ?>">
  <div>
    <input type="hidden" name="crs" value="<?cs var:Query.crs ?>" />
    <input type="hidden" name="id" value="<?cs var:Query.id ?>" />
  </div>
  <table>
     <?cs call:print_table() ?>
  </table>
</form>
</div>
</fieldset>
</td></tr>
</table>
</body>
</html>
<?cs call:runtime() ?>
