!set title=9: Cuadrado + diagonales
!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
varcnt=109
prevarcnt=89
postvarcnt=19
replycnt=9
choicecnt=0
conditioncnt=4
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(5)]
val10=-1,0,1,-1,0,1,-1,0,1
val11=1,1,1,0,0,0,-1,-1,-1
val12=1,3,5,7,9
val13=2,1,3,5;4,1,5,7;6,3,5,9;8,7,5,9
val14=0,0.5;-0.5,0;0.5,0;0,-0.5
val15=$[rint(120)]
val16=$[rint(100)]
val17=$[rint(1)]
val18=$[rint(1)]
val19=0.3
val20=1,3,9,7,1,9,7,3
val21=
val22=$[rint(3)]
val23=$[rint($val9+4)]

!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

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

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

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

!ifval $val33 =
val33= 60
!endif

!ifval $val34=
val34= 35
!endif
val35=$val33 $val34
tmp=!translate internal $	$ to ; in $val26

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

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

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

val41=$(tmp0)
!else
tmp0=!values $val39*x for x=$val37 to $val38

val41=$(tmp0)
!endif
val26=$val41
!else
val40=listed
!endif
tmp0=!mathsubst f=$(val24[1]) in $val26

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

val26=$(tmp0)
tmp0=!mathsubst rt=$val25 in $val26

val26=$(tmp0)
tmp0=!shuffle $val26

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

val42=$(tmp1)
tmp0=!values 0 for x=1 to $val23

val43=$(tmp0)
!for val44 =1 to $val9 
tmp0=!replace item number $(val12[$val44]) by $(val42[$val44]) in $val43

val43=$(tmp0)
!next

!ifval $val29<0
tmp0=!randint $val22*$val29, $val22*$val30

val45=$[$(tmp0)]
!else
tmp1=!randint 2*$val31, 2*$val30

val45=$[	     ($val22-1)*$val31+$(tmp1)]
!endif
tmp=!translate internal $	$ to ; in $val13

tmp0=!rowcnt $tmp
val46=$[rint($(tmp0))]
!for val39 =1 to $val46 
val47=$(val13[$val39;])
tmp0=!itemcnt $val47

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

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

val43=$(tmp0)
!next
val51=
tmp0=!listcomplement $val43 in $val26

val52=$(tmp0)
tmp0=!itemcnt $val52

val53=$[rint(min($val3,$(tmp0)))]
!for val44 =1 to $val53 
tmp0=!item 1 to $val3 of $val52

val54=$(tmp0)

!ifval / isin $(val54[$val44])
tmp0=!replace / by /( in \($(val54[$val44])))

val49=$(tmp0)
!else
val49=\($(val54[$val44]))
!endif
val51=$val51,$val49
!next
val32=
!for val44 =1 to $val23 
!if / isin $(val43[$val44]) 
tmp0=!replace / by /( in \($(val43[$val44])))

val49=$(tmp0)
!else
val49=\($(val43[$val44]))
!endif
tmp0=!append item $val49 to $val32

val32=$(tmp0)
!next
val55=lines black
!for val50  in $val20 
val55=$val55,$(val10[$val50]),$(val11[$val50])
!next
val56=
!for val50 =1 to 4 
val56=$val56	fill $(val14[$val50;]),$(val6[$val50])
!next
val57=$[rint(2*($val17+$val19)*$val15)]
val58=$[rint(2*($val18+$val19)*$val16)]
!readproc oef/draw.phtml $val57,$val58 \
 xrange -$val19-$val17,$val17+$val19	 yrange -$val19-$val18,$val18+$val19	 fill 0,0,white	 linewidth 3	 $val55	 $val21	 $val56	 
tmp0=$ins_url
val59=$(tmp0)
tmp0=!values x*$val15+$val57/2-$val33/2 for x in $val10

val10=$(tmp0)
tmp0=!values -y*$val16+$val58/2-$val34/2 for y in $val11

val11=$(tmp0)
val60=
!for val50 =1 to $val23 
val60=$val60	r$val50,$(val10[$val50])x$(val11[$val50])
!next
tmp0=!item 1 to $val23 of r1,r2,r3,r4,r5,r6,r7,r8,r9

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

!goto stat

!exit

:question
$()Rellenar la imagen con los objetos dados,	de manera que la suma de los elementos que limitan cada región coloreada	sea igual a $val45.	<p><center>	  
!read oef/special.phtml imagefill $val59,$val57 $val58,$val35	$val60	 
$()	</center>	
$()
!exit

:hint
$()
$()
!exit

:help
$()
$()
!exit

:solution
$()
$()
!exit

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

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

val72=$(tmp0)
val73=$val45
val74=$val45
val75=$val45
val76=$val45
val77=$val45
val78=$val45
!for val44 =1 to 8 

!ifval $(val13[1;$val44]) notsametext
val73=$val73-($(val72[$(val13[1;$val44])]))
!endif

!ifval $(val13[2;$val44]) notsametext
val74=$val74-($(val72[$(val13[2;$val44])]))
!endif

!ifval $(val13[3;$val44]) notsametext
val75=$val75-($(val72[$(val13[3;$val44])]))
!endif

!ifval $(val13[4;$val44]) notsametext
val76=$val76-($(val72[$(val13[4;$val44])]))
!endif

!ifval $(val13[5;$val44]) notsametext
val77=$val77-($(val72[$(val13[5;$val44])]))
!endif

!ifval $(val13[6;$val44]) notsametext
val78=$val78-($(val72[$(val13[6;$val44])]))
!endif
!next
tmp=!translate ";': to $     $ in $val73

tmp=!lower $tmp
tmp0=!exec maxima fullratsimp($tmp);
val73=$(tmp0)
tmp=!translate ";': to $     $ in $val74

tmp=!lower $tmp
tmp0=!exec maxima fullratsimp($tmp);
val74=$(tmp0)
tmp=!translate ";': to $     $ in $val75

tmp=!lower $tmp
tmp0=!exec maxima fullratsimp($tmp);
val75=$(tmp0)
tmp=!translate ";': to $     $ in $val76

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

!exit

:feedback

!exit

:test

!ifval $val73 notsametext and $val73=0
 condtest1=1
!else
 condtest1=0
!endif
condname1=Suma para la <font color=$(val6[1])>región $(val8[1])</font>	 = $val45

!ifval $val74 notsametext and $val74=0
 condtest2=1
!else
 condtest2=0
!endif
condname2=Suma para la <font color=$(val6[2])>región $(val8[2])</font>	 = $val45

!ifval $val75 notsametext and $val75=0
 condtest3=1
!else
 condtest3=0
!endif
condname3=Suma para la <font color=$(val6[3])>región $(val8[3])</font>	 = $val45

!ifval $val76 notsametext and $val76=0
 condtest4=1
!else
 condtest4=0
!endif
condname4=Suma para la <font color=$(val6[4])>región $(val8[4])</font>	 = $val45

!exit

:stat
vsavelist=6,8,13,23,35,44,45,57,58,59,60,62,63,64,65,66,67,68,69,70
embedcnt=1
