#ifndef ANSWERWIDGET_H #define ANSWERWIDGET_H #include #include #include "CHttpBll.h" #include "question.h" #include "questionSet.h" #include "awHandinPaper.h" #include "awResumeExam.h" #include "faceLiveness.h" #include "awTimeLeftTips.h" #include #include "CLiveViodeProc.h" #include "CMultiMonitorEnumerator.h" namespace Ui { class answerWidget; } class answerWidget : public QWidget , ITRTCVideoRenderCallback { Q_OBJECT signals: void showExamScore(); void showPracticeInfo(); void gobackCourseList(); void gobackLogin(); public: explicit answerWidget(QWidget *parent = nullptr); ~answerWidget(); void setUI(const int nLeft, const int nTop, const int nWidth, const int nHeight); private slots: void onGetExamProperty(CGetExamProperty getExamProperty); void onWeiXinAnswerEnabled(CWeiXinAnswerEnabled weiXinAnswerEnabled); void onGetExamById(CGetExamById getExamById); void onFindExamQuestionList(CFindExamQuestionList findExamQuestionList); void onGetExamRecordPaperStruct(CGetExamRecordPaperStruct getExamRecordPaperStruct); void onGetQuestionContent(CGetQuestionContent getQuestionContent); void onStartAnswer(CStartAnswer startAnswer); void onExamHeartbeat(CExamHeartbeat examHeartbeat); void onSubmitQuestionAnswer(CSubmitQuestionAnswer submitQuestionAnswer); void onEndExam(CEndExam endExam); void onGetOrgPropertiesByGroupWithoutCache(CGetOrgPropertiesByGroupWithoutCache orgProperties); void onStartFaceLiveVerify(CStartFaceLiveVerify startFaceLiveVerify); void on_btn_handInPaper_clicked(); void on_btn_all_clicked(); void on_btn_answered_clicked(); void on_btn_unanswered_clicked(); void on_btn_marked_clicked(); void on_btn_allNum_clicked(); void on_btn_answeredNum_clicked(); void on_btn_unansweredNum_clicked(); void on_btn_markedNum_clicked(); private: void getQuestionContent(QString sQuestionId, int nOrder); void showSubQuestion(CQuestionStruct &qs, int nOrder, QString sTitle, QString sProgress); CAnsweredQuestion findQuestionByOrder(CFindExamQuestionList &feql, int nOrder); void heartBreat(); void uploadAnswer(int nIndex, QString sAnswer); void showQuestionByOrder(int nOrder); void handinPaper(); void refreshStatus(); bool checkAnswer(); void startCapture(); void stopCapture(); void onRenderVideoFrame(const char* userId, TRTCVideoStreamType streamType, TRTCVideoFrame* frame); void checkRemoteBreach(); Ui::answerWidget *ui; int m_nSnapshotInterval; QString m_sPracticeType; int m_nFreezeTime; std::vector m_vPaperGroupStruct; std::shared_ptr m_pQuestion; std::shared_ptr m_pQuestionSet; std::shared_ptr m_pCountDownTimer; std::shared_ptr m_pHeartbeatTimer; std::shared_ptr m_pHandinPaper; std::shared_ptr m_pResumeExam; std::shared_ptr m_pHandinPaperTimer; std::shared_ptr m_pFaceLiveness; std::shared_ptr m_ptimeLeftTips; std::shared_ptr m_pNetWorkErrorTimerPtr; int m_nLeftSeconds = 0; int m_nEnterExamTime = 0; int m_nUsedExamSeconds = 0; int m_nEnterLivenessFaceSeconds = 0; bool bShowLivenessTip;//活体检测前提示 bool bShowLeftHint; int m_nHeartBreatFailedCount; const int m_nHeartBreatFailedExitCount = 10; std::shared_ptr m_pVideoTimer; // std::shared_ptr m_pinitTimer; // cv::VideoCapture m_cam; cv::Mat m_nCurImage; std::mutex m_imageMutex; __int64 m_lastFaceTime = 0; int m_nLastCaptureSecond = 0; int m_nNextFaceCountSecond = 0; QStringList m_sRemoteList; QStringList m_sRemoteTipList; }; #endif // ANSWERWIDGET_H