Subversion Repositories wimsdev

Rev

Rev 5052 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5052 Rev 12555
Line 1... Line 1...
1
 
1
 
2
!if $wims_class=$empty or $wims_user!=supervisor
2
!if $wims_class=$empty or $wims_user!=supervisor
3
 error=unauthorized
3
  error=unauthorized
4
 !exit
4
  !exit
5
!endif
5
!endif
6
 
6
 
7
t=!exec ftype $wims_home/$wims_sesdir/user-deposit
7
t=!exec ftype $wims_home/$wims_sesdir/user-deposit
8
!if $t=$empty
8
!if $t=$empty
9
 error=empty
9
  error=empty
10
 !exit
10
  !exit
11
!endif
11
!endif
12
!if $t=binary
12
!if $t=binary
13
 error=binary
13
  error=binary
14
 !exit
14
  !exit
15
!endif
15
!endif
16
 
16
 
17
!sh cd $wims_home/$wims_sesdir\
17
!sh cd $wims_home/$wims_sesdir\
18
 grep . user-deposit | awk '{print ":"$$0}' | tr '	"' ', ' >user_deposit\
18
 grep . user-deposit | awk '{print ":"$$0}' | tr '	"' ', ' >user_deposit\
19
 rm -f user-deposit >/dev/null
19
 rm -f user-deposit >/dev/null
20
 
20
 
21
file=$wims_sesdir/user_deposit
21
file=$wims_sesdir/user_deposit
22
n=!recordcnt wimshome/$file
22
n=!recordcnt wimshome/$file
23
!if $n<=0
23
!if $n<=0
24
 error=empty
24
  error=empty
25
 !exit
25
  !exit
26
!endif
26
!endif
27
 
27
 
28
loglist=
28
loglist=
29
!for i=1 to $n
29
!for i=1 to $n
30
 l=!record $i of wimshome/$file
30
  l=!record $i of wimshome/$file
31
 !if $gotlogin!=$empty
31
  !if $gotlogin!=$empty
32
  ltest=!item $gotlogin of $l
32
    ltest=!item $gotlogin of $l
33
  ll=!wordcnt $ltest
33
    ll=!wordcnt $ltest
34
  !if $ll=1 and # notin $ltest
34
    !if $ll=1 and # notin $ltest
35
   dep_$ltest=$l
35
      dep_$ltest=$l
36
   loglist=!append item $ltest to $loglist
36
      loglist=!append item $ltest to $loglist
-
 
37
    !endif
-
 
38
  !else
-
 
39
    !if $i>3
-
 
40
      error=no_login
-
 
41
      !exit
-
 
42
    !endif
-
 
43
    !if login isitemof $l
-
 
44
      l=!lower $l
-
 
45
      types=!nospace $l
-
 
46
      gotlogin=!positionof item login in $l
-
 
47
      gotlogin=!item 1 of $gotlogin
-
 
48
    !endif
37
  !endif
49
  !endif
38
 !else
-
 
39
  !if $i>3
-
 
40
   error=no_login
-
 
41
   !exit
-
 
42
  !endif
-
 
43
  !if login isitemof $l
-
 
44
   l=!lower $l
-
 
45
   types=!nospace $l
-
 
46
   gotlogin=!positionof item login in $l
-
 
47
   gotlogin=!item 1 of $gotlogin
-
 
48
  !endif
-
 
49
 !endif
-
 
50
!next i
50
!next i
51
 
51
 
52
!if $gotlogin=$empty
52
!if $gotlogin=$empty
53
 error=no_login
53
  error=no_login
54
 !exit
54
  !exit
55
!endif
55
!endif
56
 
56
 
57
remark=
57
remark=
58
!if sheet isin $types or exam isin $types or average isin $types
58
!if sheet isin $types or exam isin $types or average isin $types
59
 remark=$remark noauto
59
  remark=$remark noauto
60
!endif
60
!endif
61
 
61
 
62
prop=no
62
prop=no
63
!if noauto iswordof $remark or manual isin $types
63
!if noauto iswordof $remark or manual isin $types
64
 remark=$remark noprop
64
  remark=$remark noprop
65
!else
65
!else
66
 !if firstname isitemof $types and lastname isitemof $types
66
  !if firstname isitemof $types and lastname isitemof $types
67
  prop=yes
67
    prop=yes
68
  !read adm/class/userremain.proc
68
    !read adm/class/userremain.proc
69
 !endif
69
  !endif
70
!endif
70
!endif
71
 
71
 
72
!if manual isin $types
72
!if manual isin $types
73
 manual=yes
73
  manual=yes
74
!endif
74
!endif
75
 
75
 
76
replacelist=$types
76
replacelist=$types
77
types=!replace , by ,up_ in up_$types
77
types=!replace , by ,up_ in up_$types
78
gotcnt=!itemcnt $loglist
78
gotcnt=!itemcnt $loglist
Line 84... Line 84...
84
!for l in $loglist
84
!for l in $loglist
85
  !reset up_firstname,up_lastname,up_email,up_password,up_comments,up_regnum,up_photourl,up_participate,up_external_auth
85
  !reset up_firstname,up_lastname,up_email,up_password,up_comments,up_regnum,up_photourl,up_participate,up_external_auth
86
  !distribute items $(dep_$l) into $types
86
  !distribute items $(dep_$l) into $types
87
  exist=!defof user_exists in wimshome/log/classes/$wims_class/.users/$l
87
  exist=!defof user_exists in wimshome/log/classes/$wims_class/.users/$l
88
  !if $exist=yes
88
  !if $exist=yes
89
   !if $prop=yes
89
    !if $prop=yes
90
    !read adm/class/adduser $l
90
     !read adm/class/adduser $l
