Subversion Repositories wimsdev

Rev

Rev 13716 | Blame | Compare with Previous | Last modification | View Log | RSS feed

type=classify datalist
textarea="data pre post"
iEdit="pre post"

:¸ù¾ÝÐÔÖʰѶÔÏó·ÖÀà, Êó±êÍÏ·Å.

±¾Á·Ï°Õ¹Ê¾ÁËһЩ¶ÔÏóµÄ±í, ÒªÇó°´ËüÃǵÄÐÔÖÊ×÷·ÖÀà,
ÕâÊÇͨ¹ýÊó±êÍÏ·ÅÀ´ÊµÏÖµÄ.
<p>
ΪÁ˹¹ÔìÕâÖÖÀàÐ͵ÄÁ·Ï°,
Ö»Ðè¸ø³ö¶ÔÏóÒÔ¼°ËüÃǵÄÐÔÖʵıí.
</p><p>
Ö»ÒªÉÔ×÷Ð޸ľÍÄÜʹÓÃͼÏñ¶ÔÏó.</p>
<p class="wims_credits">Ä£¿é×÷Õß: <a href="mailto:qualite@wimsedu.info">Gang Xiao</a></p>

:%%%%%%%%%%%%%%%%%      ×¢       Òâ      %%%%%%%%%%%%%%%%%%%%

Èç¹ûÄãɾȥÁ˱¾·¶ÀýÖеıêÇ© (¼´¸úËæÔÚðºÅ ':' ºóÃæµÄÄǼ¸ÐÐ),
ÄÇôҲÇëɾȥÕâ¸öÍ·²¿, ·ñÔòÓпÉÄܻز»µ½ Createxo.

:%%%%%%%%%%%%%%%%%   ±»ÖØÐ¶¨ÒåµÄ²ÎÊýʾÀý   %%%%%%%%%%%%%%%%%%

:\title{°´ÐÔÖÊ·ÖÀà}
:\author{XIAO Gang}
:\email{qualite@wimsedu.info}
:\credits{}

:ÔÚÁ·Ï°ÖÐÐèÒª·ÖÀàµÄ¶ÔÏó¸öÊý. ÖÁ¶à 20 ¸ö.
\integer{tot=8}

: ±»Õ¹Ê¾µÄ¾ßÓÐÏàͬÐÔÖʵĶÔÏóµÄ×î´ó¸öÊý.
Õâ¸öÊý×ÖÓ¦¸ÃÑϸñ´óÓÚ 1.
\integer{max1=4}

: ÓûչʾµÄÐÔÖÊÊý (ĬÈϾÍÊÇÐÔÖÊÊý)
Èô´ËÊýСÓÚÐÔÖÊÊý,
»áÔÚδÌáÈ¡µÄÐÔÖÊÖÐѡһ¸öÏÐÖÃÏî.
\text{prop_cnt=}

:±»ÍϷŶÔÏóµÄ´óС, ÒÔÏñËØÎªµ¥Î», x ³Ë y.
¿¼Âǵ½Óû§¿ÉÄÜ»áÔö´óä¯ÀÀÆ÷µÄ×ÖÌå, Òò´Ë²»ÄÜÈ¡µÃ̫С.
\text{size1=100x40}

:ÐÔÖʵıí. ×î¶à 10, ÓöººÅ·Ö¸ô.
\text{prop=À¥³æ,ÄñÀà,²¸È鶯Îï}

:Ö÷ÒªÊý¾Ý.
ÿ¸ö¶ÔÏóÕ¼Ò»ÐÐ, ÏÈÊÇÃû³Æ, È»ºóÊÇÐÔÖÊ,
ÓöººÅ·Ö¸ô. <p>
×îºÃÿ¸ö·¶³ë¶¼º¬ÓÐ×ã¹»ÊýÁ¿µÄ¶ÔÏó.
×¢ÒâÔÚÊäÈëÐÔÖÊʱ²»Òª³öÏÖ´ò×Ö´íÎó!
·ñÔòÕâ¸ö¶ÔÏó»áʹÁ·Ï°±ÀÀ£.
\matrix{data=
Ó¥,ÄñÀà
ÐÅÌìÎÌ,ÄñÀà
Ö©Öë,À¥³æ
Ѽ, ÄñÀà
è, ²¸È鶯Îï
Âí,²¸È鶯Îï
¹·,²¸È鶯Îï
Öí,²¸È鶯Îï
ÎÚÑ»,ÄñÀà
òÆòì,À¥³æ
Ïó,²¸È鶯Îï
ÁÔÓ¥,ÄñÀà
º£Å¸,ÄñÀà
òÚò¼,À¥³æ
·ä,À¥³æ
ʨ×Ó,²¸È鶯Îï
Ñà×Ó,ÄñÀà
Ó¬,À¥³æ
ÎÃ,À¥³æ
Ñò,²¸È鶯Îï
¶ì,ÄñÀà
ºûµû,À¥³æ
¸ë,ÄñÀà
ºüÀê,²¸È鶯Îï
ҹݺ,ÄñÀà
Ы,À¥³æ
ºï,²¸È鶯Îï
»¢,²¸È鶯Îï
Å£,²¸È鶯Îï
}

