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

<?cs def:print_bar_graph() ?>
<div class="bar_graph">
<script language="javascript">
<?cs if:max_intervals < #10 ?>
 var g = new Graph(300, 150);
<?cs else ?>
 var g = new Graph(600, 150);
<?cs /if ?>
 g.scale = 10;
 g.title = "<?cs var:items[1].item_name ?>";
 g.xLabel = "Scores";
 g.yLabel = "Percent";
 g.addRow(<?cs each:pdata = percent ?><?cs var:pdata ?><?cs if:name(pdata) != number_scales -#1 ?>,<?cs /if ?><?cs /each ?>);
 g.setXScaleValues(<?cs each:x_scale = xscale ?>"<?cs var:x_scale ?>"<?cs if:name(x_scale) != number_scales - #1 ?>,<?cs /if ?><?cs /each ?>);
 g.setLegend(<?cs each:x_scale = xscale ?>"<?cs var:x_scale ?>"<?cs if:name(x_scale) != number_scales - #1 ?>,<?cs /if ?><?cs /each ?>);
 g.setCounts(<?cs each:cc = count ?><?cs var:cc ?><?cs if:name(cc) != number_scales - #1 ?>,<?cs /if ?><?cs /each ?>);
 g.build(); 

</script>
 </div>
<?cs /def ?>


<?cs ###########################
     # HTML starts here
     ###########################
?>
<html>
   <head>
      <title><?cs var:course_title ?> <?cs var:lang.grade_configure.scale_heading ?></title>
   <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <meta http-equiv="Cache-Control" content="No-Cache" />
    <meta http-equiv="EXPIRES" content="Mon, 22 Jul 1997 11:12:01 GMT" />
      <meta http-equiv="PRAGMA" content="No-Cache" />

   <link rel="StyleSheet" href="<?cs var:image_path ?>common.css" type="text/css"  />
   <link rel="StyleSheet" href="<?cs var:image_path ?>survey.css" type="text/css"  />
   <base href="<?cs var:server_name ?><?cs var:image_path ?>index.html" />
   <script language="javascript" src="<?cs var:image_path ?>graph.js"></script>
</head>

<?cs call:define_body() ?>
<?cs call:print_bar_graph() ?>
</body>
</html>
<?cs call:runtime() ?>

