File: var.proc

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 (73 lines) | stat: -rw-r--r-- 1,525 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

!default precision=10000
wims_prefix=class user tmp

!read Exindex
exocnt=!itemcnt $exolist
!bound qnum between integer 1 and $exocnt default 1
!bound qcmlevel between integer 1 and 8 default 3
!bound random within 0,1 default 1
wims_form_method=post

!if $cmd=reply and $status!=waiting
  error=double_reply
  !exit
!endif

!if $status=$empty
  !read dialog/exo.init
!endif

!if $status!=waiting
  !distribute item $ into solution,hint
!endif

nn=!itemcnt $shufflelist
thisexo=!item ($reply_cnt)%$nn+1 of $shufflelist
imagedir=$module_dir/images/$thisexo
deffile=def/$thisexo.def
!if $nn>1 and $status!=waiting
  wims_module_log=$wims_module_log got $thisexo
!endif

!if $status!=waiting
  !reset asklist promptlist storename storeval
  !read $deffile init
  !read dialog/var.prep
!else
  !distribute line $storeval into $storename
!endif

!read $deffile info

!if $cmd=reply and $status=waiting
  !if $ask!=$empty
    !read dialog/var.proc.ask
    !if $badask!=yes
      !goto end
    !endif
  !else
    !read dialog/var.proc.ans
    !if $partial=yes
      !goto end
    !endif
  !endif
  !advance reply_cnt
  !advance score_should
  score_got=$[$score_got+$thisscore]
  status=done
  !if $reply_cnt>=$qnum
    !ifval $score_should=0
      score_should=1
    !endif
    score=$[max(0,min(10,rint(100*$score_got/$score_should)/10))]
    module_score=$score
    wims_module_log=score $module_score/10
    status=
  !endif
!endif

:end
prompts=!items $remlist of $promptlist
remcnt=!itemcnt $remlist
gotcnt=!itemcnt $gotlist