#include <stdio.h>
#include <string.h>

#include "../global.h"
#include "shared_strtrm.h"
#include "shared_grade_book_util.h"
#include "shared_cs_util.h"

int
check_points_value( int number, char **value)
{
  #define MAX_TEMP_LEN 35
  char name[MAX_TEMP_LEN +1];
  int len =0;

   snprintf(name, MAX_TEMP_LEN +1, "Query.points_%d", number);
   hdf_get_copy(global_cgi->hdf, name, value, "");
   strtrm(*value);
   len = strlen(*value);
   if(!len || (len && !check_float_number(*value)))
   {
      snprintf(name, MAX_TEMP_LEN +1, "std.%d.red", number);
      cs_set_int_value( name, 1);
         return 0;
  }

    return 1;
    
   #undef MAX_TEMP_LEN    
}

