Subversion Repositories wimsdev

Rev

Rev 20 | Rev 12981 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 20 Rev 4594
Line 2... Line 2...
2
transfer_test=0
2
transfer_test=0
3
!distribute words $wims_read_parm into transfer_user, transfer_cmd, transfer_other
3
!distribute words $wims_read_parm into transfer_user, transfer_cmd, transfer_other
4
!if $wims_supertype!=4 or $wims_user!=supervisor
4
!if ($wims_supertype!=4 and $wims_supertype!=2) or $wims_user!=supervisor
5
 !exit
5
 !exit
6
!endif
6
!endif
7
tr_list=
7
tr_list=
8
tr_typename=!defof class_typename in wimshome/log/classes/$wims_class/.def
8
tr_typename=!defof class_typename in wimshome/log/classes/$wims_class/.def
9
tr_l1=!defof user_participate in \
9
tr_l1=!defof user_participate in \
10
	wimshome/log/classes/$wims_superclass/.users/$transfer_user
10
	wimshome/log/classes/$wims_superclass/.users/$transfer_user
-
 
11
!if $wims_supertype=4 
11
!if $tr_typename=course
12
!if $tr_typename=course
12
 tr_program=!defof sharing_exam in wimshome/log/classes/$wims_class/neighbors
13
 tr_program=!defof sharing_exam in wimshome/log/classes/$wims_class/neighbors
13
 tr_class=!defof user_class in wimshome/log/classes/$wims_class/.users/$transfer_user
14
 tr_class=!defof user_class in wimshome/log/classes/$wims_class/.users/$transfer_user
14
 !if $tr_class=$empty
15
 !if $tr_class=$empty
15
  tr_parent=!defof class_parent in wimshome/log/classes/$wims_class/.def
16
  tr_parent=!defof class_parent in wimshome/log/classes/$wims_class/.def
Line 51... Line 52...
51
  !if $tr_l2!=$empty
52
  !if $tr_l2!=$empty
52
   tr_l2=!makelist $wims_superclass/x for x in $tr_l2
53
   tr_l2=!makelist $wims_superclass/x for x in $tr_l2
53
   tr_list=!append item $tr_l2 to $tr_list
54
   tr_list=!append item $tr_l2 to $tr_list
54
  !endif
55
  !endif
55
 !next c_
56
 !next c_
-
 
57
!endif
-
 
58
!else
-
 
59
!! same for wims_supertype=2 build a tr_list analogue to the one above: 
-
 
60
!! suitable classes to look into for activity by $transfer_user
-
 
61
!if  $wims_supertype=2 and $tr_typename=class
-
 
62
 tr_sharing=!defof sharing_exam in wimshome/log/classes/$wims_class/neighbors
-
 
63
 tr_sharable=!defof sharable_exam in wimshome/log/classes/$wims_class/neighbors
-
 
64
 !! is user_class really used?
-
 
65
 tr_class=!defof user_class in wimshome/log/classes/$wims_class/.users/$transfer_user
-
 
66
 !if $tr_class=$empty
-
 
67
  !! case 1 --> $wims_class is not "giving" (tr_sharable=$empty, i.e.
-
 
68
  !!   $tr_sharing!=$empty), need to check whether it is sharing from
-
 
69
  !!   (tr_sharing!=$empty) and need to find classes sharing from the
-
 
70
  !!   same class 
-
 
71
  !if $tr_sharing!=$empty
-
 
72
   tr_list=$tr_sharing
-
 
73
   !! altri candidati
-
 
74
   tr_l2=!defof sharable_exam in wimshome/log/classes/$tr_sharing/neighbors
-
 
75
   tr_l2=!listcomplement $wims_class in $tr_l2	 
-
 
76
   !! controllo che queste effettivamente siano in sharing 
-
 
77
   !for c_ in $tr_l2
-
 
78
    tr_test=!defof sharing_exam in wimshome/log/classes/$c_/neighbors
-
 
79
    !if $tr_test=$tr_sharing
-
 
80
     tr_list=!append item $c_ to $tr_list
-
 
81
    !endif
-
 
82
   !next c_
-
 
83
  !else
-
 
84
   !! case 2 --> $wims_class is giving resources to other classes
-
 
