Subversion Repositories wimsdev

Rev

Rev 16113 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
20 reyssat 1
!for t in result,context
16113 bpr 2
  !if $(ask$t)<2
3
    n$t=0
20 reyssat 4
  !else
16113 bpr 5
    n$t=!itemcnt $($(t)list)
20 reyssat 6
  !endif
16113 bpr 7
  !if $(n$t)>1
8
    good=!item 1,2 of $($(t)list)
9
    !if $(ask$t)>2
10
      bad=!item 3 to -1 of $($(t)list)
11
      n=!itemcnt $bad
12
      s=!shuffle $n
13
      s=!item 1 to $(ask$t)-2 of $s
14
      bad=!item $s of $bad
15
      list$t=!sort items $good,$bad
16
    !else
17
      list$t=!sort items $good
18
    !endif
19
    sh$t=$wims_sort_order
20
    good$t=!positionof item 1 in $(sh$t)
21
  !endif
20 reyssat 22
!next t