File: javacurve

package info (click to toggle)
wims 2%3A4.29a%2Bdfsg1-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 185,704 kB
  • sloc: xml: 366,687; javascript: 120,570; ansic: 62,341; java: 62,170; sh: 7,744; perl: 3,937; yacc: 3,217; cpp: 1,915; lex: 1,805; makefile: 1,084; lisp: 914; pascal: 601; python: 520; php: 318; asm: 7
file content (83 lines) | stat: -rw-r--r-- 1,934 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
option:precision=" "

good=!rows2lines $(replygood$i)
image=!line 1 of $good
tester=!line 2 of $good
!set oef_applet_option=$(oef_answer_option$i)

!if $wims_read_parm=nocompare
  image=$(oef_applet_option[2;])
  tester=$(oef_applet_option[3;1])
  tester=!nonempty lines $tester
  tester=!words2items $tester
!endif
type=!item 1 of $tester

!!color can be changed... (color1=student answer, color2 good answer)
!set color1=!getopt color1 in $(replyoption$i)
!default color1=black
!set color2=!getopt color2 in $(replyoption$i)
!default color2=180,180,255

rlist=$(reply$i)
m_reply$i=$rlist
reply__$i= 

!set Inputsize=!replace internal x by , in $(oef_applet_option[1;])
!distribute items $Inputsize into xsize,ysize

!bound type within line,poly,polygon,points,segment,vector,rectangle,sline,circle,bound,curve default points

!if $type notwordof points
  !if $(reply$i)=$empty
    error=empty_data
    !exit
  !endif
!endif

rlist=!translate internal ; to , in $rlist
rlist=!nonempty items $rlist
n=!itemcnt $rlist

!!only in points initially
!if $wims_read_parm!=nocompare
  glist=!item 2 to -1 of $tester
  glist=!nonempty items $glist
  m=!itemcnt $glist
!endif

!read anstype/javacurve.$type $wims_read_parm

!if $wims_read_parm=nocompare
  !goto draw
!endif
!if $Test!=$empty or NaN isin $test
  !exit
!endif

:draw
ifile=$image
!if $imagedir isin $image
  ifile=!translate internal / to $ $ in $ifile
  ifile=!word -1 of $ifile
!else
  !if getfile isin $image
    ifile=!translate internal =/ to $  $ in $ifile
    ifile=!word -1 of $ifile
  !else
    !if getins isin $image
      ifile=!replace internal &modif= by $ $ in $ifile
      ifile=!replace internal &+modif= by $ $ in $ifile
      ifile=!replace internal special_parm= by $ $ in $ifile
      ifile=!word 2 of $ifile
    !endif
  !endif
!endif

!insdraw existing $ifile\
linewidth 3\
$primitive2\
linewidth 1\
$primitive1

reply_$i=<img src="$ins_url" alt=""/>