@@ -53,6 +53,9 @@ Vue.component('question', {
53
53
//是否存在知识点
54
54
existknl : t => ! $api . isnull ( t . knowledge ) ,
55
55
} ,
56
+ updated : function ( ) {
57
+ //this.$mathjax();
58
+ } ,
56
59
mounted : function ( ) { } ,
57
60
methods : {
58
61
//始始化的方法
@@ -66,17 +69,19 @@ Vue.component('question', {
66
69
th . ques = req . data . result ;
67
70
th . getKnowledge ( th . ques ) ;
68
71
th . ques = th . parseAnswer ( th . ques ) ;
69
-
72
+ console . error ( th . ques )
70
73
th . $nextTick ( function ( ) {
71
74
var dom = $dom ( "dd[qid='" + th . ques . Qus_ID + "']" ) ;
75
+ let title = dom . find ( 'card-title' ) ;
72
76
//清理空元素
73
77
window . ques . clearempty ( dom . find ( 'card-title' ) ) ;
74
78
window . ques . clearempty ( dom . find ( '.ans_area' ) ) ;
75
79
//公式渲染
76
80
th . $mathjax ( [ dom [ 0 ] ] ) ;
77
81
window . setTimeout ( function ( ) {
78
82
th . setfontsize ( th . fontsize ) ;
79
- } , 20 ) ;
83
+ th . $mathjax ( [ dom [ 0 ] ] ) ;
84
+ } , 200 ) ;
80
85
81
86
} ) ;
82
87
} else {
@@ -95,6 +100,10 @@ Vue.component('question', {
95
100
var size = 16 , min_size = 12 , max_size = 30 ;
96
101
ergodic ( $dom ( "dl.quesArea dd[qid='" + this . qid + "']" ) , num ) ;
97
102
function ergodic ( dom , num ) {
103
+ //如果是公式,则不处理
104
+ let domname = dom [ 0 ] . tagName . toLowerCase ( ) ;
105
+ if ( domname . toLowerCase ( ) == 'mjx-container' ) return ;
106
+ //
98
107
var fontsize = parseInt ( dom . css ( "font-size" ) ) ;
99
108
fontsize = isNaN ( fontsize ) ? size : fontsize ;
100
109
if ( num < 0 && fontsize + num > min_size ) fontsize += num ;
@@ -299,16 +308,16 @@ Vue.component('question', {
299
308
let answer = ques . Qus_Items [ i ] . answer ; //答题信息
300
309
ansstr . push ( answer ) ;
301
310
let items = ques . Qus_Items [ i ] . Ans_Context . split ( "," ) ; //正确答案
302
- if ( ! items . includes ( answer ) ) {
311
+ if ( ! items . includes ( answer ) ) {
303
312
correct = false ;
304
313
break ;
305
314
}
306
315
}
307
316
ques . Qus_Answer = ansstr . join ( ',' ) ;
308
317
this . state [ 'ans' ] = ansstr . join ( ',' ) ;
309
- this . state [ 'correct' ] = ansstr . length > 0 ? ( correct ? "succ" : "error" ) : "null" ;
318
+ this . state [ 'correct' ] = ansstr . length > 0 ? ( correct ? "succ" : "error" ) : "null" ;
310
319
if ( correct ) this . $parent . swipe ( { 'direction' : 2 } ) ;
311
- return correct ;
320
+ return correct ;
312
321
}
313
322
} ,
314
323
template : `<dd :qid="qid" :current="current" :render="init">
0 commit comments