qaTree/functions/gfunc.cpp
// input: project root, category name, attribute info
// output: void; node added to correct branch of tree
// add (distinction between categories must be incorporated)
// adds a new attribute to the category of choice 
project root, category name, attribute info
output: void; node added to correct branch of tree
add (distinction between categories must be incorporated)
adds a new attribute to the category of choice
project root category name attribute info output : void ; node added to correct branch of tree add ( distinction between categories must be incorporated ) adds a new attribute to the category of choice
string add_attr(qaTree* proj, string cat, string src, string stim, string env,
              string afct, string rsp, string rspm) {
   qaTree* categ = find_cat(proj, cat);
   if (categ  == NULL) {
      categ = newTree(cat);
      adoptcat(proj, categ);
   } 
   string new_ID = create_ID(cat);
   qaNode* attr = newattr(new_ID, src, stim, env, afct, rsp, rspm);
   if (find_attr(proj, cat, attr->ID) != NULL) {
      printf("Error; Attribute already exists");
      return NULL;
   }
   adoptattr(categ, attr);      
   return new_ID;
}
string add_attr ( qaTree * proj , string cat , string src , string stim , string env , string afct , string rsp , string rspm ) { qaTree * categ = find_cat ( proj , cat ) ; if ( categ == NULL ) { categ = newTree ( cat ) ; adoptcat ( proj , categ ) ; } string new_ID = create_ID ( cat ) ; qaNode * attr = newattr ( new_ID , src , stim , env , afct , rsp , rspm ) ; if ( find_attr ( proj , cat , attr -> ID ) != NULL ) { printf ( " " ) ; return NULL ; } adoptattr ( categ , attr ) ; return new_ID ; }
input: project root, category name, attribute info
output: void; node added to correct branch of tree
add (distinction between categories must be incorporated)
adds a new attribute to the category of choice
input : project root category name attribute info output : void ; node added to correct branch of tree add ( distinction between categories must be incorporated ) adds a new attribute to the category of choice
// create category child if none exists //create new node // if attribute to be added is a duplicate, print error and exit // (later can be edited so that it asks if you want to edit previous one) // else adopt