Rev 15316 | Rev 16364 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
14777 | guerimand | 1 | !! job=wiewpage |
2 | !! supervisor can view page of participant connected to the tchat |
||
14779 | bpr | 3 | !! |
14777 | guerimand | 4 | |
5 | !! -------- user check |
||
6 | !bound user within $ulist default $empty |
||
7 | !if $user=$empty |
||
8 | error=nouser |
||
9 | !exit |
||
10 | !endif |
||
11 | |||
16355 | guerimand | 12 | po=!positionof item $user in $ulist |
13 | username=$(nlist[$po]) |
||
14 | name_title=$username $name_page $numberses |
||
15 | |||
16 | |||
17 | |||
14777 | guerimand | 18 | !! -------- check if authorized session |
16355 | guerimand | 19 | basesession=!replace _ by , in $wims_session |
20 | basesession=!item 1 of $basesession |
||
21 | list_window=!defof $user in wimshome/s2/$basesession/.indexusersession |
||
14783 | guerimand | 22 | nbwindow=!itemcnt $list_window |
23 | !if $numberses<1 or $numberses>$nbwindow |
||
14777 | guerimand | 24 | error=usernotintchat |
25 | !exit |
||
26 | !endif |
||
14783 | guerimand | 27 | userses=!item $numberses of $list_window |
16355 | guerimand | 28 | !if tchat isin $userses |
14777 | guerimand | 29 | error=addressplay |
14779 | bpr | 30 | !exit |
14777 | guerimand | 31 | !endif |
16355 | guerimand | 32 | !reset logfile |
33 | !if exam isin $userses |
||
34 | !! case of exercise in an exam |
||
35 | userbasesession=!replace _ by , in $userses |
||
36 | userbasesession=!item 1 of $userbasesession |
||
37 | tmp=!replace internal $(userbasesession)_examt by $empty in $userses |
||
38 | tmp=!replace t by . in $tmp |
||
39 | logfile=wimshome/log/classes/$wims_class/examlog/$user/$userbasesession/$tmp |
||
40 | !else |
||
41 | !! case of an exercise in a sheet |
||
42 | tmp=!defof w_wims_exo,w_wims_sheet,w_module in wimshome/sessions/$userses/var |
||
43 | !distribute item $tmp into userexo,usersheet,exomod |
||
44 | !if $usersheet!=$empty and $userexo!=$empty |
||
45 | logfile=wimshome/sessions/$userses/exolog.$usersheet.$userexo |
||
46 | !else |
||
47 | !! case of a exercise (not in a sheet for exemple in a document) |
||
48 | category=!defof category in wimshome/public_html/modules/$exomod/INDEX |
||
49 | !if exercise isin $category |
||
50 | logfile=wimshome/sessions/$userses/exolog |
||
51 | !endif |
||
52 | !endif |
||
53 | !endif |
||
54 | !if $logfile!=$empty |
||
55 | !! ----------- use adm/class/exolog module to display exo in a sheet or exam |
||
56 | test=!fileexists $logfile |
||
57 | !if $test!=yes |
||
58 | error=addressplay |
||
59 | !exit |
||
60 | !endif |
||
61 | !writefile wimshome/$wims_sesdir/var REMOTE_ADDR=$httpd_REMOTE_ADDR\ |
||
62 | HTTP_REFERER=$httpd_HTTP_REFERER\ |
||
63 | QUERY_STRING=\ |
||
64 | HTTP_USER_AGENT=$httpd_HTTP_USER_AGENT\ |
||
65 | HTTP_COOKIE=$httpd_HTTP_COOKIE\ |
||
66 | w_cmd=new\ |
||
67 | w_lang=$class_lang\ |
||
68 | w_special_parm=1\ |
||
69 | w_special_parm2=\ |
||
70 | w_useropts=$useropts\ |
||
71 | w_wims_session=$wims_session\ |
||
72 | w_wims_subsession=$wims_subsession\ |
||
73 | w_wims_window=$wims_window\ |
||
74 | w_wims_mode=$wims_mode\ |
||
75 | w_wims_module_start_time=\ |
||
76 | w_wims_protocol=$wims_protocol\ |
||
77 | w_wims_req_time=$wims_req_time\ |
||
78 | w_wims_session_serial=$wims_session_serial\ |
||
79 | w_wims_session_start_time=$wims_session_start_time |
||
14777 | guerimand | 80 | |
16355 | guerimand | 81 | !setdef wims_checkfile=$logfile in wimshome/$wims_sesdir/var.stat |
82 | !setdef wims_checktitle=$name_title in wimshome/sessions/$basesession/var.stat |
||
83 | nbstep=!recordcnt $logfile |
||
84 | !restart module=adm/class/exolog&+cmd=new&+job=examcheck&+checkuser=$user&+checkexo=file&+checkstep=$nbstep |
||
85 | !endif |
||
14777 | guerimand | 86 | |
14783 | guerimand | 87 | |
16355 | guerimand | 88 | |
89 | !! ------------- in case of other ressources use the last.html file in s2. |
||
90 | |||
91 | |||
14783 | guerimand | 92 | !! ---------- make list of file of the user |
93 | !! the file of list_forbiddent are ignored (to be completed if need) |
||
94 | list_forbidden=last.html |
||
95 | listfile=!sh cd $wims_home/s2/$userses;\ |
||
96 | ls * |
||
97 | listfile=!lines2items $listfile |
||
98 | listfile=!listcomplement $list_forbidden in $listfile |
||
99 | listsed=$empty |
||
100 | listlink=$empty |
||
101 | !for f in $listfile |
||
102 | listsed=!append line s#$f#user$po-$f#g; to $listsed |
||
103 | listlink=!append line ln -s $wims_home/s2/$userses/$f $wims_home/s2/$wims_session/user$po-$f; to $listlink |
||
104 | !next f |
||
14777 | guerimand | 105 | !! ---------- build copy of user page |
106 | !read oef/fr/names |
||
14783 | guerimand | 107 | |
14912 | guerimand | 108 | page_content=!sh sed '1,3d' $wims_home/s2/$userses/last.html | sed 's#$(userses)#$wims_session#gi;\ |
109 | s#<a href="[^"]*"#<a href=""#gi;\ |
||
110 | s# target="[^"]*"# #gi;\ |
||
111 | s#<input type="submit"#<input type="submit" disabled #gi;\ |
||
14913 | guerimand | 112 | s#<input type="image"#<img #gi;\ |
14912 | guerimand | 113 | s#<button #<button disabled #gi;\ |
114 | s#onclick="wims_[a-zA-Z0-9^=]*=window.open([^)]*)"# #gi;\ |
||
14783 | guerimand | 115 | $listsed' |
14777 | guerimand | 116 | |
14783 | guerimand | 117 | !! make link to file of the user_session in supervisor_session (del old link before) |
118 | list=!sh cd $wims_home/s2/$wims_session;\ |
||
14886 | guerimand | 119 | lt=`find user$(po)* -type l 2>/dev/null`;\ |
14783 | guerimand | 120 | for f in $$lt; do rm $$f; done;\ |
121 | $listlink |
||
122 | |||
14777 | guerimand | 123 | warning=workinprogress |
124 | |||
14912 | guerimand | 125 | !! --- suppress auto refresh (need to put a button to refresh) |
14886 | guerimand | 126 | !let rd=!randint 111111,999999 |
15316 | guerimand | 127 | !set wims_menu_items=!append line refresh,1,module=$module&cmd=reply&+module=adm/class/tchat&+job=viewpage&+numberses=$numberses&+user=$user&+serial=$rd to $wims_menu_items |
14777 | guerimand | 128 | |
14886 | guerimand | 129 |