|
@@ -17,30 +17,33 @@ answerWidget::answerWidget(QWidget *parent) :
|
|
|
|
|
|
setStyleSheet(g_appInfoPtr->m_sQssStr);
|
|
|
|
|
|
+
|
|
|
m_sRemoteList
|
|
|
- << "qq"
|
|
|
- <<"teamviewer"
|
|
|
- <<"lookmypc"
|
|
|
- <<"xt"
|
|
|
- <<"winaw32"
|
|
|
- <<"pcaquickconnect"
|
|
|
- <<"sessioncontroller"
|
|
|
- <<"sunloginclient"
|
|
|
- <<"sunloginremote"
|
|
|
+ << "teamviewer"
|
|
|
+ << "lookmypc"
|
|
|
+ //<< "xt"
|
|
|
+ << "winaw32"
|
|
|
+ << "pcaquickconnect"
|
|
|
+ << "sessioncontroller"
|
|
|
+ << "sunlogin";
|
|
|
+// << "sunloginremote";
|
|
|
+ /* << "qq"
|
|
|
<<"wechat"
|
|
|
- <<"wemeetapp";
|
|
|
-
|
|
|
- m_sRemoteTipList<<"QQ"
|
|
|
- <<"TeamViewer"
|
|
|
- <<"LookMyPC"
|
|
|
- << QString::fromLocal8Bit("协通")
|
|
|
- <<"Symantec PCAnywhere"
|
|
|
- <<"Symantec PCAnywhere"
|
|
|
- <<"Symantec PCAnywhere"
|
|
|
- << QString::fromLocal8Bit("向日葵")
|
|
|
- << QString::fromLocal8Bit("向日葵")
|
|
|
+ <<"wemeetapp";*/
|
|
|
+
|
|
|
+ m_sRemoteTipList
|
|
|
+ << "TeamViewer"
|
|
|
+ << "LookMyPC"
|
|
|
+ //<< QString::fromLocal8Bit("协通")
|
|
|
+ << "Symantec PCAnywhere"
|
|
|
+ << "Symantec PCAnywhere"
|
|
|
+ << "Symantec PCAnywhere"
|
|
|
+ << QString::fromLocal8Bit("向日葵");
|
|
|
+ // << QString::fromLocal8Bit("向日葵");
|
|
|
+ /*
|
|
|
+ << "QQ"
|
|
|
<< QString::fromLocal8Bit("微信")
|
|
|
- << QString::fromLocal8Bit("腾讯会议");
|
|
|
+ << QString::fromLocal8Bit("腾讯会议");*/
|
|
|
|
|
|
qRegisterMetaType<CGetExamById>("CGetExamById");
|
|
|
connect(g_httpBllPtr.get(), &CHttpBll::sgnGetExamById, this, &answerWidget::onGetExamById);
|
|
@@ -80,45 +83,48 @@ answerWidget::answerWidget(QWidget *parent) :
|
|
|
m_nHeartBreatFailedCount = 0;
|
|
|
bShowLeftHint = false;
|
|
|
|
|
|
- CHttpRequestPackage hrp;
|
|
|
- hrp.sUri = QString("/api/ecs_exam_work/exam/getExamPropertyFromCacheByStudentSession/%1/%2")
|
|
|
- .arg(g_appInfoPtr->m_oExamInfo.nExamId).arg("SNAPSHOT_INTERVAL,PRACTICE_TYPE,FREEZE_TIME,PRACTICE_TYPE");
|
|
|
- hrp.nRequestType = RequestType::rtGetExamProperty;
|
|
|
- hrp.sCommonStr = "SNAPSHOT_INTERVAL,PRACTICE_TYPE,FREEZE_TIME";
|
|
|
- g_httpBllPtr->get(hrp);
|
|
|
|
|
|
- {
|
|
|
- CHttpRequestPackage hrp;
|
|
|
- hrp.sUri = QString("/api/ecs_exam_work/exam/%1").arg(g_appInfoPtr->m_oExamInfo.nExamId);
|
|
|
- hrp.nRequestType = RequestType::rtGetExamById;
|
|
|
+ GetExamProperty();
|
|
|
+// CHttpRequestPackage hrp;
|
|
|
+// hrp.sUri = QString("/api/ecs_exam_work/exam/getExamPropertyFromCacheByStudentSession/%1/%2")
|
|
|
+// .arg(g_appInfoPtr->m_oExamInfo.nExamId).arg("SNAPSHOT_INTERVAL,PRACTICE_TYPE,FREEZE_TIME,PRACTICE_TYPE");
|
|
|
+// hrp.nRequestType = RequestType::rtGetExamProperty;
|
|
|
+// hrp.sCommonStr = "SNAPSHOT_INTERVAL,PRACTICE_TYPE,FREEZE_TIME";
|
|
|
+// g_httpBllPtr->get(hrp);
|
|
|
|
|
|
- g_httpBllPtr->get(hrp);
|
|
|
- }
|
|
|
|
|
|
- CHttpRequestPackage hrp1;
|
|
|
- hrp1.sUri = "/api/ecs_oe_student/client/exam/process/getExamRecordPaperStruct";
|
|
|
- hrp1.sParamList.push_back(QString("examRecordDataId,%1").arg(g_appInfoPtr->m_oExamInfo.nExamRecordDataId));
|
|
|
- hrp1.nRequestType = RequestType::rtGetExamRecordPaperStruct;
|
|
|
- hrp1.eParamType = HttpParamType::hptUrl;
|
|
|
- g_httpBllPtr->post(hrp1);
|
|
|
+// {
|
|
|
+// CHttpRequestPackage hrp;
|
|
|
+// hrp.sUri = QString("/api/ecs_exam_work/exam/%1").arg(g_appInfoPtr->m_oExamInfo.nExamId);
|
|
|
+// hrp.nRequestType = RequestType::rtGetExamById;
|
|
|
|
|
|
- {
|
|
|
- CHttpRequestPackage hrp;
|
|
|
- hrp.sUri = "/api/ecs_oe_student/client/exam/process/findExamQuestionList";
|
|
|
- hrp.nRequestType = RequestType::rtFindExamQuestionList;
|
|
|
+// g_httpBllPtr->get(hrp);
|
|
|
+// }
|
|
|
+
|
|
|
+// CHttpRequestPackage hrp1;
|
|
|
+// hrp1.sUri = "/api/ecs_oe_student/client/exam/process/getExamRecordPaperStruct";
|
|
|
+// hrp1.sParamList.push_back(QString("examRecordDataId,%1").arg(g_appInfoPtr->m_oExamInfo.nExamRecordDataId));
|
|
|
+// hrp1.nRequestType = RequestType::rtGetExamRecordPaperStruct;
|
|
|
+// hrp1.eParamType = HttpParamType::hptUrl;
|
|
|
+// g_httpBllPtr->post(hrp1);
|
|
|
+
|
|
|
+// {
|
|
|
+// CHttpRequestPackage hrp;
|
|
|
+// hrp.sUri = "/api/ecs_oe_student/client/exam/process/findExamQuestionList";
|
|
|
+// hrp.nRequestType = RequestType::rtFindExamQuestionList;
|
|
|
|
|
|
- g_httpBllPtr->post(hrp);
|
|
|
- }
|
|
|
+// g_httpBllPtr->post(hrp);
|
|
|
+// }
|
|
|
|
|
|
|
|
|
- {
|
|
|
- CHttpRequestPackage hrp;
|
|
|
- hrp.sUri = QString("/api/ecs_exam_work/exam/weixinAnswerEnabled/%1")
|
|
|
- .arg(g_appInfoPtr->m_oExamInfo.nExamId);
|
|
|
- hrp.sParamList.push_back(QString::fromLocal8Bit("courseCode,%1").arg(g_appInfoPtr->m_oExamInfo.sCourseCode));
|
|
|
- hrp.nRequestType = RequestType::rtWeiXinAnswerEnabled;
|
|
|
- g_httpBllPtr->get(hrp);
|
|
|
- }
|
|
|
+// {
|
|
|
+// CHttpRequestPackage hrp;
|
|
|
+// hrp.sUri = QString("/api/ecs_exam_work/exam/weixinAnswerEnabled/%1")
|
|
|
+// .arg(g_appInfoPtr->m_oExamInfo.nExamId);
|
|
|
+// hrp.sParamList.push_back(QString::fromLocal8Bit("courseCode,%1").arg(g_appInfoPtr->m_oExamInfo.sCourseCode));
|
|
|
+// hrp.nRequestType = RequestType::rtWeiXinAnswerEnabled;
|
|
|
+// g_httpBllPtr->get(hrp);
|
|
|
+// }
|
|
|
|
|
|
m_pCountDownTimer = std::make_shared<QTimer>();
|
|
|
m_pCountDownTimer->setInterval(1000);
|
|
@@ -177,7 +183,7 @@ answerWidget::answerWidget(QWidget *parent) :
|
|
|
else
|
|
|
{
|
|
|
//交卷
|
|
|
- handinPaper();
|
|
|
+ handinPaper(true);
|
|
|
}
|
|
|
});
|
|
|
|
|
@@ -232,6 +238,54 @@ answerWidget::~answerWidget()
|
|
|
delete ui;
|
|
|
}
|
|
|
|
|
|
+void answerWidget::GetExamProperty()
|
|
|
+{
|
|
|
+ CHttpRequestPackage hrp;
|
|
|
+ hrp.sUri = QString("/api/ecs_exam_work/exam/getExamPropertyFromCacheByStudentSession/%1/%2")
|
|
|
+ .arg(g_appInfoPtr->m_oExamInfo.nExamId).arg("SNAPSHOT_INTERVAL,PRACTICE_TYPE,FREEZE_TIME,PRACTICE_TYPE");
|
|
|
+ hrp.nRequestType = RequestType::rtGetExamProperty;
|
|
|
+ hrp.sCommonStr = "SNAPSHOT_INTERVAL,PRACTICE_TYPE,FREEZE_TIME";
|
|
|
+ g_httpBllPtr->get(hrp);
|
|
|
+}
|
|
|
+
|
|
|
+void answerWidget::GetExamById()
|
|
|
+{
|
|
|
+ CHttpRequestPackage hrp;
|
|
|
+ hrp.sUri = QString("/api/ecs_exam_work/exam/%1").arg(g_appInfoPtr->m_oExamInfo.nExamId);
|
|
|
+ hrp.nRequestType = RequestType::rtGetExamById;
|
|
|
+
|
|
|
+ g_httpBllPtr->get(hrp);
|
|
|
+}
|
|
|
+
|
|
|
+void answerWidget::GetExamRecordPaperStruct()
|
|
|
+{
|
|
|
+ CHttpRequestPackage hrp1;
|
|
|
+ hrp1.sUri = "/api/ecs_oe_student/client/exam/process/getExamRecordPaperStruct";
|
|
|
+ hrp1.sParamList.push_back(QString("examRecordDataId,%1").arg(g_appInfoPtr->m_oExamInfo.nExamRecordDataId));
|
|
|
+ hrp1.nRequestType = RequestType::rtGetExamRecordPaperStruct;
|
|
|
+ hrp1.eParamType = HttpParamType::hptUrl;
|
|
|
+ g_httpBllPtr->post(hrp1);
|
|
|
+}
|
|
|
+
|
|
|
+void answerWidget::FindExamQuestionList()
|
|
|
+{
|
|
|
+ CHttpRequestPackage hrp;
|
|
|
+ hrp.sUri = "/api/ecs_oe_student/client/exam/process/findExamQuestionList";
|
|
|
+ hrp.nRequestType = RequestType::rtFindExamQuestionList;
|
|
|
+
|
|
|
+ g_httpBllPtr->post(hrp);
|
|
|
+}
|
|
|
+
|
|
|
+void answerWidget::WeiXinAnswerEnabled()
|
|
|
+{
|
|
|
+ CHttpRequestPackage hrp;
|
|
|
+ hrp.sUri = QString("/api/ecs_exam_work/exam/weixinAnswerEnabled/%1")
|
|
|
+ .arg(g_appInfoPtr->m_oExamInfo.nExamId);
|
|
|
+ hrp.sParamList.push_back(QString::fromLocal8Bit("courseCode,%1").arg(g_appInfoPtr->m_oExamInfo.sCourseCode));
|
|
|
+ hrp.nRequestType = RequestType::rtWeiXinAnswerEnabled;
|
|
|
+ g_httpBllPtr->get(hrp);
|
|
|
+}
|
|
|
+
|
|
|
void answerWidget::onGetSoftwareConfig(CGetSoftwareConfig getSoftwareConfig)
|
|
|
{
|
|
|
if (getSoftwareConfig.nCode == 200)
|
|
@@ -376,19 +430,32 @@ void answerWidget::onGetExamById(CGetExamById getExamById)
|
|
|
{
|
|
|
if (getExamById.nCode == 200)
|
|
|
{
|
|
|
+ m_nRetryCount = 0;
|
|
|
g_appInfoPtr->m_oExamInfo.nExamId = getExamById.nId;
|
|
|
g_appInfoPtr->m_oExamInfo.sExamType = getExamById.sExamType;
|
|
|
- g_appInfoPtr->m_oExamInfo.nDuration = getExamById.nDuration;
|
|
|
+ g_appInfoPtr->m_oExamInfo.nDuration = getExamById.nDuration;
|
|
|
+
|
|
|
+ GetExamRecordPaperStruct();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if(getExamById.sMessage.isEmpty())
|
|
|
+// if(getExamById.sMessage.isEmpty())
|
|
|
+// {
|
|
|
+// ShowMsg(QString::fromLocal8Bit("获取考试信息出错"), g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+// }
|
|
|
+// else
|
|
|
+// {
|
|
|
+// ShowMsg(getExamById.sMessage, g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+// }
|
|
|
+
|
|
|
+ if(++m_nRetryCount > 3)
|
|
|
{
|
|
|
- ShowMsg(QString::fromLocal8Bit("获取考试信息出错"), g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+ //退出
|
|
|
+ exitExamTip();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- ShowMsg(getExamById.sMessage, g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+ GetExamById();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -397,6 +464,7 @@ void answerWidget::onGetExamRecordPaperStruct(CGetExamRecordPaperStruct getExamR
|
|
|
{
|
|
|
if (getExamRecordPaperStruct.nCode == 200)
|
|
|
{
|
|
|
+ m_nRetryCount = 0;
|
|
|
m_vPaperGroupStruct.swap(getExamRecordPaperStruct.vPaperGroupStruct);
|
|
|
int nSize = m_vPaperGroupStruct.size();
|
|
|
|
|
@@ -432,17 +500,29 @@ void answerWidget::onGetExamRecordPaperStruct(CGetExamRecordPaperStruct getExamR
|
|
|
QSize size = pItem->sizeHint();
|
|
|
size.setHeight(nHeight);
|
|
|
pItem->setSizeHint(size);
|
|
|
- }
|
|
|
+ }
|
|
|
+
|
|
|
+ WeiXinAnswerEnabled();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if(getExamRecordPaperStruct.sMessage.isEmpty())
|
|
|
+// if(getExamRecordPaperStruct.sMessage.isEmpty())
|
|
|
+// {
|
|
|
+// ShowMsg(QString::fromLocal8Bit("获取考试结构出错"), g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+// }
|
|
|
+// else
|
|
|
+// {
|
|
|
+// ShowMsg(getExamRecordPaperStruct.sMessage, g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+// }
|
|
|
+
|
|
|
+ if(++m_nRetryCount > 3)
|
|
|
{
|
|
|
- ShowMsg(QString::fromLocal8Bit("获取考试结构出错"), g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+ //退出
|
|
|
+ exitExamTip();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- ShowMsg(getExamRecordPaperStruct.sMessage, g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+ GetExamRecordPaperStruct();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -462,6 +542,7 @@ void answerWidget::onFindExamQuestionList(CFindExamQuestionList findExamQuestion
|
|
|
{
|
|
|
if (findExamQuestionList.nCode == 200)
|
|
|
{
|
|
|
+ m_nRetryCount = 0;
|
|
|
int nTotal = 0;
|
|
|
int nAnswered = 0;
|
|
|
int nMarked = 0;
|
|
@@ -546,47 +627,78 @@ void answerWidget::onFindExamQuestionList(CFindExamQuestionList findExamQuestion
|
|
|
ui->pgb_answerProgress->setValue(nAnswered);
|
|
|
refreshStatus();
|
|
|
//开始答题
|
|
|
- CHttpRequestPackage hrp1;
|
|
|
- hrp1.sUri = "/api/ecs_oe_student/client/exam/process/startAnswer";
|
|
|
- hrp1.sParamList.push_back(QString("examRecordDataId,%1").arg(g_appInfoPtr->m_oExamInfo.nExamRecordDataId));
|
|
|
- hrp1.nRequestType = RequestType::rtStartAnswer;
|
|
|
- hrp1.eParamType = HttpParamType::hptUrl;
|
|
|
- g_httpBllPtr->post(hrp1);
|
|
|
+
|
|
|
+ startAnwer();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if(findExamQuestionList.sMessage.isEmpty())
|
|
|
+// if(findExamQuestionList.sMessage.isEmpty())
|
|
|
+// {
|
|
|
+// ShowMsg(QString::fromLocal8Bit("获取题目信息出错"), g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+// }
|
|
|
+// else
|
|
|
+// {
|
|
|
+// ShowMsg(findExamQuestionList.sMessage, g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+// }
|
|
|
+
|
|
|
+ if(++m_nRetryCount > 3)
|
|
|
{
|
|
|
- ShowMsg(QString::fromLocal8Bit("获取题目信息出错"), g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+ //退出
|
|
|
+ exitExamTip();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- ShowMsg(findExamQuestionList.sMessage, g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+ FindExamQuestionList();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void answerWidget::startAnwer()
|
|
|
+{
|
|
|
+ CHttpRequestPackage hrp1;
|
|
|
+ hrp1.sUri = "/api/ecs_oe_student/client/exam/process/startAnswer";
|
|
|
+ hrp1.sParamList.push_back(QString("examRecordDataId,%1").arg(g_appInfoPtr->m_oExamInfo.nExamRecordDataId));
|
|
|
+ hrp1.nRequestType = RequestType::rtStartAnswer;
|
|
|
+ hrp1.eParamType = HttpParamType::hptUrl;
|
|
|
+ g_httpBllPtr->post(hrp1);
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
void answerWidget::onGetExamProperty(CGetExamProperty getExamProperty)
|
|
|
{
|
|
|
if (getExamProperty.nCode == 200)
|
|
|
{
|
|
|
+ m_nRetryCount = 0;
|
|
|
if (getExamProperty.sType == "SNAPSHOT_INTERVAL,PRACTICE_TYPE,FREEZE_TIME")
|
|
|
{
|
|
|
m_nSnapshotInterval = getExamProperty.nSnapshotInterval;
|
|
|
g_appInfoPtr->m_oExamInfo.sPracticeType = getExamProperty.sPracticeType;
|
|
|
m_nFreezeTime = getExamProperty.nFreezeTime;
|
|
|
}
|
|
|
+
|
|
|
+ GetExamById();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if(getExamProperty.sMessage.isEmpty())
|
|
|
+// if(getExamProperty.sMessage.isEmpty())
|
|
|
+// {
|
|
|
+// ShowMsg(QString::fromLocal8Bit("获取考试信息出错"), g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+// }
|
|
|
+// else
|
|
|
+// {
|
|
|
+// ShowMsg(getExamProperty.sMessage, g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+// }
|
|
|
+
|
|
|
+ if(++m_nRetryCount > 3)
|
|
|
{
|
|
|
- ShowMsg(QString::fromLocal8Bit("获取考试信息出错"), g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+ //退出
|
|
|
+ exitExamTip();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- ShowMsg(getExamProperty.sMessage, g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+ GetExamProperty();
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -594,17 +706,29 @@ void answerWidget::onWeiXinAnswerEnabled(CWeiXinAnswerEnabled weiXinAnswerEnable
|
|
|
{
|
|
|
if (weiXinAnswerEnabled.nCode == 200)
|
|
|
{
|
|
|
+ m_nRetryCount = 0;
|
|
|
g_appInfoPtr->m_bWeiXinAnswerEnabled = weiXinAnswerEnabled.bEnabled;
|
|
|
+ FindExamQuestionList();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if(weiXinAnswerEnabled.sMessage.isEmpty())
|
|
|
+// if(weiXinAnswerEnabled.sMessage.isEmpty())
|
|
|
+// {
|
|
|
+// ShowMsg(QString::fromLocal8Bit("获取考试信息失败"), g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+// }
|
|
|
+// else
|
|
|
+// {
|
|
|
+// ShowMsg(weiXinAnswerEnabled.sMessage, g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+// }
|
|
|
+
|
|
|
+ if(++m_nRetryCount > 3)
|
|
|
{
|
|
|
- ShowMsg(QString::fromLocal8Bit("获取考试信息失败"), g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+ //退出
|
|
|
+ exitExamTip();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- ShowMsg(weiXinAnswerEnabled.sMessage, g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+ WeiXinAnswerEnabled();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -938,6 +1062,7 @@ void answerWidget::onStartAnswer(CStartAnswer startAnswer)
|
|
|
{
|
|
|
if(startAnswer.nCode == 200)
|
|
|
{
|
|
|
+ m_nRetryCount = 0;
|
|
|
m_nUsedExamSeconds = startAnswer.nUsedExamSeconds;
|
|
|
m_pHeartbeatTimer->start();
|
|
|
heartBreat();
|
|
@@ -945,64 +1070,111 @@ void answerWidget::onStartAnswer(CStartAnswer startAnswer)
|
|
|
//获取活体参数
|
|
|
if (g_appInfoPtr->m_oExamInfo.bLivenessCheck)
|
|
|
{
|
|
|
- CHttpRequestPackage hrp;
|
|
|
- hrp.sUri = QString("/api/ecs_core/org/getOrgPropertiesByGroupWithoutCache/%1/config4Edit1")
|
|
|
- .arg(g_appInfoPtr->m_sRootOrgId);
|
|
|
- hrp.nRequestType = RequestType::rtGetOrgPropertiesByGroupWithoutCache;
|
|
|
- g_httpBllPtr->get(hrp);
|
|
|
+ GetOrgPropertiesByGroupWithoutCache();
|
|
|
+// CHttpRequestPackage hrp;
|
|
|
+// hrp.sUri = QString("/api/ecs_core/org/getOrgPropertiesByGroupWithoutCache/%1/config4Edit1")
|
|
|
+// .arg(g_appInfoPtr->m_sRootOrgId);
|
|
|
+// hrp.nRequestType = RequestType::rtGetOrgPropertiesByGroupWithoutCache;
|
|
|
+// g_httpBllPtr->get(hrp);
|
|
|
|
|
|
{
|
|
|
- CHttpRequestPackage hrp;
|
|
|
- hrp.sUri = QString("/api/ecs_oe_student/client/exam/process/startFaceLiveVerify")
|
|
|
- .arg(g_appInfoPtr->m_sRootOrgId);
|
|
|
- hrp.nRequestType = RequestType::rtStartFaceLiveVerify;
|
|
|
- hrp.sParamList.push_back(QString("examRecordDataId,%1").arg(g_appInfoPtr->m_oExamInfo.nExamRecordDataId));
|
|
|
- hrp.eParamType = HttpParamType::hptUrl;
|
|
|
- g_httpBllPtr->post(hrp);
|
|
|
+// CHttpRequestPackage hrp;
|
|
|
+// hrp.sUri = QString("/api/ecs_oe_student/client/exam/process/startFaceLiveVerify")
|
|
|
+// .arg(g_appInfoPtr->m_sRootOrgId);
|
|
|
+// hrp.nRequestType = RequestType::rtStartFaceLiveVerify;
|
|
|
+// hrp.sParamList.push_back(QString("examRecordDataId,%1").arg(g_appInfoPtr->m_oExamInfo.nExamRecordDataId));
|
|
|
+// hrp.eParamType = HttpParamType::hptUrl;
|
|
|
+// g_httpBllPtr->post(hrp);
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if(startAnswer.sMessage.isEmpty())
|
|
|
+// if(startAnswer.sMessage.isEmpty())
|
|
|
+// {
|
|
|
+// ShowMsg(QString::fromLocal8Bit("开始作答失败"), g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+// }
|
|
|
+// else
|
|
|
+// {
|
|
|
+// ShowMsg(startAnswer.sMessage, g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+// }
|
|
|
+
|
|
|
+ if(++m_nRetryCount > 3)
|
|
|
{
|
|
|
- ShowMsg(QString::fromLocal8Bit("开始作答失败"), g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+ //退出
|
|
|
+ exitExamTip();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- ShowMsg(startAnswer.sMessage, g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+ startAnwer();
|
|
|
}
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void answerWidget::GetOrgPropertiesByGroupWithoutCache()
|
|
|
+{
|
|
|
+ CHttpRequestPackage hrp;
|
|
|
+ hrp.sUri = QString("/api/ecs_core/org/getOrgPropertiesByGroupWithoutCache/%1/config4Edit1")
|
|
|
+ .arg(g_appInfoPtr->m_sRootOrgId);
|
|
|
+ hrp.nRequestType = RequestType::rtGetOrgPropertiesByGroupWithoutCache;
|
|
|
+ g_httpBllPtr->get(hrp);
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
void answerWidget::onGetOrgPropertiesByGroupWithoutCache(CGetOrgPropertiesByGroupWithoutCache orgProperties)
|
|
|
{
|
|
|
if(orgProperties.nCode == 200)
|
|
|
{
|
|
|
+ m_nRetryCount = 0;
|
|
|
g_appInfoPtr->m_oExamInfo.nActionNum = orgProperties.nActionNum;
|
|
|
g_appInfoPtr->m_oExamInfo.sActionOptions = orgProperties.sActionOptions;
|
|
|
g_appInfoPtr->m_oExamInfo.sActionOrder = orgProperties.sActionOrder;
|
|
|
g_appInfoPtr->m_oExamInfo.nActionDuration = orgProperties.nActionDuration;
|
|
|
- g_appInfoPtr->m_oExamInfo.nActionAlert = orgProperties.nActionAlert;
|
|
|
+ g_appInfoPtr->m_oExamInfo.nActionAlert = orgProperties.nActionAlert;
|
|
|
+
|
|
|
+ StartFaceLiveVerify();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if(orgProperties.sMessage.isEmpty())
|
|
|
+// if(orgProperties.sMessage.isEmpty())
|
|
|
+// {
|
|
|
+// ShowMsg(QString::fromLocal8Bit("获取考试信息失败"), g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+// }
|
|
|
+// else
|
|
|
+// {
|
|
|
+// ShowMsg(orgProperties.sMessage, g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+// }
|
|
|
+
|
|
|
+ if(++m_nRetryCount > 3)
|
|
|
{
|
|
|
- ShowMsg(QString::fromLocal8Bit("获取考试信息失败"), g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+ //退出
|
|
|
+ exitExamTip();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- ShowMsg(orgProperties.sMessage, g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+ GetOrgPropertiesByGroupWithoutCache();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void answerWidget::StartFaceLiveVerify()
|
|
|
+{
|
|
|
+ CHttpRequestPackage hrp;
|
|
|
+ hrp.sUri = QString("/api/ecs_oe_student/client/exam/process/startFaceLiveVerify")
|
|
|
+ .arg(g_appInfoPtr->m_sRootOrgId);
|
|
|
+ hrp.nRequestType = RequestType::rtStartFaceLiveVerify;
|
|
|
+ hrp.sParamList.push_back(QString("examRecordDataId,%1").arg(g_appInfoPtr->m_oExamInfo.nExamRecordDataId));
|
|
|
+ hrp.eParamType = HttpParamType::hptUrl;
|
|
|
+ g_httpBllPtr->post(hrp);
|
|
|
+}
|
|
|
+
|
|
|
void answerWidget::onStartFaceLiveVerify(CStartFaceLiveVerify startFaceLiveVerify)
|
|
|
{
|
|
|
if(startFaceLiveVerify.nCode == 200)
|
|
|
{
|
|
|
+ m_nRetryCount = 0;
|
|
|
g_appInfoPtr->m_oExamInfo.nFaceLiveVerifyId = startFaceLiveVerify.nFaceLiveVerifyId;
|
|
|
g_appInfoPtr->m_oExamInfo.nFaceVerifyTimes = startFaceLiveVerify.nTimes;
|
|
|
g_appInfoPtr->m_oExamInfo.nFaceVerifyDoMinute = startFaceLiveVerify.nStartMinute;
|
|
@@ -1010,13 +1182,23 @@ void answerWidget::onStartFaceLiveVerify(CStartFaceLiveVerify startFaceLiveVerif
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- if(startFaceLiveVerify.sMessage.isEmpty())
|
|
|
+// if(startFaceLiveVerify.sMessage.isEmpty())
|
|
|
+// {
|
|
|
+// ShowMsg(QString::fromLocal8Bit("开启活体验证失败"), g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+// }
|
|
|
+// else
|
|
|
+// {
|
|
|
+// ShowMsg(startFaceLiveVerify.sMessage, g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+// }
|
|
|
+
|
|
|
+ if(++m_nRetryCount > 3)
|
|
|
{
|
|
|
- ShowMsg(QString::fromLocal8Bit("开启活体验证失败"), g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+ //退出
|
|
|
+ exitExamTip();
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- ShowMsg(startFaceLiveVerify.sMessage, g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
+ StartFaceLiveVerify();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1076,28 +1258,29 @@ void answerWidget::onExamHeartbeat(CExamHeartbeat examHeartbeat)
|
|
|
|
|
|
if (m_nHeartBreatFailedCount >= m_nHeartBreatFailedExitCount)
|
|
|
{
|
|
|
+ exitExamTip();
|
|
|
//退出
|
|
|
- awTimeLeftTips *wExitExam = new awTimeLeftTips(MASK_POP_WIDGET_TYPE::wt_exitExam, (QWidget*)(this->parent()));
|
|
|
- connect(wExitExam, &awTimeLeftTips::timeLeftConfirm, this, [this, wExitExam]() {
|
|
|
- if (m_pNetWorkErrorTimerPtr)
|
|
|
- {
|
|
|
- m_pNetWorkErrorTimerPtr->stop();
|
|
|
- }
|
|
|
- delete wExitExam;
|
|
|
- emit gobackLogin();
|
|
|
- });
|
|
|
- wExitExam->show();
|
|
|
- if (m_pNetWorkErrorTimerPtr == nullptr)
|
|
|
- {
|
|
|
- m_pNetWorkErrorTimerPtr = std::make_shared<QTimer>();
|
|
|
- m_pNetWorkErrorTimerPtr->setInterval(30 * 1000);
|
|
|
- connect(m_pNetWorkErrorTimerPtr.get(), &QTimer::timeout, [this, wExitExam]() {
|
|
|
- m_pNetWorkErrorTimerPtr->stop();
|
|
|
- delete wExitExam;
|
|
|
- emit gobackLogin();
|
|
|
- });
|
|
|
- }
|
|
|
- m_pNetWorkErrorTimerPtr->start();
|
|
|
+// awTimeLeftTips *wExitExam = new awTimeLeftTips(MASK_POP_WIDGET_TYPE::wt_exitExam, (QWidget*)(this->parent()));
|
|
|
+// connect(wExitExam, &awTimeLeftTips::timeLeftConfirm, this, [this, wExitExam]() {
|
|
|
+// if (m_pNetWorkErrorTimerPtr)
|
|
|
+// {
|
|
|
+// m_pNetWorkErrorTimerPtr->stop();
|
|
|
+// }
|
|
|
+// delete wExitExam;
|
|
|
+// emit gobackLogin();
|
|
|
+// });
|
|
|
+// wExitExam->show();
|
|
|
+// if (m_pNetWorkErrorTimerPtr == nullptr)
|
|
|
+// {
|
|
|
+// m_pNetWorkErrorTimerPtr = std::make_shared<QTimer>();
|
|
|
+// m_pNetWorkErrorTimerPtr->setInterval(30 * 1000);
|
|
|
+// connect(m_pNetWorkErrorTimerPtr.get(), &QTimer::timeout, [this, wExitExam]() {
|
|
|
+// m_pNetWorkErrorTimerPtr->stop();
|
|
|
+// delete wExitExam;
|
|
|
+// emit gobackLogin();
|
|
|
+// });
|
|
|
+// }
|
|
|
+// m_pNetWorkErrorTimerPtr->start();
|
|
|
|
|
|
}
|
|
|
|
|
@@ -1112,6 +1295,32 @@ void answerWidget::onExamHeartbeat(CExamHeartbeat examHeartbeat)
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void answerWidget::exitExamTip()
|
|
|
+{
|
|
|
+ //退出
|
|
|
+ awTimeLeftTips *wExitExam = new awTimeLeftTips(MASK_POP_WIDGET_TYPE::wt_exitExam, (QWidget*)(this->parent()));
|
|
|
+ connect(wExitExam, &awTimeLeftTips::timeLeftConfirm, this, [this, wExitExam]() {
|
|
|
+ if (m_pNetWorkErrorTimerPtr)
|
|
|
+ {
|
|
|
+ m_pNetWorkErrorTimerPtr->stop();
|
|
|
+ }
|
|
|
+ delete wExitExam;
|
|
|
+ emit gobackLogin();
|
|
|
+ });
|
|
|
+ wExitExam->show();
|
|
|
+ if (m_pNetWorkErrorTimerPtr == nullptr)
|
|
|
+ {
|
|
|
+ m_pNetWorkErrorTimerPtr = std::make_shared<QTimer>();
|
|
|
+ m_pNetWorkErrorTimerPtr->setInterval(30 * 1000);
|
|
|
+ connect(m_pNetWorkErrorTimerPtr.get(), &QTimer::timeout, [this, wExitExam]() {
|
|
|
+ m_pNetWorkErrorTimerPtr->stop();
|
|
|
+ delete wExitExam;
|
|
|
+ emit gobackLogin();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ m_pNetWorkErrorTimerPtr->start();
|
|
|
+}
|
|
|
+
|
|
|
void answerWidget::on_btn_handInPaper_clicked()
|
|
|
{
|
|
|
if(m_nFreezeTime*60 > m_nUsedExamSeconds + m_nEnterExamTime - m_nLeftSeconds)
|
|
@@ -1169,7 +1378,7 @@ bool answerWidget::checkAnswer()
|
|
|
return bRet;
|
|
|
}
|
|
|
|
|
|
-void answerWidget::handinPaper()
|
|
|
+void answerWidget::handinPaper(bool bForce)
|
|
|
{
|
|
|
m_pCountDownTimer->stop();
|
|
|
|
|
@@ -1192,11 +1401,12 @@ void answerWidget::handinPaper()
|
|
|
|
|
|
if (checkAnswer())
|
|
|
{
|
|
|
- CHttpRequestPackage hrp;
|
|
|
- hrp.sUri = QString("/api/ecs_oe_student/client/exam/process/endExam");
|
|
|
- hrp.sCommonStr = __FILE__;
|
|
|
- hrp.nRequestType = RequestType::rtEndExam;
|
|
|
- g_httpBllPtr->post(hrp);
|
|
|
+// CHttpRequestPackage hrp;
|
|
|
+// hrp.sUri = QString("/api/ecs_oe_student/client/exam/process/endExam");
|
|
|
+// hrp.sCommonStr = __FILE__;
|
|
|
+// hrp.nRequestType = RequestType::rtEndExam;
|
|
|
+// g_httpBllPtr->post(hrp);
|
|
|
+ doEndExam(bForce);
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -1206,19 +1416,35 @@ void answerWidget::handinPaper()
|
|
|
m_pHandinPaperTimer->setInterval(10 * 1000);
|
|
|
connect(m_pHandinPaperTimer.get(), &QTimer::timeout, this, [&]() {
|
|
|
if (checkAnswer())
|
|
|
- {
|
|
|
+ {
|
|
|
m_pHandinPaperTimer->stop();
|
|
|
- CHttpRequestPackage hrp;
|
|
|
- hrp.sUri = QString("/api/ecs_oe_student/client/exam/process/endExam");
|
|
|
- hrp.sCommonStr = __FILE__;
|
|
|
- hrp.nRequestType = RequestType::rtEndExam;
|
|
|
- g_httpBllPtr->post(hrp);
|
|
|
+ doEndExam(bForce);
|
|
|
+// CHttpRequestPackage hrp;
|
|
|
+// hrp.sUri = QString("/api/ecs_oe_student/client/exam/process/endExam");
|
|
|
+// hrp.sCommonStr = __FILE__;
|
|
|
+// hrp.nRequestType = RequestType::rtEndExam;
|
|
|
+// g_httpBllPtr->post(hrp);
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+void answerWidget::doEndExam(bool bForce)
|
|
|
+{
|
|
|
+ CHttpRequestPackage hrp;
|
|
|
+ hrp.sUri = QString("/api/ecs_oe_student/client/exam/process/endExam");
|
|
|
+ if(bForce)
|
|
|
+ {
|
|
|
+ hrp.sParamList.push_back(QString("force,%1").arg(bForce));
|
|
|
+ hrp.eParamType = HttpParamType::hptUrl;
|
|
|
+ }
|
|
|
+ hrp.sCommonStr = __FILE__;
|
|
|
+ hrp.sAdditionStr = bForce ? "1" : "0";
|
|
|
+ hrp.nRequestType = RequestType::rtEndExam;
|
|
|
+ g_httpBllPtr->post(hrp);
|
|
|
+}
|
|
|
+
|
|
|
void answerWidget::onEndExam(CEndExam endExam)
|
|
|
{
|
|
|
if(endExam.sModuleName == __FILE__)
|
|
@@ -1246,23 +1472,16 @@ void answerWidget::onEndExam(CEndExam endExam)
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
- QTimer::singleShot(5*1000, this, [](){
|
|
|
- CHttpRequestPackage hrp;
|
|
|
- hrp.sUri = QString("/api/ecs_oe_student/client/exam/process/endExam");
|
|
|
- hrp.sCommonStr = __FILE__;
|
|
|
- hrp.nRequestType = RequestType::rtEndExam;
|
|
|
- g_httpBllPtr->post(hrp);
|
|
|
+ QTimer::singleShot(5*1000, this, [&](){
|
|
|
+// CHttpRequestPackage hrp;
|
|
|
+// hrp.sUri = QString("/api/ecs_oe_student/client/exam/process/endExam");
|
|
|
+// hrp.sCommonStr = __FILE__;
|
|
|
+// hrp.nRequestType = RequestType::rtEndExam;
|
|
|
+// g_httpBllPtr->post(hrp);
|
|
|
+
|
|
|
+ doEndExam(endExam.bForce);
|
|
|
});
|
|
|
|
|
|
- /*
|
|
|
- if(endExam.sMessage.isEmpty())
|
|
|
- {
|
|
|
- ShowMsg(QString::fromLocal8Bit("交卷失败"), g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- ShowMsg(endExam.sMessage, g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
|
|
|
- }*/
|
|
|
}
|
|
|
}
|
|
|
}
|