#include <stdio.h>

#include "ClearSilver.h"
#include "global.h"
#include "custom.h"		/* for date FORMAT strings */
#include "grade.h"		/* for date FORMAT strings */
#include "manhat-lib/shared_util.h"
#include "manhat-lib/shared_cs_util.h"


void
set_info(const char *course, const char *key, CONFIG_STRUCT *conf,SESSION *user) 
{

    cs_set_course_info( conf);    /* shared_cs_util.c */
    cs_set_current_time();    /* shared_cs_util.c */
    if(conf->grades == 1 || conf->grades == 3)
       cs_set_back_url(course, key, "grades_fac_menu");  /* shared_cs_util.c */

}


	
void
read_parameters ( char *course, char *key)
{
    cs_get_required_parameter("crs", course, MAX_PATH);
    cs_get_required_parameter("id", key, MAX_KEY);
}


int
main ()
{
  char course[MAX_PATH +1];
  char key[MAX_KEY +1];
  SESSION user;
  CONFIG_STRUCT conf;

  cs_cgi_init();   /* shared_cs_util.c */
  read_parameters (course, key);
  read_configuration_file (course, &conf);	
  validate_key (key, &user, &conf);	

  if(user.group != FACULTY)
      cs_critical_error(ERR_REQUEST_DENIED, "");   /** shared_cs_util.c */
   
   set_info( course, key, &conf, &user);
   cs_cgi_display ( "grades_delete_form", 1); /* shared_cs_util.c */
   cs_cgi_destroy();                   /* shared_cs_util.c */

  return 0;			/* exit successfully */

}







	







