SentenceMulModule.vue 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719
  1. <!-- -->
  2. <template>
  3. <div
  4. class="sentence-control"
  5. :class="[
  6. curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].id
  7. ? 'hasmp3'
  8. : ''
  9. ]"
  10. v-if="isShowTemp"
  11. >
  12. <div
  13. class="out-audioLine-box"
  14. v-if="
  15. curQue.mp3_list && curQue.mp3_list.length > 0 && curQue.mp3_list[0].id
  16. "
  17. >
  18. <div class="aduioLine-box aduioLine-practice">
  19. <AudioLine
  20. audioId="fillInforAudioLine"
  21. :mp3="curQue.mp3_list[0].id"
  22. :getCurTime="getCurTime"
  23. :themeColor="themeColor"
  24. :ed="ed"
  25. type="audioLine"
  26. ref="fillInforAudioLine"
  27. @handleListenRead="handleListenRead"
  28. />
  29. </div>
  30. </div>
  31. <div
  32. :class="[
  33. 'container-box',
  34. curQue.img_list &&
  35. curQue.img_list.length > 0 &&
  36. curQue.img_site == 'rightCenter'
  37. ? 'container-box-flex'
  38. : ''
  39. ]"
  40. >
  41. <div
  42. class="fill-img-box"
  43. v-if="
  44. curQue.img_list &&
  45. curQue.img_list.length > 0 &&
  46. curQue.img_site == 'top'
  47. "
  48. >
  49. <el-image
  50. :src="curQue.img_list[0].id"
  51. v-if="curQue.img_list[0].id"
  52. fit="scale-down"
  53. class="fill-img"
  54. :style="{ width: curQue.img_size + 'px' }"
  55. ></el-image>
  56. </div>
  57. <div
  58. v-if="judgeAnswer == 'standardAnswer'"
  59. :class="['container', curQue.sortType == 'row' ? 'ul-flex' : '']"
  60. >
  61. <div :class="['sent-option li-flex sent-option-standardAnswer']">
  62. <div
  63. :class="[
  64. 'sent-option-items',
  65. itemsWidth == 780 ? 'sent-option-items-0' : 'sent-option-items-8'
  66. ]"
  67. v-for="(items, indexs) in userErrorList"
  68. :key="'sent-option-items' + judgeAnswer + indexs"
  69. :style="{
  70. width:
  71. curQue.sortType == 'col'
  72. ? itemsWidth + 'px'
  73. : Math.floor(780 / curQue.option.length) - 16 + 'px'
  74. }"
  75. >
  76. <div
  77. :class="[
  78. 'horn-24',
  79. items.pyNumber &&
  80. items.pyNumber[0] > 0 &&
  81. curQue.pyPosition == 'top'
  82. ? 'horn-hasPY'
  83. : ''
  84. ]"
  85. v-if="
  86. curQue.mp3_list &&
  87. curQue.mp3_list.length > 0 &&
  88. curQue.mp3_list[0].id &&
  89. items.bg &&
  90. items.ed
  91. "
  92. :style="{
  93. height:
  94. items.detail &&
  95. items.detail.length > 0 &&
  96. items.detail[0].maxFontsize
  97. ? (items.detail[0].maxFontsize * 3) / 2 + 'px'
  98. : '32px',
  99. marginTop:
  100. items.detail &&
  101. items.detail.length > 0 &&
  102. items.detail[0].maxFontsize
  103. ? ''
  104. : '0px'
  105. }"
  106. >
  107. <AudioItem
  108. :itemBg="items.bg"
  109. :itemEd="items.ed"
  110. :curTime="curTime"
  111. :handleChangeTime="handleChangeTime"
  112. :stopAudioS="stopAudioS"
  113. :themeColor="themeColor"
  114. />
  115. </div>
  116. <div :class="['sent-stem', bgClassName]">
  117. <!-- 题干 -->
  118. <div class="stem-content">
  119. <!-- items.fn_check_list.judge_check || sdItem.fn_check_list.record_check.indexOf('normal') > -1
  120. ? 'sent-main-138'
  121. : '', -->
  122. <div
  123. :class="[
  124. 'sent-main',
  125. items.fn_check_list.judge_check.indexOf('col') > -1 ||
  126. items.fn_check_list.short_check ||
  127. sdItem.fn_check_list.record_check.indexOf('normal') > -1
  128. ? 'sent-que-flex'
  129. : '',
  130. items.fn_check_list.radio_check.indexOf('row') > -1 ||
  131. items.fn_check_list.checkbox_check.indexOf('row') > -1
  132. ? 'sent-main-bottom'
  133. : ''
  134. ]"
  135. v-for="(sdItem, sdIndex) in items.detail"
  136. :key="'sent-option-items' + indexs + sdIndex"
  137. >
  138. <div class="sent-que-box">
  139. <div
  140. class="sent-que"
  141. v-for="(sddItem, sddIndex) in sdItem.detail"
  142. :key="'sent-option-items' + indexs + sdIndex + sddIndex"
  143. :style="{
  144. paddingLeft:
  145. sddItem.config.wordPadding.indexOf('left') > -1
  146. ? '4px'
  147. : '0px',
  148. paddingRight:
  149. sddItem.config.wordPadding.indexOf('right') > -1
  150. ? '4px'
  151. : '0px'
  152. }"
  153. >
  154. <!-- 补全句子 -->
  155. <OneSentenceTemp
  156. :detail="sddItem"
  157. :pyPosition="curQue.pyPosition"
  158. :TaskModel="TaskModel"
  159. :pyColor="curQue.pyColor"
  160. :Bookanswer="userBookanswer[indexs]"
  161. :judgeAnswer="judgeAnswer"
  162. :correctAnswer="items.correct.complateArr"
  163. :isInput="
  164. items.fn_check_list.sent_check ==
  165. 'sentence_complete_input_chs' ||
  166. items.fn_check_list.sent_check ==
  167. 'sentence_long_input_chs'
  168. "
  169. :fn_check_list="items.fn_check_list"
  170. :bgColor="curQue.bgColor"
  171. :pyNumber="items.pyNumber && items.pyNumber[sdIndex]"
  172. :record_check="sdItem.fn_check_list.record_check"
  173. :hengLeg="sdItem.hengLeg"
  174. :maxFontsize="sdItem.maxFontsize"
  175. :textIndent="sdItem.textindent"
  176. />
  177. <template
  178. v-if="
  179. sddItem.img_list &&
  180. sddItem.img_list.length > 0 &&
  181. sddItem.img_list[0].id
  182. "
  183. >
  184. <img
  185. :src="sddItem.img_list[0].id"
  186. class="sddItem_img_list"
  187. :style="[imgStyle(sddItem)]"
  188. />
  189. </template>
  190. <!-- <div class="en" v-if="sdItem.en">{{ sdItem.en }}</div> -->
  191. <div
  192. class="promax-box-div"
  193. v-if="
  194. sdItem.fn_check_list.record_check.indexOf('promax') >
  195. -1
  196. "
  197. >
  198. <Soundrecord
  199. :type="
  200. sdItem.fn_check_list.record_check
  201. ? typeList[sdItem.fn_check_list.record_check]
  202. : 'normal'
  203. "
  204. class="promax-box"
  205. :TaskModel="TaskModel"
  206. :tmIndex="sdIndex"
  207. :answerRecordList="[]"
  208. />
  209. </div>
  210. </div>
  211. </div>
  212. <div
  213. ref="answerpart"
  214. v-if="
  215. items.fn_check_list.judge_check ||
  216. sdItem.fn_check_list.record_check ||
  217. items.fn_check_list.short_check ||
  218. items.fn_check_list.radio_check.indexOf('col') > -1 ||
  219. items.fn_check_list.checkbox_check.indexOf('col') > -1
  220. "
  221. :class="[
  222. 'answer-part',
  223. items.pyNumber && items.pyNumber[1] > 0
  224. ? 'answer-part-hasPY'
  225. : '',
  226. items.fn_check_list.judge_check ||
  227. sdItem.fn_check_list.record_check
  228. ? 'answer-part-138'
  229. : ''
  230. ]"
  231. >
  232. <!-- 短输入 -->
  233. <div
  234. :class="[
  235. 'short-part',
  236. items.pyNumber && items.pyNumber[0] > 0
  237. ? 'short-part-hasPY'
  238. : '',
  239. items.fn_check_list.is_short_auto
  240. ? 'short-part-flex'
  241. : ''
  242. ]"
  243. v-if="sdIndex == 0 && items.fn_check_list.short_check"
  244. >
  245. <ShortInputTemp
  246. :doubleInput="items.correct.doubleInput"
  247. :Bookanswer="userBookanswer[indexs]"
  248. :TaskModel="TaskModel"
  249. :is_short_auto="items.fn_check_list.is_short_auto"
  250. :judgeAnswer="judgeAnswer"
  251. />
  252. </div>
  253. <!-- 判断 -->
  254. <div
  255. :class="[
  256. 'judge-part',
  257. items.fn_check_list.judge_check.indexOf('row') > -1
  258. ? 'answer-part-padding-5'
  259. : ''
  260. ]"
  261. v-if="sdIndex == 0 && items.fn_check_list.judge_check"
  262. >
  263. <JudgeTemp
  264. :isRecord="items.fn_check_list.record_check"
  265. :Bookanswer="userBookanswer[indexs]"
  266. :judge_isNo="items.judge_isNo"
  267. :TaskModel="TaskModel"
  268. :Isexample="items.Isexample"
  269. :judgeCorrectAnswer="items.correct.judge"
  270. :judgeAnswer="judgeAnswer"
  271. />
  272. </div>
  273. <!-- 多选题 -->
  274. <div
  275. :class="[
  276. 'short-part',
  277. items.pyNumber && items.pyNumber[0] > 0
  278. ? 'short-part-hasPY'
  279. : ''
  280. ]"
  281. v-if="
  282. sdIndex == 0 &&
  283. items.fn_check_list.checkbox_check.indexOf('col') > -1
  284. "
  285. >
  286. <OptionTemp
  287. :option="items.checkbox_option"
  288. :row="
  289. items.fn_check_list.checkbox_check.indexOf('row') > -1
  290. "
  291. :Bookanswer="userBookanswer[indexs]"
  292. :TaskModel="TaskModel"
  293. type="checkbox"
  294. :curQue="curQue"
  295. :items="items"
  296. :judgeAnswer="judgeAnswer"
  297. :correctAnswer="items.correct"
  298. />
  299. </div>
  300. <!-- 单选题 -->
  301. <div
  302. :class="[
  303. 'short-part',
  304. items.pyNumber && items.pyNumber[0] > 0
  305. ? 'short-part-hasPY'
  306. : ''
  307. ]"
  308. v-if="
  309. sdIndex == 0 &&
  310. items.fn_check_list.radio_check.indexOf('col') > -1
  311. "
  312. >
  313. <OptionTemp
  314. :option="items.radio_option"
  315. :row="
  316. items.fn_check_list.radio_check.indexOf('row') > -1
  317. "
  318. :Bookanswer="userBookanswer[indexs]"
  319. :correctAnswer="items.correct"
  320. :TaskModel="TaskModel"
  321. type="radio"
  322. :curQue="curQue"
  323. :items="items"
  324. :judgeAnswer="judgeAnswer"
  325. />
  326. </div>
  327. <!-- 录音 -->
  328. <div
  329. class="judge-part record-part"
  330. v-if="
  331. sdItem.fn_check_list.record_check &&
  332. items.fn_check_list.sent_check !=
  333. 'sentence_long_input_chs'
  334. "
  335. >
  336. <Soundrecord
  337. :type="
  338. sdItem.fn_check_list.record_check
  339. ? typeList[sdItem.fn_check_list.record_check]
  340. : 'normal'
  341. "
  342. :class="[
  343. 'record_' +
  344. typeList[sdItem.fn_check_list.record_check],
  345. 'record-common',
  346. items.fn_check_list.short_check
  347. ? 'record-common-40'
  348. : ''
  349. ]"
  350. :TaskModel="TaskModel"
  351. :tmIndex="sdIndex"
  352. :answerRecordList="[]"
  353. />
  354. </div>
  355. </div>
  356. </div>
  357. <!-- 多选题 -->
  358. <div
  359. class="select-que"
  360. v-if="items.fn_check_list.checkbox_check.indexOf('row') > -1"
  361. :style="{
  362. paddingLeft:
  363. items.detail &&
  364. items.detail[0] &&
  365. items.detail[0].textindent &&
  366. items.detail[0].detail &&
  367. items.detail[0].detail[0]
  368. ? items.detail[0].detail[0].config.fontSize.replace(
  369. 'px',
  370. ''
  371. ) *
  372. 2 +
  373. 'px'
  374. : '0'
  375. }"
  376. >
  377. <OptionTemp
  378. :option="items.checkbox_option"
  379. :row="
  380. items.fn_check_list.checkbox_check.indexOf('row') > -1
  381. "
  382. :Bookanswer="userBookanswer[indexs]"
  383. :correctAnswer="items.correct"
  384. :TaskModel="TaskModel"
  385. type="checkbox"
  386. :curQue="curQue"
  387. :items="items"
  388. :judgeAnswer="judgeAnswer"
  389. />
  390. </div>
  391. <!-- 单选题 -->
  392. <div
  393. class="select-que"
  394. v-if="items.fn_check_list.radio_check.indexOf('row') > -1"
  395. :style="{
  396. paddingLeft:
  397. items.detail &&
  398. items.detail[0] &&
  399. items.detail[0].textindent &&
  400. items.detail[0].detail &&
  401. items.detail[0].detail[0]
  402. ? items.detail[0].detail[0].config.fontSize.replace(
  403. 'px',
  404. ''
  405. ) *
  406. 2 +
  407. 'px'
  408. : '0'
  409. }"
  410. >
  411. <OptionTemp
  412. :option="items.radio_option"
  413. :row="items.fn_check_list.radio_check.indexOf('row') > -1"
  414. :Bookanswer="userBookanswer[indexs]"
  415. :correctAnswer="items.correct"
  416. :TaskModel="TaskModel"
  417. type="radio"
  418. :curQue="curQue"
  419. :items="items"
  420. :judgeAnswer="judgeAnswer"
  421. />
  422. </div>
  423. </div>
  424. </div>
  425. <!-- 题干 -->
  426. </div>
  427. </div>
  428. </div>
  429. <div
  430. v-else
  431. :class="['container', curQue.sortType == 'row' ? 'ul-flex' : '']"
  432. >
  433. <div
  434. :class="[
  435. 'sent-option',
  436. curQue.mp3_list &&
  437. curQue.mp3_list.length > 0 &&
  438. curQue.mp3_list[0].id
  439. ? 'sent-option-24'
  440. : '',
  441. curQue.sortType == 'row' ? 'sent-option-row' : 'li-flex'
  442. ]"
  443. v-for="(item, index) in curQue.option"
  444. :key="'sent-option' + index"
  445. >
  446. <div
  447. :class="[
  448. 'sent-option-items',
  449. itemsWidth == 780 ? 'sent-option-items-0' : 'sent-option-items-8'
  450. ]"
  451. v-for="(itemO, indeO) in item"
  452. :key="'sent-option-items' + index + indeO"
  453. :style="{
  454. width: curQue.sortType == 'col' ? itemsWidth + 'px' : '100%'
  455. }"
  456. >
  457. <div
  458. :class="[
  459. 'horn-24',
  460. itemO.pyNumber &&
  461. itemO.pyNumber[0] > 0 &&
  462. curQue.pyPosition == 'top'
  463. ? 'horn-hasPY'
  464. : ''
  465. ]"
  466. v-if="
  467. curQue.mp3_list &&
  468. curQue.mp3_list.length > 0 &&
  469. curQue.mp3_list[0].id &&
  470. itemO.bg &&
  471. itemO.ed
  472. "
  473. :style="{
  474. height:
  475. itemO.detail &&
  476. itemO.detail.length > 0 &&
  477. itemO.detail[0].maxFontsize
  478. ? (itemO.detail[0].maxFontsize * 3) / 2 + 'px'
  479. : '32px',
  480. marginTop:
  481. itemO.detail &&
  482. itemO.detail.length > 0 &&
  483. itemO.detail[0].maxFontsize
  484. ? ''
  485. : '0px'
  486. }"
  487. >
  488. <AudioItem
  489. :itemBg="itemO.bg"
  490. :itemEd="itemO.ed"
  491. :curTime="curTime"
  492. :handleChangeTime="handleChangeTime"
  493. :stopAudioS="stopAudioS"
  494. :themeColor="themeColor"
  495. />
  496. </div>
  497. <div :class="['sent-stem', bgClassName]">
  498. <div
  499. v-if="itemO.numbertotal"
  500. :class="[
  501. 'number-box number-box-hasmp3',
  502. itemO.pyNumber &&
  503. itemO.pyNumber[0] > 0 &&
  504. curQue.pyPosition == 'top'
  505. ? 'number-box-hasPY'
  506. : '',
  507. curQue.numberBg ? '' : 'number-box-nobg'
  508. ]"
  509. :style="{
  510. height:
  511. itemO.detail &&
  512. itemO.detail.length > 0 &&
  513. itemO.detail[0].maxFontsize
  514. ? (itemO.detail[0].maxFontsize * 3) / 2 + 'px'
  515. : '32px',
  516. marginTop:
  517. itemO.detail &&
  518. itemO.detail.length > 0 &&
  519. itemO.detail[0].maxFontsize
  520. ? ''
  521. : '0px',
  522. fontSize: itemO.numberfontSize
  523. }"
  524. >
  525. {{ itemO.numbertotal }}
  526. </div>
  527. <div class="stem-maincontent">
  528. <div>
  529. <div
  530. :class="['sent-main']"
  531. v-for="(sdItem, sdIndex) in itemO.detail"
  532. :key="'sent-option-items' + index + indeO + sdIndex"
  533. >
  534. <div class="sent-que-box">
  535. <div
  536. class="sent-que"
  537. v-for="(sddItem, sddIndex) in sdItem.detail"
  538. :key="
  539. 'sent-option-items' +
  540. index +
  541. indeO +
  542. sdIndex +
  543. sddIndex
  544. "
  545. :style="{
  546. paddingLeft:
  547. sddItem.config.wordPadding.indexOf('left') > -1
  548. ? '4px'
  549. : '0px',
  550. paddingRight:
  551. sddItem.config.wordPadding.indexOf('right') > -1
  552. ? '4px'
  553. : '0px'
  554. }"
  555. >
  556. <OneSentenceTemp
  557. :detail="sddItem"
  558. :pyPosition="curQue.pyPosition"
  559. :TaskModel="TaskModel"
  560. :pyColor="curQue.pyColor"
  561. :Bookanswer="curQue.Bookanswer[index][indeO]"
  562. :judgeAnswer="judgeAnswer"
  563. :isInput="false"
  564. :fn_check_list="itemO.fn_check_list"
  565. :bgColor="curQue.bgColor"
  566. :pyNumber="itemO.pyNumber && itemO.pyNumber[sdIndex]"
  567. :record_check="sdItem.fn_check_list.record_check"
  568. :hengLeg="sdItem.hengLeg"
  569. :maxFontsize="sdItem.maxFontsize"
  570. :textIndent="sdItem.textindent"
  571. />
  572. <template
  573. v-if="
  574. sddItem.img_list &&
  575. sddItem.img_list.length > 0 &&
  576. sddItem.img_list[0].id
  577. "
  578. >
  579. <img
  580. :src="sddItem.img_list[0].id"
  581. class="sddItem_img_list"
  582. :style="[imgStyle(sddItem)]"
  583. />
  584. </template>
  585. <div
  586. class="promax-box-div"
  587. v-if="
  588. sdItem.fn_check_list.record_check.indexOf(
  589. 'promax'
  590. ) > -1
  591. "
  592. >
  593. <Soundrecord
  594. :type="
  595. sdItem.fn_check_list.record_check
  596. ? typeList[sdItem.fn_check_list.record_check]
  597. : 'normal'
  598. "
  599. class="promax-box"
  600. :TaskModel="TaskModel"
  601. :tmIndex="sdIndex"
  602. :answerRecordList="
  603. curQue.Bookanswer[index][indexs].recordList[
  604. sdIndex
  605. ]
  606. "
  607. :index="index"
  608. :indexs="indexs"
  609. :modelType="curQue.type"
  610. @handleWav="handleWav"
  611. />
  612. </div>
  613. </div>
  614. </div>
  615. </div>
  616. </div>
  617. <div v-for="(items, indexs) in itemO.options" :key="indexs">
  618. <div
  619. :class="[
  620. 'sent-main',
  621. items.fn_check_list.judge_check.indexOf('col') > -1 ||
  622. items.fn_check_list.short_check ||
  623. sdItem.fn_check_list.record_check.indexOf('normal') > -1
  624. ? 'sent-que-flex'
  625. : '',
  626. items.fn_check_list.radio_check.indexOf('row') > -1 ||
  627. items.fn_check_list.checkbox_check.indexOf('row') > -1
  628. ? 'sent-main-bottom'
  629. : ''
  630. ]"
  631. v-for="(sdItem, sdIndex) in items.detail"
  632. :key="'sent-option-items' + index + indexs + sdIndex"
  633. >
  634. <div class="sent-que-box">
  635. <div
  636. class="sent-que"
  637. v-for="(sddItem, sddIndex) in sdItem.detail"
  638. :key="
  639. 'sent-option-items' +
  640. index +
  641. indexs +
  642. sdIndex +
  643. sddIndex
  644. "
  645. :style="{
  646. paddingLeft:
  647. sddItem.config.wordPadding.indexOf('left') > -1
  648. ? '4px'
  649. : '0px',
  650. paddingRight:
  651. sddItem.config.wordPadding.indexOf('right') > -1
  652. ? '4px'
  653. : '0px'
  654. }"
  655. >
  656. <OneSentenceTemp
  657. :detail="sddItem"
  658. :pyPosition="curQue.pyPosition"
  659. :TaskModel="TaskModel"
  660. :pyColor="curQue.pyColor"
  661. :Bookanswer="curQue.Bookanswer[index][indeO][indexs]"
  662. :judgeAnswer="judgeAnswer"
  663. :correctAnswer="items.correct.complateArr"
  664. :isInput="
  665. items.fn_check_list.sent_check ==
  666. 'sentence_complete_input_chs' ||
  667. items.fn_check_list.sent_check ==
  668. 'sentence_long_input_chs'
  669. "
  670. :fn_check_list="items.fn_check_list"
  671. :bgColor="curQue.bgColor"
  672. :pyNumber="items.pyNumber && items.pyNumber[sdIndex]"
  673. :record_check="sdItem.fn_check_list.record_check"
  674. :hengLeg="sdItem.hengLeg"
  675. :maxFontsize="sdItem.maxFontsize"
  676. :textIndent="sdItem.textindent"
  677. />
  678. <template
  679. v-if="
  680. sddItem.img_list &&
  681. sddItem.img_list.length > 0 &&
  682. sddItem.img_list[0].id
  683. "
  684. >
  685. <img
  686. :src="sddItem.img_list[0].id"
  687. class="sddItem_img_list"
  688. :style="[imgStyle(sddItem)]"
  689. />
  690. </template>
  691. <div
  692. class="promax-box-div"
  693. v-if="
  694. sdItem.fn_check_list.record_check.indexOf(
  695. 'promax'
  696. ) > -1
  697. "
  698. >
  699. <Soundrecord
  700. :type="
  701. sdItem.fn_check_list.record_check
  702. ? typeList[sdItem.fn_check_list.record_check]
  703. : 'normal'
  704. "
  705. class="promax-box"
  706. :TaskModel="TaskModel"
  707. :tmIndex="indexs"
  708. :answerRecordList="
  709. curQue.Bookanswer[index][indeO][indexs]
  710. .recordList[sdIndex]
  711. "
  712. :index="index"
  713. :indexs="indeO"
  714. :sddIndex="sdIndex"
  715. :modelType="curQue.type"
  716. @handleWav="handleWav"
  717. />
  718. </div>
  719. </div>
  720. </div>
  721. <div
  722. ref="answerpart"
  723. v-if="
  724. items.fn_check_list.judge_check ||
  725. sdItem.fn_check_list.record_check ||
  726. items.fn_check_list.short_check ||
  727. items.fn_check_list.radio_check.indexOf('col') > -1 ||
  728. items.fn_check_list.checkbox_check.indexOf('col') > -1
  729. "
  730. :class="[
  731. 'answer-part',
  732. items.pyNumber && items.pyNumber[1] > 0
  733. ? 'answer-part-hasPY'
  734. : '',
  735. items.fn_check_list.judge_check ||
  736. sdItem.fn_check_list.record_check
  737. ? 'answer-part-138'
  738. : ''
  739. ]"
  740. >
  741. <div
  742. :class="[
  743. 'short-part',
  744. items.pyNumber && items.pyNumber[0] > 0
  745. ? 'short-part-hasPY'
  746. : '',
  747. items.fn_check_list.is_short_auto
  748. ? 'short-part-flex'
  749. : ''
  750. ]"
  751. v-if="sdIndex == 0 && items.fn_check_list.short_check"
  752. >
  753. <ShortInputTemp
  754. :doubleInput="items.correct.doubleInput"
  755. :Bookanswer="curQue.Bookanswer[index][indeO][indexs]"
  756. :TaskModel="TaskModel"
  757. :is_short_auto="items.fn_check_list.is_short_auto"
  758. :judgeAnswer="judgeAnswer"
  759. />
  760. </div>
  761. <div
  762. :class="[
  763. 'judge-part',
  764. items.fn_check_list.judge_check.indexOf('row') > -1
  765. ? 'answer-part-padding-5'
  766. : ''
  767. ]"
  768. v-if="sdIndex == 0 && items.fn_check_list.judge_check"
  769. >
  770. <JudgeTemp
  771. :isRecord="items.fn_check_list.record_check"
  772. :Bookanswer="curQue.Bookanswer[index][indeO][indexs]"
  773. :judge_isNo="items.judge_isNo"
  774. :TaskModel="TaskModel"
  775. :Isexample="items.Isexample"
  776. :judgeCorrectAnswer="items.correct.judge"
  777. :judgeAnswer="judgeAnswer"
  778. />
  779. </div>
  780. <div
  781. :class="[
  782. 'short-part',
  783. items.pyNumber && items.pyNumber[0] > 0
  784. ? 'short-part-hasPY'
  785. : ''
  786. ]"
  787. v-if="
  788. sdIndex == 0 &&
  789. items.fn_check_list.checkbox_check.indexOf('col') >
  790. -1
  791. "
  792. >
  793. <OptionTemp
  794. :option="items.checkbox_option"
  795. :row="
  796. items.fn_check_list.checkbox_check.indexOf('row') >
  797. -1
  798. "
  799. :Bookanswer="curQue.Bookanswer[index][indeO][indexs]"
  800. :TaskModel="TaskModel"
  801. type="checkbox"
  802. :curQue="curQue"
  803. :items="items"
  804. :judgeAnswer="judgeAnswer"
  805. />
  806. </div>
  807. <div
  808. :class="[
  809. 'short-part',
  810. items.pyNumber && items.pyNumber[0] > 0
  811. ? 'short-part-hasPY'
  812. : ''
  813. ]"
  814. v-if="
  815. sdIndex == 0 &&
  816. items.fn_check_list.radio_check.indexOf('col') > -1
  817. "
  818. >
  819. <OptionTemp
  820. :option="items.radio_option"
  821. :row="
  822. items.fn_check_list.radio_check.indexOf('row') > -1
  823. "
  824. :Bookanswer="curQue.Bookanswer[index][indeO][indexs]"
  825. :correctAnswer="items.correct"
  826. :TaskModel="TaskModel"
  827. type="radio"
  828. :curQue="curQue"
  829. :items="items"
  830. :judgeAnswer="judgeAnswer"
  831. />
  832. </div>
  833. <div
  834. class="judge-part record-part"
  835. v-if="
  836. sdItem.fn_check_list.record_check &&
  837. items.fn_check_list.sent_check !=
  838. 'sentence_long_input_chs'
  839. "
  840. >
  841. <Soundrecord
  842. :type="
  843. sdItem.fn_check_list.record_check
  844. ? typeList[sdItem.fn_check_list.record_check]
  845. : 'normal'
  846. "
  847. :class="[
  848. 'record_' +
  849. typeList[sdItem.fn_check_list.record_check],
  850. 'record-common',
  851. items.fn_check_list.short_check
  852. ? 'record-common-40'
  853. : ''
  854. ]"
  855. :TaskModel="TaskModel"
  856. :tmIndex="indexs"
  857. :answerRecordList="
  858. curQue.Bookanswer[index][indeO][indexs].recordList[
  859. sdIndex
  860. ]
  861. "
  862. :index="index"
  863. :indexs="indeO"
  864. :sddIndex="sdIndex"
  865. :modelType="curQue.type"
  866. @handleWav="handleWav"
  867. />
  868. </div>
  869. </div>
  870. </div>
  871. <div
  872. class="select-que"
  873. v-if="
  874. items.fn_check_list.checkbox_check.indexOf('row') > -1
  875. "
  876. :style="{
  877. paddingLeft:
  878. items.detail &&
  879. items.detail[0] &&
  880. items.detail[0].textindent &&
  881. items.detail[0].detail &&
  882. items.detail[0].detail[0]
  883. ? items.detail[0].detail[0].config.fontSize.replace(
  884. 'px',
  885. ''
  886. ) *
  887. 2 +
  888. 'px'
  889. : '0'
  890. }"
  891. >
  892. <OptionTemp
  893. :option="items.checkbox_option"
  894. :row="
  895. items.fn_check_list.checkbox_check.indexOf('row') > -1
  896. "
  897. :Bookanswer="curQue.Bookanswer[index][indeO][indexs]"
  898. :correctAnswer="items.correct"
  899. :TaskModel="TaskModel"
  900. type="checkbox"
  901. :curQue="curQue"
  902. :items="items"
  903. :judgeAnswer="judgeAnswer"
  904. />
  905. </div>
  906. <div
  907. class="select-que"
  908. v-if="items.fn_check_list.radio_check.indexOf('row') > -1"
  909. :style="{
  910. paddingLeft:
  911. items.detail &&
  912. items.detail[0] &&
  913. items.detail[0].textindent &&
  914. items.detail[0].detail &&
  915. items.detail[0].detail[0]
  916. ? items.detail[0].detail[0].config.fontSize.replace(
  917. 'px',
  918. ''
  919. ) *
  920. 2 +
  921. 'px'
  922. : '0'
  923. }"
  924. >
  925. <OptionTemp
  926. :option="items.radio_option"
  927. :row="items.fn_check_list.radio_check.indexOf('row') > -1"
  928. :Bookanswer="curQue.Bookanswer[index][indeO][indexs]"
  929. :correctAnswer="items.correct"
  930. :TaskModel="TaskModel"
  931. type="radio"
  932. :curQue="curQue"
  933. :items="items"
  934. :judgeAnswer="judgeAnswer"
  935. />
  936. </div>
  937. </div>
  938. </div>
  939. </div>
  940. </div>
  941. </div>
  942. </div>
  943. <div
  944. class="fill-img-box"
  945. v-if="
  946. curQue.img_list &&
  947. curQue.img_list.length > 0 &&
  948. (curQue.img_site == 'rightCenter' || curQue.img_site == 'bottom')
  949. "
  950. >
  951. <el-image
  952. :src="curQue.img_list[0].id"
  953. v-if="curQue.img_list[0].id"
  954. fit="scale-down"
  955. class="fill-img"
  956. :style="{ width: curQue.img_size + 'px' }"
  957. ></el-image>
  958. </div>
  959. </div>
  960. </div>
  961. </template>
  962. <script>
  963. import AudioLine from "./AudioLine.vue";
  964. import AudioItem from "./components/AudioItem.vue";
  965. import OneSentenceTemp from "./components/OneSentenceTemp.vue";
  966. import JudgeTemp from "./components/JudgeTemp.vue";
  967. import ShortInputTemp from "./components/ShortInputTemp.vue";
  968. import NumberStyle from "./components/NumberStyle.vue";
  969. import EditDiv from "./EditDiv.vue";
  970. import Soundrecord from "./Soundrecord.vue"; // 录音模板
  971. import OptionTemp from "./components/OptionTemp.vue";
  972. export default {
  973. components: {
  974. AudioLine,
  975. AudioItem,
  976. NumberStyle,
  977. EditDiv,
  978. Soundrecord,
  979. OneSentenceTemp,
  980. JudgeTemp,
  981. ShortInputTemp,
  982. OptionTemp
  983. },
  984. props: ["curQue", "themeColor", "TaskModel", "judgeAnswer"],
  985. data() {
  986. return {
  987. curTime: 0,
  988. stopAudioS: false,
  989. ed: null,
  990. userAnswer: {
  991. Isexample: false,
  992. completeInput: [],
  993. shortInput: "",
  994. longInput: "",
  995. doubleInput: [],
  996. judge: {},
  997. checkbox: {},
  998. radio: {},
  999. recordList: {},
  1000. completeImage: []
  1001. },
  1002. chsFhList: [",", "。", "”", ":", "》", "?", "!", ";"],
  1003. itemsWidth: 0,
  1004. typeList: {
  1005. sentence_record_mini_chs: "mini",
  1006. sentence_record_normal_chs: "normal",
  1007. sentence_record_pro_chs: "pro",
  1008. sentence_record_promax_chs: "promax"
  1009. },
  1010. answerpart: [],
  1011. userErrorList: [],
  1012. userBookanswer: [],
  1013. userErrorNumberTotal: 0
  1014. };
  1015. },
  1016. computed: {
  1017. isShowTemp() {
  1018. let _this = this;
  1019. let bool = false;
  1020. if (_this.curQue && _this.curQue.Bookanswer) {
  1021. if (_this.judgeAnswer == "standardAnswer") {
  1022. if (_this.userErrorNumberTotal > 0) {
  1023. bool = true;
  1024. } else {
  1025. bool = false;
  1026. }
  1027. } else {
  1028. bool = true;
  1029. }
  1030. }
  1031. return bool;
  1032. },
  1033. bgClassName() {
  1034. let className = "";
  1035. if (this.curQue.bgColor == "grey") {
  1036. className = "sent-stem-grey";
  1037. } else if (this.curQue.bgColor == "white") {
  1038. className = "sent-stem-white";
  1039. }
  1040. return className;
  1041. },
  1042. imgStyle() {
  1043. return function(config) {
  1044. let _this = this;
  1045. let styleConfig = null;
  1046. if (config.config && config.config.fontSize) {
  1047. let sizeVal = config.config.fontSize.replace("px", "");
  1048. styleConfig = {
  1049. height: Number(sizeVal) * 1.5 + "px",
  1050. width: Number(sizeVal) * 1.5 + "px"
  1051. };
  1052. }
  1053. return styleConfig;
  1054. };
  1055. }
  1056. },
  1057. watch: {},
  1058. //方法集合
  1059. methods: {
  1060. getCurTime(curTime) {
  1061. this.curTime = curTime * 1000;
  1062. },
  1063. //点击播放某个句子
  1064. handleChangeTime(time, edTime) {
  1065. let _this = this;
  1066. _this.curTime = time;
  1067. _this.stopAudioS = true;
  1068. _this.$refs.fillInforAudioLine.onTimeupdateTime(time / 1000, true);
  1069. _this.ed = edTime;
  1070. },
  1071. handleListenRead(playFlag) {
  1072. this.stopAudioS = playFlag;
  1073. },
  1074. handleWav(list, tmIndex, index, indexs, sddIndex) {
  1075. tmIndex = tmIndex ? tmIndex : 0;
  1076. index = index ? index : 0;
  1077. indexs = indexs ? indexs : 0;
  1078. let resList = list.filter((item, index) => index == list.length - 1);
  1079. if (sddIndex || sddIndex === 0) {
  1080. this.$set(
  1081. this.curQue.Bookanswer[index][indexs][tmIndex].recordList,
  1082. sddIndex,
  1083. resList
  1084. );
  1085. } else {
  1086. this.$set(
  1087. this.curQue.Bookanswer[index][indexs].recordList,
  1088. tmIndex,
  1089. resList
  1090. );
  1091. }
  1092. },
  1093. handleData() {
  1094. let Bookanswer = [];
  1095. let itemLeg = 0;
  1096. this.totalHasPy = false;
  1097. let option = JSON.parse(JSON.stringify(this.curQue.option));
  1098. let completeImage = [];
  1099. option.forEach((itemO, indexO) => {
  1100. Bookanswer.push([]);
  1101. completeImage = [];
  1102. itemLeg = itemO.length > itemLeg ? itemO.length : itemLeg;
  1103. itemO.forEach((item, index) => {
  1104. Bookanswer[indexO].push([]);
  1105. // this.$set(Bookanswer[indexO][index],'optionsAnswer',[])
  1106. if (this.curQue.wordTime && this.curQue.wordTime.length > 0) {
  1107. let time = this.curQue.wordTime[item.index];
  1108. if (time) {
  1109. item.ed = time.ed;
  1110. item.bg = time.bg;
  1111. }
  1112. }
  1113. if (item.detail) {
  1114. item.detail.forEach(itemI => {
  1115. itemI.detail.forEach(itemss => {
  1116. if (itemss.wordsList && itemss.wordsList.length > 0) {
  1117. itemss.wordsList.forEach(itemsss => {
  1118. this.mergeWordSymbol(itemsss);
  1119. });
  1120. }
  1121. });
  1122. });
  1123. }
  1124. item.options.forEach((items, indexs) => {
  1125. let userAnswer = JSON.parse(JSON.stringify(this.userAnswer));
  1126. let correct = JSON.parse(JSON.stringify(items.correct));
  1127. let complateArr = correct.completeInput.split("\n");
  1128. complateArr.forEach((itemI, indexI) => {
  1129. if (itemI == "??" || itemI == "??") {
  1130. complateArr[indexI] = "";
  1131. }
  1132. });
  1133. items.correct.complateArr = complateArr;
  1134. this.curQue.option[indexO][index].options[
  1135. indexs
  1136. ].correct.complateArr = complateArr;
  1137. if (items.Isexample) {
  1138. userAnswer.Isexample = true;
  1139. userAnswer.recordList = {};
  1140. }
  1141. Bookanswer[indexO][index].push(userAnswer);
  1142. let hengIndex = 0;
  1143. items.pyNumber = [];
  1144. items.detail.forEach((sdItem, sdIndex) => {
  1145. let isHasPY = 0;
  1146. let maxFontsize = 0;
  1147. sdItem.detail.forEach(sddItem => {
  1148. if (sddItem.wordsList.length > 0) {
  1149. sddItem.wordsList.forEach((sItem, sIndex) => {
  1150. let reg = /_{2,}/g;
  1151. if (reg.test(sItem.chs)) {
  1152. sItem.index = sIndex;
  1153. sItem.isHeng = true;
  1154. sItem.hengIndex = hengIndex;
  1155. hengIndex++;
  1156. }
  1157. //补全句子
  1158. if (
  1159. !this.curQue.Bookanswer &&
  1160. (items.fn_check_list.sent_check ==
  1161. "sentence_complete_input_chs" ||
  1162. items.fn_check_list.sent_check ==
  1163. "sentence_long_input_chs")
  1164. ) {
  1165. let reg = /_{2,}/g;
  1166. if (reg.test(sItem.chs)) {
  1167. let bool = false;
  1168. if (sddItem.hasOwnProperty("input_Isexample")) {
  1169. bool = sddItem.input_Isexample;
  1170. } else {
  1171. bool = items.Isexample;
  1172. }
  1173. let obj = null;
  1174. if (!sddItem.input_tian) {
  1175. obj = {
  1176. answer:
  1177. bool && complateArr[sItem.hengIndex]
  1178. ? complateArr[sItem.hengIndex]
  1179. : "",
  1180. userAnswerJudge:
  1181. bool || !complateArr[sItem.hengIndex]
  1182. ? ""
  1183. : "[JUDGE##F##JUDGE]",
  1184. input_Isexample: bool ? true : false
  1185. };
  1186. Bookanswer[indexO][index][indexs].completeInput.push(
  1187. JSON.parse(JSON.stringify(obj))
  1188. );
  1189. } else {
  1190. if (sddItem.hengLeg == "-1") {
  1191. completeImage.push(obj);
  1192. } else {
  1193. for (let i = 0; i < Number(sddItem.hengLeg); i++) {
  1194. completeImage.push(obj);
  1195. }
  1196. }
  1197. Bookanswer[indexO][index][indexs].completeInput.push(
  1198. JSON.parse(JSON.stringify(completeImage))
  1199. );
  1200. }
  1201. }
  1202. }
  1203. this.mergeWordSymbol(sItem);
  1204. if (sItem.pinyin) {
  1205. isHasPY++;
  1206. this.totalHasPy = true;
  1207. }
  1208. let fontSize = JSON.parse(JSON.stringify(sItem.fontSize));
  1209. fontSize = Number(fontSize.replace("px", ""));
  1210. maxFontsize =
  1211. fontSize > maxFontsize ? fontSize : maxFontsize;
  1212. });
  1213. } else {
  1214. if (sddItem.sentence) {
  1215. let fontSize = JSON.parse(
  1216. JSON.stringify(sddItem.config.fontSize)
  1217. );
  1218. fontSize = Number(fontSize.replace("px", ""));
  1219. maxFontsize =
  1220. fontSize > maxFontsize ? fontSize : maxFontsize;
  1221. }
  1222. }
  1223. });
  1224. sdItem.maxFontsize = maxFontsize;
  1225. items.pyNumber.push(isHasPY);
  1226. });
  1227. if (!this.curQue.Bookanswer) {
  1228. //双输入/短输入
  1229. if (
  1230. items.fn_check_list.short_check == "sentence_double_input_chs"
  1231. ) {
  1232. items.correct.doubleInput.forEach(cItem => {
  1233. let obj = {
  1234. correct:
  1235. items.Isexample && cItem.correct ? cItem.correct : "",
  1236. userAnswerJudge:
  1237. !items.Isexample &&
  1238. (cItem.correct || cItem.correct == "0")
  1239. ? "[JUDGE##F##JUDGE]"
  1240. : ""
  1241. };
  1242. Bookanswer[indexO][index][indexs].doubleInput.push(
  1243. JSON.parse(JSON.stringify(obj))
  1244. );
  1245. });
  1246. }
  1247. //判断
  1248. if (items.fn_check_list.judge_check) {
  1249. let judge_obj = {
  1250. correct:
  1251. items.Isexample && items.correct.judge
  1252. ? items.correct.judge
  1253. : "",
  1254. userAnswerJudge:
  1255. !items.Isexample && items.correct.judge
  1256. ? "[JUDGE##F##JUDGE]"
  1257. : ""
  1258. };
  1259. Bookanswer[indexO][index][indexs].judge = JSON.parse(
  1260. JSON.stringify(judge_obj)
  1261. );
  1262. }
  1263. //单选
  1264. if (items.fn_check_list.radio_check) {
  1265. let radio_obj = {
  1266. correct:
  1267. items.Isexample &&
  1268. (items.correct.radio || items.correct.radio === 0)
  1269. ? items.correct.radio
  1270. : "",
  1271. userAnswerJudge:
  1272. !items.Isexample &&
  1273. (items.correct.radio || items.correct.radio === 0)
  1274. ? "[JUDGE##F##JUDGE]"
  1275. : ""
  1276. };
  1277. Bookanswer[indexO][index][indexs].radio = JSON.parse(
  1278. JSON.stringify(radio_obj)
  1279. );
  1280. }
  1281. //多选
  1282. if (items.fn_check_list.checkbox_check) {
  1283. let checkbox_obj = {
  1284. correct:
  1285. items.Isexample &&
  1286. items.correct.checkbox &&
  1287. items.correct.checkbox.length > 0
  1288. ? items.correct.checkbox
  1289. : [],
  1290. userAnswerJudge:
  1291. !items.Isexample &&
  1292. items.correct.checkbox &&
  1293. items.correct.checkbox.length > 0
  1294. ? "[JUDGE##F##JUDGE]"
  1295. : ""
  1296. };
  1297. Bookanswer[indexO][index][indexs].checkbox = JSON.parse(
  1298. JSON.stringify(checkbox_obj)
  1299. );
  1300. }
  1301. }
  1302. items.radio_option.forEach((rItem, rIndex) => {
  1303. rItem.detail.pyNumber = [];
  1304. rItem.detail.wordsList.forEach(rpwItem => {
  1305. let isHasPY2 = 0;
  1306. rpwItem.forEach(rpsItem => {
  1307. this.mergeWordSymbol(rpsItem);
  1308. if (rpsItem.pinyin) {
  1309. isHasPY2++;
  1310. }
  1311. });
  1312. rItem.detail.pyNumber.push(isHasPY2);
  1313. });
  1314. });
  1315. items.checkbox_option.forEach((cItem, rIndex) => {
  1316. cItem.detail.pyNumber = [];
  1317. cItem.detail.wordsList.forEach(cpwItem => {
  1318. let isHasPY3 = 0;
  1319. cpwItem.forEach(cpsItem => {
  1320. this.mergeWordSymbol(cpsItem);
  1321. if (cpsItem.pinyin) {
  1322. isHasPY3++;
  1323. }
  1324. });
  1325. cItem.detail.pyNumber.push(isHasPY3);
  1326. });
  1327. });
  1328. });
  1329. });
  1330. });
  1331. if (!this.curQue.Bookanswer) {
  1332. this.$nextTick(() => {
  1333. this.$set(
  1334. this.curQue,
  1335. "Bookanswer",
  1336. JSON.parse(JSON.stringify(Bookanswer))
  1337. );
  1338. });
  1339. } else {
  1340. let BookanswerStr = JSON.stringify(this.curQue.Bookanswer);
  1341. let errReg = /\[JUDGE##F##JUDGE\]/g;
  1342. if (errReg.test(BookanswerStr)) {
  1343. let errorArr = BookanswerStr.match(/\[JUDGE##F##JUDGE\]/g);
  1344. this.userErrorNumberTotal = errorArr.length;
  1345. }
  1346. }
  1347. this.$set(this.curQue, "option", option);
  1348. let contentWidth = 780;
  1349. if (this.curQue.img_list && this.curQue.img_list.length > 0) {
  1350. contentWidth = 780 - this.curQue.img_size;
  1351. }
  1352. if (itemLeg == 1) {
  1353. this.itemsWidth = 780;
  1354. } else {
  1355. this.itemsWidth = Math.floor(contentWidth / itemLeg) - 16;
  1356. }
  1357. // 把答错的挑出来
  1358. if (this.judgeAnswer == "standardAnswer") {
  1359. this.userErrorList = [];
  1360. this.userBookanswer = [];
  1361. this.curQue.option.forEach((itemO, indexO) => {
  1362. itemO.forEach((item, index) => {
  1363. item.options.forEach((items, indexs) => {
  1364. let flag = false;
  1365. // 多输入或者短输入
  1366. items.correct.doubleInput.forEach((itemI, indexI) => {
  1367. if (
  1368. itemI.correct &&
  1369. itemI.correct !=
  1370. this.curQue.Bookanswer[indexO][index][indexs].doubleInput[
  1371. indexI
  1372. ].correct
  1373. ) {
  1374. flag = true;
  1375. }
  1376. });
  1377. // 句子填空
  1378. items.correct.complateArr.forEach((itemI, indexI) => {
  1379. if (
  1380. itemI &&
  1381. itemI !=
  1382. this.curQue.Bookanswer[indexO][index][indexs].completeInput[
  1383. indexI
  1384. ].answer
  1385. ) {
  1386. flag = true;
  1387. }
  1388. });
  1389. // 句子判断
  1390. if (
  1391. items.correct.judge &&
  1392. items.correct.judge !=
  1393. this.curQue.Bookanswer[indexO][index][indexs].judge.correct
  1394. ) {
  1395. flag = true;
  1396. }
  1397. // 句子单选
  1398. if (
  1399. items.correct.radio !== "" &&
  1400. items.correct.radio !==
  1401. this.curQue.Bookanswer[indexO][index][indexs].radio.correct
  1402. ) {
  1403. flag = true;
  1404. }
  1405. // 句子多选
  1406. if (
  1407. items.correct &&
  1408. items.correct.checkbox.length > 0 &&
  1409. items.correct.checkbox.sort().toString() !=
  1410. this.curQue.Bookanswer[indexO][index][indexs].checkbox.correct
  1411. .sort()
  1412. .toString()
  1413. ) {
  1414. flag = true;
  1415. }
  1416. if (flag) {
  1417. this.userErrorList.push(items);
  1418. this.userBookanswer.push(
  1419. this.curQue.Bookanswer[indexO][index][indexs]
  1420. );
  1421. }
  1422. });
  1423. });
  1424. });
  1425. console.log(this.userErrorList);
  1426. }
  1427. },
  1428. //词和标点合一起
  1429. mergeWordSymbol(sItem) {
  1430. if (this.chsFhList.indexOf(sItem.chs) > -1) {
  1431. sItem.isShow = false;
  1432. } else {
  1433. sItem.isShow = true;
  1434. }
  1435. }
  1436. },
  1437. //生命周期 - 创建完成(可以访问当前this实例)
  1438. created() {},
  1439. //生命周期 - 挂载完成(可以访问DOM元素)
  1440. mounted() {
  1441. let _this = this;
  1442. _this.handleData();
  1443. _this.$nextTick(() => {
  1444. if (_this.$refs.answerpart) {
  1445. _this.$refs.answerpart.forEach(item => {
  1446. _this.answerpart.push(item.offsetWidth);
  1447. });
  1448. }
  1449. });
  1450. },
  1451. beforeCreate() {}, //生命周期 - 创建之前
  1452. beforeMount() {}, //生命周期 - 挂载之前
  1453. beforeUpdate() {}, //生命周期 - 更新之前
  1454. updated() {}, //生命周期 - 更新之后
  1455. beforeDestroy() {}, //生命周期 - 销毁之前
  1456. destroyed() {}, //生命周期 - 销毁完成
  1457. activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
  1458. };
  1459. </script>
  1460. <style lang="scss" scoped>
  1461. //@import url(); 引入公共css类
  1462. .sentence-control {
  1463. width: 100%;
  1464. box-sizing: border-box;
  1465. border-radius: 8px;
  1466. overflow: hidden;
  1467. .out-audioLine-box {
  1468. background: #f7f7f7;
  1469. border-bottom: 1px solid rgba(0, 0, 0, 0.1);
  1470. }
  1471. .container-box {
  1472. width: 100%;
  1473. &-flex {
  1474. display: flex;
  1475. align-items: stretch;
  1476. }
  1477. &-auto {
  1478. .fill-img-box {
  1479. width: 100%;
  1480. }
  1481. }
  1482. .fill-img-box {
  1483. display: flex;
  1484. justify-content: center;
  1485. align-items: center;
  1486. }
  1487. }
  1488. .container {
  1489. flex: 1;
  1490. padding: 0;
  1491. box-sizing: border-box;
  1492. &.ul-flex {
  1493. display: flex;
  1494. flex-wrap: wrap;
  1495. justify-content: space-between;
  1496. .sent-option-24 {
  1497. padding: 0 24px;
  1498. }
  1499. }
  1500. .sent-option {
  1501. &.li-flex {
  1502. display: flex;
  1503. margin: 0px;
  1504. .sent-option-items {
  1505. &-0 {
  1506. margin: 8px 0; // 单列左右间距去掉
  1507. }
  1508. &-8 {
  1509. margin-left: 8px;
  1510. margin-right: 8px;
  1511. }
  1512. }
  1513. }
  1514. &-row {
  1515. flex: 1;
  1516. }
  1517. &-standardAnswer {
  1518. flex-flow: wrap;
  1519. }
  1520. }
  1521. .sent-option-items {
  1522. width: 100%;
  1523. display: flex;
  1524. flex-direction: row;
  1525. justify-content: flex-start;
  1526. box-sizing: border-box;
  1527. background: #ffffff;
  1528. border: 1px solid rgba(0, 0, 0, 0.1);
  1529. border-radius: 8px;
  1530. margin: 8px 0;
  1531. padding: 8px 12px;
  1532. .number-box {
  1533. width: 16px;
  1534. height: 30px;
  1535. border-radius: 100%;
  1536. display: flex;
  1537. justify-content: center;
  1538. align-items: center;
  1539. margin-right: 8px;
  1540. margin-top: 3px;
  1541. color: #000;
  1542. // &-hasmp3 {
  1543. // margin-top: 8px;
  1544. // }
  1545. &-hasPY {
  1546. margin-top: 21px;
  1547. }
  1548. &-nobg {
  1549. width: 24px;
  1550. justify-content: flex-end;
  1551. }
  1552. }
  1553. > .number-box {
  1554. margin-right: 16px;
  1555. }
  1556. .horn-24 {
  1557. height: 30px;
  1558. display: flex;
  1559. justify-content: center;
  1560. align-items: center;
  1561. margin-right: 8px;
  1562. margin-top: 3px;
  1563. &.horn-hasPY {
  1564. margin-top: 28px;
  1565. }
  1566. }
  1567. }
  1568. .sent-stem {
  1569. flex: 1;
  1570. display: flex;
  1571. background: #fff;
  1572. .stem-maincontent {
  1573. flex: 1;
  1574. }
  1575. .stem-content {
  1576. flex: 1;
  1577. }
  1578. .number-box {
  1579. // &-hasPY {
  1580. // margin-top: 19px;
  1581. // }
  1582. }
  1583. .sent-main {
  1584. position: relative;
  1585. width: 100%;
  1586. display: flex;
  1587. flex-wrap: wrap;
  1588. box-sizing: border-box;
  1589. &-138 {
  1590. padding-right: 138px;
  1591. }
  1592. &-bottom {
  1593. margin-bottom: 9px;
  1594. }
  1595. }
  1596. .sent-que-box {
  1597. display: flex;
  1598. flex-wrap: wrap;
  1599. padding: 4px 0;
  1600. }
  1601. .sent-que {
  1602. font-size: 0;
  1603. &-flex {
  1604. flex: 1;
  1605. display: flex;
  1606. justify-content: space-between;
  1607. align-items: stretch;
  1608. }
  1609. .sentence-part {
  1610. flex: 1;
  1611. }
  1612. }
  1613. .answer-part {
  1614. flex: 1;
  1615. display: flex;
  1616. justify-content: flex-end;
  1617. align-items: center;
  1618. // padding-left: 16px;
  1619. // &-hasPY {
  1620. // padding-top: 9px;
  1621. // }
  1622. // &.answer-part-138 {
  1623. // position: absolute;
  1624. // right: 0px;
  1625. // top: 1px;
  1626. // }
  1627. > div {
  1628. margin-left: 8px;
  1629. }
  1630. .judge-part {
  1631. &-padding-5 {
  1632. padding: 5px 0 16px;
  1633. }
  1634. }
  1635. .record-part {
  1636. padding: 0;
  1637. }
  1638. .short-part {
  1639. display: flex;
  1640. align-items: center;
  1641. margin-left: 0;
  1642. &-flex {
  1643. flex: 1;
  1644. }
  1645. // padding-top: 16px;
  1646. // &-hasPY {
  1647. // padding-top: 24px;
  1648. // }
  1649. }
  1650. }
  1651. }
  1652. }
  1653. .record-common {
  1654. background: #ffffff;
  1655. border: 1px solid rgba(0, 0, 0, 0.1);
  1656. box-sizing: border-box;
  1657. border-radius: 8px;
  1658. padding: 0 12px;
  1659. margin: 0 auto;
  1660. &-40 {
  1661. height: 40px;
  1662. }
  1663. }
  1664. // .record_mini {
  1665. // width: 68px;
  1666. // }
  1667. // .record_normal {
  1668. // width: 126px;
  1669. // }
  1670. .promax-box-div {
  1671. width: 100%;
  1672. background: #ffffff;
  1673. border: 1px solid rgba(0, 0, 0, 0.1);
  1674. box-sizing: border-box;
  1675. border-radius: 0px 0px 8px 8px;
  1676. .promax-box {
  1677. width: 320px;
  1678. height: 40px;
  1679. border-radius: 20px;
  1680. padding: 0 16px;
  1681. }
  1682. }
  1683. &.hasmp3 {
  1684. .sent-option {
  1685. padding: 0px 16px;
  1686. }
  1687. &.sentence-control {
  1688. background: #f7f7f7;
  1689. border: 1px solid rgba(0, 0, 0, 0.1);
  1690. }
  1691. }
  1692. }
  1693. </style>
  1694. <style lang="scss">
  1695. .sentence-control {
  1696. .answer-part {
  1697. .OptionComponents-npc {
  1698. ul {
  1699. justify-content: flex-end;
  1700. }
  1701. }
  1702. }
  1703. }
  1704. </style>