SentenceModule.vue 58 KB

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