[Hw4mdl-svn] SF.net SVN: hw4mdl: [142] trunk/moodle/mod/liveclassroom
Brought to you by:
jhlinder,
trollinger
|
From: <sh...@us...> - 2006-12-28 15:00:52
|
Revision: 142
http://svn.sourceforge.net/hw4mdl/?rev=142&view=rev
Author: shazan
Date: 2006-12-28 07:00:51 -0800 (Thu, 28 Dec 2006)
Log Message:
-----------
fix bug 10538 :now, the archives are visible for students if they are available.
the array with all the archives is now indexed by the id of the archive.
Modified Paths:
--------------
trunk/moodle/mod/liveclassroom/api.php
trunk/moodle/mod/liveclassroom/manageRoomAction.php
Modified: trunk/moodle/mod/liveclassroom/api.php
===================================================================
--- trunk/moodle/mod/liveclassroom/api.php 2006-12-28 14:45:06 UTC (rev 141)
+++ trunk/moodle/mod/liveclassroom/api.php 2006-12-28 15:00:51 UTC (rev 142)
@@ -691,8 +691,7 @@
$j++;
}
}
-
-
+
return $list_return;
}
@@ -705,8 +704,8 @@
*/
function liveclassroom_api_get_open_archive_list_for_a_room($roomid,$userid) {
global $CFG;
-
- $final_list = "&attribute=class_id&attribute=longname&filter01=archive&filter01value=1&filter02=preview&filter02value=1&AccessUser=$userid";
+
+ $final_list = "&attribute=preview&attribute=class_id&attribute=longname&filter01=archive&filter01value=1&AccessUser=$userid";
$enc_list = str_replace(" ", "+", $final_list);
$data = liveclassroom_api_send_query(LIVECLASSROOM_API_FUNCTION_GET_ROOM_LIST, $enc_list);
@@ -724,18 +723,20 @@
$j=0;
- for($i=1;$i<sizeof($line)-2;$i=$i+3) {
+ for($i=1;$i<sizeof($line)-3;$i=$i+4) {
$test = strstr($line[$i+1],$roomid);
if($test!=false) {
- // $list_return[$j][0]= liveclassroom_parse_line($line[$i],"preview=");
- $list_return[$j][1]= liveclassroom_parse_line($line[$i],"class_id=");
- $list_return[$j][2] = liveclassroom_parse_line($line[$i+1],"longname=");
- $j++;
+ if(liveclassroom_parse_line($line[$i],"preview=")==0) {
+ $list_return[$j][1]= liveclassroom_parse_line($line[$i+1],"class_id=");
+ $list_return[$j][2] = liveclassroom_parse_line($line[$i+2],"longname=");
+ $j++;
+ }
}
}
return $list_return;
+
}
/*
@@ -766,12 +767,12 @@
$j=0;
for($i=1;$i<sizeof($line)-3;$i=$i+4) {
+ $id = liveclassroom_parse_line($line[$i+1],"class_id=");
+ $list_return[$id][0]= liveclassroom_parse_line($line[$i],"preview=");
+ $list_return[$id][1]= $id;
+ $list_return[$id][2] = liveclassroom_parse_line($line[$i+2],"longname=");
+ $j++;
- $list_return[$line[$i+1]][0]= liveclassroom_parse_line($line[$i],"preview=");
- $list_return[$line[$i+1]][1]= liveclassroom_parse_line($line[$i+1],"class_id=");
- $list_return[$line[$i+1]][2] = liveclassroom_parse_line($line[$i+2],"longname=");
- $j++;
-
}
@@ -1362,6 +1363,8 @@
$tabarchive = array();
$orphanedArchives = liveclassroom_api_get_archive_list($userid);
+
+ add_to_log($COURSE->id, "liveclassroom", "archive", "action", sizeof($orphanedArchives));
$nbrClosedArchive = 0;
for($i=1;$i<sizeof($line)-3;$i=$i+4){
@@ -1379,12 +1382,19 @@
if ($isteacher=="1")
{
$tabarchive = liveclassroom_api_get_archive_list_for_a_room($roomid,$userid);
+ add_to_log($COURSE->id, "liveclassroom", "archiveteacher", "action", sizeof($tabarchive));
+ foreach ($tabarchive as $tabarchive_value) {
+ unset($orphanedArchives[$tabarchive_value[1]]) ;
+ }
}
else //just the open archive
{
$tabarchive = liveclassroom_api_get_open_archive_list_for_a_room($roomid,$userid);
- add_to_log("", "liveclassroom", "test id", "test", $userid);
- add_to_log("", "liveclassroom", "test archive", "test", sizeof($tabarchive));
+ add_to_log($COURSE->id, "liveclassroom", "archivestudent", "action", sizeof($tabarchive));
+ $tabarchiveall = $tabarchive = liveclassroom_api_get_archive_list_for_a_room($roomid,$userid);
+ foreach ($tabarchiveall as $tabarchiveall_value) {
+ unset($orphanedArchives[$tabarchiveall_value[1]]) ;
+ }
}
if(liveclassroom_api_role_user_room($roomid, $studentuserid)=='Student') { //lecture room
@@ -1433,7 +1443,6 @@
foreach ($tabarchive as $tabarchive_value) {
$archive = $xmldoc->create_element('archive');
- // $xmlOrphanedArchiveForStudent = $xmldoc->CreateElement("orphanedArchiveForStudent");
$archiveid = $xmldoc->create_element('id');
$archiveid->append_child($xmldoc->create_text_node("$tabarchive_value[1]"));
@@ -1453,7 +1462,7 @@
$archive->append_child($archivename);
$archive->append_child($archivepreview);
$archives->append_child($archive);
- unset($orphanedArchives[$tabarchive_value[1]]) ;
+
/*
if ( ($roompreview==1) && ($tabarchive_value[0]==0))
{
@@ -1477,7 +1486,8 @@
*/
}
$roomParameters->append_child($archives);
-
+
+
}
$closedArchive = $xmldoc->create_element("closedArchive");
@@ -1497,7 +1507,7 @@
$listElements->append_child($element);
}
-
+ add_to_log($COURSE->id, "liveclassroom", "orphaned", "action", sizeof($orphanedArchives));
foreach ($orphanedArchives as $orphanedArchive)
{
$xmlOrphanedArchive = $xmldoc->create_element("listElement");
Modified: trunk/moodle/mod/liveclassroom/manageRoomAction.php
===================================================================
--- trunk/moodle/mod/liveclassroom/manageRoomAction.php 2006-12-28 14:45:06 UTC (rev 141)
+++ trunk/moodle/mod/liveclassroom/manageRoomAction.php 2006-12-28 15:00:51 UTC (rev 142)
@@ -60,26 +60,30 @@
}
-
}
if(isteacher($courseid)) {
if($_GET['action']=='createRoom') {
if($list_attributes['led']=='instructor'){
- $bool = true;
+ $bool = true;
+ if (!isset($list_attributes['chatenable'])) $list_attributes['chatenable']="0";
+ if (!isset($list_attributes['student_wb_liveapp'])) $list_attributes['student_wb_liveapp']="0";
+ if (!isset($list_attributes['hms_two_way_enabled'])) $list_attributes['hms_two_way_enabled']="0";
+ if (!isset($list_attributes['hms_simulcast_restricted'])) $list_attributes['hms_simulcast_restricted']=1;
}
- else $bool = false;
+ else {
+ $bool = false;
+ if (!isset($list_attributes['can_archive'])) $list_attributes['can_archive']="0";
+ if (!isset($list_attributes['can_liveshare'])) $list_attributes['can_liveshare']="0";
+ if (!isset($list_attributes['can_ppt_import'])) $list_attributes['can_ppt_import']="0";
+
+ }
//Available
- if (!isset($list_attributes['can_archive'])) $list_attributes['can_archive']="0";
- if (!isset($list_attributes['can_liveshare'])) $list_attributes['can_liveshare']="0";
- if (!isset($list_attributes['can_ppt_import'])) $list_attributes['can_ppt_import']="0";
- if (!isset($list_attributes['hms_two_way_enabled'])) $list_attributes['hms_two_way_enabled']="0";
- if (!isset($list_attributes['hms_simulcast_restricted'])) $list_attributes['hms_simulcast_restricted']=1;
if (!isset($list_attributes['preview'])) $list_attributes['preview']=1;
- if (!isset($list_attributes['student_wb_enabled'])) $list_attributes['student_wb_enabled']="0";
- if (!isset($list_attributes['student_wb_liveapp'])) $list_attributes['student_wb_liveapp']="0";
- if (!isset($list_attributes['chatenable'])) $list_attributes['chatenable']="0";
+ if (!isset($list_attributes['student_wb_enabled'])) $list_attributes['student_wb_enabled']="0";
+
+
if (!liveclassroom_create_room ($courseid, $list_attributes['longname'], $bool, $list_attributes)) {
notice(get_string("roomcreationfailed", "liveclassroom"), $_SERVER["HTTP_REFERER"]);
exit;
@@ -87,17 +91,21 @@
$messageType = 'roomCreated';
}
else if($_GET['action']=='updateRoom') {
+ if($list_attributes['led']=='instructor'){
+ if (!isset($list_attributes['chatenable'])) $list_attributes['chatenable']="0";
+ if (!isset($list_attributes['student_wb_liveapp'])) $list_attributes['student_wb_liveapp']="0";
+ if (!isset($list_attributes['hms_two_way_enabled'])) $list_attributes['hms_two_way_enabled']="0";
+ if (!isset($list_attributes['hms_simulcast_restricted'])) $list_attributes['hms_simulcast_restricted']=1;
+ }
+ else {
+ if (!isset($list_attributes['can_archive'])) $list_attributes['can_archive']="0";
+ if (!isset($list_attributes['can_liveshare'])) $list_attributes['can_liveshare']="0";
+ if (!isset($list_attributes['can_ppt_import'])) $list_attributes['can_ppt_import']="0";
+
+ }
//Available
-
- if (!isset($list_attributes['can_archive'])) $list_attributes['can_archive']="0";
- if (!isset($list_attributes['can_liveshare'])) $list_attributes['can_liveshare']="0";
- if (!isset($list_attributes['can_ppt_import'])) $list_attributes['can_ppt_import']="0";
- if (!isset($list_attributes['hms_two_way_enabled'])) $list_attributes['hms_two_way_enabled']="0";
- if (!isset($list_attributes['hms_simulcast_restricted'])) $list_attributes['hms_simulcast_restricted']=1;
if (!isset($list_attributes['preview'])) $list_attributes['preview']=1;
- if (!isset($list_attributes['student_wb_enabled'])) $list_attributes['student_wb_enabled']="0";
- if (!isset($list_attributes['student_wb_liveapp'])) $list_attributes['student_wb_liveapp']="0";
- if (!isset($list_attributes['chatenable'])) $list_attributes['chatenable']="0";
+ if (!isset($list_attributes['student_wb_enabled'])) $list_attributes['student_wb_enabled']="0";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|