content.php 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478
  1. <div class="paper teaching">
  2. <!-- 词汇集训-->
  3. <div class="part vocabulary">
  4. <div class="content">
  5. <div class="title-head">
  6. <div class="title">
  7. <div class="title-text">
  8. Expression Intensive Training(词汇集训)
  9. </div>
  10. </div>
  11. <div class="title-bottom">
  12. <!--span>人教必修一</span-->
  13. <span><?php echo $title; ?></span>
  14. </div>
  15. </div>
  16. <!-- 词汇回顾 -->
  17. <?php if($word_review && $wordReview){ ?>
  18. <div class="modular review">
  19. <div class="modular-title">
  20. <img class="modular-title-icon" src="<?php echo $server.'/images/magic_word/lable1-icon.png'; ?> " alt="">
  21. <?php echo $title_m_no[$flag_m_no]; ?>、Expression Review (词汇回顾)</div>
  22. <?php foreach($word_review as $value){
  23. if(!$value['single_word'] && !$value['phrase']) continue;
  24. ?>
  25. <div class="unit-block">
  26. <div class="unit-title">
  27. <img src="<?php echo $server.'/images/magic_word/start.png';?>" alt="" />
  28. <span><?php echo $value['name']; ?></span>
  29. </div>
  30. <?php if($value['single_word']){?>
  31. <div class="type-block word-block">
  32. <div class="word-type">单词:</div>
  33. <p>
  34. <?php
  35. $_word = '';
  36. foreach($value['single_word'] as $id=>$word){
  37. $_word .= $word['content'].', ';
  38. }
  39. echo substr($_word,0,-2);
  40. ?>
  41. </p>
  42. </div>
  43. <?php } ?>
  44. <?php if($value['phrase']){ ?>
  45. <div class="type-block word-block">
  46. <div class="word-type">短语:</div>
  47. <p>
  48. <?php
  49. $_word = '';
  50. foreach($value['phrase'] as $id=>$word){
  51. $_word .= $word['content'].',';
  52. }
  53. echo substr($_word,0,-1);
  54. ?>
  55. </p>
  56. </div>
  57. <?php } ?>
  58. </div>
  59. <?php }?>
  60. <div class="qr-code">
  61. <div class="qr-code-text">用APP扫码点读词汇→</div>
  62. <img src="<?php echo $h5_image;?>" alt="" />
  63. </div>
  64. </div>
  65. <?php
  66. $flag_m_no++; } ?>
  67. <!-- 词汇精讲 -->
  68. <?php if($word_phase && $wordExplain){ ?>
  69. <div class="modular explain">
  70. <div class="modular-title">
  71. <img class="modular-title-icon" src="<?php echo $server.'/images/magic_word/lable1-icon.png'; ?> " alt="">
  72. <?php echo $title_m_no[$flag_m_no]; ?>、Expression Consolidation (词汇精讲)
  73. </div>
  74. <div class="word-table">
  75. <table>
  76. <tbody>
  77. <?php
  78. $word_explain_no = 1;
  79. foreach($word_phase as $word_id=>$info){
  80. ?>
  81. <tr>
  82. <td>
  83. <div class="word-table-left">
  84. <div class="word">
  85. <i><?php echo $word_explain_no; ?></i>
  86. <span><?php echo $info['content']; ?></span><?php echo $info['phonetic_symbol']; ?>
  87. </div>
  88. <p><?php echo $info['mean']; ?></p>
  89. </div>
  90. </td>
  91. <td>
  92. <div class="word-table-right">
  93. <?php if(isset($info['derivative']['derivative']) && $info['derivative']['derivative']){ ?>
  94. <div class="from">
  95. <span class="from-lable">【派生】</span>
  96. <p class="from-txt">
  97. <?php
  98. $_content = '';
  99. foreach($info['derivative']['derivative'] as $id=>$content){
  100. $_content .= $content.';';
  101. }
  102. echo substr($_content,0,-1);
  103. ?>
  104. </p>
  105. </div>
  106. <?php }?>
  107. <?php if(isset($info['phrase']['phrase']) && $info['phrase']['phrase']){?>
  108. <div class="from">
  109. <span class="from-lable">【短语】</span>
  110. <p class="from-txt">
  111. <?php
  112. $_content = '';
  113. foreach($info['phrase']['phrase'] as $id=>$content){
  114. $_content .= $content.';';
  115. }
  116. echo substr($_content,0,-1);
  117. ?>
  118. </p>
  119. </div>
  120. <?php }?>
  121. <?php if(isset($info['assoc']) && $info['assoc']){?>
  122. <div class="from">
  123. <span class="from-lable">【趣味记忆法】</span>
  124. <p class="from-txt">
  125. <?php echo $info['assoc'];?>
  126. </p>
  127. </div>
  128. <?php }?>
  129. </div>
  130. </td>
  131. </tr>
  132. <?php $word_explain_no++; } ?>
  133. </tbody>
  134. </table>
  135. </div>
  136. <div class="qr-code">
  137. <div class="qr-code-text">用APP扫码点读词汇→</div>
  138. <img src="<?php echo $h5_image;?>" alt="" />
  139. </div>
  140. </div>
  141. <?php $flag_m_no++;}?>
  142. <!-- 精准训练 -->
  143. <?php
  144. if($translate || $wordApply || $discourse){
  145. ?>
  146. <div class="modular train">
  147. <div class="modular-title">
  148. <img class="modular-title-icon" src="<?php echo $server.'/images/magic_word/lable1-icon.png'; ?> " alt="">
  149. <?php echo $title_m_no[$flag_m_no]; ?>、Precise Application (精准训练)
  150. </div>
  151. <!-- 英汉互译 -->
  152. <?php
  153. $flag_m_no = 1;
  154. if($translates && $translate){
  155. ?>
  156. <div class="unit-block">
  157. <div class="unit-title b-title">
  158. <img src="<?php echo $server.'/images/magic_word/start.png';?>" alt="" />
  159. <span>(<?php echo $title_m_no[$flag_m_no]; ?>)
  160. <?php if($setting['practice_type'] == 1){ //共性
  161. echo $translate_type[$setting['translate_type']];
  162. }else{ //个性
  163. echo isset($translates['type']) ? $translate_type[$translates['type']] : $translate_type[1];
  164. }
  165. ?>
  166. </span>
  167. </div>
  168. <div class="type-block">
  169. <ol class="sort-list lr-list s-line clearfix">
  170. <?php
  171. $translate_type_no = 1;
  172. if($setting['practice_type'] == 1){ //共性
  173. if($setting['translate_type'] == 1){ //英汉互译
  174. if(isset($translates['phrases'])){
  175. foreach ($translates['phrases'] as $val){
  176. ?>
  177. <li><?php echo $val['mean']; ?><i><?php echo $val['content']; ?></i></li>
  178. <?php
  179. $translate_type_no++;
  180. }
  181. }
  182. if(isset($translates['single_words'])){
  183. foreach ($translates['single_words'] as $val){
  184. ?>
  185. <li><?php echo $translate_type_no < 11 ? $val['mean'] :$val['content']; ?><i><?php echo $translate_type_no < 11 ? $val['content'] : $val['mean']; ?></i></li>
  186. <?php
  187. $translate_type_no++;
  188. }
  189. }
  190. }elseif($setting['translate_type'] == 2){ //英译中
  191. if(isset($translates['phrases'])){
  192. foreach ($translates['phrases'] as $val){
  193. ?>
  194. <li><?php echo $val['content']; ?><i><?php echo $val['mean']; ?></i></li>
  195. <?php
  196. $translate_type_no++;
  197. }
  198. }
  199. if(isset($translates['single_words'])){
  200. foreach ($translates['single_words'] as $val){
  201. ?>
  202. <li><?php echo $val['content']; ?><i><?php echo $val['mean']; ?></i></li>
  203. <?php
  204. $translate_type_no++;
  205. }
  206. }
  207. }else{ //中译英
  208. if(isset($translates['phrases'])){
  209. foreach ($translates['phrases'] as $val){
  210. ?>
  211. <li><?php echo $val['mean']; ?><i><?php echo $val['content']; ?></i></li>
  212. <?php
  213. $translate_type_no++;
  214. }
  215. }
  216. if(isset($translates['single_words'])){
  217. foreach ($translates['single_words'] as $val){
  218. ?>
  219. <li><?php echo $val['mean'] ; ?><i><?php echo $val['content']; ?></i></li>
  220. <?php
  221. $translate_type_no++;
  222. }
  223. }
  224. }
  225. }else{ //个性
  226. if(isset($translates['type']) && $translates['type'] == 1){
  227. foreach ($translates['phrases'] as $val){
  228. ?>
  229. <li><?php echo $val['mean']; ?><i><?php echo $val['content']; ?></i></li>
  230. <?php
  231. $translate_type_no++;
  232. }
  233. if(isset($translates['single_words'])){
  234. foreach ($translates['single_words'] as $val){
  235. ?>
  236. <li><?php echo $translate_type_no < 11 ? $val['mean'] : $val['content']; ?><i><?php echo $translate_type_no < 11 ? $val['content'] : $val['mean']; ?></i></li>
  237. <?php
  238. $translate_type_no++;
  239. }
  240. }
  241. }elseif(isset($translates['type']) && $translates['type'] == 2){
  242. if(isset($translates['phrases'])){
  243. foreach ($translates['phrases'] as $val){
  244. ?>
  245. <li><?php echo $val['content']; ?><i><?php echo $val['mean']; ?></i></li>
  246. <?php
  247. $translate_type_no++;
  248. }
  249. }
  250. if(isset($translates['single_words'])){
  251. foreach ($translates['single_words'] as $val){
  252. ?>
  253. <li><?php echo $val['content']; ?><i><?php echo $val['mean']; ?></i></li>
  254. <?php
  255. $translate_type_no++;
  256. }
  257. }
  258. }elseif(isset($translates['type']) && $translates['type'] == 3){
  259. if(isset($translates['phrases'])){
  260. foreach ($translates['phrases'] as $val){
  261. ?>
  262. <li><?php echo $val['mean']; ?><i><?php echo $val['content']; ?></i></li>
  263. <?php
  264. $translate_type_no++;
  265. }
  266. }
  267. if(isset($translates['single_words'])){
  268. foreach ($translates['single_words'] as $val){
  269. ?>
  270. <li><?php echo $val['mean'] ; ?><i><?php echo $val['content']; ?></i></li>
  271. <?php
  272. $translate_type_no++;
  273. }
  274. }
  275. }
  276. }
  277. ?>
  278. </ol>
  279. </div>
  280. </div>
  281. <?php $flag_m_no++; } ?>
  282. <!-- 词汇运用 -->
  283. <?php if($word_apply_ids && $wordApply){
  284. #$wordSpell 单词拼写是否显示
  285. #$sentenceFill 单句语法填空是否显示
  286. # $sentenceTranslate 单句翻译是否显示
  287. if($wordSpell || $sentenceFill || $sentenceTranslate) {
  288. $topic_type = array(47=>'Word Spelling (单词拼写)',55=>'Grammar Gap in Sentence (单句语法填空)',56=>'Sentence Translation (单句翻译)');
  289. $no = 1;
  290. // print_r($word_apply_content);exit;
  291. ?>
  292. <div class="unit-block has-three">
  293. <div class="unit-title b-title">
  294. <img src="<?php echo $server.'/images/magic_word/start.png';?>" alt="" />
  295. <span>(<?php echo $title_m_no[$flag_m_no]; ?>)Word in Practice (单词运用)</span>
  296. </div>
  297. <?php foreach($word_apply_ids as $tp=>$topic_id){
  298. if(array_key_exists($tp,$topic_type)){
  299. if(!$wordSpell && $tp == 47)continue;
  300. if(!$sentenceFill && $tp == 55)continue;
  301. if(!$sentenceTranslate && $tp == 56)continue;
  302. ?>
  303. <div class="type-block">
  304. <div class="type-title">
  305. <div class="type-title-content">
  306. <img src="<?php echo $server.'/images/magic_word/Feather-bg.png';?>" alt="" />
  307. <i><?php echo $title_no[$no];?></i><?php echo isset($topic_type[$tp]) ? $topic_type[$tp] : ''; ?>
  308. </div>
  309. </div>
  310. <ol class="sort-list <?php echo $tp == 56 ? 'b-line' : ''; ?>">
  311. <?php foreach($word_apply_ids[$tp] as $topic_id){
  312. $topic_id = number_format($topic_id,0,null,'');
  313. ?>
  314. <li>
  315. <?php if(isset($word_apply_content[$topic_id])){
  316. echo preg_replace("/<\/?[p|P|article][^>]*>/si","",$word_apply_content[$topic_id]['title']);
  317. $answer = isset($word_apply_content[$topic_id]['items'][0]['options'][0]['option_content']) ? preg_replace("/<\/?[p|P][^>]*>/si","",$word_apply_content[$topic_id]['items'][0]['options'][0]['option_content']) : '';
  318. $analysis = preg_replace("/<\/?[p|P][^>]*>/si","",$word_apply_content[$topic_id]['parse_content']);
  319. echo $tp == 56 ? '<i>'.$answer.'</i>' : '<div class="ans-ana">
  320. <div class="ans">
  321. <em class="ana-lable">【答案】</em>
  322. <span>'.$answer.'</span>
  323. </div>
  324. <p class="analysis">
  325. <em class="ana-lable">【解析】</em>
  326. '.$analysis.'
  327. </p>
  328. </div>';
  329. }else{
  330. continue;
  331. } ?>
  332. </li>
  333. <?php
  334. }
  335. ?>
  336. </ol>
  337. </div>
  338. <?php }?>
  339. <?php
  340. $no++;} $flag_m_no++;
  341. }
  342. }?>
  343. <!-- 语篇训练 -->
  344. <?php if($card_topic_ids && $discourse){
  345. $topic_type = $topic_type_ids;
  346. $no = 1;
  347. ?>
  348. <div class="unit-block has-three">
  349. <div class="unit-title b-title">
  350. <img src="<?php echo $server.'/images/magic_word/start.png';?>" alt="" />
  351. <span>(<?php echo $title_m_no[$flag_m_no]; ?>) Passage Test (语篇训练)</span>
  352. </div>
  353. <?php foreach($card_topic_ids as $tp=>$topic_id){
  354. $card_topic_ids[$tp] = number_format($card_topic_ids[$tp],0,null,'');
  355. $topic_id = number_format($topic_id,0,null,'');
  356. if(array_key_exists($tp,$topic_type)){
  357. ?>
  358. <div class="type-block paragraph">
  359. <div class="type-title">
  360. <div class="type-title-content">
  361. <img src="<?php echo $server.'/images/magic_word/Feather-bg.png';?>" alt="" />
  362. <i><?php echo $title_no[$no];?></i><?php echo isset($topic_type[$tp]) ? $topic_type[$tp] : ''; ?>
  363. </div>
  364. </div>
  365. <article>
  366. <?php echo isset($card_topic_content[$card_topic_ids[$tp]]) ? preg_replace("/(?:height|width)=(\'|\").*?\"/si","",$card_topic_content[$card_topic_ids[$tp]]['title']) : ''; ?>
  367. </article>
  368. <?php if($tp == $topic_type_k_v['reading_comprehension'] ){ ?>
  369. <div class="option-block">
  370. <?php if(isset($card_topic_content[$card_topic_ids[$tp]])){
  371. $topic_no = 1;
  372. $answer_select_display = array(0=>'A',1=>'B',2=>'C',3=>'D',4=>'E',5=>'F',6=>'G',7=>'H',8=>'I');
  373. foreach($card_topic_content[$card_topic_ids[$tp]]['slave'] as $v){
  374. ?>
  375. <div class="question-block">
  376. <p class="question">
  377. <?php echo $topic_no.'.'.preg_replace("/<\/?[p|P][^>]*>/si","",$v['title']) ; ?>
  378. </p>
  379. <ul class="option-list">
  380. <?php if(isset($v['items']['options']) && $v['items']['options']){
  381. foreach($v['items']['options'] as $kkk =>$vvv){
  382. ?>
  383. <li>
  384. <?php echo isset($answer_select_display[$kkk]) ? $answer_select_display[$kkk] : ''; ?>
  385. <?php echo preg_replace("/<\/?[p|P][^>]*>/si","",$vvv['option_content']);?>
  386. </li>
  387. <?php
  388. }
  389. }?>
  390. <!-- --><?php //echo preg_replace("/<\/?[p|P][^>]*>/si","",$v['options']) ; ?>
  391. </ul>
  392. </div>
  393. <?php $topic_no++;}
  394. }?>
  395. </div>
  396. <?php }elseif($tp == $topic_type_k_v['choice_cloze']){
  397. if(isset($card_topic_content[$card_topic_ids[$tp]])){
  398. ?>
  399. <div class="option-block">
  400. <ul class="sort-list">
  401. <?php foreach($card_topic_content[$card_topic_ids[$tp]]['slave'] as $v){
  402. ?>
  403. <li>
  404. <ul class="option-list">
  405. <?php if(isset($v['items']['options']) && $v['items']['options']){
  406. foreach($v['items']['options'] as $vvv){
  407. echo preg_replace("/<\/?[p|P][^>]*>/si","",$vvv['option_content']);
  408. }
  409. }?>
  410. <!-- --><?php //echo preg_replace("/<\/?[p|P][^>]*>/si","",$v['options']) ; ?>
  411. </ul>
  412. </li>
  413. <?php
  414. }?>
  415. </ul>
  416. </div>
  417. <?php
  418. }
  419. }?>
  420. <div class="ans-ana">
  421. <div class="ans-list">
  422. <em class="ans-lable">【答案】</em>
  423. <ul class="sort-list">
  424. <?php
  425. $answer_select_display = array(0=>'A',1=>'B',2=>'C',3=>'D',4=>'E',5=>'F',6=>'G',7=>'H',8=>'I');
  426. foreach($card_topic_content[$card_topic_ids[$tp]]['slave'] as $option_answer){ ?>
  427. <?php
  428. if(isset($option_answer['items']['options']) && $option_answer['items']['options']){
  429. foreach($option_answer['items']['options'] as $kkk=>$vvv) {
  430. if($vvv['option_correct']) {
  431. ?>
  432. <li><?php
  433. if($tp == $topic_type_k_v['grammar_gap_filling']){
  434. echo preg_replace("/<\/?[p|P][^>]*>/si", "", $vvv['option_content']);
  435. }elseif($tp == $topic_type_k_v['sentence_cloze']){
  436. if(count($option_answer['items']['options']) == 1){
  437. echo preg_replace("/<\/?[p|P][^>]*>/si", "", $vvv['option_content']);
  438. }else{
  439. echo isset($answer_select_display[$kkk])? $answer_select_display[$kkk]:'0';
  440. }
  441. }else{
  442. echo isset($answer_select_display[$kkk])? $answer_select_display[$kkk]:'0';
  443. }
  444. ?>
  445. </li>
  446. <?php
  447. }
  448. }
  449. }?>
  450. <!-- <li style="font-weight: bold">--><?php //echo preg_replace("/<\/?[p|P][^>]*>/si","",$option_answer);?><!--</li>-->
  451. <?php }?>
  452. </ul>
  453. </div>
  454. <div class="analysis">
  455. <em class="ana-lable">【解析】</em>
  456. <?php echo $card_topic_content[$card_topic_ids[$tp]]['parse_content']; ?>
  457. </div>
  458. </div>
  459. </div>
  460. <?php }
  461. $no++; }?>
  462. </div>
  463. <?php
  464. } ?>
  465. </div>
  466. </div>
  467. <?php $flag_m_no++;}?>
  468. <div style="page-break-after: always;"></div>
  469. </div>
  470. </div>
  471. <div style="page-break-after: always;"></div>