Subversion Repositories wimsdev

Rev

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

Rev Author Line No. Line
7638 bpr 1
!!no more use !
7612 bpr 2
!!input :user, class, sheet (optional), exo (optional)
3
!!output:
4
!! script_out: lines for each exo in sheet coming from exostat
5
!!  should put only the best things ??
6
!! script_best: best result (depending on the required points)
7
!! script_p3 (average of best result, only in the case sheet and exo are empty
8
!! should be the third word of the result of !getscorepercent
9
 
10
!distribute items $wims_read_parm into sc_user,sc_class,sc_sheet,sc_exo
11
!reset script_out script_best script_percent3
12
!if $sc_exo!=$empty
12555 bpr 13
  !set script_out=!sh export exostat_dirbase exostat_types exostat_classes exostat_user exostat_sheet\
7612 bpr 14
	exostat_dirbase=$wims_home/log/classes\
15
	exostat_types="score"\
16
	exostat_classes="$sc_class"\
17
	exostat_user="$sc_user"\
18
	exostat_sheet="$sc_sheet"\
19
	$wims_home/bin/exostat
12555 bpr 20
  !set sc_best_=!getopt $(sc_sheet)_$(sc_exo) in $script_out
21
  !set sc_best_=!nonempty items $(sc_best_[2;])
22
  !set sc_best_=!sort reverse numeric items $sc_best_
23
  !if $sc_best_!=$empty
24
    !set sc_req=!getscorerequire sheet=$sc_sheet exo=$(sc_exo)
25
    !set sc_req=$[ceil(min(10,$sc_req/10))]
26
    !set sc_best=!replace internal , by + in $(sc_best_[1..$sc_req])
27
    !set script_best=$[$sc_best]
28
  !endif
7612 bpr 29
  !goto end
30
!endif
31
 
32
!if $sc_sheet!=$empty
33
 
34
  !reset script_out
35
  !set sc_sheet=!words2items $sc_sheet
36
  !reset sc_best
37
  !set sc_sheet_cnt=!itemcnt $sc_sheet
38
  !for sc_s=1 to $sc_sheet_cnt
7638 bpr 39
    !set sc_sh=$(sc_sheet[$sc_s])
7612 bpr 40
    !set script_out=!sh export exostat_dirbase exostat_types exostat_classes exostat_user exostat_sheet\
41
	exostat_dirbase=$wims_home/log/classes\
42
	exostat_types="score"\
43
	exostat_classes="$sc_class"\
44
	exostat_user="$sc_user"\
45
	exostat_sheet="$sc_sh"\
46
	$wims_home/bin/exostat
47
 
48
    !if $script_out!=$empty
12555 bpr 49
      !set script_p3=0
50
      !set sc_wg=0
51
      !set sc_require=!getscorerequire sheet=$sc_sh
52
      !set sc_weight=!getscoreweight sheet=$sc_sh
53
      !set sc_d=!recordcnt wimshome/log/classes/$wims_class/sheets/.sheet$sc_sh
54
      !reset script_best
55
      !for sc_ex=1 to $sc_d
56
        !set sc_best_=!getopt $(sc_sh)_$(sc_ex) in $script_out
57
        !set sc_best_=!nonempty items $(sc_best_[2;])
58
        !set sc_best_=!sort reverse numeric items $sc_best_
59
        !if $sc_best_!=$empty
60
          !set sc_req=!word $(sc_ex) of $sc_require
61
          !set sc_req=$[ceil(min(10,$sc_req/10))]
62
          !set sc_best_=!replace internal , by + in $(sc_best_[1..$sc_req])
63
          !set sc_best_=$[round(10*($sc_best_)/$sc_req)/10]
64
          !set sc_w=!word $(sc_ex) of $sc_weight
65
          !set sc_wg=$[$sc_wg + $sc_w]
66
          !set script_p3=$script_p3 + $sc_w*$sc_best_
67
        !endif
68
        !!leave the empty items
69
        !set sc_best=$sc_best$sc_best_,
70
      !next exo
7638 bpr 71
 
12555 bpr 72
      !set script_best=!append line $sc_best to $script_best
73
      !set script_percent3=!append line $[ceil(100*($script_p3)/$sc_wg)/1000] to $script_percent3\
74
      !set script_out=!append line $script_out_ to $script_out
75
    !else
76
      !set script_best=!append line 0 to $script_best
77
      !set script_percent3=!append line 0 to $script_percent3
7638 bpr 78
    !endif
7612 bpr 79
  !next sheet
80
!endif
7638 bpr 81
:end