!set title=7: Asterisco
!if $wims_read_parm!=$empty
 !goto $wims_read_parm
!endif
oef2wims_version=3.22
language=es
author=XIAO, Gang
email=xiao@unice.fr
computeanswer=no
precision=10000

ansorder=r,r,r,r,r,r,r,r,r,r
varcnt=92
prevarcnt=86
postvarcnt=5
replycnt=10
choicecnt=0
conditioncnt=3
feedbackcnt=0
format=html

val1=$imagedir
val2=$confparm1
val3=$confparm2
val4=$confparm3
val5=$confparm4

!if $testcondition=yes
 !goto test
!endif
!if $status=waiting
 !exit
!endif

val6=red,green,blue,gray,orange,cyan,violet,black
val7=rojo,verde,azul,gris,naranja,cián,violeta,negro
val8=roja,verde,azul,gris,naranja,cián,violeta,negra
val9=$[rint(4)]
val10=$[rint(7)]
val11=0,-1,1,-2,2,-1,1
val12=0,1,1,0,0,-1,-1
val13=1,2,3,4
val14=5,1,4;6,1,3;7,1,2
val15=$[rint(65)]
val16=$[rint(100)]
val17=$[rint(2)]
val18=$[rint(1)]
val19=$val8
val20=línea
val21=de la

!ifval $val2 issametext 
val2=$[rint(1)]
!endif

!ifval $val3 issametext 
val3=$[rint(0)]
!endif
tmp0=!shuffle a,b,c,d,r,s,t,x,y,z

val22=$(tmp0)
tmp0=!randitem 2,3,5

val23=sqrt($(tmp0))
tmp0=!record $val2 of src/data

val24=$(tmp0)
val25=$(val24[1;])
val26=$(val24[2;])
val27=$(val24[3;1])
val28=$(val24[3;2])
val29=$[rint(($val27+$val28)/2)]
val30=$(val26[1])
val31=$(val26[2])
val32=$(val26[3])

!ifval $val31 =
val31= 60
!endif

!ifval $val32=
val32= 35
!endif
val33=$val31 $val32
tmp=!translate internal $	$ to ; in $val24

tmp=!row 4 to -1 of $tmp
tmp0=!translate internal $\
$ to ; in $tmp
tmp1=!rows2lines $(tmp0)

val24=$(tmp1)
tmp0=!itemcnt $val24

val34=$[rint($(tmp0))]
!if $val34<=3 
val35=$(val24[1])
val36=$(val24[2])
val37=$(val24[3])
val38=computed
!if $val37<0 
tmp0=!values $val37*x,-($val37)*x for x=$val35 to $val36

val39=$(tmp0)
!else
tmp0=!values $val37*x for x=$val35 to $val36

val39=$(tmp0)
!endif
val24=$val39
!else
val38=listed
!endif
tmp0=!mathsubst f=$(val22[1]) in $val24

val24=$(tmp0)
tmp0=!mathsubst g=$(val22[2]) in $val24

val24=$(tmp0)
tmp0=!mathsubst rt=$val23 in $val24

val24=$(tmp0)
tmp0=!shuffle $val24

tmp1=!item 1 to $val9 of $(tmp0)

val40=$(tmp1)
tmp0=!values 0 for x=1 to $val10

val41=$(tmp0)
!for val42 =1 to $val9 
tmp0=!replace item number $(val13[$val42]) by $(val40[$val42]) in $val41

val41=$(tmp0)
!next

!ifval $val27<0
tmp0=!randint 2*$val27, 2*$val28

val43=$[$(tmp0)]
!else
tmp1=!randint 2*$val29, 2*$val28

val43=$[$val29+$(tmp1)]
!endif
tmp=!translate internal $	$ to ; in $val14

tmp0=!rowcnt $tmp
val44=$[rint($(tmp0))]
!for val37 =1 to $val44 
val45=$(val14[$val37;])
tmp0=!itemcnt $val45

