[svn r10773] we are now able to integrate links + student publications in the lp.

skala
Eric Marguin 19 years ago
parent f3f3b46ac0
commit 1a54072692
  1. 28
      main/newscorm/learnpath.class.php
  2. 1
      main/newscorm/lp_controller.php
  3. 5
      main/newscorm/resourcelinker.inc.php
  4. 6
      main/work/work.lib.php

@ -1880,7 +1880,7 @@ class learnpath {
$mycurrentitemid = $this->get_current_item_id();
if($this->mode == 'fullscreen'){
if($this->mode == 'fullscreen'){
$navbar = '<table cellpadding="0" cellspacing="0" align="left">'."\n".
@ -4563,21 +4563,19 @@ class learnpath {
$return .= '<div><a href="' . $_SERVER['PHP_SELF'] . '?cidReq=' . $_GET['cidReq'] . '&amp;action=add_item&amp;type=' . TOOL_DOCUMENT . '&amp;lp_id=' . $_SESSION['oLP']->lp_id . '">'.get_lang("NewDocument").'</a></div>';
$return .= '<div><a href="' . $_SERVER['PHP_SELF'] . '?cidReq=' . $_GET['cidReq'] . '&amp;action=add_item&amp;type=' . TOOL_QUIZ . '&amp;lp_id=' . $_SESSION['oLP']->lp_id . '">'.get_lang("NewQuiz").'</a></div>';
$return .= '<p class="lp_title" style="margin-top:10px;">'.get_lang("UseAnExistingResource").'</p>';
/* get al the docs */
/* get all the docs */
$return .= $this->get_documents();
/* get al the exercises */
$return .= $this->get_exercises();
/* get al links */
//$return .= $this->get_links();
/* get al the student publications */
//$return .= $this->get_student_publications();
/* get all the exercises */
$return .= $this->get_exercises();
/* get all the links */
$return .= $this->get_links();
/* get al the student publications */
$return .= $this->get_student_publications();
$return .= '</div>' . "\n";
@ -4641,7 +4639,8 @@ class learnpath {
* @return unknown
*/
function display_quiz_form($action = 'add', $id = 0, $extra_info = '')
{
{
$tbl_lp_item = Database::get_course_table('lp_item');
$tbl_quiz = Database::get_course_table(TABLE_QUIZ_TEST);
@ -4844,8 +4843,7 @@ class learnpath {
$return .= '</form>' . "\n";
$return .= '</div>' . "\n";
$return .= '</div>' . "\n";
return $return;
}

@ -385,7 +385,6 @@ switch($_REQUEST['action'])
break;
case 'view_item':
if($debug>0) error_log('New LP - view_item action triggered', 0);
if(!$lp_found){ error_log('New LP - No learnpath given for view item', 0); require('lp_list.php'); }

@ -1940,6 +1940,11 @@ function rl_get_resource_link_for_learnpath($course_code, $learnpath_id, $id_in_
break;
case TOOL_USER:
$link .= $main_dir_path.'user/user.php?origin='.$origin;
break;
case 'student_publication' :
include '../work/work.lib.php';
$path = get_work_path(1);
$link .= $main_course_path.$path;
break;
}//end switch
return $link;

@ -520,7 +520,7 @@ function del_dir($base_work_dir,$dir){
$dir = str_replace('./','',$dir);
$dir = str_replace('.','',$dir);
if(!is_dir($base_work_dir.$dir)) {return -1;}
$table = Database::get_course_table(STUDENT_PUBLICATION_TABLE);
$table = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
$sql = "DELETE FROM $table WHERE url LIKE 'work/".$dir."/%'";
$res = api_sql_query($sql,__FILE__,__LINE__);
require_once(api_get_library_path().'/fileManage.lib.php');
@ -532,7 +532,7 @@ function del_dir($base_work_dir,$dir){
* @return string Path (or -1 on error)
*/
function get_work_path($id){
$table = Database::get_course_table(STUDENT_PUBLICATION_TABLE);
$table = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
$sql = "SELECT * FROM $table WHERE id=$id";
$res = api_sql_query($sql);
if(Database::num_rows($res)!=1){
@ -550,7 +550,7 @@ function get_work_path($id){
*/
function update_work_url($id,$new_path){
if(empty($id)) return -1;
$table = Database::get_course_table(STUDENT_PUBLICATION_TABLE);
$table = Database::get_course_table(TABLE_STUDENT_PUBLICATION);
$sql = "SELECT * FROM $table WHERE id=$id";
$res = api_sql_query($sql);
if(Database::num_rows($res)!=1){

Loading…
Cancel
Save