91
   !endif
91
    !endif
92
  !else
92
  !else
93
   exist2=!defof user_exists in wimshome/log/classes/$wims_class/.users/.$l
93
    exist2=!defof user_exists in wimshome/log/classes/$wims_class/.users/.$l
94
   !if $exist2=yes
94
    !if $exist2=yes
95
    erased=!append item $l to $erased
95
      erased=!append item $l to $erased
96
   !else
96
    !else
97
    missing=!append item $l to $missing
97
      missing=!append item $l to $missing
98
    !if $up_firstname!=$empty and $up_lastname!=$empty and $up_password!=$empty
98
      !if $up_firstname!=$empty and $up_lastname!=$empty and $up_password!=$empty
99
     !if $prop=yes
99
        !if $prop=yes
100
      !if $userremain>0
100
          !if $userremain>0
101
       !read adm/class/adduser $l
101
            !read adm/class/adduser $l
102
       !if $l notwordof $bad
102
            !if $l notwordof $bad
103
        added=!append item $l to $added
103
              added=!append item $l to $added
104
       !else
104
            !else
105
        userremain=$[$userremain-1]
105
              userremain=$[$userremain-1]
106
       !endif
106
            !endif
107
      !else
107
          !else
108
       remark=$remark full
108
            remark=$remark full
-
 
109
          !endif
-
 
110
      !endif
109
      !endif
111
      !endif
110
     !endif
-
 
111
    !endif
112
    !endif
112
   !endif
-
 
113
  !endif
113
  !endif
114
!next l
114
!next l
115
missing=!listcomplement $added in $missing
115
missing=!listcomplement $added in $missing
116
 
116
 
117
!if $change!=$empty
117
!if $change!=$empty
118
 !read adm/class/mkuserlist
118
  !read adm/class/mkuserlist
119
 wims_class_log=spreadsheet userinfo
119
  wims_class_log=spreadsheet userinfo
120
!endif
120
!endif
121
 
121
 
122
!if $manual=yes
122
!if $manual=yes
123
 fn=wimshome/log/classes/$wims_class/.grades
123
  fn=wimshome/log/classes/$wims_class/.grades
124
 fu=wimshome/log/classes/$wims_class/.userlist
124
  fu=wimshome/log/classes/$wims_class/.userlist
125
 l=!record 1 of $fn
125
  l=!record 1 of $fn
126
 t=!line 2 of $l
126
  t=!line 2 of $l
127
 n=!itemcnt $t
127
  n=!itemcnt $t
128
 n=$[$n-2]
128
  n=$[$n-2]
129
 !if $n<1
129
  !if $n<1
130
  error=no_manual
130
    error=no_manual
131
  !exit
131
    !exit
132
 !endif
132
  !endif
133
 otypes=nn
133
  otypes=nn
134
 !for i=1 to $n
-
 
135
  otypes=$otypes,o_$i
-
 
136
 !next i
-
 
137
 first=$l
-
 
138
 cnt=!recordcnt $fn
-
 
139
 !for u=2 to $cnt
-
 
140
  l=!record $u of $fn
-
 
141
  uu=!item 1 of $l
-
 
142
  orig_$uu=!item 2 to -1 of $l
-
 
143
 !next u
-
 
144
 !writefile $fn :$first
-
 
145
 cnt=!recordcnt $fu
-
 
146
 !for i=1 to $cnt
-
 
147
  l_=!record $i of $fu
-
 
148
  u=!item 3 of $l_
-
 
149
  !distribute items $(dep_$u) into $types
-
 
150
  !distribute items $(orig_$u) into $otypes
-
 
151
  t_=!defof user_firstname user_lastname in wimshome/log/classes/$wims_class/.users/$u
-
 
152
  !for i=1 to $n
134
  !for i=1 to $n
153
   l_=$[$(up_manual$i)]
-
 
154
   !if NaN isin $l_ or Inf isin $l_ or $l_<0 or $l_>100000 or $(up_manual$i)=$empty
-
 
155
    l_=
-
 
156
   !endif
-
 
157
   !default l_=$(o_$i)
135
    otypes=$otypes,o_$i
158
   t_=!append item $l_ to $t_
-
 
159
  !next i
136
  !next i
-
 
137
  first=$l
-
 
138
  cnt=!recordcnt $fn
-
 
139
  !for u=2 to $cnt
-
 
140
    l=!record $u of $fn
-
 
141
    uu=!item 1 of $l
-
 
142
    orig_$uu=!item 2 to -1 of $l
-
 
143
  !next u
-
 
144
  !writefile $fn :$first
-
 
145
  cnt=!recordcnt $fu
-
 
146
  !for i=1 to $cnt
-
 
147
    l_=!record $i of $fu
-
 
148
    u=!item 3 of $l_
-
 
149
    !distribute items $(dep_$u) into $types
-
 
150
    !distribute items $(orig_$u) into $otypes
-
 
151
    t_=!defof user_firstname user_lastname in wimshome/log/classes/$wims_class/.users/$u
-
 
152
    !for i=1 to $n
-
 
153
      l_=$[$(up_manual$i)]
-
 
154
      !if NaN isin $l_ or Inf isin $l_ or $l_<0 or $l_>100000 or $(up_manual$i)=$empty
-
 
155
        l_=
-
 
156
      !endif
-
 
157
      !default l_=$(o_$i)
-
 
158
      t_=!append item $l_ to $t_
-
 
159
    !next i
160
  !appendfile $fn :$u,$t_
160
    !appendfile $fn :$u,$t_
161
 !next u
161
  !next u
162
 wims_class_log=spreadsheet grades
162
  wims_class_log=spreadsheet grades
163
!endif
163
!endif
164
 
-