📄 ld_face.cpp
字号:
#include <string>
#include <iostream>
#include <windows.h>
#include <conio.h>
#include "LD_SysHead.h"
#include "LD_Face.h"
#include "LD_Control.h"
#include "LD_Ex_Add.h"
#include "LD_EX_Look.h"
#include "LD_EX_Change.h"
#include "LD_Ctr_Register.h"
#include "LD_FileR.h"
using namespace std;
LD_Control Test;
void ShiTi_main(void);
/************************************************************************/
/* 公共界面头界面 作者:王贵平 */
/************************************************************************/
void LD_Face::LD_FC_Local(string _name)
{
cout << "☆□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□☆" << '\t'<<'\n' << endl;
cout << "\t\t\t\t"<<_name<<'\t'<< endl;
cout <<""<<'\t'<<endl;
cout << "☆□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□☆" << '\t'<<'\n' << endl;
}
/************************************************************************/
/* 登陆界面 作者:张恒山 */
/************************************************************************/
void LD_Face::LD_FC_Login(void)
{
char sUserName[10]="";
char szPassWord[7]="";
int j;
int nNum=0;
struct dd
{
int aa;
};
// h
for(j=1; j<4; )
{
cout<<endl;
cout<<"★□■□■□■□■□■□■□■ □■□■□■□■□■□■□□■□■□□■□■□★\n";
cout<<"□ □\n";
cout<<"■ ═ ═ ═ ═ ═ ═ ═ ═ ■\n";
cout<<"□ ╭╧╮╭╧╮╭╧╮╭╧╮ ╭╧╮╭╧╮╭╧╮╭╧╮ □\n";
cout<<"■ ║乐║║成║║数│║字║ ║通║║信║║学│║院║ ■\n";
cout<<"□ ╘∞╛╘∞╛╘∞╛╘∞╛ ╘∞╛╘∞╛╘∞╛╘∞╛ □\n";
cout<<"■ ■\n";
cout<<"□ L A N D I N G □\n";
cout<<"■ ■\n";
cout<<"□ □\n";
cout<<"■ WELCOME! ■\n";
cout<<"□ □\n";
cout<<"★□■□■□■□■□■□■□■ □■□■□■□■□■□■□□■□■□□■□■□★\n\n";
if (nNum==1)
{
cout<<"用户名或密码不正确,请重新输入,(请注意:您只有三次输入的机会!)您还有"<<(4-j)<<"次机会"<<endl;
}
cout<<"\t [用户名]: \n";
cout<<" \n";
cout<<"\t[用户密码]: \n";
COORD co;
co.X = 20;
co.Y = 15+nNum;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), co);
char Tmp;
for(int i=0; i<10; i++)
{
Tmp=getch();
if (Tmp==8)
{
i-=1;
if(Tmp==8&&i>=0)
{
cout<<Tmp;
cout<<" ";
cout<<Tmp;
sUserName[i]='\0';
i-=1;
continue;
}
}
else if(Tmp==13)
{
break;
}
else if(Tmp!=8)
{
sUserName[i]=Tmp;
cout<<sUserName[i];
}
}
co.Y = 17+nNum;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), co);
for(i=0; i<7; i++)
{
char mm=getch();
if (mm==8)
{
i-=1;
if(mm==8&&i>=0)
{
cout<<"\b\b";
cout<<" ";
cout<<"\b\b";
i-=1;
}
}
else if(i<6)
{
szPassWord[i]=mm;
cout<<"* ";
}
}
getch();
if (strcmp(sUserName,"admin")==0&&strcmp(szPassWord,"123456")==0)
{
j++;
system("cls");
nNum=0;
LD_FC_Expland();
break;
}
else
{
j++;
if (j==4)
{
exit(0);
}
nNum=1;
system("cls");
}
}
}
/************************************************************************/
/* 欢迎界面 作者:王贵平 */
/************************************************************************/
void LD_Face::LD_FC_Welcome()
{
cout<<" L D C I ★☆ 考试系统之后台管理系统 ☆★ ";
cout<<"\n";
cout<<" ═ ═ ═ ═ ═ ═ ═ ═ \n";
cout<<" ╭╧╮╭╧╮╭╧╮╭╧╮ ╭╧╮╭╧╮╭╧╮╭╧╮ \n";
cout<<" ║乐║║成║║数│║字║ ║通║║信║║学│║院║ \n";
cout<<" ╘∞╛╘∞╛╘∞╛╘∞╛ ╘∞╛╘∞╛╘∞╛╘∞╛ \n\n";
cout<<" ╭╮ ╭☆╭——╮ ╭╮ ╭╮ ╭———╮ \n";
cout<<" ││ │││╭—★ ││ ││ ★ ╭—╮ │\n";
cout<<" │╰—╯││╰╮ ││ ││ ││ ││\n";
cout<<" │╭—╮││╭╯ ││ ││ ││ ╰╯\n";
cout<<" ││ │││╰—╮ │╰——╮ │╰——╮ │╰—╯★ \n";
cout<<" ╰★ ╰╯╰—— ╯ ☆———╯ ★———╯╰———☆ \n\n";
cout<<" 【中文版】"<<endl;
Sleep(1000);
system("cls");
}
/************************************************************************/
/* 说明界面 作者:张恒山 */
/************************************************************************/
void LD_Face::LD_FC_Expland()
{
void KaoSmain();
cout<<"★□■□■□■□■□■□■□■ □■□■□■□■□■□■□□■□■□□■□■□★\n";
cout<<"■ ═ ═ ═ ═ ═ ═ ═ ═ ■\n";
cout<<"□ ╭╧╮╭╧╮╭╧╮╭╧╮ ╭╧╮╭╧╮╭╧╮╭╧╮ □\n";
cout<<"■ ║乐║║成║║数│║字║ ║通║║信║║学│║院║ ■\n";
cout<<"□ ╘∞╛╘∞╛╘∞╛╘∞╛ ╘∞╛╘∞╛╘∞╛╘∞╛ □\n";
cout<<"□ 使 用 说 明 □\n";
cout<<"■ 1. 试题管理系统: ■\n";
cout<<"□ ★ 录入试题 每十道题自动生成一套试卷,每套试卷分值为100分。 □\n";
cout<<"■ ★ 预览 方便您对已保存的试题进行查看。 ■\n";
cout<<"■ ★ 修改 通过修改功能您可以对不满意的试题进行修改。 ■\n";
cout<<"■ ★ 删除 您可以删除单道题或者一套试卷。 ■\n";
cout<<"■ ■\n";
cout<<"■ 2. 考生注册管理系统: ■\n";
cout<<"■ ★ 注册 考生注册的用户名必须唯一,否则系统会自动分配用户名。 ■\n";
cout<<"■ ★ 查询 您可以方便的查看考生基本信息。 ■\n";
cout<<"■ ★ 修改 修改考生密码等信息。 ■\n";
cout<<"■ ★ 删除 对于已考过的考生信息可以进行删除。 ■\n";
cout<<"■ ■\n";
cout<<"□ 【1.试题管理】 【2.考生注册管理】 □\n";
cout<<"□ □\n";
cout<<"★□■□■□■□■□■□■□■ □■□■□■□■□■□■□□■□■□□■□■□★\n";
cout<<"请选择: '1' 进入试题管理系统、'2' 进入考生注册管理系统, 按'Esc'退出! :\n "<<endl<<endl;
char chA = '0';
while(chA!='1'&&chA!='2'&&chA!=27)
{
chA = getch();
}
// LD_Control con;
// LD_File *fil = NULL;;
// LD_File *noceSpace = con.LD_CTR_ReadExam(1,fil);
switch(chA)
{
case '1':
ShiTi_main();
break;
case '2':
KaoSmain();
break;
default:
break;
}
}
/************************************************************************/
/* 试题管理界面 */
/************************************************************************/
char LD_Face::LD_FC_ExamManage(void)
{
char chIn = 0;
system("cls");
cout << "☆□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□☆" << '\t'<<'\n' << endl;
cout << "\t\t\t\t" << "试题管理" << '\t'<< endl;
cout << "" << '\t' << endl;
cout << "☆□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□☆" << '\t'<<'\n' << endl;
cout << "\t\t\t\t" << endl;
cout << "\t\t\t\t" << endl;
cout << "\t\t\t\t" << endl;
cout << "\t\t\t\t1 -> 录入试题" << "\t\t\n" << endl;
cout << "\t\t\t\t2 -> 浏览修改试卷" << "\t\t\n" << endl;
cout << "\t\t\t\tESC -> 返回" << "\t\t\n" << endl;
cout << "\t\t\t\t" << endl;
cout << "\t\t\t\t" << endl;
cout << "\t\t请输入对应选项:";
chIn = getch();
while(chIn!='1'&&chIn!='2'&&chIn!=27)
{
chIn = getch();
}
return chIn;
}
/*************************************************************************/
/* 试题录入界面 */
/*************************************************************************/
char LD_Face::LD_FC_ExamAdd(LD_File* _Last)
{
LD_File* _LastTmp = _Last;
char chIn = '1';
int _FL_FenShu = 0;
static int nOne = 0;
static int _FL_TaoTi = _LastTmp->getTaoTi();
static int _FL_TiHao = _LastTmp->getTiHao()+(_FL_TaoTi-1)*10;
static int nScore = 0;
string _FL_TiGan;
string _FL_XuanXiang[7];
string _FL_DaAn;
while(nOne == 0)
{
nOne = 1;
if(_LastTmp->getTiHao()==10)
{
nScore = 0;
}
else
{
nScore = 0;
system("cls");
cout<<"☆□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□☆\n"<<endl;
cout<<"\t\t\t\t"<<"输入试题"<<'\t'<< endl;
cout<<""<<'\t'<<endl;
cout<<"☆□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□☆"<<'\t'<<'\n'<<endl;
cout<<"\t\t\t"<<"◆第 " << _LastTmp->getTaoTi() << " 套试卷已经录入了 "<< _LastTmp->getTiHao() << " 题是否继续录入?\n"<< endl;
cout<<"\t\t\t"<<"1 继续\n"<<endl;
cout<<"\t\t\t"<<"ESC 返回重新录入(注意:会清除以前输入的 "<<_LastTmp->getTiHao()<<" 题)\n"<<endl;
chIn = getch();
while(chIn !='1'&&chIn!=27)
{
chIn = getch();
}
if(chIn ==27)
{
return 'r';
}
else if(chIn == '1')
{
while( _LastTmp->getTaoTi()==_FL_TaoTi)
{
nScore += _LastTmp->getFenShu();
_LastTmp = _LastTmp->getPreviousP();
}
break;
}
}
}
while (_Last->getTiHao() %10 == 0)
{
system("cls");
cout<<"☆□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□☆"<<'\t'<<'\n'<<endl;
cout<<"\t\t\t\t"<<"输入试题"<<'\t'<< endl;
cout<<""<<'\t'<<endl;
cout<<"☆□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□☆"<<'\t'<<'\n'<<endl;
cout<<"\t\t\t1 添加试题\tESC 返回\n"<<endl;
chIn = getch();
while(chIn!='1'&&chIn!=27)
{
chIn = getch();
}
if(chIn == 27)
{
return chIn;
}
else if(chIn =='1')
{
++_FL_TaoTi;
break;
}
}
if (chIn == '1')
{
++_FL_TiHao;
system("cls");
cout << "☆□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□☆" << '\t' << '\n' << endl;
cout << "\t\t\t\t" << "输入试题" << '\t' << endl;
cout << "" << '\t' << endl;
cout << "☆□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□■□☆" << '\t' << '\n' << endl;
cout << "\t\t\t\t\t\t" << "本试卷录入试题的总分:"<< nScore << "分" << '\t'<< endl;
cout << "\t\t\t\t" << "试题 "<< _FL_TiHao << "\n" << endl;
cout << "\n◆输入题干 :";
cin >> _FL_TiGan;
setFL_TiGan(_FL_TiGan);
while (1)
{
cout << "\n◆输入选项 a:";
cin >> _FL_XuanXiang[0];
cout << "\n◆输入选项 b:";
cin >> _FL_XuanXiang[1];
cout << "\n◆输入选项 c:";
cin >> _FL_XuanXiang[2];
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -