?? test.h
字號:
#ifndef _TEST_H
#define _TEST_H
#include <string>
#include <vector>
using namespace std;
#include "FileOpt.h"
const int TEST_NUM = 10; // 每套試卷最多10道題
const int TITLE_NUM = 50;
// 試題類
class CTest
{
protected:
string m_strTitle;// 題干
vector<string> m_arrOpt;// 選項
vector<char> m_arrAns; // 答案
int m_nScore; // 分數
public:
CTest();
~CTest();
string GetTitle();
int SetTitle(string strTitle);
int GetScore();
int SetScore(int nScore);
int GetOpt(vector<string>& vtOpt);
int SetOpt(vector<string>& vtOpt);
int GetAns(vector<char>& vtAns);
int SetAns(vector<char>& vtAns);
void Serialize(CFileOpt& ar);
void WriteUserFile(CFileOpt& ar); // 寫入用戶定義的文件
};
typedef vector<CTest*> CTestVT;
// 試卷類
class CPaper
{
protected:
CTestVT m_vtTest; // 最多10道題
CTestVT::iterator m_nCurTest; // 當前所在試題
public:
CPaper();
~CPaper();
int GetTestNum(); // 獲取該試卷題目數量
int GetTotalScore();// 獲取試卷題目總分數
int IsValid();
int AddTest();
int DelTest();
int MovePrev();
int MoveNext();
int MoveFirst();
int MoveLast();
int Edit(string strTitle, string strAns, string strScore, string strOptA,
string strOptB, string strOptC, string strOptD, string strOptE, string strOptF, string strOptG);
int GetContext(string &strTitle, string &strAns, string &strScore, string &strOptA,
string &strOptB, string &strOptC, string &strOptD, string &strOptE, string &strOptF, string& strOptG);
int GetTestIndex(int& nIndex);
void Serialize(CFileOpt& ar);
void WriteUserFile(CFileOpt& ar); // 寫入用戶定義的文件
};
typedef vector<CPaper*> CPaperVT;
#endif
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -