Rev 11661 | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
5967 | obado | 1 | # GetSheetStats |
2 | # Donne des statistiques sur le travail des participants pour chaque exo de la feuille $qsheet |
||
3 | |||
4 | #Pour commencer, on verifie la classe |
||
5 | !read scripts/check.class |
||
6 | !if $error!=$empty |
||
7 | !exit |
||
8 | !endif |
||
9 | |||
10 | #puis la feuille |
||
11 | type=sheets |
||
12 | !read scripts/check.proc |
||
13 | !if $error!=$empty |
||
11661 | obado | 14 | !exit |
5967 | obado | 15 | !endif |
16 | |||
17 | sheet_properties=!lines2items $qproperties\ |
||
18 | |||
19 | sheet_status=!item 1 of $sheet_properties |
||
20 | !if $sheet_status<1 or $sheet_status>2 |
||
11661 | obado | 21 | error=Sheet #$qsheet must be active |
22 | !exit |
||
5967 | obado | 23 | !endif |
24 | |||
25 | # S'il n'y a aucun utilisateur, inutile de continuer |
||
26 | usercnt=!recordcnt wimshome/log/classes/$qclass/.userlist |
||
27 | !if $usercnt=0 |
||
28 | error=There is no user in this class |
||
29 | !exit |
||
30 | !endif |
||
31 | |||
32 | sheet_mean_quality = 0 |
||
33 | sheet_mean_percent = 0 |
||
34 | sheet_max_percent = 0 |
||
35 | sheet_max_quality = 0 |
||
36 | |||
37 | !for u=1 to $usercnt |
||
11661 | obado | 38 | l=!record $u of wimshome/log/classes/$qclass/.userlist |
39 | quser=!item 3 of $l |
||
40 | !defread $users_dir/$quser |
||
5967 | obado | 41 | |
11661 | obado | 42 | # getscorepercent fournit le pourcentage de realisation et la qualite obtenus sur la feuille |
43 | # attention : getscorepercent peut ne rien renvoyer si unes des feuilles précédent $qsheet n'a jamais été activée. |
||
44 | sheet_summaries=!getscorepercent user=$quser class=$qclass sheet=$qsheet |
||
45 | user_percent=!word 1 of $sheet_summaries |
||
46 | user_quality=!word 2 of $sheet_summaries |
||
47 | |||
48 | !default user_percent=0 |
||
49 | !default user_quality=0 |
||
50 | |||
51 | # On calcule les notes maximums |
||
52 | !if $user_percent>$sheet_max_percent |
||
53 | sheet_max_percent=$user_percent |
||
54 | !endif |
||
55 | !if $user_quality>$sheet_max_quality |
||
56 | sheet_max_quality=$user_quality |
||
57 | !endif |
||
58 | |||
59 | # notes détaillées par exercice |
||
60 | # getscore : |
||
61 | gotdetail=!getscore user=$quser class=$qclass sheet=$qsheet |
||
62 | # getscoremean : obtient le détail des notes de qualité par exercice |
||
63 | qualitydetail=!getscoremean user=$quser class=$qclass sheet=$qsheet |
||
64 | |||
65 | !for v in gotdetail, qualitydetail |
||
66 | $v=!trim $($v) |
||
67 | $v=!wordstoitems $($v) |
||
68 | !next v |
||
69 | |||
70 | nb_exos = 0 |
||
71 | !if $u=1 |
||
72 | # au premier utilisateur, on initialise le total des notes par exercice : |
||
73 | sheetqualitydetail = $qualitydetail |
||
74 | sheetgotdetail = $gotdetail |
||
75 | sheet_mean_quality = $user_quality |
||
76 | sheet_mean_percent = $user_percent |
||
77 | nb_exos = !itemcnt $gotdetail |
||
78 | !else |
||
79 | total_temp = $empty |
||
80 | quality_temp = $empty |
||
81 | |||
82 | !for note in $gotdetail |
||
83 | !advance nb_exos |
||
84 | old_note = !item $nb_exos of $sheetgotdetail |
||
85 | new_note = $[$old_note + $note] |
||
86 | total_temp=!append item $new_note to $total_temp |
||
87 | |||
88 | old_mean = !item $nb_exos of $sheetqualitydetail |
||
89 | new_mean = !item $nb_exos of $qualitydetail |
||
90 | new_mean = $[$new_mean + $old_mean] |
||
91 | quality_temp= !append item $new_mean to $quality_temp |
||
92 | !next note |
||
93 | |||
94 | sheetgotdetail = $total_temp |
||
95 | sheetqualitydetail = $quality_temp |
||
96 | sheet_mean_quality = $[$sheet_mean_quality + $user_quality] |
||
97 | sheet_mean_percent = $[$sheet_mean_percent + $user_percent] |
||
98 | !endif |
||
99 | |||
5967 | obado | 100 | !next u |
101 | |||
102 | total_temp = $empty |
||
103 | quality_temp = $empty |
||
104 | !for i=1 to $nb_exos |
||
11661 | obado | 105 | old_note = !item $i of $sheetgotdetail |
106 | new_note = $[$old_note / $usercnt] |
||
107 | total_temp=!append item $new_note to $total_temp |
||
5967 | obado | 108 | |
11661 | obado | 109 | old_quality = !item $i of $sheetqualitydetail |
110 | new_quality = $[$old_quality / $usercnt] |
||
111 | quality_temp= !append item $new_quality to $quality_temp |
||
5967 | obado | 112 | !next i |
113 | |||
114 | sheetgotdetail = $total_temp |
||
115 | sheetqualitydetail = $quality_temp |
||
116 | |||
117 | sheet_mean_quality=$[$sheet_mean_quality/$usercnt] |
||
118 | sheet_mean_percent=$[$sheet_mean_percent/$usercnt] |
||
119 | |||
120 | scoremax=!record 0 of wimshome/log/classes/$qclass/sheets/.severity |
||
121 | scoremax=!word 1 of $scoremax |
||
122 | !default scoremax = 10 |
||
123 | |||
15837 | guerimand | 124 | weights = !getscoreweight class=$qclass sheet=$qsheet user=$quser |
125 | requires = !getscorerequire class=$qclass sheet=$qsheet user=$quser |