85
   !! (tr_sharable!=$empty) suitable class are in the ones in
-
 
86
   !! $wims_superclass/.subclasses that have $wims_class in sharing_exams
-
 
87
   !if $tr_sharable!=$empty
-
 
88
    tr_list=
-
 
89
    cnt_class=!recordcnt wimshome/log/classes/$wims_superclass/.subclasses
-
 
90
    !for i = 1 to $cnt_class
-
 
91
     cl=!record $i of wimshome/log/classes/.index
-
 
92
     cl_test=$(cl[1])
-
 
93
     cl_sharing=!defof sharing_exam in wimshome/log/classes/$cl_test/neighbors
-
 
94
     !if $cl_sharing=$wims_class
-
 
95
      tr_list=!append item $cl_test to $tr_list 
-
 
96
     !endif
-
 
97
    !next
-
 
98
   !endif
-
 
99
  !endif
-
 
100
 !else
-
 
101
  tr_class=$wims_superclass/$tr_class
-
 
102
 !endif
-
 
103
!endif
56
!endif
104
!endif
57
 
105
 
58
!if $tr_list!=$empty
106
!if $tr_list!=$empty
59
 tr_l1=!makelist x/score for x in $tr_list
107
 tr_l1=!makelist x/score for x in $tr_list
60
 tr_l2=!makelist x/noscore for x in $tr_list
108
 tr_l2=!makelist x/noscore for x in $tr_list
Line 66... Line 114...
66
	find $tr_l2 -name $transfer_user | sed 's!/noscore/.*$$!!'
114
	find $tr_l2 -name $transfer_user | sed 's!/noscore/.*$$!!'
67
 tr_score=!words2items $tr_score
115
 tr_score=!words2items $tr_score
68
 tr_noscore=!words2items $tr_noscore
116
 tr_noscore=!words2items $tr_noscore
69
 tr_list=!listunion $tr_score and $tr_noscore
117
 tr_list=!listunion $tr_score and $tr_noscore
70
 tr_list=!nonempty items $tr_list
118
 tr_list=!nonempty items $tr_list
71
!endif
119
!endif
72
 
120
 
73
transfer_test=!itemcnt $tr_list
121
transfer_test=!itemcnt $tr_list
74
!if $transfer_test<1 or $transfer_cmd=test or\
122
!if $transfer_test<1 or $transfer_cmd=test or\
75
	$transfer_other notitemof $tr_list
123
	$transfer_other notitemof $tr_list
76
 !exit
124
 !exit
77
!endif
125
!endif
78
 
126
 
-
 
127
!if $wims_supertype=4
79
!default tr_program=!defof sharing_exam in wimshome/log/classes/$transfer_other/neighbors
128
!default tr_program=!defof sharing_exam in wimshome/log/classes/$transfer_other/neighbors
80
!if $tr_typename!=course
129
!if $tr_typename!=course
81
 tr_l1=!defof class_ocourses in wimshome/log/classes/$wims_class/.def
130
 tr_l1=!defof class_ocourses in wimshome/log/classes/$wims_class/.def
82
 tr_l2=!defof user_courses in wimshome/log/classes/$wims_class/.users/$transfer_user
131
 tr_l2=!defof user_courses in wimshome/log/classes/$wims_class/.users/$transfer_user
83
 tr_l1=!append item $tr_l2 to $tr_l1
132
 tr_l1=!append item $tr_l2 to $tr_l1
Line 94... Line 143...
94
  error=no_reccourse
143
  error=no_reccourse
95
  !exit
144
  !exit
96
 !endif
145
 !endif
97
!else
146
!else
98
 tr_this=$wims_class
147
 tr_this=$wims_class
-
 
148
!endif
-
 
149
!endif
-
 
150
 
-
 
151
!if $wims_supertype=2 and $tr_typename=class
-
 
152
 !if $transfer_other isitemof $tr_list
-
 
153
  tr_this=$wims_class
-
 
154
 !endif
99
!endif
155
!endif
100
 
156
 
101
tr_c1=log/classes/$transfer_other
157
tr_c1=log/classes/$transfer_other
102
tr_c2=log/classes/$tr_this
158
tr_c2=log/classes/$tr_this
103
!if $transfer_cmd=replace
159
!if $transfer_cmd=replace