fillBlank.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #ifndef FILLBLANK_H
  2. #define FILLBLANK_H
  3. #include <QWidget>
  4. #include <QTimer>
  5. #include "paperDef.h"
  6. #include "CBaseWidget.h"
  7. #include "CHttpBll.h"
  8. namespace Ui {
  9. class fillBlank;
  10. }
  11. class fillBlank : public CQuestionBaseWidget
  12. {
  13. Q_OBJECT
  14. public:
  15. explicit fillBlank(CSubQuestionStruct &sqs, QWidget *parent = nullptr);
  16. ~fillBlank();
  17. int setUI(const int nWidth);
  18. void handinPaper();
  19. void audioPlayCountChange();
  20. int widgetType();
  21. signals:
  22. void markedItem(bool bMarked, int nOrder);
  23. void questionAnswered(bool bAnswered, int nOrder);
  24. void uploadAnswer(int nOrder, __int64 timeStamp, QString sAnswer);
  25. private slots:
  26. void on_btn_mark_clicked();
  27. void onAnswerChanged();
  28. void onTimeout();
  29. private:
  30. void initBody(Json::Value jBody, int nOrderIndex);
  31. QString generateAnswer(bool &answered);
  32. void updateAnswer();
  33. bool eventFilter(QObject *obj, QEvent *ev);
  34. void setMarkStyle();
  35. Ui::fillBlank *ui;
  36. CSubQuestionStruct &m_sqs;
  37. int m_nListHeight;
  38. bool b_isPressed;
  39. QTimer *m_pTimer;
  40. bool m_bAnswerChange;
  41. QString m_sAnswer;
  42. __int64 m_nTimeStap;
  43. };
  44. #endif // FILLBLANK_H