:Ñ¡Ïî.
Èç¹ûÄãÏëËæ»úÅÅÁÐÐÔÖʵĴÎÐò, ¿ÉʹÓÃÑ¡Ïî "shuffle".
\text{option=}

:±í¸ñÇ°ÃæµÄÎÄ×Ö. ¿ÉÒÔʹÓà html ±ê×¢.
\text{pre=Çë¸ù¾ÝËù¸ø·¶³ë·ÖÀàÏÂÁж¯Îï.}

:±í¸ñºóÃæµÄÎÄ×Ö. ¿ÉÒÔʹÓà html ±ê×¢.
\text{post=}

:ÔÚ·¶³ëǰµÄϵ´Ê.
\text{estun=ÊÇ}

:ÈçºÎ³Æºô²»ÄÜ·ÖÀàµÄ¶ÔÏó?
\text{noclass=²»ÊôÓÚÈκη¶³ë}

:%%%%%%%%%%%%%%       ²»Òª¸Ä¶¯ÏÂÃæÕâ¶ÎÃüÁî          %%%%%%%%%%%%%%%%

\integer{pcnt=items(\prop)}
\integer{prop_cnt=\prop_cnt=? \pcnt}
\integer{prop_cnt=min(\prop_cnt,\pcnt)}
\integer{datacnt=rows(\data)}
\integer{max2=\max1+1}
\integer{tot=\tot<\pcnt?\pcnt}
\text{prop=\pcnt>1 and shuffle iswordof \option?shuffle(\prop)}

\text{first=}
\text{firsti=}
\text{second=}
\text{secondi=}
\text{dist=}
\text{disti=}
\for{i=1 to \prop_cnt}{
 \text{t=shuffle(column(1,wims(select \data where column 2 issametext \prop[\i])))}
 \integer{s=min(\max1,items(\t))}
 \text{first=wims(append item \t[1] to \first)}
 \text{firsti=wims(append item \i to \firsti)}
 \if{\s > 1}{
  \text{second=wims(append item \t[2..\s] to \second)}
  \text{secondi=wims(append item wims(makelist \i for x=2 to \s) to \secondi)}
 }
}
distracteur
\if{\prop_cnt<\pcnt}{
 \text{t=shuffle(column(1,wims(select \data where column 2 issametext \prop[\prop_cnt+1])))}
 \integer{s=min(\max1,items(\t))}
 \text{dist=wims(append item \t[1] to \dist)}
 \text{disti=wims(append item \i to \disti)}
}

\if{\tot>\prop_cnt}{
 \integer{scnt=items(\second)}
 \integer{secnt=min(\tot-\prop_cnt,\scnt)}
 \integer{tot=\prop_cnt+\secnt}
 \text{sh2=shuffle(\scnt)}
 \text{sh2=\sh2[1..\secnt]}
 \text{second=item(\sh2,\second)}
 \text{secondi=item(\sh2,\secondi)}
 \text{all=\first,\second}
 \text{alli=\firsti,\secondi}
}{
 \text{all=\first}
 \text{alli=\firsti}
}
\text{all=wims(nonempty items \all)}
\text{all=wims(listuniq \all)}
\integer{acnt=items(\all)}
\text{sh=shuffle(\acnt)}
\text{all=item(\sh,\all)}
\text{alli=item(\sh,\alli)}
\text{prop=\prop[1..\prop_cnt]}
\text{props=wims(tolower \prop)}
\text{alls=wims(tolower \all)}
\text{size=\size1 x \max2}
\text{sizev=\size x \max2}
\text{rep=item(1..\prop_cnt,wims(makelist r x for x=1 to 10))}
\steps{\rep}
\integer{distc=\dist!= ? 1 : 0}
\conditions{wims(makelist x for x=1 to \acnt + \distc)}

:%%%%%%%%%%%%% ÏÖÔÚ¿ÉÒÔÓà html ¸ñʽÌîÈëÎÊÌâµÄ³ÂÊö  %%%%%%%%%%%%%%%%%%%%%%%%%

