choiceQuesiton.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef CHOICEQUESITON_H
  2. #define CHOICEQUESITON_H
  3. #include <QWidget>
  4. #include "paperDef.h"
  5. #include "json/json.h"
  6. #include "CBaseWidget.h"
  7. #include "CHttpBll.h"
  8. namespace Ui {
  9. class choiceQuesiton;
  10. }
  11. class choiceQuesiton : public CQuestionBaseWidget
  12. {
  13. Q_OBJECT
  14. public:
  15. explicit choiceQuesiton(CSubQuestionStruct &sqs, QWidget *parent = nullptr);
  16. ~choiceQuesiton();
  17. int setUI(const int nWidth);
  18. void handinPaper();
  19. int widgetType();
  20. void audioPlayCountChange();
  21. signals:
  22. void markedItem(bool bMarked, int nIndex);
  23. void questionAnswered(bool bAnswered, int nIndex);
  24. void uploadAnswer(int nIndex, __int64 timeStamp, QString sAnswer);
  25. private slots:
  26. void onAnswerChanged(int nOrderIndex);
  27. void onAnswered();
  28. void onCancelAnswered();
  29. void onMutiAnswerChanged();
  30. void on_btn_mark_clicked();
  31. private:
  32. void initBody(Json::Value jBody, int nOrderIndex);
  33. void initJudgeOptions();
  34. void initOptions(std::vector<int> voptionPermutation, std::vector<COption> vOptions, QString sQuestionType);
  35. void answerChange();
  36. void updateAnswer(QString sAnsStr, QString sAudioPalyedInfo);
  37. void setAnswer(QString sAnswer);
  38. void setMarkStyle();
  39. Ui::choiceQuesiton *ui;
  40. CSubQuestionStruct &m_sqs;
  41. int m_nListHeight;
  42. bool b_isPressed;
  43. QString m_sAnswerStr;
  44. };
  45. #endif // CHOICEQUESITON_H