!set title=~10: Pentagrama
!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=97
prevarcnt=89
postvarcnt=7
replycnt=10
choicecnt=0
conditioncnt=5
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)]
tmp0=!values sin(2*n*pi/5) for n=0 to 4

tmp1=!values -sin(2*n*pi/5)*0.381966 for n=0 to 4

val10=$(tmp0),	        $(tmp1)
tmp0=!values cos(2*n*pi/5)-0.1 for n=0 to 4

tmp1=!values -cos(2*n*pi/5)*0.381966-0.1 for n=0 to 4

val11=$(tmp0),	        $(tmp1)
val12=$[rint(200)]
val13=$[rint(200)]
val14=$[rint(1)]
val15=$[rint(1)]
val16=$[0.07]
val17=$[rint($val9 + 5)]
val18=$val8
val19=línea
val20=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

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

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

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

!ifval $val30 =
val30= 60
!endif

!ifval $val31=
val31= 35
!endif
val32=$val30 $val31
tmp=!translate internal $	$ to ; in $val23

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

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

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

val38=$(tmp0)
!else
tmp0=!values $val36*x for x=$val34 to $val35

val38=$(tmp0)
!endif
val23=$val38
!else
val37=listed
!endif
tmp0=!mathsubst f=$(val21[1]) in $val23

val23=$(tmp0)
tmp0=!mathsubst g=$(val21[2]) in $val23

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

val23=$(tmp0)
tmp0=!shuffle $val23

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

val39=$(tmp1)
tmp0=!values 0 for x=1 to 15

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

val40=$(tmp0)
tmp0=!replace item number $val41+10 by -($(val39[$val41])) in $val40

val40=$(tmp0)
!next

!ifval $val26<0
tmp0=!randint $val26, $val27

val42=$[rint($(tmp0))]
!else
tmp1=!randint $val28, $val27

val42=$[rint($val28+$(tmp1))]
!endif
val43=6,3,4,11;7,4,5,12;8,1,5,13;9,1,2,14;10,2,3,15
tmp=!translate internal $	$ to ; in $val43

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

val46=$[rint($(tmp0))]
val47=($val42)
!for val48 =2 to $val46 
val47=$val47-($(val40[$(val45[$val48])]))
!next
!if $val37 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 $val40

val40=$(tmp0)
!next
val49=
tmp0=!listcomplement $val40 in $val23

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

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

val52=$(tmp0)

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

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

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

val29=$(tmp0)
!next
val42=$[rint($val42*2)]
val40=$(val40[1..10])
val43=1,3,9,10;2,4,6,10;3,5,6,7;1,4,7,8;2,5,8,9
val53=1,3,5,2,4,1
val54=
!for val48 =1 to 5 
val54=$val54	line $(val10[$(val53[$val48])]),$(val11[$(val53[$val48])]),$(val10[$(val53[$val48+1])]),$(val11[$(val53[$val48+1])]),$(val6[$val48])
!next
val55=$[rint(2*($val14+$val16)*$val12)]
val56=$[rint(2*($val15+$val16)*$val13)]
!readproc oef/draw.phtml $val55,$val56 \
 xrange -$val16-$val14,$val14+$val16	 yrange -$val16-$val15,$val15+$val16	 fill 0,0,white	 linewidth 3	 $val54	 
tmp0=$ins_url
val57=$(tmp0)
tmp0=!values x*$val12+$val55/2-$val30/2 for x in $val10

val10=$(tmp0)
tmp0=!values -y*$val13+$val56/2-$val31/2 for y in $val11

val11=$(tmp0)
val58=
!for val48 =1 to $val17 
val58=$val58	r$val48,$(val10[$val48])x$(val11[$val48])
!next
tmp0=!item 1 to $val17 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;$(val29[1])$val49
replytype2=dragfill
replyname2=Caja 2
replygood2=?analyze 61;$(val29[2])
replytype3=dragfill
replyname3=Caja 3
replygood3=?analyze 62;$(val29[3])
replytype4=dragfill
replyname4=Caja 4
replygood4=?analyze 63;$(val29[4])
replytype5=dragfill
replyname5=Caja 5
replygood5=?analyze 64;$(val29[5])
replytype6=dragfill
replyname6=Caja 6
replygood6=?analyze 65;$(val29[6])
replytype7=dragfill
replyname7=Caja 7
replygood7=?analyze 66;$(val29[7])
replytype8=dragfill
replyname8=Caja 8
replygood8=?analyze 67;$(val29[8])
replytype9=dragfill
replyname9=Caja 9
replygood9=?analyze 68;$(val29[9])
replytype10=dragfill
replyname10=Caja 10
replygood10=?analyze 69;$(val29[10])
question=__EXECUTED_1692754_EXERCISE__

!goto stat

!exit

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

:hint
$()
$()
!exit

:help
$()
$()
!exit

:solution
$()
$()
!exit

:postdef
tmp0=!item 1 to $val17 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 $val42-($(val71[$(val43[1;1])]))-($(val71[$(val43[1;2])]))-($(val71[$(val43[1;3])]))-($(val71[$(val43[1;4])]))

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

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

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

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

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

!exit

:feedback

!exit

:test

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

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

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

!ifval $val75 notsametext and $val75=0
 condtest4=1
!else
 condtest4=0
!endif
condname4=Suma $val20 <font color=$(val6[4])>$val19 $(val18[4])</font>	 = $val42

!ifval $val76 notsametext and $val76=0
 condtest5=1
!else
 condtest5=0
!endif
condname5=Suma $val20 <font color=$(val6[5])>$val19 $(val18[5])</font>	 = $val42

!exit

:stat
vsavelist=6,17,18,19,20,32,42,43,55,56,57,58,60,61,62,63,64,65,66,67,68,69
embedcnt=1