val46=$[rint($(tmp0))]
val47=($val43)
!for val48 =2 to $val46 
val47=$val47-($(val41[$(val45[$val48])]))
!next
!if $val38 issametext computed 
val47=$[$val47]
!else
t_=!replace internal \( by ( in expand($val47)
tmp0=!exec maxima $t_

val47=$(tmp0)
!endif
tmp0=!replace item number $(val45[1]) by $val47 in $val41

val41=$(tmp0)
!next
val49=
tmp0=!listcomplement $val41 in $val24

val50=$(tmp0)
tmp0=!itemcnt $val50

val51=$[rint(min($val3,$(tmp0)))]
!for val42 =1 to $val51 
tmp0=!item 1 to $val3 of $val50

val52=$(tmp0)

!ifval / isin $(val52[$val42])
tmp0=!replace / by /( in \($(val52[$val42])))

val47=$(tmp0)
!else
val47=\($(val52[$val42]))
!endif
val49=$val49,$val47
!next
val30=
!for val42 =1 to $val10 
!if / isin $(val41[$val42]) 
tmp0=!replace / by /( in \($(val41[$val42])))

val47=$(tmp0)
!else
val47=\($(val41[$val42]))
!endif
tmp0=!append item $val47 to $val30

val30=$(tmp0)
!next
val53=
!for val42 =1 to $val44 
val45=$(val14[$val42;])
val53=$val53	lines $(val6[$val42]),$(val11[$(val45[1])]),$(val12[$(val45[1])]),$(val11[$(val45[2])]),$(val12[$(val45[2])]),$(val11[$(val45[3])]),$(val12[$(val45[3])])	
!next
val54=0.3
val55=$[rint(2*($val17+$val54)*$val15)]
val56=$[rint(2*($val18+$val54)*$val16)]
!readproc oef/draw.phtml $val55,$val56 \
 xrange -$val54-$val17,$val17+$val54	 yrange -$val54-$val18,$val18+$val54	 fill 0,0,white	 linewidth 3	 $val53	 
tmp0=$ins_url
val57=$(tmp0)
tmp0=!values x*$val15+$val55/2-$val31/2 for x in $val11

val11=$(tmp0)
tmp0=!values -y*$val16+$val56/2-$val32/2 for y in $val12

val12=$(tmp0)
val58=
!for val48 =1 to $val10 
val58=$val58	r$val48,$(val11[$val48])x$(val12[$val48])
!next
tmp0=!item 1 to $val10 of r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15

val59=$(tmp0)
oefsteps=$val59 
nextstep=!nosubst $val59 
!readproc oef/steps.proc
replytype1=dragfill
replyname1=Caja 1
replygood1=?analyze 60;$(val30[1])$val49
replytype2=dragfill
replyname2=Caja 2
replygood2=?analyze 61;$(val30[2])
replytype3=dragfill
replyname3=Caja 3
replygood3=?analyze 62;$(val30[3])
replytype4=dragfill
replyname4=Caja 4
replygood4=?analyze 63;$(val30[4])
replytype5=dragfill
replyname5=Caja 5
replygood5=?analyze 64;$(val30[5])
replytype6=dragfill
replyname6=Caja 6
replygood6=?analyze 65;$(val30[6])
replytype7=dragfill
replyname7=Caja 7
replygood7=?analyze 66;$(val30[7])
replytype8=dragfill
replyname8=Caja 8
replygood8=?analyze 67;$(val30[8])
replytype9=dragfill
replyname9=Caja 9
replygood9=?analyze 68;$(val30[9])
replytype10=dragfill
replyname10=Caja 10
replygood10=?analyze 69;$(val30[10])
question=__EXECUTED_1692754_EXERCISE__

!goto stat

!exit

:question
$()Rellenar la imagen con los objetos dados,	de manera que la suma de cada $val20 sea igual a $val43.	<p><center>	  
!read oef/special.phtml imagefill $val57,$val55 $val56,$val33	$val58	 
$()	</center>	
$()
!exit

:hint
$()
$()
!exit

:help
$()
$()
!exit

:solution
$()
$()
!exit

:postdef
tmp0=!item 1 to $val10 of $val60,$val61,$val62,$val63,$val64,$val65,$val66,$val67,$val68,$val69,\r11,\r12,\r13,\r14,\r15

val70=$(tmp0)
tmp0=!replace internal \ by in $val70

val71=$(tmp0)
tmp=!translate ";': to $     $ in $val43-($(val71[$(val14[1;1])]))-($(val71[$(val14[1;2])]))-($(val71[$(val14[1;3])]))

tmp=!lower $tmp
tmp0=!exec maxima fullratsimp($tmp);
val72=$(tmp0)
tmp=!translate ";': to $     $ in $val43-($(val71[$(val14[2;1])]))-($(val71[$(val14[2;2])]))-($(val71[$(val14[2;3])]))

tmp=!lower $tmp
tmp0=!exec maxima fullratsimp($tmp);
val73=$(tmp0)
tmp=!translate ";': to $     $ in $val43-($(val71[$(val14[3;1])]))-($(val71[$(val14[3;2])]))-($(val71[$(val14[3;3])]))

tmp=!lower $tmp
tmp0=!exec maxima fullratsimp($tmp);
val74=$(tmp0)

!exit

:feedback

!exit

:test

!ifval $val72 notsametext and $val72=0
 condtest1=1
!else
 condtest1=0
!endif
condname1=Suma $val21 <font color=$(val6[1])>$val20 $(val19[1])</font>	 = $val43

!ifval $val73 notsametext and $val73=0
 condtest2=1
!else
 condtest2=0
!endif
condname2=Suma $val21 <font color=$(val6[2])>$val20 $(val19[2])</font>	 = $val43

!ifval $val74 notsametext and $val74=0
 condtest3=1
!else
 condtest3=0
!endif
condname3=Suma $val21 <font color=$(val6[3])>$val20 $(val19[3])</font>	 = $val43

!exit

:stat
vsavelist=6,10,14,19,20,21,33,43,55,56,57,58,60,61,62,63,64,65,66,67,68,69
embedcnt=1
