[Answered] Publishing LP link only on session homepage

Moderator: Coursenligne

[Answered] Publishing LP link only on session homepage

Postby mark111 » Thu Mar 10, 2011 8:31 am

From the course: i can enable(visibility) the tool (LP repository view), i can publish a link to any of the LPs on the COURSE homepage, but that's it. Enabling access to the tool manifests in the tool visibility on the SESSIONS course home page, publishing just not. On the other hand, links from LINKS tool, published on the course home page, are visible on the session course home page.

may i suggest rethinking philosophy used behind the tool usage control (when used within sessions)?

btw:

publishing link to specific LP on sessions course can be done by editing sessions course home page. BUt look at the procedure:

set LP tool visible from the course home page, switch to the sesssions course, grab desired LP link, edit sessions home page and insert just grabbed link, enter to original course home page and make LP tool invisible

 

mark111
 
Posts: 21
Joined: Wed Jan 20, 2010 10:29 am

Hi Mark, Not adding this to

Postby ywarnier » Sun Mar 13, 2011 8:58 pm

Hi Mark,

Not adding this to the system has just been a matter of not getting the time to do it (and sessions management is much more trickier than it might seem at first glance). If you would like to suggest a patch, please do so on http://support.chamilo.org/projects/chamilo-18/issues

ywarnier
 
Posts: 983
Joined: Wed Dec 16, 2009 3:12 pm

Hi, Yannik, here's the

Postby mark111 » Sun Mar 20, 2011 11:11 pm

Hi, Yannick,

here's the solution. I do not think it's good enough to be called a patch. Some of the reasons are mentioned bellow; and as i said before. i just can't get the philosophy (bussiness rules?) behind the controling of the session's tools.  So, just move this post to the troubleshooting section if you like to.

 

 

ok,
home page links are constructed and shown (taken from course_home/activity.php, but no matter which view) :
 
$my_list = CourseHome::get_tools_category(TOOL_STUDENT_VIEW);  // construct the list of the tools
CourseHome::show_tools_category($my_list);                     // shows the list
 
constructed list from the get_tools_catagory shows publish lp link as:
 
[6] => Array
        (
            [id] => 27
            [name] => NovaUčnaPot
            [link] => newscorm/lp_controller.php?action=view&lp_id=1&id_session=0
            [image] => scormbuilder.gif
            [visibility] => 1
            [admin] => 0
            [address] => pastillegris.gif
            [added_tool] => 0
            [target] => _self
            [category] => authoring
            [session_id] => 0
        )
 
so lp is present in the constructed list, but condition for showing (from CourseHome::show_tools_category ) that reads:
 
