SentenceMulModule.vue 61 KB

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