answerWidget.h 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. #ifndef ANSWERWIDGET_H
  2. #define ANSWERWIDGET_H
  3. #include <QWidget>
  4. #include <QTimer>
  5. #include "CHttpBll.h"
  6. #include "question.h"
  7. #include "questionSet.h"
  8. #include "awHandinPaper.h"
  9. #include "awResumeExam.h"
  10. #include "faceLiveness.h"
  11. #include <opencv2/opencv.hpp>
  12. namespace Ui {
  13. class answerWidget;
  14. }
  15. class answerWidget : public QWidget
  16. {
  17. Q_OBJECT
  18. signals:
  19. void showExamScore();
  20. void showPracticeInfo();
  21. void gobackCourseList();
  22. public:
  23. explicit answerWidget(QWidget *parent = nullptr);
  24. ~answerWidget();
  25. void setUI(const int nLeft, const int nTop, const int nWidth, const int nHeight);
  26. private slots:
  27. void onGetExamProperty(CGetExamProperty getExamProperty);
  28. void onWeiXinAnswerEnabled(CWeiXinAnswerEnabled weiXinAnswerEnabled);
  29. void onGetExamById(CGetExamById getExamById);
  30. void onFindExamQuestionList(CFindExamQuestionList findExamQuestionList);
  31. void onGetExamRecordPaperStruct(CGetExamRecordPaperStruct getExamRecordPaperStruct);
  32. void onGetQuestionContent(CGetQuestionContent getQuestionContent);
  33. void onStartAnswer(CStartAnswer startAnswer);
  34. void onExamHeartbeat(CExamHeartbeat examHeartbeat);
  35. void onSubmitQuestionAnswer(CSubmitQuestionAnswer submitQuestionAnswer);
  36. void onEndExam(CEndExam endExam);
  37. void onGetOrgPropertiesByGroupWithoutCache(CGetOrgPropertiesByGroupWithoutCache orgProperties);
  38. void onStartFaceLiveVerify(CStartFaceLiveVerify startFaceLiveVerify);
  39. void on_btn_handInPaper_clicked();
  40. void on_btn_all_clicked();
  41. void on_btn_answered_clicked();
  42. void on_btn_unanswered_clicked();
  43. void on_btn_marked_clicked();
  44. void on_btn_allNum_clicked();
  45. void on_btn_answeredNum_clicked();
  46. void on_btn_unansweredNum_clicked();
  47. void on_btn_markedNum_clicked();
  48. private:
  49. void getQuestionContent(QString sQuestionId, int nOrder);
  50. void showSubQuestion(CQuestionStruct &qs, int nOrder, QString sTitle, QString sProgress);
  51. CAnsweredQuestion findQuestionByOrder(CFindExamQuestionList &feql, int nOrder);
  52. void heartBreat();
  53. void uploadAnswer(int nIndex, QString sAnswer);
  54. void showQuestionByOrder(int nOrder);
  55. void handinPaper();
  56. void refreshStatus();
  57. bool checkAnswer();
  58. void startCapture();
  59. void stopCapture();
  60. Ui::answerWidget *ui;
  61. int m_nSnapshotInterval;
  62. QString m_sPracticeType;
  63. int m_nFreezeTime;
  64. std::vector<CPaperGroupStruct> m_vPaperGroupStruct;
  65. std::shared_ptr<question> m_pQuestion;
  66. std::shared_ptr<questionSet> m_pQuestionSet;
  67. std::shared_ptr<QTimer> m_pCountDownTimer;
  68. std::shared_ptr<QTimer> m_pHeartbeatTimer;
  69. std::shared_ptr<awHandinPaper> m_pHandinPaper;
  70. std::shared_ptr<awResumeExam> m_pResumeExam;
  71. std::shared_ptr<QTimer> m_pHandinPaperTimer;
  72. std::shared_ptr<faceLiveness> m_pFaceLiveness;
  73. int m_nLeftSeconds;
  74. bool bShowLivenessTip;
  75. std::shared_ptr<QTimer> m_pVideoTimer;
  76. std::shared_ptr<QTimer> m_pinitTimer;
  77. cv::VideoCapture m_cam;
  78. int m_nLastCaptureSecond;
  79. };
  80. #endif // ANSWERWIDGET_H