foreach ($all_tools_list as & $tool){
                if ($tool['image'] == 'scormbuilder.gif') {
                    // display links to lp only for current session
                    if (api_get_session_id() != $tool['session_id']) {  // session id is wrong, continue with no action at the beggining of the block
                        continue;
                    }
 
prevents lp from showing as looking for the field [session_id] to be real session_id not 0 as been read from database table.
at this point, we can choose to control publishing lp link only by originated course. but from code, i suspect, that original idea was a bit more complex (controled by DB table field), but poorly or just not implemented. No matter what, following change should works with 1.8.7(.1):
 
main/inc/lib/course_home.lib.php / method get_tools_category /somewhere around line 489:
 
original code:
while ($temp_row = Database::fetch_assoc($result)) {
            if ($check) {
                if (!in_array($temp_row['name'],$hide_list)) {
                    $all_tools_list[] = $temp_row;
                } else {
                }
            } else {
                    $all_tools_list[] = $temp_row;
            }
        }
 
        /*if(api_is_course_coach()) {
 
changed:
 
while ($temp_row = Database::fetch_assoc($result)) {
            if ($check) {
                if (!in_array($temp_row['name'],$hide_list)) {
                    if ( $temp_row['image']=='scormbuilder.gif' ){
                        $temp_row['session_id'] = $session_id;     // change id to current session id
                    }
                    $all_tools_list[] = $temp_row;
                } else {
                }
            } else {
                    if ( $temp_row['image']=='scormbuilder.gif' ){
                        $temp_row['session_id'] = $session_id;    // change id to current session id
                    }
                    $all_tools_list[] = $temp_row;
            }
        }
 
        /*if(api_is_course_coach()) {
 
for the 1.8.7 will works. Note, that [code] [link] => newscorm/lp_controller.php?action=view&lp_id=1&id_session=0 [/code] was not changed (!!) since was not used anywhere. But this is not thee case with
1.8.8 (alpha+) as there is new interface for the session home. Currently this interface does not taking care about the visibility and there is a bug connected with lp_link constructed (duplicated id_session parameter, ... unfinished task?).
 
mark111
 
Posts: 21
Joined: Wed Jan 20, 2010 10:29 am

When I tried repeating

Postby clark40 » Wed May 04, 2011 10:17 am

When I tried repeating creating three course pages within the Chamilo free campus - I find that the arrows allow to move between the pages created as shown by the list below the progression box but my created content does not appear. A friend of mine installed chamilo on a solaris both and it shows the same problems as my server - unable to use the course forward and back arrows to move through the different content pages in the course area but you can see at least one of the pages content although it apear as if you are stuck on that one page.650-177 E20-361 HP0-D07 C-TADM51-70 JN0-360 70-401 70-681 1z0-052 6401-1 646-656 C-TFIN52-64 350-050

clark40
 
Posts: 5
Joined: Wed May 04, 2011 7:27 am


Return to Development suggestions

Who is online

Users browsing this forum: No registered users and 2 guests

[Answered] Publishing LP link only on session homepage

Moderator: Coursenligne

[Answered] Publishing LP link only on session homepage

Postby mark111 » Thu Mar 10, 2011 8:31 am

From the course: i can enable(visibility) the tool (LP repository view), i can publish a link to any of the LPs on the COURSE homepage, but that's it. Enabling access to the tool manifests in the tool visibility on the SESSIONS course home page, publishing just not. On the other hand, links from LINKS tool, published on the course home page, are visible on the session course home page.

may i suggest rethinking philosophy used behind the tool usage control (when used within sessions)?

btw:

publishing link to specific LP on sessions course can be done by editing sessions course home page. BUt look at the procedure:

set LP tool visible from the course home page, switch to the sesssions course, grab desired LP link, edit sessions home page and insert just grabbed link, enter to original course home page and make LP tool invisible

 

mark111
 
Posts: 21
Joined: Wed Jan 20, 2010 10:29 am

Hi Mark, Not adding this to

Postby ywarnier » Sun Mar 13, 2011 8:58 pm

Hi Mark,

Not adding this to the system has just been a matter of not getting the time to do it (and sessions management is much more trickier than it might seem at first glance). If you would like to suggest a patch, please do so on http://support.chamilo.org/projects/chamilo-18/issues

ywarnier
 
Posts: 983
Joined: Wed Dec 16, 2009 3:12 pm

Hi, Yannik, here's the

Postby mark111 » Sun Mar 20, 2011 11:11 pm

Hi, Yannick,

here's the solution. I do not think it's good enough to be called a patch. Some of the reasons are mentioned bellow; and as i said before. i just can't get the philosophy (bussiness rules?) behind the controling of the session's tools.  So, just move this post to the troubleshooting section if you like to.

 

 

ok,
home page links are constructed and shown (taken from course_home/activity.php, but no matter which view) :
 
$my_list = CourseHome::get_tools_category(TOOL_STUDENT_VIEW);  // construct the list of the tools
CourseHome::show_tools_category($my_list);                     // shows the list
 
constructed list from the get_tools_catagory shows publish lp link as:
 
[6] => Array
        (
            [id] => 27
            [name] => NovaUčnaPot
            [link] => newscorm/lp_controller.php?action=view&lp_id=1&id_session=0
            [image] => scormbuilder.gif
            [visibility] => 1
            [admin] => 0
            [address] => pastillegris.gif
            [added_tool] => 0
            [target] => _self
            [category] => authoring
            [session_id] => 0
        )
 
so lp is present in the constructed list, but condition for showing (from CourseHome::show_tools_category ) that reads:
 
foreach ($all_tools_list as & $tool){
                if ($tool['image'] == 'scormbuilder.gif') {
                    // display links to lp only for current session
                    if (api_get_session_id() != $tool['session_id']) {  // session id is wrong, continue with no action at the beggining of the block
                        continue;
                    }
 
prevents lp from showing as looking for the field [session_id] to be real session_id not 0 as been read from database table.
at this point, we can choose to control publishing lp link only by originated course. but from code, i suspect, that original idea was a bit more complex (controled by DB table field), but poorly or just not implemented. No matter what, following change should works with 1.8.7(.1):
 
main/inc/lib/course_home.lib.php / method get_tools_category /somewhere around line 489:
 
original code:
while ($temp_row = Database::fetch_assoc($result)) {
            if ($check) {
                if (!in_array($temp_row['name'],$hide_list)) {
                    $all_tools_list[] = $temp_row;
                } else {
                }
            } else {
                    $all_tools_list[] = $temp_row;
            }
        }
 
        /*if(api_is_course_coach()) {
 
changed:
 
while ($temp_row = Database::fetch_assoc($result)) {
            if ($check) {
                if (!in_array($temp_row['name'],$hide_list)) {
                    if ( $temp_row['image']=='scormbuilder.gif' ){
                        $temp_row['session_id'] = $session_id;     // change id to current session id
                    }
                    $all_tools_list[] = $temp_row;
                } else {
                }
            } else {
                    if ( $temp_row['image']=='scormbuilder.gif' ){
                        $temp_row['session_id'] = $session_id;    // change id to current session id
                    }
                    $all_tools_list[] = $temp_row;
            }
        }
 
        /*if(api_is_course_coach()) {
 
for the 1.8.7 will works. Note, that [code] [link] => newscorm/lp_controller.php?action=view&lp_id=1&id_session=0 [/code] was not changed (!!) since was not used anywhere. But this is not thee case with
1.8.8 (alpha+) as there is new interface for the session home. Currently this interface does not taking care about the visibility and there is a bug connected with lp_link constructed (duplicated id_session parameter, ... unfinished task?).
 
mark111
 
Posts: 21
Joined: Wed Jan 20, 2010 10:29 am

When I tried repeating

Postby clark40 » Wed May 04, 2011 10:17 am

When I tried repeating creating three course pages within the Chamilo free campus - I find that the arrows allow to move between the pages created as shown by the list below the progression box but my created content does not appear. A friend of mine installed chamilo on a solaris both and it shows the same problems as my server - unable to use the course forward and back arrows to move through the different content pages in the course area but you can see at least one of the pages content although it apear as if you are stuck on that one page.650-177 E20-361 HP0-D07 C-TADM51-70 JN0-360 70-401 70-681 1z0-052 6401-1 646-656 C-TFIN52-64 350-050

clark40
 
Posts: 5
Joined: Wed May 04, 2011 7:27 am


Return to Development suggestions

Who is online

Users browsing this forum: No registered users and 2 guests

Social network

Youtube

Subscribe to our newsletter

Leave us your e-mail in the box below, then make sure you approve the confirmation e-mail you will receive

 


 

Upcoming events