version 1.12, 2000/06/30 21:36:16
|
version 1.15, 2000/08/22 13:19:56
|
Line 2
|
Line 2
|
Copyright (C) 1992-2000 Michigan State University |
Copyright (C) 1992-2000 Michigan State University |
|
|
The CAPA system is free software; you can redistribute it and/or |
The CAPA system is free software; you can redistribute it and/or |
modify it under the terms of the GNU Library General Public License as |
modify it under the terms of the GNU General Public License as |
published by the Free Software Foundation; either version 2 of the |
published by the Free Software Foundation; either version 2 of the |
License, or (at your option) any later version. |
License, or (at your option) any later version. |
|
|
The CAPA system is distributed in the hope that it will be useful, |
The CAPA system is distributed in the hope that it will be useful, |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
Library General Public License for more details. |
General Public License for more details. |
|
|
You should have received a copy of the GNU Library General Public |
You should have received a copy of the GNU General Public |
License along with the CAPA system; see the file COPYING. If not, |
License along with the CAPA system; see the file COPYING. If not, |
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
Boston, MA 02111-1307, USA. */ |
Boston, MA 02111-1307, USA. |
|
|
|
As a special exception, you have permission to link this program |
|
with the TtH/TtM library and distribute executables, as long as you |
|
follow the requirements of the GNU GPL in regard to all of the |
|
software in the executable aside from TtH/TtM. |
|
*/ |
|
|
/* =||>|===================== capaCommon.c =====================|<||= */ |
/* =||>|===================== capaCommon.c =====================|<||= */ |
/* created 1994 by Isaac Tsai */ |
/* created 1994 by Isaac Tsai */ |
/* 1994, 1995, 1996, 1997, 1998, 1999 copyrighted by Isaac Tsai */ |
|
/* TODO: restructure capa_check_ans*() calls into one */ |
/* TODO: restructure capa_check_ans*() calls into one */ |
/* =||>|===================== capaCommon.c =====================|<||= */ |
/* =||>|===================== capaCommon.c =====================|<||= */ |
#include <ctype.h> |
#include <ctype.h> |
Line 3378 Problem_t *p; char **answers; int cnt; c
|
Line 3383 Problem_t *p; char **answers; int cnt; c
|
ii++; |
ii++; |
if(ii==cnt) done = 1; |
if(ii==cnt) done = 1; |
} |
} |
if( result == 0 ) { /* check if any of the outcome has failed to be a numeric */ |
if( result == 0 ) { |
|
/* check if any of the outcome has failed to be a numeric |
|
or was a malformed equation */ |
done = ii = 0; |
done = ii = 0; |
while( !done ) { |
while( !done ) { |
if( outcomes[ii] == WANTED_NUMERIC ) { |
if( outcomes[ii] == WANTED_NUMERIC || outcomes[ii] == BAD_FORMULA ) { |
result = outcomes[ii]; |
result = outcomes[ii]; |
done = 1; |
done = 1; |
} |
} |
Line 3389 Problem_t *p; char **answers; int cnt; c
|
Line 3396 Problem_t *p; char **answers; int cnt; c
|
if(ii==cnt) done = 1; |
if(ii==cnt) done = 1; |
} |
} |
} |
} |
if( result == 0 ) { /* check if any of the outcome has failed on sig figs */ |
if( result == 0 ) {/*check if any of the outcome has failed on sig figs*/ |
done = ii = 0; |
done = ii = 0; |
while( !done ) { |
while( !done ) { |
if( outcomes[ii] == SIG_FAIL ) { |
if( outcomes[ii] == SIG_FAIL ) { |