::ÔÚÎÄÖпÉʹÓà \embed{reply 3,\size} ±íʾµÚ 3 ¸ö»Ø´ðÀ¸ <p>
Óà \prop[4] »ò \props[4] Ö¸µÚ 4 ¸öÐÔÖÊ, ǰÕß±íʾÊ××Öĸ´óд,
ºóÕß±íʾÊ××ÖĸСд.

\statement{<div class="instruction">
\pre
</div>
<table class="wimsnoborder">
\if{vertical iswordof \option}{
  <tr>\for{k=1 to \prop_cnt}{<th>\prop[\k]</th>}</tr>
  <tr>\for{k=1 to \prop_cnt}{
    <td style="text-align:left;vertical-align:top">\embed{reply \k, \sizev}</td>}
  </tr>
}{
  \for{k=1 to \prop_cnt}{
   <tr>
     <th>\prop[\k]</th>
     <td style="text-align:left">\embed{reply \k, \size}</td>
   </tr>
  }
 }
</table>
\post
}

:%%%%%%%%%%%%%      ²»Òª¸Ä¶¯ÒÔϵÄÃüÁî        %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\answer{\prop[1]}{\r1;\all,\dist}{type=dragfill}
\answer{\prop[2]}{\r2}{type=dragfill}
\answer{\prop[3]}{\r3}{type=dragfill}
\answer{\prop[4]}{\r4}{type=dragfill}
\answer{\prop[5]}{\r5}{type=dragfill}
\answer{\prop[6]}{\r6}{type=dragfill}
\answer{\prop[7]}{\r7}{type=dragfill}
\answer{\prop[8]}{\r8}{type=dragfill}
\answer{\prop[9]}{\r9}{type=dragfill}
\answer{\prop[10]}{\r10}{type=dragfill}

\text{totans=item(1..\prop_cnt,
        wims(items2words \r1),
        wims(items2words \r2),
        wims(items2words \r3),
        wims(items2words \r4),
        wims(items2words \r5),
        wims(items2words \r6),
        wims(items2words \r7),
        wims(items2words \r8),
        wims(items2words \r9),
        wims(items2words \r10))}
text{totans=wims(replace internal &#39; to ' in \totans)}
\text{clean=}
\text{check=}
\for{t=1 to \acnt}{
 \integer{cat=0}
 \for{r=1 to \prop_cnt}{
  \integer{cat=\all[\t] iswordof \totans[\r]?\r}
 }
 \if{\cat > 0}{
  \text{clean=\clean \estun \props[\cat],}
  \text{check=\alli[\t]=\cat?\check 1,:\check 0,}
 }{
  \text{clean=\clean \noclass,}
  \text{check=\check 0,}
 }
}

\if{\dist!=}{
 \for{t=1 to 1}{
   \integer{cat=0}
   \for{r=1 to \prop_cnt}{
    \integer{cat=\dist[\t] iswordof \totans[\r]?\r}
   }
 \if{\cat = 0}{
   \text{clean=\clean \dist[\t] \noclass,}
   \text{check=\check 1,}
  }{
   \text{clean=\clean \dist[\t] \estun \props[\cat],}
   \text{check=\check 0,}
  }
 }
}

\condition{\all[1] \clean[1]}{\check[1]=1}
\condition{\all[2] \clean[2]}{\check[2]=1}
\condition{\all[3] \clean[3]}{\check[3]=1}
\condition{\all[4] \clean[4]}{\check[4]=1}
\condition{\all[5] \clean[5]}{\check[5]=1}
\condition{\all[6] \clean[6]}{\check[6]=1}
\condition{\all[7] \clean[7]}{\check[7]=1}
\condition{\all[8] \clean[8]}{\check[8]=1}
\condition{\all[9] \clean[9]}{\check[9]=1}
\condition{\all[10] \clean[10]}{\check[10]=1}
\condition{\all[11] \clean[11]}{\check[11]=1}
\condition{\all[12] \clean[12]}{\check[12]=1}
\condition{\all[13] \clean[13]}{\check[13]=1}
\condition{\all[14] \clean[14]}{\check[14]=1}
\condition{\all[15] \clean[15]}{\check[15]=1}
\condition{\all[16] \clean[16]}{\check[16]=1}
\condition{\all[17] \clean[17]}{\check[17]=1}
\condition{\all[18] \clean[18]}{\check[18]=1}
\condition{\all[19] \clean[19]}{\check[19]=1}
\condition{\all[20] \clean[20]}{\check[20]=1}