courseList.cpp 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401
  1. #include "courseList.h"
  2. #include "ui_courseList.h"
  3. #include "awMsgBox.h"
  4. #include <QDesktopWidget>
  5. #include <QMouseEvent>
  6. #include "CAppInfo.h"
  7. #include "CSqlite3DBProc.h"
  8. courseList::courseList(QWidget *parent) :
  9. QWidget(parent),
  10. ui(new Ui::courseList)
  11. {
  12. ui->setupUi(this);
  13. setWindowFlags(Qt::FramelessWindowHint);
  14. setStyleSheet(g_appInfoPtr->m_sQssStr);
  15. qRegisterMetaType<CGetStudentInfoBySession>("CGetStudentInfoBySession");
  16. connect(g_httpBllPtr.get(), &CHttpBll::sgnGetStudentInfoBySession, this, &courseList::onGetStudentInfoBySession);
  17. qRegisterMetaType<CSpecialtyNameList>("CSpecialtyNameList");
  18. connect(g_httpBllPtr.get(), &CHttpBll::sgnSpecialtyNameList, this, &courseList::onSpecialtyNameList);
  19. qRegisterMetaType<CCheckExamInProgress>("CCheckExamInProgress");
  20. connect(g_httpBllPtr.get(), &CHttpBll::sgnCheckExamInProgress, this, &courseList::onCheckExamInProgress);
  21. qRegisterMetaType<CGetStudentClientMenu>("CGetStudentClientMenu");
  22. connect(g_httpBllPtr.get(), &CHttpBll::sgnGetStudentClientMenu, this, &courseList::onGetStudentClientMenu);
  23. qRegisterMetaType<CGetUserNoticeList>("CGetUserNoticeList");
  24. connect(g_httpBllPtr.get(), &CHttpBll::sgnGetUserNoticeList, this, &courseList::onGetUserNoticeList);
  25. qRegisterMetaType<CDownLoadFileInfo>("CDownLoadFileInfo");
  26. connect(g_httpBllPtr.get(), &CHttpBll::sgnDownLoadFile, this, &courseList::onDownLoadFile);
  27. qRegisterMetaType<CAppDownLoadUrl>("CAppDownLoadUrl");
  28. connect(g_httpBllPtr.get(), &CHttpBll::sgnAppDownLoadUrl, this, &courseList::onAppDownLoadUrl);
  29. qRegisterMetaType<CStartExamLimit>("CStartExamLimit");
  30. connect(g_httpBllPtr.get(), &CHttpBll::sgnStartExamLimit, this, &courseList::onStartExamLimit);
  31. qRegisterMetaType<CIpLimit>("CIpLimit");
  32. connect(g_httpBllPtr.get(), &CHttpBll::sgnIpLimit, this, &courseList::onIpLimit);
  33. qRegisterMetaType<CGetExamProperty>("CGetExamProperty");
  34. connect(g_httpBllPtr.get(), &CHttpBll::sgnGetExamProperty, this, &courseList::onGetExamProperty);
  35. qRegisterMetaType<CFaceCheckEnabled>("CFaceCheckEnabled");
  36. connect(g_httpBllPtr.get(), &CHttpBll::sgnFaceCheckEnabled, this, &courseList::onFaceCheckEnabled);
  37. qRegisterMetaType<CLivenessEnabled>("CLivenessEnabled");
  38. connect(g_httpBllPtr.get(), &CHttpBll::sgnLivenessEnabled, this, &courseList::onLivenessEnabled);
  39. qRegisterMetaType<CEndExam>("CEndExam");
  40. connect(g_httpBllPtr.get(), &CHttpBll::sgnEndExam, this, &courseList::onEndExam);
  41. qRegisterMetaType<CGetOrgPropertiesByGroupWithoutCache>("CGetOrgPropertiesByGroupWithoutCache");
  42. connect(g_httpBllPtr.get(), &CHttpBll::sgnGetOrgPropertiesByGroupWithoutCache, this, &courseList::onGetOrgPropertiesByGroupWithoutCache);
  43. sqlite3_stmt *stmt;
  44. QString sSql = QString("select agreement from t_agreement where student_id=%1")
  45. .arg(g_appInfoPtr->m_nStudentId);
  46. if (!g_sysDBProcPtr->QuerySql(sSql.toStdString(), &stmt))
  47. {
  48. ShowMsg(QString::fromLocal8Bit("加载隐私协议信息失败!"), this, MSG_ICON_TYPE::mit_error);
  49. }
  50. bool bAgreement = false;
  51. int nField = 0;
  52. g_sysDBProcPtr->BeginGetFields(stmt);
  53. if (!g_sysDBProcPtr->Eof())
  54. {
  55. if (g_sysDBProcPtr->GetFields(0, nField, stmt) == 1)
  56. {
  57. bAgreement = true;
  58. }
  59. }
  60. g_sysDBProcPtr->EndGetFields(stmt);
  61. if (!bAgreement)
  62. {
  63. if (m_pPrivacyWidget == nullptr)
  64. {
  65. m_pPrivacyWidget = std::make_shared<privacyWidget>(this);
  66. connect(m_pPrivacyWidget.get(), &privacyWidget::agreement, this, [&]() {
  67. m_pPrivacyWidget.reset();
  68. getStudentInfoBySession();
  69. });
  70. connect(m_pPrivacyWidget.get(), &privacyWidget::disAgreement, this, [&]() {
  71. on_btn_exit_clicked();
  72. });
  73. }
  74. m_pPrivacyWidget->show();
  75. }
  76. else
  77. {
  78. getStudentInfoBySession();
  79. }
  80. initUI();
  81. m_pMobileLogin = nullptr;
  82. m_pStudentInfo = nullptr;
  83. m_pMobileLoginBtnTimer = std::make_shared<QTimer>();
  84. m_pMobileLoginBtnTimer->setInterval(500);
  85. connect(m_pMobileLoginBtnTimer.get(), &QTimer::timeout, this, &courseList::hideMobileLoginBtn);
  86. m_pStudentInfoBtnTimer = std::make_shared<QTimer>();
  87. m_pStudentInfoBtnTimer->setInterval(500);
  88. connect(m_pStudentInfoBtnTimer.get(), &QTimer::timeout, this, &courseList::hideStudentInfoBtn);
  89. m_pServerTime = std::make_shared<QTimer>();
  90. m_pServerTime->setInterval(1000);
  91. connect(m_pServerTime.get(), &QTimer::timeout, this, [&]() {
  92. ui->label_serverTime->adjustSize();
  93. ui->label_serverTime->setText(QString::fromLocal8Bit("服务器时间:%1")
  94. .arg(QDateTime::fromMSecsSinceEpoch(g_appInfoPtr->serverMTime()).toString("yyyy-MM-dd hh:mm:ss")));
  95. });
  96. m_pServerTime->start();
  97. m_pRefreshMenuTimer = std::make_shared<QTimer>();
  98. m_pRefreshMenuTimer->setInterval(1000 * 60 * 3);
  99. connect(m_pRefreshMenuTimer.get(), &QTimer::timeout, this, []() {
  100. CHttpRequestPackage hrp;
  101. hrp.sUri = "/api/ecs_core/rolePrivilege/getStudentClientMenu";
  102. hrp.nRequestType = RequestType::rtGetStudentClientMenu;
  103. hrp.sParamList.push_back(QString::fromLocal8Bit("rootOrgId,%1").arg(g_appInfoPtr->m_sRootOrgId));
  104. g_httpBllPtr->get(hrp);
  105. });
  106. m_pOnlineTimer = std::make_shared<QTimer>();
  107. m_pOnlineTimer->setInterval(1000*60*3);
  108. connect(m_pOnlineTimer.get(), &QTimer::timeout, this, []() {
  109. CHttpRequestPackage hrp1;
  110. hrp1.sUri = "/api/ecs_core/student/online_signal/" + QString::number(g_appInfoPtr->m_nStudentId);
  111. hrp1.nRequestType = RequestType::rtOnlineSignal;
  112. g_httpBllPtr->get(hrp1);
  113. });
  114. ui->btn_mobileLogin->installEventFilter(this);
  115. ui->btn_studentInfo->installEventFilter(this);
  116. m_pOnlineTimer->start();
  117. m_pRefreshMenuTimer->start();
  118. if (!g_appInfoPtr->m_sMenuLogoUrl.isEmpty())
  119. {
  120. QString sFileName = g_appInfoPtr->m_sMenuLogoUrl.right(g_appInfoPtr->m_sMenuLogoUrl.length() - g_appInfoPtr->m_sMenuLogoUrl.lastIndexOf("/") - 1);
  121. sFileName = g_appInfoPtr->m_sCacheFileDir + sFileName;
  122. CHttpRequestPackage hrp;
  123. hrp.sUri = g_appInfoPtr->m_sMenuLogoUrl;
  124. hrp.sCommonStr = sFileName;
  125. hrp.sCommonStr1 = __FILE__;
  126. hrp.sAdditionStr = "MenuLogoUrl";
  127. hrp.nRequestType = RequestType::rtDownLoadFile;
  128. hrp.nRetryCount = 3;
  129. g_httpBllPtr->downLoad(hrp);
  130. }
  131. else
  132. {
  133. ui->label_cl_org_icon->setPixmap(QPixmap(":/images/qm-logo.png").scaled(ui->label_cl_org_icon->width(), ui->label_cl_org_icon->height(),
  134. Qt::KeepAspectRatio, Qt::SmoothTransformation));
  135. }
  136. }
  137. courseList::~courseList()
  138. {
  139. awMsgBox::clear(this);
  140. delete ui;
  141. }
  142. void courseList::initUI()
  143. {
  144. QDesktopWidget *dekwiget = QApplication::desktop();
  145. setGeometry(0, 0, dekwiget->width(), dekwiget->height());
  146. ui->widget_cl_BG->setGeometry(0, 0, dekwiget->width(), dekwiget->height());
  147. ui->widget_menu->setGeometry(0, 0, g_appInfoPtr->m_fRate*96, height());
  148. ui->widget_top->setGeometry(ui->widget_menu->width(), 0, width() - ui->widget_menu->width(), g_appInfoPtr->m_fRate*56);
  149. ui->widget_bottom->setGeometry(ui->widget_top->x(), height() - g_appInfoPtr->m_fRate*38, ui->widget_top->width(), g_appInfoPtr->m_fRate*38);
  150. ui->stw_courseList->setGeometry(ui->widget_top->x(), ui->widget_top->y() + ui->widget_top->height(),
  151. ui->widget_top->width(), height() - ui->widget_top->height() - ui->widget_bottom->height());
  152. /*
  153. clOnlineExam *cloe = new clOnlineExam;
  154. cloe->setUI(ui->stw_courseList->width(), ui->stw_courseList->height());
  155. ui->stw_courseList->addWidget(cloe);
  156. clOnlineHomework *clow = new clOnlineHomework;
  157. clow->setUI(ui->stw_courseList->width(), ui->stw_courseList->height());
  158. ui->stw_courseList->addWidget(clow);
  159. clOnlinePractice *clop = new clOnlinePractice;
  160. clop->setUI(ui->stw_courseList->width(), ui->stw_courseList->height());
  161. ui->stw_courseList->addWidget(clop);
  162. clOfflineExam *cloffe = new clOfflineExam;
  163. cloffe->setUI(ui->stw_courseList->width(), ui->stw_courseList->height());
  164. ui->stw_courseList->addWidget(cloffe);
  165. clNoticeList *clnl = new clNoticeList;
  166. clnl->setUI(ui->stw_courseList->width(), ui->stw_courseList->height());
  167. ui->stw_courseList->addWidget(clnl);
  168. clEditPassword *clep = new clEditPassword;
  169. clep->setUI(ui->stw_courseList->width(), ui->stw_courseList->height());
  170. ui->stw_courseList->addWidget(clep);
  171. ui->stw_courseList->setCurrentIndex(0);
  172. */
  173. ui->label_cl_org_icon->setGeometry(g_appInfoPtr->m_fRate*15, g_appInfoPtr->m_fRate*15, g_appInfoPtr->m_fRate*66, g_appInfoPtr->m_fRate*66);
  174. ui->btn_onlineExam->setGeometry(g_appInfoPtr->m_fRate*20, g_appInfoPtr->m_fRate*103, g_appInfoPtr->m_fRate*56, g_appInfoPtr->m_fRate*66);
  175. ui->btn_onlineHomework->setGeometry(ui->btn_onlineExam->x(), ui->btn_onlineExam->y() + ui->btn_onlineExam->height() + g_appInfoPtr->m_fRate*17,
  176. ui->btn_onlineExam->width(), ui->btn_onlineExam->height());
  177. ui->btn_onlinePractice->setGeometry(ui->btn_onlineExam->x(), ui->btn_onlineHomework->y() + ui->btn_onlineHomework->height() + g_appInfoPtr->m_fRate*17,
  178. ui->btn_onlineExam->width(), ui->btn_onlineExam->height());
  179. ui->btn_offlineExam->setGeometry(ui->btn_onlineExam->x(), ui->btn_onlinePractice->y() + ui->btn_onlinePractice->height() + g_appInfoPtr->m_fRate*17,
  180. ui->btn_onlineExam->width(), ui->btn_onlineExam->height());
  181. ui->btn_notice->setGeometry(ui->btn_onlineExam->x(), ui->btn_offlineExam->y() + ui->btn_offlineExam->height() + g_appInfoPtr->m_fRate*17,
  182. ui->btn_onlineExam->width(), ui->btn_onlineExam->height());
  183. ui->btn_noticeNum->setGeometry(ui->btn_notice->x() + ui->btn_notice->width() - g_appInfoPtr->m_fRate*16, ui->btn_notice->y(),
  184. g_appInfoPtr->m_fRate*16, g_appInfoPtr->m_fRate*16);
  185. ui->btn_noticeNum->setVisible(false);
  186. ui->btn_editPassword->setGeometry(ui->btn_onlineExam->x(), ui->btn_notice->y() + ui->btn_notice->height() + g_appInfoPtr->m_fRate*17,
  187. ui->btn_onlineExam->width(), ui->btn_onlineExam->height());
  188. ui->label_currentPlaceIcon->setGeometry(g_appInfoPtr->m_fRate*30, (ui->widget_top->height() - g_appInfoPtr->m_fRate*10)/2,
  189. g_appInfoPtr->m_fRate*10, g_appInfoPtr->m_fRate*10);
  190. ui->label_currrentPlace->adjustSize();
  191. ui->label_currrentPlace->setGeometry(ui->label_currentPlaceIcon->x() + ui->label_currentPlaceIcon->width() + g_appInfoPtr->m_fRate*10,
  192. (ui->widget_top->height() - ui->label_currrentPlace->height())/2, g_appInfoPtr->m_fRate*400, ui->label_currrentPlace->height());
  193. ui->btn_cl_close->setGeometry(ui->widget_top->width() - g_appInfoPtr->m_fRate*10 - g_appInfoPtr->m_fRate*24, g_appInfoPtr->m_fRate*16,
  194. g_appInfoPtr->m_fRate*24, g_appInfoPtr->m_fRate*24);
  195. ui->btn_minisize->setGeometry(ui->btn_cl_close->x() - g_appInfoPtr->m_fRate*6 - ui->btn_cl_close->width(), ui->btn_cl_close->y(),
  196. ui->btn_cl_close->width(), ui->btn_cl_close->height());
  197. ui->label_VLine->setGeometry(ui->btn_minisize->x() - g_appInfoPtr->m_fRate*21, ui->btn_cl_close->y(),
  198. g_appInfoPtr->m_fRate*1 < 1 ? 1 : g_appInfoPtr->m_fRate*1, g_appInfoPtr->m_fRate*24);
  199. ui->btn_exit->setGeometry(ui->label_VLine->x() - g_appInfoPtr->m_fRate*(20+24), ui->btn_cl_close->y(),
  200. ui->btn_cl_close->width(), ui->btn_cl_close->height());
  201. ui->btn_studentInfo->setGeometry(ui->btn_exit->x() - g_appInfoPtr->m_fRate*(10+90), ui->btn_cl_close->y(),
  202. g_appInfoPtr->m_fRate*90, g_appInfoPtr->m_fRate*24);
  203. ui->btn_studentInfo->setIconSize(QSize(g_appInfoPtr->m_fRate*8, g_appInfoPtr->m_fRate*8));
  204. ui->btn_studentInfo->setIcon(QIcon(":/images/icon-student-info.png"));
  205. ui->label_arrow->setGeometry(ui->btn_studentInfo->x() + (ui->btn_studentInfo->width() - g_appInfoPtr->m_fRate*12)/2,
  206. ui->btn_studentInfo->y() + ui->btn_studentInfo->height(),
  207. g_appInfoPtr->m_fRate*12, g_appInfoPtr->m_fRate*3);
  208. ui->label_arrow->setVisible(false);
  209. ui->btn_mobileLogin->setGeometry(ui->btn_studentInfo->x() - g_appInfoPtr->m_fRate*(10+167), ui->btn_cl_close->y(),
  210. g_appInfoPtr->m_fRate*167, g_appInfoPtr->m_fRate*24);
  211. ui->btn_mobileLogin->setIconSize(QSize(g_appInfoPtr->m_fRate*8, g_appInfoPtr->m_fRate*8));
  212. ui->btn_mobileLogin->setIcon(QIcon(":/images/icon-mobile-login.png"));
  213. ui->label_cl_company->adjustSize();
  214. ui->label_cl_company->setGeometry(g_appInfoPtr->m_fRate*30, (ui->widget_bottom->height() - ui->label_cl_company->height())/2,
  215. ui->label_cl_company->width(), ui->label_cl_company->height());
  216. ui->label_cl_version->adjustSize();
  217. ui->label_cl_version->setGeometry(ui->widget_bottom->width() - g_appInfoPtr->m_fRate*30 - ui->label_cl_version->width(),
  218. ui->label_cl_company->y(), ui->label_cl_version->width(), ui->label_cl_version->height());
  219. ui->label_serverTime->setText(QString::fromLocal8Bit("服务器时间:%1")
  220. .arg(QDateTime::fromMSecsSinceEpoch(g_appInfoPtr->serverMTime()).toString("yyyy-MM-dd hh:mm:ss")));
  221. ui->label_serverTime->adjustSize();
  222. ui->label_serverTime->setGeometry(ui->label_cl_version->x() - g_appInfoPtr->m_fRate*20 - ui->label_serverTime->width(), ui->label_cl_company->y(),
  223. ui->label_serverTime->width(), ui->label_serverTime->height());
  224. setCheck(COURSE_MENU_BTN_TYPE::cmbt_online_exam);
  225. }
  226. void courseList::menuBtnRePosistion()
  227. {
  228. int nTop = g_appInfoPtr->m_fRate * 103;
  229. if(ui->btn_onlineExam->isVisible())
  230. {
  231. ui->btn_onlineExam->setGeometry(g_appInfoPtr->m_fRate * 20, nTop, g_appInfoPtr->m_fRate * 56, g_appInfoPtr->m_fRate * 66);
  232. nTop = nTop + ui->btn_onlineExam->height() + g_appInfoPtr->m_fRate * 17;
  233. }
  234. if(ui->btn_onlineHomework->isVisible())
  235. {
  236. ui->btn_onlineHomework->setGeometry(ui->btn_onlineExam->x(), nTop,
  237. ui->btn_onlineExam->width(), ui->btn_onlineExam->height());
  238. nTop = nTop + ui->btn_onlineExam->height() + g_appInfoPtr->m_fRate * 17;
  239. }
  240. if (ui->btn_onlinePractice->isVisible())
  241. {
  242. ui->btn_onlinePractice->setGeometry(ui->btn_onlineExam->x(), nTop,
  243. ui->btn_onlineExam->width(), ui->btn_onlineExam->height());
  244. nTop = nTop + ui->btn_onlineExam->height() + g_appInfoPtr->m_fRate * 17;
  245. }
  246. if (ui->btn_offlineExam->isVisible())
  247. {
  248. ui->btn_offlineExam->setGeometry(ui->btn_onlineExam->x(), nTop,
  249. ui->btn_onlineExam->width(), ui->btn_onlineExam->height());
  250. nTop = nTop + ui->btn_onlineExam->height() + g_appInfoPtr->m_fRate * 17;
  251. }
  252. if (ui->btn_notice->isVisible())
  253. {
  254. ui->btn_notice->setGeometry(ui->btn_onlineExam->x(), nTop,
  255. ui->btn_onlineExam->width(), ui->btn_onlineExam->height());
  256. ui->btn_noticeNum->setGeometry(ui->btn_notice->x() + ui->btn_notice->width() - g_appInfoPtr->m_fRate * 16, ui->btn_notice->y(),
  257. g_appInfoPtr->m_fRate * 16, g_appInfoPtr->m_fRate * 16);
  258. nTop = nTop + ui->btn_onlineExam->height() + g_appInfoPtr->m_fRate * 17;
  259. }
  260. if (ui->btn_editPassword->isVisible())
  261. {
  262. ui->btn_editPassword->setGeometry(ui->btn_onlineExam->x(), ui->btn_notice->y() + ui->btn_notice->height() + g_appInfoPtr->m_fRate * 17,
  263. ui->btn_onlineExam->width(), ui->btn_onlineExam->height());
  264. }
  265. }
  266. void courseList::on_btn_minisize_clicked()
  267. {
  268. emit minisize();
  269. }
  270. void courseList::on_btn_cl_close_clicked()
  271. {
  272. // logout();
  273. // close();
  274. QCoreApplication::quit();
  275. }
  276. void courseList::setCheck(COURSE_MENU_BTN_TYPE cmbt)
  277. {
  278. QString sNormalSheet = QString(R"(outline:none;
  279. font-size:%1px;
  280. font-family:"Microsoft YaHei";
  281. font-weight:400;
  282. color:rgba(255,255,255,0.4);
  283. background:rgba(255,255,255,0);
  284. border-radius:%2;)").arg((int)(g_appInfoPtr->m_fRate*12)).arg(g_appInfoPtr->m_fRate*12);
  285. QString sCheckSheet = QString(R"(QPushButton
  286. {
  287. outline:none;
  288. font-size:%1px;
  289. font-family:"Microsoft YaHei";
  290. font-weight:400;
  291. color:rgba(255,255,255,1);
  292. border-radius:%2px;
  293. background:qlineargradient(spread:pad, x1:0, y1:0, x2:1, y2:0, stop:0 rgba(16, 195, 182, 1), stop:1 rgba(39, 217, 146, 1));
  294. })").arg((int)(g_appInfoPtr->m_fRate*12)).arg(g_appInfoPtr->m_fRate*12);
  295. ui->btn_onlineExam->setStyleSheet(sNormalSheet);
  296. ui->btn_onlineHomework->setStyleSheet(sNormalSheet);
  297. ui->btn_onlinePractice->setStyleSheet(sNormalSheet);
  298. ui->btn_offlineExam->setStyleSheet(sNormalSheet);
  299. ui->btn_notice->setStyleSheet(sNormalSheet);
  300. ui->btn_editPassword->setStyleSheet(sNormalSheet);
  301. if (m_pOnlineExam != nullptr)
  302. {
  303. m_pOnlineExam->hide();
  304. }
  305. if (m_pOnlineHomework != nullptr)
  306. {
  307. m_pOnlineHomework->hide();
  308. }
  309. if (m_pOnlinePractice != nullptr)
  310. {
  311. m_pOnlinePractice->hide();
  312. m_pOnlinePractice->releaseClopResult();
  313. }
  314. if (m_pClopReport != nullptr)
  315. {
  316. m_pClopReport->hide();
  317. }
  318. if (m_pOfflineExam != nullptr)
  319. {
  320. m_pOfflineExam->hide();
  321. }
  322. if (m_pNoticeList != nullptr)
  323. {
  324. m_pNoticeList->hide();
  325. }
  326. if (m_pEditPassword != nullptr)
  327. {
  328. m_pEditPassword->hide();
  329. }
  330. QString sCurrentPlace = "";
  331. if (cmbt == COURSE_MENU_BTN_TYPE::cmbt_online_exam)
  332. {
  333. if (m_pOnlineExam == nullptr)
  334. {
  335. m_pOnlineExam = std::make_shared<clOnlineExam>(ui->stw_courseList);
  336. m_pOnlineExam->setUI(ui->stw_courseList->width(), ui->stw_courseList->height());
  337. connect(m_pOnlineExam.get(), &clOnlineExam::enterExam, this, &courseList::onEnterExam);
  338. }
  339. m_pOnlineExam->show();
  340. ui->btn_onlineExam->setStyleSheet(sCheckSheet);
  341. sCurrentPlace = QString::fromLocal8Bit("当前所在位置:在线考试");
  342. }
  343. else if(cmbt == COURSE_MENU_BTN_TYPE::cmbt_online_homework)
  344. {
  345. if (m_pOnlineHomework == nullptr)
  346. {
  347. m_pOnlineHomework = std::make_shared<clOnlineHomework>(ui->stw_courseList);
  348. m_pOnlineHomework->setUI(ui->stw_courseList->width(), ui->stw_courseList->height());
  349. connect(m_pOnlineHomework.get(), &clOnlineHomework::enterExam, this, &courseList::onEnterExam);
  350. }
  351. m_pOnlineHomework->show();
  352. ui->btn_onlineHomework->setStyleSheet(sCheckSheet);
  353. sCurrentPlace = QString::fromLocal8Bit("当前所在位置:在线作业");
  354. }
  355. else if(cmbt == COURSE_MENU_BTN_TYPE::cmbt_online_practice)
  356. {
  357. if (m_pOnlinePractice == nullptr)
  358. {
  359. m_pOnlinePractice = std::make_shared<clOnlinePractice>(ui->stw_courseList);
  360. m_pOnlinePractice->setUI(ui->stw_courseList->width(), ui->stw_courseList->height());
  361. connect(m_pOnlinePractice.get(), &clOnlinePractice::enterExam, this, &courseList::onEnterExam);
  362. }
  363. m_pOnlinePractice->show();
  364. ui->btn_onlinePractice->setStyleSheet(sCheckSheet);
  365. sCurrentPlace = QString::fromLocal8Bit("当前所在位置:在线练习");
  366. }
  367. else if(cmbt == COURSE_MENU_BTN_TYPE::cmbt_offline_exam)
  368. {
  369. if (m_pOfflineExam == nullptr)
  370. {
  371. m_pOfflineExam = std::make_shared<clOfflineExam>(ui->stw_courseList);
  372. m_pOfflineExam->setUI(ui->stw_courseList->width(), ui->stw_courseList->height());
  373. }
  374. m_pOfflineExam->show();
  375. ui->btn_offlineExam->setStyleSheet(sCheckSheet);
  376. sCurrentPlace = QString::fromLocal8Bit("当前所在位置:离线考试");
  377. }
  378. else if(cmbt == COURSE_MENU_BTN_TYPE::cmbt_notice)
  379. {
  380. if (m_pNoticeList == nullptr)
  381. {
  382. m_pNoticeList = std::make_shared<clNoticeList>(ui->stw_courseList);
  383. m_pNoticeList->setUI(ui->stw_courseList->width(), ui->stw_courseList->height());
  384. }
  385. m_pNoticeList->show();
  386. ui->btn_notice->setStyleSheet(sCheckSheet);
  387. sCurrentPlace = QString::fromLocal8Bit("当前所在位置:公告通知");
  388. }
  389. else if(cmbt == COURSE_MENU_BTN_TYPE::cmbt_edit_password)
  390. {
  391. if (m_pEditPassword == nullptr)
  392. {
  393. m_pEditPassword = std::make_shared<clEditPassword>(ui->stw_courseList);
  394. m_pEditPassword->setUI(ui->stw_courseList->width(), ui->stw_courseList->height());
  395. }
  396. m_pEditPassword->show();
  397. ui->btn_editPassword->setStyleSheet(sCheckSheet);
  398. sCurrentPlace = QString::fromLocal8Bit("当前所在位置:修改密码");
  399. }
  400. ui->label_currrentPlace->setText(sCurrentPlace);
  401. }
  402. void courseList::onEnterExam(CL_OPERATION_TYPE cot, __int64 nExamId, __int64 nExamStudentId, QString sCourseCode, QString sCourseName)
  403. {
  404. if(cot == CL_OPERATION_TYPE::cot_online_exam)
  405. {
  406. g_appInfoPtr->m_oExamInfo.sExamType = EXAM_TYPES::ONLINE;
  407. }
  408. g_appInfoPtr->m_oExamInfo.nExamId = nExamId;
  409. g_appInfoPtr->m_oExamInfo.nExamStudentId = nExamStudentId;
  410. g_appInfoPtr->m_oExamInfo.sCourseCode = sCourseCode;
  411. g_appInfoPtr->m_oExamInfo.sCourseName = sCourseName;
  412. //开考限流
  413. m_nRetryCount = 0;
  414. CHttpRequestPackage hrp;
  415. hrp.sUri = QString("https://tcc.qmth.com.cn/rate_limit/prod/startExam/%1").arg(100);
  416. hrp.nRequestType = RequestType::rtStartExamLimit;
  417. g_httpBllPtr->getUrl(hrp);
  418. }
  419. void courseList::onStartExamLimit(CStartExamLimit startExamLimit)
  420. {
  421. if (startExamLimit.nCode == 200)
  422. {
  423. ++m_nRetryCount;
  424. if (startExamLimit.bPass)
  425. {
  426. CHttpRequestPackage hrp;
  427. hrp.sUri = QString("/api/ecs_exam_work/exam/ipLimit/%1").arg(g_appInfoPtr->m_oExamInfo.nExamId);
  428. hrp.nRequestType = RequestType::rtIpLimit;
  429. g_httpBllPtr->get(hrp);
  430. }
  431. else
  432. {
  433. //重试
  434. if(m_nRetryCount >= 3)
  435. {
  436. ShowMsg(QString::fromLocal8Bit("系统繁忙,请稍后重试"), this, MSG_ICON_TYPE::mit_error);
  437. }
  438. else
  439. {
  440. QTimer::singleShot(3*1000, this, [](){
  441. CHttpRequestPackage hrp;
  442. hrp.sUri = QString("https://tcc.qmth.com.cn/rate_limit/prod/startExam/%1").arg(100);
  443. hrp.nRequestType = RequestType::rtStartExamLimit;
  444. g_httpBllPtr->getUrl(hrp);
  445. });
  446. }
  447. }
  448. }
  449. else
  450. {
  451. ShowMsg(QString::fromLocal8Bit("开考失败"), this, MSG_ICON_TYPE::mit_error);
  452. }
  453. }
  454. void courseList::onIpLimit(CIpLimit ipLimit)
  455. {
  456. if (ipLimit.nCode == 200)
  457. {
  458. if (!ipLimit.bLimited)
  459. {
  460. //断点
  461. CHttpRequestPackage hrp;
  462. hrp.sUri = "/api/ecs_oe_student/client/exam/process/checkExamInProgress";
  463. hrp.nRequestType = RequestType::rtCheckExamInProgress;
  464. hrp.sCommonStr = EXAM_INPROGRESS_ENTER_TYPE::EIET_ENTER_EXAM;
  465. g_httpBllPtr->post(hrp);
  466. }
  467. else
  468. {
  469. ShowMsg(QString::fromLocal8Bit("当前ip限制参加考试"), this, MSG_ICON_TYPE::mit_error);
  470. }
  471. }
  472. else
  473. {
  474. ShowMsg(QString::fromLocal8Bit("开考失败"), this, MSG_ICON_TYPE::mit_error);
  475. }
  476. }
  477. void courseList::onGetExamProperty(CGetExamProperty getExamProperty)
  478. {
  479. if (getExamProperty.nCode == 200)
  480. {
  481. if (getExamProperty.sType == "CHECK_ENVIRONMENT,IS_FACE_CHECK,SNAPSHOT_INTERVAL,WARN_THRESHOLD,FACE_VERIFY_START_MINUTE,FACE_VERIFY_END_MINUTE,IS_STRANGER_ENABLE,IS_FACE_VERIFY_BEFORE")
  482. {
  483. g_appInfoPtr->m_oExamInfo.bIsFaceCheck = getExamProperty.bIsFaceCheck;
  484. g_appInfoPtr->m_oExamInfo.nWarnThreshold = getExamProperty.nWarnThreshold;
  485. g_appInfoPtr->m_oExamInfo.nSnapshotInterval = getExamProperty.nSnapshotInterval;
  486. g_appInfoPtr->m_oExamInfo.nFaceVerifyStartMinute = getExamProperty.nFaceVerifyStartMinute;
  487. g_appInfoPtr->m_oExamInfo.nFaceVerifyEndMinute = getExamProperty.nFaceVerifyEndMinute;
  488. g_appInfoPtr->m_oExamInfo.bIsStrangerEnable = getExamProperty.bIsStrangerEnable;
  489. g_appInfoPtr->m_oExamInfo.bIsLivenessBefore = getExamProperty.bIsLivenessBefore;
  490. if (getExamProperty.bCheckEnvironment && !g_appInfoPtr->m_oExamInfo.bIsExamInProgress)
  491. {
  492. if(m_pWhetherEnvTest == nullptr)
  493. {
  494. m_pWhetherEnvTest = std::make_shared<etWhetherEnvTest>(this);
  495. connect(m_pWhetherEnvTest.get(), &etWhetherEnvTest::envTest, this, [&](){
  496. m_pWhetherEnvTest.reset();
  497. //环境检测
  498. if (m_pEnvironmentalTest == nullptr)
  499. {
  500. m_pEnvironmentalTest = std::make_shared<environmentalTest>(this);
  501. connect(m_pEnvironmentalTest.get(), &environmentalTest::enterExam, this, [&](){
  502. m_pEnvironmentalTest.reset();
  503. //人脸识别
  504. CHttpRequestPackage hrp;
  505. hrp.sUri = QString("/api/ecs_exam_work/exam/faceCheckEnabled/%1")
  506. .arg(g_appInfoPtr->m_oExamInfo.nExamId);
  507. hrp.nRequestType = RequestType::rtFaceCheckEnabled;
  508. g_httpBllPtr->get(hrp);
  509. });
  510. }
  511. m_pEnvironmentalTest->show();
  512. });
  513. connect(m_pWhetherEnvTest.get(), &etWhetherEnvTest::skipEnvTest, this, [&](){
  514. m_pWhetherEnvTest.reset();
  515. //人脸识别
  516. CHttpRequestPackage hrp;
  517. hrp.sUri = QString("/api/ecs_exam_work/exam/faceCheckEnabled/%1")
  518. .arg(g_appInfoPtr->m_oExamInfo.nExamId);
  519. hrp.nRequestType = RequestType::rtFaceCheckEnabled;
  520. g_httpBllPtr->get(hrp);
  521. });
  522. }
  523. m_pWhetherEnvTest->show();
  524. }
  525. else
  526. {
  527. //人脸识别
  528. CHttpRequestPackage hrp;
  529. hrp.sUri = QString("/api/ecs_exam_work/exam/faceCheckEnabled/%1")
  530. .arg(g_appInfoPtr->m_oExamInfo.nExamId);
  531. hrp.nRequestType = RequestType::rtFaceCheckEnabled;
  532. g_httpBllPtr->get(hrp);
  533. }
  534. }
  535. }
  536. else
  537. {
  538. if(getExamProperty.sMessage.isEmpty())
  539. {
  540. ShowMsg(QString::fromLocal8Bit("获取考试信息失败"), this, MSG_ICON_TYPE::mit_error);
  541. }
  542. else
  543. {
  544. ShowMsg(getExamProperty.sMessage, this);
  545. }
  546. }
  547. }
  548. void courseList::onFaceCheckEnabled(CFaceCheckEnabled faceCheckEnabled)
  549. {
  550. if (faceCheckEnabled.nCode == 200)
  551. {
  552. //人脸检测
  553. g_appInfoPtr->m_oExamInfo.bFaceCheck = faceCheckEnabled.bEnabled;
  554. // if (faceCheckEnabled.bEnabled && !g_appInfoPtr->m_oExamInfo.bIsExamInProgress)
  555. // {
  556. // if (g_appInfoPtr->m_sStudentPhotoPath.isEmpty())
  557. // {
  558. // ShowMsg(QString::fromLocal8Bit("本场考试需要进行人脸检测,但是您没有上传底照,请联系老师"), this, MSG_ICON_TYPE::mit_error);
  559. // return;
  560. // }
  561. // if (m_pFaceCompare == nullptr)
  562. // {
  563. // m_pFaceCompare = std::make_shared<faceCompare>(this);
  564. // connect(m_pFaceCompare.get(), &faceCompare::exitFaceCompare, this, [&]() {
  565. // m_pFaceCompare.reset();
  566. // });
  567. // connect(m_pFaceCompare.get(), &faceCompare::faceComparePass, this, [&]() {
  568. // m_pFaceCompare.reset();
  569. // //活体检测
  570. // CHttpRequestPackage hrp;
  571. // hrp.sUri = QString("/api/ecs_exam_work/exam/identificationOfLivingEnabled/%1")
  572. // .arg(g_appInfoPtr->m_oExamInfo.nExamId);
  573. // hrp.nRequestType = RequestType::rtLivenessEnabled;
  574. // g_httpBllPtr->get(hrp);
  575. // });
  576. // }
  577. // m_pFaceCompare->show();
  578. // }
  579. // else
  580. {
  581. //活体检测
  582. CHttpRequestPackage hrp;
  583. hrp.sUri = QString("/api/ecs_exam_work/exam/identificationOfLivingEnabled/%1")
  584. .arg(g_appInfoPtr->m_oExamInfo.nExamId);
  585. hrp.nRequestType = RequestType::rtLivenessEnabled;
  586. g_httpBllPtr->get(hrp);
  587. }
  588. }
  589. else
  590. {
  591. if(faceCheckEnabled.sMessage.isEmpty())
  592. {
  593. ShowMsg(QString::fromLocal8Bit("获取人脸识别信息失败"), this, MSG_ICON_TYPE::mit_error);
  594. }
  595. else
  596. {
  597. ShowMsg(faceCheckEnabled.sMessage, this, MSG_ICON_TYPE::mit_error);
  598. }
  599. }
  600. }
  601. void courseList::doFaceCompare()
  602. {
  603. if (g_appInfoPtr->m_sStudentPhotoPath.isEmpty())
  604. {
  605. ShowMsg(QString::fromLocal8Bit("本场考试需要进行人脸检测,但是您没有上传底照,请联系老师"), this, MSG_ICON_TYPE::mit_error);
  606. return;
  607. }
  608. if (m_pFaceCompare == nullptr)
  609. {
  610. m_pFaceCompare = std::make_shared<faceCompare>(this);
  611. connect(m_pFaceCompare.get(), &faceCompare::exitFaceCompare, this, [&]() {
  612. m_pFaceCompare.reset();
  613. });
  614. connect(m_pFaceCompare.get(), &faceCompare::faceComparePass, this, [&]() {
  615. m_pFaceCompare.reset();
  616. //进入待考
  617. enterWaitExam();
  618. });
  619. }
  620. m_pFaceCompare->show();
  621. }
  622. void courseList::onLivenessEnabled(CLivenessEnabled livenessEnabled)
  623. {
  624. if (livenessEnabled.nCode == 200)
  625. {
  626. g_appInfoPtr->m_oExamInfo.bLivenessCheck = livenessEnabled.bEnabled;
  627. GetOrgPropertiesByGroupWithoutCache();
  628. //进入待考
  629. // enterWaitExam();
  630. }
  631. else
  632. {
  633. if(livenessEnabled.sMessage.isEmpty())
  634. {
  635. ShowMsg(QString::fromLocal8Bit("获取活体信息失败"), this, MSG_ICON_TYPE::mit_error);
  636. }
  637. else
  638. {
  639. ShowMsg(livenessEnabled.sMessage, this, MSG_ICON_TYPE::mit_error);
  640. }
  641. }
  642. }
  643. void courseList::doLiveness()
  644. {
  645. //活体检测
  646. if(m_pFaceLiveness == nullptr)
  647. {
  648. m_pFaceLiveness = std::make_shared<faceLiveness>(FACE_LIVENESS_TYPE::flt_entry_exam, this);
  649. connect(m_pFaceLiveness.get(), &faceLiveness::faceLivenessFaild, this, [&](){
  650. g_appInfoPtr->m_oExamInfo.nFaceLiveVerifyId = 0;
  651. m_pFaceLiveness.reset();
  652. });
  653. connect(m_pFaceLiveness.get(), &faceLiveness::faceLivenessSucceed, this, [&](){
  654. g_appInfoPtr->m_oExamInfo.nFaceLiveVerifyId = 0;
  655. m_pFaceLiveness.reset();
  656. //进入待考
  657. enterWaitExam();
  658. });
  659. m_pFaceLiveness->show();
  660. }
  661. }
  662. void courseList::GetOrgPropertiesByGroupWithoutCache()
  663. {
  664. CHttpRequestPackage hrp;
  665. hrp.sUri = QString("/api/ecs_core/org/getOrgPropertiesByGroupWithoutCache/%1/config4Edit1")
  666. .arg(g_appInfoPtr->m_sRootOrgId);
  667. hrp.nRequestType = RequestType::rtGetOrgPropertiesByGroupWithoutCache;
  668. g_httpBllPtr->get(hrp);
  669. }
  670. void courseList::onGetOrgPropertiesByGroupWithoutCache(CGetOrgPropertiesByGroupWithoutCache orgProperties)
  671. {
  672. if(orgProperties.nCode == 200)
  673. {
  674. m_nRetryCount = 0;
  675. g_appInfoPtr->m_oExamInfo.nActionNum = orgProperties.nActionNum;
  676. g_appInfoPtr->m_oExamInfo.sActionOptions = orgProperties.sActionOptions;
  677. g_appInfoPtr->m_oExamInfo.sActionOrder = orgProperties.sActionOrder;
  678. g_appInfoPtr->m_oExamInfo.nActionDuration = orgProperties.nActionDuration;
  679. g_appInfoPtr->m_oExamInfo.nActionAlert = orgProperties.nActionAlert;
  680. g_appInfoPtr->m_oExamInfo.nAllActionDuration = orgProperties.nAllActionDuration;
  681. if(!g_appInfoPtr->m_oExamInfo.bIsExamInProgress)
  682. {
  683. if(g_appInfoPtr->m_oExamInfo.bIsLivenessBefore && g_appInfoPtr->m_oExamInfo.bIsFaceCheck)
  684. {
  685. doLiveness();
  686. }
  687. else if(g_appInfoPtr->m_oExamInfo.bFaceCheck)
  688. {
  689. doFaceCompare();
  690. }
  691. else
  692. {
  693. enterWaitExam();
  694. }
  695. }
  696. else
  697. {
  698. enterWaitExam();
  699. }
  700. }
  701. else
  702. {
  703. if(orgProperties.sMessage.isEmpty())
  704. {
  705. ShowMsg(QString::fromLocal8Bit("获取活体信息失败"), this, MSG_ICON_TYPE::mit_error);
  706. }
  707. else
  708. {
  709. ShowMsg(orgProperties.sMessage, this, MSG_ICON_TYPE::mit_error);
  710. }
  711. }
  712. }
  713. void courseList::enterWaitExam()
  714. {
  715. //进入待考
  716. if (m_pBackground == nullptr)
  717. {
  718. if (g_appInfoPtr->m_oExamInfo.bIsExamInProgress)
  719. {
  720. m_pBackground = std::make_shared<awBackground>(AW_WIDGET_TYPE::awwt_answerWidget, this);
  721. m_pResumeExam.reset();
  722. }
  723. else
  724. {
  725. m_pBackground = std::make_shared<awBackground>(AW_WIDGET_TYPE::awwt_waitExam, this);
  726. }
  727. connect(m_pBackground.get(), &awBackground::minisize, this, &courseList::minisize);
  728. connect(m_pBackground.get(), &awBackground::closeWidget, this, [&](){
  729. m_pBackground.reset();
  730. m_pRefreshMenuTimer->start();
  731. if(m_pOnlineExam)
  732. {
  733. m_pOnlineExam->refreshExam();
  734. }
  735. if(m_pOnlineHomework)
  736. {
  737. m_pOnlineHomework->refreshExam();
  738. }
  739. });
  740. connect(m_pBackground.get(), &awBackground::gobackLogin, this, [&](){
  741. m_pBackground.reset();
  742. logout();
  743. close();
  744. });
  745. connect(m_pBackground.get(), &awBackground::showPracticeInfo, this, [&](){
  746. m_pBackground.reset();
  747. CPracticeRecord pr;
  748. pr.nId = g_appInfoPtr->m_oExamInfo.nExamRecordDataId;
  749. pr.sCourseCode = g_appInfoPtr->m_oExamInfo.sCourseCode;
  750. pr.sCourseName = g_appInfoPtr->m_oExamInfo.sCourseName;
  751. if(m_pClopReport == nullptr)
  752. {
  753. m_pClopReport = std::make_shared<clopReport>(pr, true, ui->stw_courseList);
  754. connect(m_pClopReport.get(), &clopReport::goback, this, [&](){
  755. m_pClopReport.reset();
  756. if(m_pOnlinePractice)
  757. {
  758. m_pOnlinePractice->refreshExamInfo();
  759. }
  760. });
  761. m_pClopReport->setUI(0, 0, ui->stw_courseList->width(), ui->stw_courseList->height());
  762. }
  763. m_pClopReport->show();
  764. m_pRefreshMenuTimer->start();
  765. });
  766. }
  767. m_pBackground->show();
  768. m_pRefreshMenuTimer->stop();
  769. }
  770. void courseList::on_btn_onlineExam_clicked()
  771. {
  772. ui->stw_courseList->setCurrentIndex(0);
  773. setCheck(COURSE_MENU_BTN_TYPE::cmbt_online_exam);
  774. }
  775. void courseList::on_btn_onlineHomework_clicked()
  776. {
  777. ui->stw_courseList->setCurrentIndex(1);
  778. setCheck(COURSE_MENU_BTN_TYPE::cmbt_online_homework);
  779. }
  780. void courseList::on_btn_onlinePractice_clicked()
  781. {
  782. ui->stw_courseList->setCurrentIndex(2);
  783. setCheck(COURSE_MENU_BTN_TYPE::cmbt_online_practice);
  784. }
  785. void courseList::on_btn_offlineExam_clicked()
  786. {
  787. ui->stw_courseList->setCurrentIndex(3);
  788. setCheck(COURSE_MENU_BTN_TYPE::cmbt_offline_exam);
  789. }
  790. void courseList::on_btn_notice_clicked()
  791. {
  792. ui->stw_courseList->setCurrentIndex(4);
  793. setCheck(COURSE_MENU_BTN_TYPE::cmbt_notice);
  794. }
  795. void courseList::on_btn_editPassword_clicked()
  796. {
  797. ui->stw_courseList->setCurrentIndex(5);
  798. setCheck(COURSE_MENU_BTN_TYPE::cmbt_edit_password);
  799. }
  800. void courseList::on_btn_exit_clicked()
  801. {
  802. logout();
  803. close();
  804. }
  805. void courseList::logout()
  806. {
  807. CHttpRequestPackage hrp;
  808. hrp.sUri = "/api/ecs_core/auth/logout";
  809. hrp.nRequestType = RequestType::rtLogout;
  810. g_httpBllPtr->get(hrp);
  811. }
  812. bool courseList::eventFilter(QObject *obj, QEvent *ev)
  813. {
  814. if(ev->type() == QEvent::Enter)
  815. {
  816. if(obj == ui->btn_mobileLogin)
  817. {
  818. m_pMobileLoginBtnTimer->stop();
  819. if(m_pStudentInfo != nullptr)
  820. {
  821. m_pStudentInfo.reset();
  822. m_pStudentInfo = nullptr;
  823. }
  824. if(m_pMobileLogin == nullptr)
  825. {
  826. m_pMobileLogin = std::make_shared<clMobileLogin>(this);
  827. m_pMobileLogin->setUI(g_appInfoPtr->m_fRate*838, g_appInfoPtr->m_fRate*53, g_appInfoPtr->m_fRate*240, g_appInfoPtr->m_fRate*290);
  828. m_pMobileLogin->show();
  829. m_pMobileLogin->installEventFilter(this);
  830. }
  831. ui->btn_mobileLogin->setIcon(QIcon(":/images/icon-mobile-login-hover.png"));
  832. }
  833. else if(obj == ui->btn_studentInfo)
  834. {
  835. m_pStudentInfoBtnTimer->stop();
  836. if(m_pMobileLogin != nullptr)
  837. {
  838. m_pMobileLogin.reset();
  839. m_pMobileLogin = nullptr;
  840. }
  841. if(m_pStudentInfo == nullptr)
  842. {
  843. m_pStudentInfo = std::make_shared<clStudentInfo>(this);
  844. connect(m_pStudentInfo.get(), &clStudentInfo::sgnStudentLogout, this, [&]() {
  845. on_btn_exit_clicked();
  846. });
  847. connect(m_pStudentInfo.get(), &clStudentInfo::sgnStudentEditPassword, this, [&]() {
  848. if (m_pStudentInfo != nullptr)
  849. {
  850. m_pStudentInfo.reset();
  851. }
  852. on_btn_editPassword_clicked();
  853. });
  854. m_pStudentInfo->setUI(g_appInfoPtr->m_fRate*838, g_appInfoPtr->m_fRate*53, g_appInfoPtr->m_fRate*330, g_appInfoPtr->m_fRate*240);
  855. m_pStudentInfo->show();
  856. m_pStudentInfo->installEventFilter(this);
  857. }
  858. ui->btn_studentInfo->setIcon(QIcon(":/images/icon-student-info-hover.png"));
  859. }
  860. else if(obj == m_pMobileLogin.get())
  861. {
  862. m_pMobileLoginBtnTimer->stop();
  863. }
  864. else if(obj == m_pStudentInfo.get())
  865. {
  866. m_pStudentInfoBtnTimer->stop();
  867. }
  868. }
  869. else if(ev->type() == QEvent::Leave)
  870. {
  871. if(obj == ui->btn_mobileLogin || obj == m_pMobileLogin.get())
  872. {
  873. ui->btn_mobileLogin->setIcon(QIcon(":/images/icon-mobile-login.png"));
  874. m_pMobileLoginBtnTimer->start();
  875. }
  876. if(obj == ui->btn_studentInfo || obj == m_pStudentInfo.get())
  877. {
  878. ui->btn_studentInfo->setIcon(QIcon(":/images/icon-student-info.png"));
  879. m_pStudentInfoBtnTimer->start();
  880. }
  881. }
  882. return QWidget::eventFilter(obj, ev);
  883. }
  884. void courseList::hideStudentInfoBtn()
  885. {
  886. if(m_pStudentInfo != nullptr)
  887. {
  888. m_pStudentInfo.reset();
  889. }
  890. }
  891. void courseList::hideMobileLoginBtn()
  892. {
  893. if(m_pMobileLogin != nullptr)
  894. {
  895. m_pMobileLogin.reset();
  896. }
  897. }
  898. void courseList::getStudentInfoBySession()
  899. {
  900. CHttpRequestPackage hrp;
  901. hrp.sUri = "/api/ecs_core/student/getStudentInfoBySession";
  902. hrp.nRequestType = RequestType::rtGetStudentInfoBySession;
  903. g_httpBllPtr->get(hrp);
  904. }
  905. void courseList::onGetStudentInfoBySession(CGetStudentInfoBySession getStudentInfoBySession)
  906. {
  907. if (getStudentInfoBySession.nCode == 200)
  908. {
  909. g_appInfoPtr->m_nStudentId = getStudentInfoBySession.nId;
  910. g_appInfoPtr->m_sStudentName = getStudentInfoBySession.sName;
  911. g_appInfoPtr->m_nOrgId = getStudentInfoBySession.nOrgId;
  912. g_appInfoPtr->m_sOrgCode = getStudentInfoBySession.sOrgCode;
  913. g_appInfoPtr->m_sOrgName = getStudentInfoBySession.sOrgName;
  914. g_appInfoPtr->m_sStudentCode = getStudentInfoBySession.sStudentCode;
  915. g_appInfoPtr->m_sStudentIdentityNumber = getStudentInfoBySession.sIdentityNumber;
  916. g_appInfoPtr->m_sStudentPhotoPath = getStudentInfoBySession.sPhotoPath;
  917. g_appInfoPtr->m_bStudentEnable = getStudentInfoBySession.bEnable;
  918. ui->btn_studentInfo->setText(g_appInfoPtr->m_sStudentName);
  919. ui->btn_studentInfo->setVisible(g_appInfoPtr->m_bStudentEnable);
  920. ui->btn_mobileLogin->setVisible(g_appInfoPtr->m_bShowStudentClientAppQrcode);
  921. CHttpRequestPackage hrp;
  922. hrp.sUri = "/api/ecs_exam_work/exam_student/specialtyNameList";
  923. hrp.nRequestType = RequestType::rtSpecialtyNameList;
  924. g_httpBllPtr->get(hrp);
  925. if (!g_appInfoPtr->m_sStudentPhotoPath.isEmpty())
  926. {
  927. QString sFileName = g_appInfoPtr->m_sStudentPhotoPath.right(g_appInfoPtr->m_sStudentPhotoPath.length() - g_appInfoPtr->m_sStudentPhotoPath.lastIndexOf("/") - 1);
  928. sFileName = g_appInfoPtr->m_sCacheFileDir + sFileName;
  929. CHttpRequestPackage hrp;
  930. hrp.sUri = g_appInfoPtr->m_sStudentPhotoPath;
  931. hrp.sCommonStr = sFileName;
  932. hrp.sCommonStr1 = __FILE__;
  933. hrp.sAdditionStr = "StudentPhotoPath";
  934. hrp.nRequestType = RequestType::rtDownLoadFile;
  935. hrp.nRetryCount = 3;
  936. g_httpBllPtr->downLoad(hrp);
  937. }
  938. if (g_appInfoPtr->m_bShowStudentClientAppQrcode)
  939. {
  940. CHttpRequestPackage hrp;
  941. hrp.sUri = "/api/ecs_core/systemProperty/APP_DOWNLOAD_URL";
  942. hrp.nRequestType = RequestType::rtAppDownLoadUrl;
  943. g_httpBllPtr->get(hrp);
  944. }
  945. }
  946. else
  947. {
  948. if(getStudentInfoBySession.sMessage.isEmpty())
  949. {
  950. ShowMsg(QString::fromLocal8Bit("获取考生信息失败"), this, MSG_ICON_TYPE::mit_error);
  951. }
  952. else
  953. {
  954. ShowMsg(getStudentInfoBySession.sMessage, this, MSG_ICON_TYPE::mit_error);
  955. }
  956. courseList::getStudentInfoBySession();
  957. }
  958. }
  959. void courseList::onAppDownLoadUrl(CAppDownLoadUrl appDownLoadUrl)
  960. {
  961. if (appDownLoadUrl.nCode == 200)
  962. {
  963. g_appInfoPtr->m_sAppDownLoadUrl = appDownLoadUrl.sUrl;
  964. }
  965. else
  966. {
  967. if(appDownLoadUrl.sMessage.isEmpty())
  968. {
  969. ShowMsg(QString::fromLocal8Bit("获取APP下载地址失败"), this, MSG_ICON_TYPE::mit_error);
  970. }
  971. else
  972. {
  973. ShowMsg(appDownLoadUrl.sMessage, this, MSG_ICON_TYPE::mit_error);
  974. }
  975. }
  976. }
  977. void courseList::onDownLoadFile(CDownLoadFileInfo downLoadFileInfo)
  978. {
  979. if(downLoadFileInfo.sModuleName == __FILE__)
  980. {
  981. if (downLoadFileInfo.nCode == 200)
  982. {
  983. // QString sFileName = g_appInfoPtr->m_sStudentPhotoPath.right(g_appInfoPtr->m_sStudentPhotoPath.length() - g_appInfoPtr->m_sStudentPhotoPath.lastIndexOf("/") - 1);
  984. // sFileName = g_appInfoPtr->m_sCacheFileDir + sFileName;
  985. if (downLoadFileInfo.sAdditionStr == "MenuLogoUrl")
  986. {
  987. QString sFileName = g_appInfoPtr->m_sMenuLogoUrl.right(g_appInfoPtr->m_sMenuLogoUrl.length() - g_appInfoPtr->m_sMenuLogoUrl.lastIndexOf("/") - 1);
  988. sFileName = g_appInfoPtr->m_sCacheFileDir + sFileName;
  989. ui->label_cl_org_icon->setPixmap(QPixmap(sFileName).scaled(ui->label_cl_org_icon->width(), ui->label_cl_org_icon->height(),
  990. Qt::KeepAspectRatio, Qt::SmoothTransformation));
  991. }
  992. }
  993. else
  994. {
  995. if(downLoadFileInfo.sMessage.isEmpty())
  996. {
  997. ShowMsg(QString::fromLocal8Bit("下载失败"), this, MSG_ICON_TYPE::mit_error);
  998. }
  999. else
  1000. {
  1001. ShowMsg(downLoadFileInfo.sMessage, this, MSG_ICON_TYPE::mit_error);
  1002. }
  1003. }
  1004. }
  1005. }
  1006. void courseList::onSpecialtyNameList(CSpecialtyNameList specialtyNameList)
  1007. {
  1008. if (specialtyNameList.nCode == 200)
  1009. {
  1010. g_appInfoPtr->m_sSpecialtyName = specialtyNameList.sSpecialtyName;
  1011. CHttpRequestPackage hrp;
  1012. hrp.sUri = "/api/ecs_oe_student/client/exam/process/checkExamInProgress";
  1013. hrp.nRequestType = RequestType::rtCheckExamInProgress;
  1014. hrp.sCommonStr = EXAM_INPROGRESS_ENTER_TYPE::EIET_COURSE_LIST;
  1015. g_httpBllPtr->post(hrp);
  1016. }
  1017. else
  1018. {
  1019. if(specialtyNameList.sMessage.isEmpty())
  1020. {
  1021. ShowMsg(QString::fromLocal8Bit("获取专业信息失败"), this, MSG_ICON_TYPE::mit_error);
  1022. }
  1023. else
  1024. {
  1025. ShowMsg(specialtyNameList.sMessage, this, MSG_ICON_TYPE::mit_error);
  1026. }
  1027. }
  1028. }
  1029. void courseList::onCheckExamInProgress(CCheckExamInProgress checkExamInProgress)
  1030. {
  1031. if (checkExamInProgress.nCode == 200)
  1032. {
  1033. if (checkExamInProgress.bHasExamInProgress)
  1034. {
  1035. if (checkExamInProgress.bIsExceed)
  1036. {
  1037. //超过断点时长交卷
  1038. g_appInfoPtr->m_oExamInfo.nExamRecordDataId = checkExamInProgress.nExamRecordDataId;
  1039. g_appInfoPtr->m_oExamInfo.nExamId = checkExamInProgress.nExamId;
  1040. CHttpRequestPackage hrp;
  1041. hrp.sUri = QString("/api/ecs_oe_student/client/exam/process/endExam");
  1042. hrp.sCommonStr = __FILE__;
  1043. hrp.nRequestType = RequestType::rtEndExam;
  1044. g_httpBllPtr->post(hrp);
  1045. }
  1046. else
  1047. {
  1048. //进入断点
  1049. g_appInfoPtr->m_oExamInfo.nExamId = checkExamInProgress.nExamId;
  1050. g_appInfoPtr->m_oExamInfo.nExamRecordDataId = checkExamInProgress.nExamRecordDataId;
  1051. g_appInfoPtr->m_oExamInfo.sExamType = checkExamInProgress.sExamType;
  1052. g_appInfoPtr->m_oExamInfo.bIsExamInProgress = true;
  1053. if (m_pResumeExam == nullptr)
  1054. {
  1055. m_pResumeExam = std::make_shared<awResumeExam>(this);
  1056. }
  1057. m_pResumeExam->show();
  1058. //环境监测
  1059. CHttpRequestPackage hrp;
  1060. hrp.sUri = QString("/api/ecs_exam_work/exam/getExamPropertyFromCacheByStudentSession/%1/%2")
  1061. .arg(g_appInfoPtr->m_oExamInfo.nExamId).arg("CHECK_ENVIRONMENT,IS_FACE_CHECK,SNAPSHOT_INTERVAL,WARN_THRESHOLD,FACE_VERIFY_START_MINUTE,FACE_VERIFY_END_MINUTE,IS_STRANGER_ENABLE,IS_FACE_VERIFY_BEFORE");
  1062. hrp.nRequestType = RequestType::rtGetExamProperty;
  1063. hrp.sCommonStr = "CHECK_ENVIRONMENT,IS_FACE_CHECK,SNAPSHOT_INTERVAL,WARN_THRESHOLD,FACE_VERIFY_START_MINUTE,FACE_VERIFY_END_MINUTE,IS_STRANGER_ENABLE,IS_FACE_VERIFY_BEFORE";
  1064. g_httpBllPtr->get(hrp);
  1065. }
  1066. }
  1067. else
  1068. {
  1069. g_appInfoPtr->m_oExamInfo.bIsExamInProgress = false;
  1070. if (checkExamInProgress.sEnterType == EXAM_INPROGRESS_ENTER_TYPE::EIET_COURSE_LIST)
  1071. {
  1072. CHttpRequestPackage hrp;
  1073. hrp.sUri = "/api/ecs_core/rolePrivilege/getStudentClientMenu";
  1074. hrp.nRequestType = RequestType::rtGetStudentClientMenu;
  1075. hrp.sParamList.push_back(QString::fromLocal8Bit("rootOrgId,%1").arg(g_appInfoPtr->m_sRootOrgId));
  1076. g_httpBllPtr->get(hrp);
  1077. if (m_pWelcomeWidget == nullptr)
  1078. {
  1079. m_pWelcomeWidget = std::make_shared<welcomeWidget>(g_appInfoPtr->m_sStudentName, g_appInfoPtr->m_sStudentCode, g_appInfoPtr->m_sSpecialtyName, this);
  1080. connect(m_pWelcomeWidget.get(), &welcomeWidget::exitWelcomeWidget, this, [&]() {
  1081. m_pWelcomeWidget.reset();
  1082. });
  1083. }
  1084. m_pWelcomeWidget->show();
  1085. }
  1086. else
  1087. {
  1088. //环境监测
  1089. CHttpRequestPackage hrp;
  1090. hrp.sUri = QString("/api/ecs_exam_work/exam/getExamPropertyFromCacheByStudentSession/%1/%2")
  1091. .arg(g_appInfoPtr->m_oExamInfo.nExamId).arg("CHECK_ENVIRONMENT,IS_FACE_CHECK,SNAPSHOT_INTERVAL,WARN_THRESHOLD,FACE_VERIFY_START_MINUTE,FACE_VERIFY_END_MINUTE,IS_STRANGER_ENABLE,IS_FACE_VERIFY_BEFORE");
  1092. hrp.nRequestType = RequestType::rtGetExamProperty;
  1093. hrp.sCommonStr = "CHECK_ENVIRONMENT,IS_FACE_CHECK,SNAPSHOT_INTERVAL,WARN_THRESHOLD,FACE_VERIFY_START_MINUTE,FACE_VERIFY_END_MINUTE,IS_STRANGER_ENABLE,IS_FACE_VERIFY_BEFORE";
  1094. g_httpBllPtr->get(hrp);
  1095. }
  1096. }
  1097. }
  1098. else
  1099. {
  1100. if(checkExamInProgress.sMessage.isEmpty())
  1101. {
  1102. ShowMsg(QString::fromLocal8Bit("获取断点信息失败"), this, MSG_ICON_TYPE::mit_error);
  1103. }
  1104. else
  1105. {
  1106. ShowMsg(checkExamInProgress.sMessage, this, MSG_ICON_TYPE::mit_error);
  1107. }
  1108. }
  1109. }
  1110. void courseList::onEndExam(CEndExam endExam)
  1111. {
  1112. if(endExam.sModuleName == __FILE__)
  1113. {
  1114. if (endExam.nCode == 200)
  1115. {
  1116. m_pRefreshMenuTimer->stop();
  1117. if(m_pBackground != nullptr)
  1118. {
  1119. m_pBackground.reset();
  1120. }
  1121. m_pBackground = std::make_shared<awBackground>(AW_WIDGET_TYPE::awwt_examScore, this);
  1122. connect(m_pBackground.get(), &awBackground::minisize, this, &courseList::minisize);
  1123. connect(m_pBackground.get(), &awBackground::closeWidget, this, [&](){
  1124. m_pBackground.reset();
  1125. m_pRefreshMenuTimer->start();
  1126. if(m_pOnlineExam)
  1127. {
  1128. m_pOnlineExam->refreshExam();
  1129. }
  1130. if(m_pOnlineHomework)
  1131. {
  1132. m_pOnlineHomework->refreshExam();
  1133. }
  1134. });
  1135. m_pBackground->show();
  1136. }
  1137. else
  1138. {
  1139. if(endExam.sMessage.isEmpty())
  1140. {
  1141. ShowMsg(QString::fromLocal8Bit("交卷失败"), g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
  1142. }
  1143. else
  1144. {
  1145. ShowMsg(endExam.sMessage, g_appInfoPtr->m_pAnsBgWidget, MSG_ICON_TYPE::mit_error);
  1146. }
  1147. }
  1148. }
  1149. }
  1150. void courseList::onGetStudentClientMenu(CGetStudentClientMenu getStudentClientMenu)
  1151. {
  1152. if (getStudentClientMenu.nCode == 200)
  1153. {
  1154. ui->btn_onlineExam->setVisible(false);
  1155. ui->btn_onlineHomework->setVisible(false);
  1156. ui->btn_onlinePractice->setVisible(false);
  1157. ui->btn_offlineExam->setVisible(false);
  1158. ui->btn_notice->setVisible(false);
  1159. ui->btn_editPassword->setVisible(false);
  1160. for (CStudentClientMenu scm : getStudentClientMenu.vMenus)
  1161. {
  1162. QString sMenuName = scm.sName;
  1163. sMenuName.insert(sMenuName.length()/2, '\n');
  1164. QString sMenuCode = scm.sCode.left(scm.sCode.lastIndexOf("_"));
  1165. if (sMenuCode == "stu_online_exam")
  1166. {
  1167. ui->btn_onlineExam->setVisible(true);
  1168. ui->btn_onlineExam->setText(sMenuName);
  1169. }
  1170. else if (sMenuCode == "stu_online_homework")
  1171. {
  1172. ui->btn_onlineHomework->setVisible(true);
  1173. ui->btn_onlineHomework->setText(sMenuName);
  1174. }
  1175. else if (sMenuCode == "stu_online_practice")
  1176. {
  1177. ui->btn_onlinePractice->setVisible(true);
  1178. ui->btn_onlinePractice->setText(sMenuName);
  1179. }
  1180. else if (sMenuCode == "stu_offline_exam")
  1181. {
  1182. ui->btn_offlineExam->setVisible(true);
  1183. ui->btn_offlineExam->setText(sMenuName);
  1184. }
  1185. else if (sMenuCode == "stu_notice")
  1186. {
  1187. ui->btn_notice->setVisible(true);
  1188. ui->btn_notice->setText(sMenuName);
  1189. CHttpRequestPackage hrp;
  1190. hrp.sUri = "/api/ecs_exam_work/notice/getUserNoticeList";
  1191. hrp.nRequestType = RequestType::rtGetUserNoticeList;
  1192. g_httpBllPtr->get(hrp);
  1193. }
  1194. else if (sMenuCode == "stu_modify_pwd")
  1195. {
  1196. ui->btn_editPassword->setVisible(true);
  1197. ui->btn_editPassword->setText(sMenuName);
  1198. }
  1199. }
  1200. menuBtnRePosistion();
  1201. }
  1202. else
  1203. {
  1204. if(getStudentClientMenu.sMessage.isEmpty())
  1205. {
  1206. ShowMsg(QString::fromLocal8Bit("获取菜单失败"), this, MSG_ICON_TYPE::mit_error);
  1207. }
  1208. else
  1209. {
  1210. ShowMsg(getStudentClientMenu.sMessage, this, MSG_ICON_TYPE::mit_error);
  1211. }
  1212. }
  1213. }
  1214. void courseList::onGetUserNoticeList(CGetUserNoticeList getUserNoticeList)
  1215. {
  1216. if (getUserNoticeList.nCode == 200)
  1217. {
  1218. if (m_pNoticeList == nullptr)
  1219. {
  1220. m_pNoticeList = std::make_shared<clNoticeList>(ui->stw_courseList);
  1221. m_pNoticeList->setUI(ui->stw_courseList->width(), ui->stw_courseList->height());
  1222. connect(m_pNoticeList.get(), &clNoticeList::unReadNoticeCount, this, [&](int nCount) {
  1223. ui->btn_noticeNum->setText(QString::number(nCount));
  1224. ui->btn_noticeNum->setVisible(nCount > 0);
  1225. });
  1226. connect(m_pNoticeList.get(), &clNoticeList::readNotice, this, [&](__int64 nId) {
  1227. m_pNoticePopWidget->setNoticeRead(nId);
  1228. });
  1229. }
  1230. m_pNoticeList->setNotice(getUserNoticeList.vNoticeList);
  1231. if (m_pNoticePopWidget == nullptr)
  1232. {
  1233. m_pNoticePopWidget = std::make_shared<clNoticePopWidget>(this);
  1234. m_pNoticePopWidget->setUI(g_appInfoPtr->m_fRate * 960, g_appInfoPtr->m_fRate * 558, g_appInfoPtr->m_fRate * 310, g_appInfoPtr->m_fRate * 200);
  1235. connect(m_pNoticePopWidget.get(), &clNoticePopWidget::showNoticeDetail, this, [&](__int64 nId){
  1236. setCheck(COURSE_MENU_BTN_TYPE::cmbt_notice);
  1237. m_pNoticeList->viewNotice(nId);
  1238. });
  1239. }
  1240. int nUnReadCount = 0;
  1241. for (CNoticeInfo ni : getUserNoticeList.vNoticeList)
  1242. {
  1243. if (!ni.bHasRead)
  1244. {
  1245. m_pNoticePopWidget->addNotice(ni);
  1246. ++nUnReadCount;
  1247. }
  1248. }
  1249. ui->btn_noticeNum->setText(QString::number(nUnReadCount));
  1250. ui->btn_noticeNum->setVisible(nUnReadCount > 0);
  1251. if(m_pNoticePopWidget->noticeCount() > 0)
  1252. {
  1253. m_pNoticePopWidget->show();
  1254. }
  1255. }
  1256. else
  1257. {
  1258. if(getUserNoticeList.sMessage.isEmpty())
  1259. {
  1260. ShowMsg(QString::fromLocal8Bit("获取通知信息失败"), this, MSG_ICON_TYPE::mit_error);
  1261. }
  1262. else
  1263. {
  1264. ShowMsg(getUserNoticeList.sMessage, this, MSG_ICON_TYPE::mit_error);
  1265. }
  1266. }
  1267. }