File:
[LON-CAPA] /
loncom /
homework /
caparesponse /
capa.i
Revision
1.3:
download - view:
text,
annotated -
select for diffs
Fri Mar 12 21:06:19 2004 UTC (21 years, 1 month ago) by
albertel
Branches:
MAIN
CVS tags:
HEAD
- BUG# Lots, lets start with 186,32,220,870
- when checking unit,sigfig etctera, we want to tell the student what we think they enetered, need to get the error string out of the C code and into perl space.
- Still need to do something with the message but at lest we have it now
- <numericalhint> properl namespace it's vars now.
%module capa
%{
%}
%typemap(perl5,in) char** reterror (char** cvalue) {
SV* tempsv;
if (!SvROK($source)) {
croak("expected a reference\n");
}
tempsv = SvRV($source);
if ((!SvPOK(tempsv))) {
croak("expected a double reference\n");
}
int len;
char *temp=SvPV(tempsv,len);
cvalue = &temp;
$target = cvalue;
}
%typemap(perl5,argout) char ** reterror {
SV *tempsv;
tempsv = SvRV($arg);
if (($source!=NULL) && (*$source!=NULL)) {
sv_setpv(tempsv, *$source);
free(*$source);
}
}
extern int caparesponse_capa_check_answer(char *response,char *correct,
int type,int tol_type,double tolerance,
int sig_lbound,int sig_ubound,
char *ans_fmt, char *unit_str,
int calc, char *id_list, char *pts_list,
char *rndseed, char** reterror);
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>