#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 namespace Ui { class answerWidget; } class answerWidget : public QWidget { Q_OBJECT signals: void showExamScore(); void showPracticeInfo(); void gobackCourseList(); 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(); 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; int m_nLeftSeconds; bool bShowLivenessTip; std::shared_ptr m_pVideoTimer; std::shared_ptr m_pinitTimer; cv::VideoCapture m_cam; int m_nLastCaptureSecond; }; #endif // ANSWERWIDGET_H