Rev 16364 | 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 |
||
16366 | guerimand | 21 | list_window=!defof $user in wimshome/sessions/$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 |
16364 | guerimand | 32 | |
33 | !readproc script/mktitle.proc $userses |
||
34 | |||
35 | !!reset logfile |
||
36 | !!!if exam isin $userses |
||
37 | !! !! case of exercise in an exam |
||
38 | !! userbasesession=!replace _ by , in $userses |
||
39 | !! userbasesession=!item 1 of $userbasesession |
||
40 | !! tmp=!replace internal $(userbasesession)_examt by $empty in $userses |
||
41 | !! tmp=!replace t by . in $tmp |
||
42 | !! logfile=wimshome/log/classes/$wims_class/examlog/$user/$userbasesession/$tmp |
||
43 | !!else |
||
44 | !! !! case of an exercise in a sheet |
||
45 | !! tmp=!defof w_wims_exo,w_wims_sheet,w_module in wimshome/sessions/$userses/var |
||
46 | !! !distribute item $tmp into userexo,usersheet,exomod |
||
47 | !! !if $usersheet!=$empty and $userexo!=$empty |
||
48 | !! logfile=wimshome/sessions/$userses/exolog.$usersheet.$userexo |
||
49 | !! !else |
||
50 | !! !! case of a exercise (not in a sheet for exemple in a document) |
||
51 | !! category=!defof category in wimshome/public_html/modules/$exomod/INDEX |
||
52 | !! !if exercise isin $category |
||
53 | !! logfile=wimshome/sessions/$userses/exolog |
||
54 | !! !endif |
||
55 | !! !endif |
||
56 | !!!endif |
||
57 | |||
58 | |||
59 | |||
16355 | guerimand | 60 | !if $logfile!=$empty |
61 | !! ----------- use adm/class/exolog module to display exo in a sheet or exam |
||
62 | test=!fileexists $logfile |
||
63 | !if $test!=yes |
||
64 | error=addressplay |
||
65 | !exit |
||
66 | !endif |
||
67 | !writefile wimshome/$wims_sesdir/var REMOTE_ADDR=$httpd_REMOTE_ADDR\ |
||
68 | HTTP_REFERER=$httpd_HTTP_REFERER\ |
||
69 | QUERY_STRING=\ |
||
70 | HTTP_USER_AGENT=$httpd_HTTP_USER_AGENT\ |
||
71 | HTTP_COOKIE=$httpd_HTTP_COOKIE\ |
||
72 | w_cmd=new\ |
||
73 | w_lang=$class_lang\ |
||
74 | w_special_parm=1\ |
||
75 | w_special_parm2=\ |
||
76 | w_useropts=$useropts\ |
||
77 | w_wims_session=$wims_session\ |
||
78 | w_wims_subsession=$wims_subsession\ |
||
79 | w_wims_window=$wims_window\ |
||
80 | w_wims_mode=$wims_mode\ |
||
81 | w_wims_module_start_time=\ |
||
82 | w_wims_protocol=$wims_protocol\ |
||
83 | w_wims_req_time=$wims_req_time\ |
||
84 | w_wims_session_serial=$wims_session_serial\ |
||
85 | w_wims_session_start_time=$wims_session_start_time |
||
14777 | guerimand | 86 | |
16355 | guerimand | 87 | !setdef wims_checkfile=$logfile in wimshome/$wims_sesdir/var.stat |
16364 | guerimand | 88 | !setdef wims_checktitle=$output_title in wimshome/sessions/$basesession/var.stat |
16355 | guerimand | 89 | nbstep=!recordcnt $logfile |
90 | !restart module=adm/class/exolog&+cmd=new&+job=examcheck&+checkuser=$user&+checkexo=file&+checkstep=$nbstep |
||
91 | !endif |
||
14777 | guerimand | 92 | |
14783 | guerimand | 93 | |
16355 | guerimand | 94 | |
95 | !! ------------- in case of other ressources use the last.html file in s2. |
||
96 | |||
97 | |||
14783 | guerimand | 98 | !! ---------- make list of file of the user |
99 | !! the file of list_forbiddent are ignored (to be completed if need) |
||
100 | list_forbidden=last.html |
||
101 | listfile=!sh cd $wims_home/s2/$userses;\ |
||
102 | ls * |
||
103 | listfile=!lines2items $listfile |
||
104 | listfile=!listcomplement $list_forbidden in $listfile |
||
105 | listsed=$empty |
||
106 | listlink=$empty |
||
107 | !for f in $listfile |
||
108 | listsed=!append line s#$f#user$po-$f#g; to $listsed |
||
109 | listlink=!append line ln -s $wims_home/s2/$userses/$f $wims_home/s2/$wims_session/user$po-$f; to $listlink |
||
110 | !next f |
||
14777 | guerimand | 111 | !! ---------- build copy of user page |
112 | !read oef/fr/names |
||
14783 | guerimand | 113 | |
14912 | guerimand | 114 | page_content=!sh sed '1,3d' $wims_home/s2/$userses/last.html | sed 's#$(userses)#$wims_session#gi;\ |
115 | s#<a href="[^"]*"#<a href=""#gi;\ |
||
116 | s# target="[^"]*"# #gi;\ |
||
117 | s#<input type="submit"#<input type="submit" disabled #gi;\ |
||
14913 | guerimand | 118 | s#<input type="image"#<img #gi;\ |
14912 | guerimand | 119 | s#<button #<button disabled #gi;\ |
120 | s#onclick="wims_[a-zA-Z0-9^=]*=window.open([^)]*)"# #gi;\ |
||
14783 | guerimand | 121 | $listsed' |
14777 | guerimand | 122 | |
14783 | guerimand | 123 | !! make link to file of the user_session in supervisor_session (del old link before) |
124 | list=!sh cd $wims_home/s2/$wims_session;\ |
||
14886 | guerimand | 125 | lt=`find user$(po)* -type l 2>/dev/null`;\ |
14783 | guerimand | 126 | for f in $$lt; do rm $$f; done;\ |
127 | $listlink |
||
128 | |||
14777 | guerimand | 129 | warning=workinprogress |
130 | |||
14912 | guerimand | 131 | !! --- suppress auto refresh (need to put a button to refresh) |
14886 | guerimand | 132 | !let rd=!randint 111111,999999 |
15316 | guerimand | 133 | !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 | 134 | |
14886 | guerimand | 135 |