home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Supreme Volume 6 #1
/
swsii.zip
/
swsii
/
220
/
MMPI.ZIP
/
MMPI.HPP
< prev
next >
Wrap
Text File
|
1992-03-21
|
3KB
|
130 lines
// Enum for bit-fields in MMPIQuestion
#include <fstream.h>
#include <iostream.h>
enum MMPIScales {
Q, // ? Unanswered question
F, // F Validity
K, // K Correction
Hs, // Hs Hypochondriasis
D, // D Depression
Hy, // Hy Hysteria
Pd, // Pd Psychopathic deviant
Mf_M, // Mf Masculinity-femininity Male
Mf_F, // Mf Masculinity-femininity Female
Pa, // Pa Paranoia
Pt, // Pt Psychasthenia
Sc, // Sc Schizophrenia
Ma, // Ma Hypomania
Si, // Si Social introversion
L, // L Lie
NUM_SCALES // Total count of above scales
};
#define MALE 'M'
#define FEMALE 'F'
// ASCII equivalents for 'MMPIScales' enum is in MMPI.CPP
extern char *aScale[];
struct MMPITotal {
short total[NUM_SCALES];
MMPITotal();
void clear();
MMPITotal scale(int);
MMPITotal getCorrection();
friend MMPITotal& operator+= (MMPITotal&, MMPITotal&);
friend int show();
};
class MMPIQuestion {
public:
char *text;
char scale[NUM_SCALES];
char response; // User answer to this question
MMPIQuestion(char *); // Duplicate string into 'text'
~MMPIQuestion();
void clearScales(); // Set scales to ' '
int setScale(char *); // Attempt to set a scale from an ASCII scale set
char getScale(int); // Return a T/F/' '
MMPITotal eval(); // Evaluate a test response
};
typedef struct MMPINode {
MMPIQuestion *dat;
struct MMPINode *prev;
struct MMPINode *next;
MMPINode(MMPIQuestion *);
MMPIQuestion *unlink();
} MMPINode;
#define NO_NODE (MMPINode *)0;
class MMPITest {
private:
MMPINode *curr;
MMPINode *head; // First randomized node
MMPINode *tail; // Last randomized node
MMPINode *find(MMPIQuestion *); // Find a node
MMPINode *goPosn(int); // Go to sequential node
public:
int size; // Total number of objects
MMPITest(char *file = "TEST.DAT");
~MMPITest();
MMPINode *add(MMPIQuestion *obj);
void del(MMPIQuestion *obj);
MMPIQuestion *first();
MMPIQuestion *last();
MMPIQuestion *at(int pos);
MMPIQuestion *next();
MMPIQuestion *prev();
MMPIQuestion *current();
void flush();
char name[17];
char gender;
unsigned int total;
MMPITotal results;
MMPITotal Correction;
MMPITotal Adjusted;
MMPITotal Scale;
int isEmpty();
MMPIQuestion* isNotComplete();
int eval();
int load(char *file);
void clearAnswers();
int saveAnswers(char *);
int loadAnswers(char *);
int ResultForm(char *fName="REPORT.RPT");
};