Merge branch '1.9.x' of github.com:chamilo/chamilo-lms into nuevo

1.9.x
Julio Montoya 11 years ago
commit 65293ace70
  1. 9
      index.php
  2. 1
      main/admin/course_intro_pdf_import.php
  3. 4
      main/admin/session_import.php
  4. 27
      main/coursecopy/classes/CourseBuilder.class.php
  5. 21
      main/css/base.css
  6. 64
      main/exercice/aiken.php
  7. 99
      main/exercice/export/aiken/aiken_import.inc.php
  8. 2
      main/inc/ajax/admin.ajax.php
  9. 9
      main/inc/lib/course.lib.php
  10. 2
      main/inc/lib/course_home.lib.php
  11. 2
      main/inc/lib/javascript/bxslider/bx_styles/bx_styles.css
  12. 26
      main/inc/lib/sessionmanager.lib.php
  13. 7
      main/inc/lib/userportal.lib.php
  14. 16
      main/lang/english/exercice.inc.php
  15. 16
      main/lang/spanish/exercice.inc.php
  16. 29
      main/newscorm/learnpath.class.php
  17. 15
      plugin/bbb/lib/bbb.lib.php

@ -179,13 +179,10 @@ if (!isset($_REQUEST['include'])) {
global $_configuration;
//hiding global announcements when user not connected
if ($_configuration['hide_global_announcements_when_not_connected'] && isset($_user['user_id'])) {
$controller->tpl->assign('announcements_block', $announcements_block);
}
//hiding home top whe user not connected
if ($_configuration['hide_home_top_when_connected'] && !isset($_user['user_id'])) {
$controller->tpl->assign('home_page_block', $controller->return_home_page());
if (empty($_configuration['hide_global_announcements_when_not_connected']) || !empty($_user['user_id'])) {
$controller->tpl->assign('announcements_block', $announcements_block);
}
$controller->tpl->assign('home_page_block', $controller->return_home_page());
$controller->tpl->assign('hot_courses', $hot_courses);
$controller->tpl->assign('navigation_course_links', $controller->return_navigation_links());
$controller->tpl->assign('notice_block', $controller->return_notice());

@ -147,6 +147,7 @@ function import_pdfs($file, $subDir = '/') {
}
} else {
error_log($parts[0].' is not a course, apparently');
$errors[] = array('Line' => 0, 'Code' => $parts[0], 'Title' => $parts[0].' - '.get_lang('CodeDoesNotExists'));
}
}
return $errors;

@ -324,6 +324,8 @@ if ($_POST['formSent']) {
course_code = '$course_code',
id_session='$session_id'";
$rs_course = Database::query($sql_course);
$course_info = api_get_course_info($course['code']);
SessionManager::installCourse($id_session, $course_info['real_id']);
}
$course_coaches = explode(',', $node_course->Coach);
@ -387,6 +389,8 @@ if ($_POST['formSent']) {
course_code = '".$vcourse['code']."',
id_session='$session_id'";
$rs_course = Database::query($sql_course);
$course_info = api_get_course_info($course['code']);
SessionManager::installCourse($id_session, $course_info['real_id']);
$course_coaches = explode(",",$node_course->Coach);

@ -975,19 +975,20 @@ class CourseBuilder
}
}
//$sql = 'SELECT * FROM '.$table_thematic_plan.' WHERE c_id = '.$course_id.' AND thematic_id = '.$row['id'];
$sql = "SELECT tp.*
FROM $table_thematic_plan tp
INNER JOIN $table_thematic t ON (t.id=tp.thematic_id)
WHERE t.c_id = $course_id AND
tp.c_id = $course_id AND
thematic_id = {$row['id']} AND
tp.id IN (".implode(', ', $thematic_plan_id_list).") ";
$result = Database::query($sql);
while ($sub_row = Database::fetch_array($result,'ASSOC')) {
$thematic->add_thematic_plan($sub_row);
if (count($thematic_plan_id_list) > 0) {
$sql = "SELECT tp.*
FROM $table_thematic_plan tp
INNER JOIN $table_thematic t ON (t.id=tp.thematic_id)
WHERE t.c_id = $course_id AND
tp.c_id = $course_id AND
thematic_id = {$row['id']} AND
tp.id IN (".implode(', ', $thematic_plan_id_list).") ";
$result = Database::query($sql);
while ($sub_row = Database::fetch_array($result,'ASSOC')) {
$thematic->add_thematic_plan($sub_row);
}
}
$this->course->add_resource($thematic);
}

@ -284,12 +284,19 @@ form .formw input {
#top_main_content .span3 {
float: left;
}
[dir=rtl] #top_main_content .span3 {
float: right;
}
#top_main_content .control-group .span3 {
float: none;
}
#top_main_content .span9 {
float: left;
}
[dir=rtl] #top_main_content .span9 {
float: right;
}
#top_main_content .span6 {
width: 460px;
}
@ -433,6 +440,16 @@ footer #footer_right {
padding: 2px 2px 2px 14px;
vertical-align:middle;
}
[dir=rtl] .actions {
background:#efefef;
border:1px solid #ccc;
margin-bottom: 11px;
height:32px;
padding: 2px 2px 2px 14px;
vertical-align:middle;
float: right;
}
.actions .actions-pagination {
float:right;
margin-top:2px;
@ -504,6 +521,10 @@ footer #footer_right {
max-height: 100px;
}
[dir=rtl] #friends > .thumbnails > li {
float: right;
}
.show-grid [class*="span"] {
background-color: #EEEEEE;
border-bottom-left-radius: 3px;

@ -14,14 +14,19 @@ $language_file = 'exercice';
// including the global Chamilo file
require_once '../inc/global.inc.php';
require_once api_get_path(LIBRARY_PATH).'document.lib.php';
$lib_path = api_get_path(LIBRARY_PATH);
$main_path = api_get_path(SYS_CODE_PATH);
require_once $lib_path.'document.lib.php';
require_once $lib_path.'fileUpload.lib.php';
require_once $lib_path.'fileManage.lib.php';
// including additional libraries
require_once 'exercise.class.php';
require_once 'question.class.php';
require_once 'answer.class.php';
require_once 'unique_answer.class.php';
require_once $main_path.'exercice/export/aiken/aiken_import.inc.php';
require_once $main_path.'exercice/export/aiken/aiken_classes.php';
// section (for the tabs)
$this_section = SECTION_COURSES;
@ -35,56 +40,8 @@ if (!api_is_allowed_to_edit(null, true)) {
$interbreadcrumb[]= array ("url"=>"exercice.php", "name"=> get_lang('Exercices'));
$is_allowedToEdit = api_is_allowed_to_edit(null, true);
/**
* This function displays the form for import of the zip file with qti2
*/
function aiken_display_form($msg = '') {
$name_tools = get_lang('ImportAikenQuiz');
$form = '<div class="actions">';
$form .= '<a href="exercice.php?show=test">' . Display :: return_icon('back.png', get_lang('BackToExercisesList'),'',ICON_SIZE_MEDIUM).'</a>';
$form .= '</div>';
if (!empty($msg)) {
$form .= $msg;
}
$form_validator = new FormValidator('aiken_upload', 'post',api_get_self()."?".api_get_cidreq(), null, array('enctype' => 'multipart/form-data') );
$form_validator->addElement('header', $name_tools);
$form_validator->addElement('file', 'userFile', get_lang('DownloadFile'));
$form_validator->addElement('style_submit_button', 'submit', get_lang('Send'), 'class="upload"');
$form .= $form_validator->return_form();
echo $form;
}
/**
* This function will import the zip file with the respective qti2
* @param array $uploaded_file ($_FILES)
*/
function aiken_import_file($array_file) {
$unzip = 0;
$lib_path = api_get_path(LIBRARY_PATH);
require_once $lib_path.'fileUpload.lib.php';
require_once $lib_path.'fileManage.lib.php';
$process = process_uploaded_file($array_file);
if (preg_match('/\.(zip|txt)$/i', $array_file['name'])) {
// if it's a zip, allow zip upload
$unzip = 1;
}
if ($process && $unzip == 1) {
$main_path = api_get_path(SYS_CODE_PATH);
require_once $main_path.'exercice/export/aiken/aiken_import.inc.php';
require_once $main_path.'exercice/export/aiken/aiken_classes.php';
$imported = import_exercise($array_file['name']);
if ($imported) {
header('Location: exercice.php?'.api_get_cidreq());
} else {
$msg = Display::return_message(get_lang('UplNoFileUploaded'),'error');
return $msg;
}
}
}
// display header
Display::display_header(get_lang('ImportAikenQuiz'), 'Exercises');
$msg = '';
// import file
@ -94,9 +51,6 @@ if ((api_is_allowed_to_edit(null, true))) {
}
}
// display header
Display::display_header(get_lang('ImportAikenQuiz'), 'Exercises');
// display Aiken form
aiken_display_form($msg);

@ -31,6 +31,25 @@ function tempdir($dir, $prefix = 'tmp', $mode = 0777) {
return $path;
}
/**
* This function displays the form for import of the zip file with qti2
* @param string Report message to show in case of error
*/
function aiken_display_form($msg = '') {
$name_tools = get_lang('ImportAikenQuiz');
$form = '<div class="actions">';
$form .= '<a href="exercice.php?show=test">' . Display :: return_icon('back.png', get_lang('BackToExercisesList'),'',ICON_SIZE_MEDIUM).'</a>';
$form .= '</div>';
$form .= $msg;
$form_validator = new FormValidator('aiken_upload', 'post',api_get_self()."?".api_get_cidreq(), null, array('enctype' => 'multipart/form-data') );
$form_validator->addElement('header', $name_tools);
$form_validator->addElement('file', 'userFile', get_lang('DownloadFile'));
$form_validator->addElement('style_submit_button', 'submit', get_lang('Send'), 'class="upload"');
$form .= $form_validator->return_form();
$form .= '<blockquote>'.get_lang('ImportAikenQuizExplanation').'<br /><pre>'.get_lang('ImportAikenQuizExplanationExample').'</pre></blockquote>';
echo $form;
}
/**
* Gets the uploaded file (from $_FILES) and unzip it to the given directory
* @param string The directory where to do the work
@ -44,13 +63,13 @@ function get_and_unzip_uploaded_exercise($baseWorkDir, $uploadPath) {
// upload failed
return false;
}
if (preg_match('/.zip$/i', $_FILES['userFile']['name']) && handle_uploaded_document($_course, $_FILES['userFile'], $baseWorkDir, $uploadPath, $_user['user_id'], 0, null, 1)) {
if (!function_exists('gzopen')) {
if (preg_match('/.zip$/i', $_FILES['userFile']['name']) && handle_uploaded_document($_course, $_FILES['userFile'], $baseWorkDir, $uploadPath, $_user['user_id'], 0, null, 1, 'overwrite', false)) {
if (!function_exists('gzopen')) {
return false;
}
// upload successful
return true;
} elseif (preg_match('/.txt/i', $_FILES['userFile']['name']) && handle_uploaded_document($_course, $_FILES['userFile'], $baseWorkDir, $uploadPath, $_user['user_id'], 0, null, 0)) {
} elseif (preg_match('/.txt/i', $_FILES['userFile']['name']) && handle_uploaded_document($_course, $_FILES['userFile'], $baseWorkDir, $uploadPath, $_user['user_id'], 0, null, 0, 'overwrite', false)) {
return true;
} else {
return false;
@ -58,16 +77,15 @@ function get_and_unzip_uploaded_exercise($baseWorkDir, $uploadPath) {
}
/**
* Main function to import the Aiken exercise
* @return an array as a backlog of what was really imported, and error or debug messages to display
* @return mixed True on success, error message on failure
*/
function import_exercise($file) {
function aiken_import_exercise($file) {
global $exercise_info;
global $element_pile;
global $non_HTML_tag_to_avoid;
global $record_item_body;
// used to specify the question directory where files could be found in relation in any question
global $questionTempDir;
$archive_path = api_get_path(SYS_ARCHIVE_PATH) . 'aiken';
$baseWorkDir = $archive_path;
@ -87,17 +105,17 @@ function import_exercise($file) {
$element_pile = array (); //pile to known the depth in which we are
//$module_info = array (); //array to store the info we need
// if file is not a .zip, then we cancel all
// if file is not a .zip, then we cancel all
if (!preg_match('/.(zip|txt)$/i', $file)) {
Display :: display_error_message(get_lang('YouMustUploadAZipOrTxtFile'));
return false;
return 'YouMustUploadAZipOrTxtFile';
}
// unzip the uploaded file in a tmp directory
if (preg_match('/.(zip|txt)$/i', $file)) {
if (!get_and_unzip_uploaded_exercise($baseWorkDir, $uploadPath)) {
Display :: display_error_message(get_lang('ThereWasAProblemWithYourFile'));
return false;
Display :: display_error_message(get_lang(''));
return 'ThereWasAProblemWithYourFile';
}
}
@ -114,23 +132,22 @@ function import_exercise($file) {
$questionHandle = opendir($baseWorkDir . '/' . $file);
while (false !== ($questionFile = readdir($questionHandle))) {
if (preg_match('/.txt$/i', $questionFile)) {
$result = parse_file($baseWorkDir, $file, $questionFile);
$result = aiken_parse_file($exercise_info, $baseWorkDir, $file, $questionFile);
$file_found = true;
}
}
} elseif (preg_match('/.txt$/i', $file)) {
$result = parse_file($baseWorkDir, '', $file);
$result = aiken_parse_file($exercise_info, $baseWorkDir, '', $file);
$file_found = true;
} // else ignore file
}
if (!$file_found) {
Display :: display_error_message(get_lang('NoTxtFileFoundInTheZip'));
return false;
//Display :: display_error_message(get_lang('NoTxtFileFoundInTheZip'));
$result = 'NoTxtFileFoundInTheZip';
}
if ($result == false ) {
return false;
if ($result !== true ) {
return $result;
}
//add exercise in tool
//1.create exercise
@ -186,21 +203,21 @@ function import_exercise($file) {
/**
* Parses an Aiken file and builds an array of exercise + questions to be
* imported by the import_exercise() function
* @param array The reference to the array in which to store the questions
* @param string Path to the directory with the file to be parsed (without final /)
* @param string Name of the last directory part for the file (without /)
* @param string Name of the file to be parsed (including extension)
* @return bool True on success, false on error
* @return mixed True on success, error message on error
* @assert ('','','') === false
*/
function parse_file($exercisePath, $file, $questionFile) {
global $exercise_info;
function aiken_parse_file(&$exercise_info, $exercisePath, $file, $questionFile) {
global $questionTempDir;
$questionTempDir = $exercisePath . '/' . $file . '/';
$questionFilePath = $questionTempDir . $questionFile;
if (!is_file($questionFilePath)) {
return false;
return 'FileNotFound';
}
$data = file($questionFilePath);
@ -232,13 +249,27 @@ function parse_file($exercisePath, $file, $questionFile) {
} elseif (preg_match('/^ANSWER_EXPLANATION:\s?(.*)/', $info, $matches)) {
//Comment of correct answer
$correct_answer_index = array_search($matches[1], $answers_array);
//$exercise_info['question'][$question_index]['answer'][$correct_answer_index]['feedback'] = $matches[1];
$exercise_info['question'][$question_index]['feedback'] = $matches[1];
} elseif (preg_match('/^TEXTO_CORRECTA:\s?(.*)/', $info, $matches)) {
//Comment of correct answer (Spanish e-ducativa format)
$correct_answer_index = array_search($matches[1], $answers_array);
$exercise_info['question'][$question_index]['feedback'] = $matches[1];
} elseif (preg_match('/^TAGS:\s?([A-Z])\s?/', $info, $matches)) {
//TAGS for chamilo >= 1.10
$exercise_info['question'][$question_index]['answer_tags'] = explode(',', $matches[1]);
} elseif (preg_match('/^ETIQUETAS:\s?([A-Z])\s?/', $info, $matches)) {
//TAGS for chamilo >= 1.10 (Spanish e-ducativa format)
$exercise_info['question'][$question_index]['answer_tags'] = explode(',', $matches[1]);
} elseif (preg_match('/^(\r)?\n/',$info)) {
//moving to next question (tolerate \r\n or just \n)
if (empty($exercise_info['question'][$question_index]['correct_answers'])) {
error_log('Aiken: Error in question index '.$question_index.': no correct answer defined');
return 'ExerciseAikenErrorNoCorrectAnswerDefined';
}
if (empty($exercise_info['question'][$question_index]['answer'])) {
error_log('Aiken: Error in question index '.$question_index.': no answer option given');
return 'ExerciseAikenErrorNoAnswerOptionGiven';
}
$question_index++;
//emptying answers array when moving to next question
$answers_array = array();
@ -254,4 +285,28 @@ function parse_file($exercisePath, $file, $questionFile) {
$exercise_info['question'][$key]['weighting'][current(array_keys($exercise_info['question'][$key]['weighting']))] = 20 / $total_questions;
}
return true;
}
/**
* This function will import the zip file with the respective qti2
* @param array $uploaded_file ($_FILES)
*/
function aiken_import_file($array_file) {
$unzip = 0;
$process = process_uploaded_file($array_file);
if (preg_match('/\.(zip|txt)$/i', $array_file['name'])) {
// if it's a zip, allow zip upload
$unzip = 1;
}
if ($process && $unzip == 1) {
$imported = aiken_import_exercise($array_file['name']);
if ($imported === true) {
header('Location: exercice.php?'.api_get_cidreq());
} else {
$msg = Display::return_message(get_lang($imported),'error');
return $msg;
}
}
}

@ -4,6 +4,8 @@
* Responses to AJAX calls
*/
// Language files that need to be included.
$language_file = array('admin');
require_once '../global.inc.php';
require_once api_get_path(SYS_CODE_PATH).'admin/statistics/statistics.lib.php';

@ -1766,7 +1766,7 @@ class CourseManager
/**
* This function creates a virtual course.
* It assumes all parameters have been checked and are not empty.
* It checks whether a course with the $wanted_course_code already exists.
* It checks wether a course with the $wanted_course_code already exists.
*
* Users of this library should consider this function private,
* please call attempt_create_virtual_course instead of this one.
@ -1825,7 +1825,7 @@ class CourseManager
* This function deletes a whole course-area from the platform. When the
* given course is a virtual course, the database and directory will not be
* deleted.
* When the given course is a real course, also all virtual courses referring
* When the given course is a real course, also all virtual courses refering
* to the given course will be deleted.
* Considering the fact that we remove all traces of the course in the main
* database, it makes sense to remove all tracking as well (if stats databases exist)
@ -3363,6 +3363,11 @@ class CourseManager
if (!$nosession) {
global $now, $date_start, $date_end;
}
if (empty($date_start) or empty($date_end)) {
$sess = SessionManager::get_sessions_list(array('s.id = ' => $course_info['id_session']));
$date_start = $sess[$course_info['id_session']]['date_start'];
$date_end = $sess[$course_info['id_session']]['date_end'];
}
// Table definitions
$main_user_table = Database :: get_main_table(TABLE_MAIN_USER);

@ -751,7 +751,7 @@ class CourseHome
$icon = Display::return_icon($tool['image'], $tool_name, array('class' => 'tool-icon', 'id' => 'toolimage_'.$tool['id']), ICON_SIZE_BIG, false);
// Validation when belongs to a session
$session_img = api_get_session_image($tool['session_id'], $_user['status']);
$session_img = api_get_session_image($tool['session_id'], (!empty($_user['status']) ? $_user['status'] : ''));
if ($studentview) {
$tool_link_params['href'] .= '&isStudentView=true';
}

@ -116,7 +116,7 @@
text-decoration: none;
}
#slider strong {
font-size: 1.1em;
font-weight: bold;
}
#slider li a {
color: #3183B1;

@ -2377,6 +2377,8 @@ class SessionManager
$sql_course = "INSERT IGNORE INTO $tbl_session_course
SET course_code = '$course_code', id_session='$session_id'";
Database::query($sql_course);
$course_info = api_get_course_info($course_code);
SessionManager::installCourse($session_id, $course_info['real_id']);
if ($debug) {
$logger->addInfo("Sessions - Adding course '$course_code' to session #$session_id");
@ -2748,8 +2750,9 @@ class SessionManager
}
/**
* @param array $sessions
* @param array $courses
* Assign coaches of a session(s) as teachers to a given course (or courses)
* @param array A list of session IDs
* @param array A list of course IDs
* @return string
*/
public static function copyCoachesFromSessionToCourse($sessions, $courses)
@ -2811,7 +2814,12 @@ class SessionManager
return $htmlResult;
}
public static function getCourseToolToByManaged()
/**
* Get the list of course tools that have to be dealt with in case of
* registering any course to a session
* @return array The list of tools to be dealt with (literal names)
*/
public static function getCourseToolToBeManaged()
{
return array(
'courseDescription',
@ -2821,12 +2829,14 @@ class SessionManager
/**
* @param $sessionId
* @param $courseId
* Calls the methods bound to each tool when a course is registered into a session
* @param int Session ID
* @param int Course ID
* @return void
*/
public static function installCourse($sessionId, $courseId)
{
$toolList = self::getCourseToolToByManaged();
$toolList = self::getCourseToolToBeManaged();
foreach($toolList as $tool) {
$method = 'add'.$tool;
@ -2837,12 +2847,14 @@ class SessionManager
}
/**
* Calls the methods bound to each tool when a course is unregistered from
* a session
* @param $sessionId
* @param $courseId
*/
public static function unInstallCourse($sessionId, $courseId)
{
$toolList = self::getCourseToolToByManaged();
$toolList = self::getCourseToolToBeManaged();
foreach($toolList as $tool) {
$method = 'remove'.$tool;

@ -208,7 +208,7 @@ class IndexManager {
/* Includes a created page */
function return_home_page() {
global $_configuration;
// Including the page for the news
$html = '';
@ -216,6 +216,11 @@ class IndexManager {
$open = @(string)file_get_contents(api_get_path(SYS_PATH).$this->home.$_GET['include']);
$html = api_to_system_encoding($open, api_detect_encoding(strip_tags($open)));
} else {
//hiding home top when user not connected
global $_user;
if ($_configuration['hide_home_top_when_connected'] && isset($_user['user_id'])) {
return $html;
}
if (!empty($_SESSION['user_language_choice'])) {
$user_selected_language = $_SESSION['user_language_choice'];
} elseif (!empty($_SESSION['_user']['language'])) {

@ -2,6 +2,22 @@
/*
for more information: see languages.txt in the lang folder.
*/
$ImportAikenQuizExplanationExample = "This is the text for question 1
A. Answer 1
B. Answer 2
C. Answer 3
ANSWER: B
This is the text for question 2
A. Answer 1
B. Answer 2
C. Answer 3
D. Answer 4
ANSWER: D
ANSWER_EXPLANATION: this is an optional feedback comment that will appear next to the correct answer.";
$ImportAikenQuizExplanation = "The Aiken format comes in a simple text (.txt) file, with several question blocks, each separated by a blank line. The first line is the question, the answer lines are prefixed by a letter and a dot, and the correct answer comes next with the ANSWER: prefix. See example below.";
$ExerciseAikenErrorNoAnswerOptionGiven = "The imported file has at least one question without any answer (or the answers do not include the required prefix letter). Please make sure each question has at least one answer and that it is prefixed by a letter and a dot or a parenthesis, like this: A. answer one";
$ExerciseAikenErrorNoCorrectAnswerDefined = "The imported file includes at least one question without any correct answer defined. Please make sure all questions include the ANSWER: [Letter] line.";
$ThereWasAProblemWithYourFile = "There was an unknown issue with your file. Please review its format and try again.";
$YouMustUploadAZipOrTxtFile = "You must upload a .txt or .zip file";
$NoTxtFileFoundInTheZip = "No .txt file found in zip";

@ -2,6 +2,22 @@
/*
for more information: see languages.txt in the lang folder.
*/
$ImportAikenQuizExplanationExample = "Este es el texto de la pregunta 1
A. Respuesta 1
B. Respuesta 2
C. Respuesta 3
ANSWER: B
Este es el texto de la pregunta 2 (notese la línea blanca arriba)
A. Respuesta 1
B. Respuesta 2
C. Respuesta 3
D. Respuesta 4
ANSWER: D
ANSWER_EXPLANATION: Este es un texto opcional de retroalimentación que aparecerá al costado de la respuesta correcta.";
$ImportAikenQuizExplanation = "El formato Aiken es un simple formato texto (archivo .txt) con varios bloques de preguntas, cada bloque separado por una línea blanca. La primera línea es la pregunta. Las líneas de respuestas tienen un prefijo de letra y punto, y la respuesta correcta sigue, con el prefijo 'ANSWER:'. Ver ejemplo a continuación.";
$ExerciseAikenErrorNoAnswerOptionGiven = "El archivo importado tiene por lo menos una pregunta sin respuesta (o las respuestas no incluyen la letra de prefijo requerida). Asegúrese de que cada pregunta tengo por lo mínimo una respuesta y que esté prefijada por una letra y un punto o una paréntesis, como sigue: A. Respuesta uno";
$ExerciseAikenErrorNoCorrectAnswerDefined = "El archivo importado contiene por lo menos una pregunta sin ninguna respuesta definida. Asegúrese que todas las preguntas tienen una línea tipo ANSWER: [letra], y vuelva a intentar.";
$ThereWasAProblemWithYourFile = "Hubo un error desconocido en su archivo. Por favor revise su formato e intente nuevamente.";
$YouMustUploadAZipOrTxtFile = "Tiene que subir un archivo .txt o .zip";
$NoTxtFileFoundInTheZip = "No se encontró ningun archivo .txt en el zip";

@ -1862,6 +1862,10 @@ class learnpath
$package_type = '';
$at_root = false;
$manifest = '';
$aicc_match_crs = 0;
$aicc_match_au = 0;
$aicc_match_des = 0;
$aicc_match_cst = 0;
// The following loop should be stopped as soon as we found the right imsmanifest.xml (how to recognize it?).
if (is_array($zipContentArray) && count($zipContentArray) > 0) {
@ -1874,15 +1878,34 @@ class learnpath
$package_type = 'scorm';
break; // Exit the foreach loop.
}
elseif (preg_match('/aicc\//i', $thisContent['filename'])) {
// If found an aicc directory... (!= false means it cannot be false (error) or 0 (no match)).
$package_type = 'aicc';
elseif (preg_match('/aicc\//i', $thisContent['filename']) || in_array(strtolower(pathinfo($thisContent['filename'], PATHINFO_EXTENSION)), array( 'crs','au','des','cst'))) {
$ext = strtolower(pathinfo($thisContent['filename'], PATHINFO_EXTENSION));
switch ($ext) {
case 'crs':
$aicc_match_crs = 1;
break;
case 'au':
$aicc_match_au = 1;
break;
case 'des':
$aicc_match_des = 1;
break;
case 'cst':
$aicc_match_cst = 1;
break;
default:
break;
}
//break; // Don't exit the loop, because if we find an imsmanifest afterwards, we want it, not the AICC.
} else {
$package_type = '';
}
}
}
if (empty($package_type) && 4 == ($aicc_match_crs + $aicc_match_au + $aicc_match_des + $aicc_match_cst)) {
// If found an aicc directory... (!= false means it cannot be false (error) or 0 (no match)).
$package_type = 'aicc';
}
return $package_type;
}

@ -246,14 +246,14 @@ class bbb {
foreach ($meeting_list as $meeting_db) {
$meeting_bbb = $this->get_meeting_info(array('meetingId' => $meeting_db['id'], 'password' => $pass));
$meeting_bbb['end_url'] = api_get_self().'?action=end&id='.$meeting_db['id'];
$meeting_bbb['end_url'] = api_get_self().'?'.api_get_cidreq().'&action=end&id='.$meeting_db['id'];
if ((string)$meeting_bbb['returncode'] == 'FAILED') {
if ($meeting_db['status'] == 1 && $this->is_teacher()) {
$this->end_meeting($meeting_db['id']);
}
} else {
$meeting_bbb['add_to_calendar_url'] = api_get_self().'?action=add_to_calendar&id='.$meeting_db['id'].'&start='.api_strtotime($meeting_db['created_at']);
$meeting_bbb['add_to_calendar_url'] = api_get_self().'?'.api_get_cidreq().'&action=add_to_calendar&id='.$meeting_db['id'].'&start='.api_strtotime($meeting_db['created_at']);
}
$record_array = array();
@ -278,9 +278,9 @@ class bbb {
if (is_array($record) && isset($record['recordId'])) {
$url = Display::url(get_lang('ViewRecord'), $record['playbackFormatUrl'], array('target' => '_blank'));
if ($this->is_teacher()) {
$url .= Display::url(Display::return_icon('link.gif',get_lang('CopyToLinkTool')), api_get_self().'?action=copy_record_to_link_tool&id='.$meeting_db['id'].'&record_id='.$record['recordId']);
$url .= Display::url(Display::return_icon('agenda.png',get_lang('AddToCalendar')), api_get_self().'?action=add_to_calendar&id='.$meeting_db['id'].'&start='.api_strtotime($meeting_db['created_at']).'&url='.$record['playbackFormatUrl']);
$url .= Display::url(Display::return_icon('delete.png',get_lang('Delete')), api_get_self().'?action=delete_record&id='.$record['recordId']);
$url .= Display::url(Display::return_icon('link.gif',get_lang('CopyToLinkTool')), api_get_self().'?'.api_get_cidreq().'&action=copy_record_to_link_tool&id='.$meeting_db['id'].'&record_id='.$record['recordId']);
$url .= Display::url(Display::return_icon('agenda.png',get_lang('AddToCalendar')), api_get_self().'?'.api_get_cidreq().'&action=add_to_calendar&id='.$meeting_db['id'].'&start='.api_strtotime($meeting_db['created_at']).'&url='.$record['playbackFormatUrl']);
$url .= Display::url(Display::return_icon('delete.png',get_lang('Delete')), api_get_self().'?'.api_get_cidreq().'&action=delete_record&id='.$record['recordId']);
}
//$url .= api_get_self().'?action=publish&id='.$record['recordID'];
$count++;
@ -316,8 +316,8 @@ class bbb {
$item['created_at'] = api_convert_and_format_date($meeting_db['created_at']);
//created_at
$item['publish_url'] = api_get_self().'?action=publish&id='.$meeting_db['id'];
$item['unpublish_url'] = api_get_self().'?action=unpublish&id='.$meeting_db['id'];
$item['publish_url'] = api_get_self().'?'.api_get_cidreq().'&action=publish&id='.$meeting_db['id'];
$item['unpublish_url'] = api_get_self().'?'.api_get_cidreq().'&action=unpublish&id='.$meeting_db['id'];
if ($meeting_db['status'] == 1) {
$joinParams = array(
@ -442,7 +442,6 @@ class bbb {
$records = BigBlueButtonBN::getRecordingsArray($id, $this->url, $this->salt);
if (!empty($records)) {
foreach ($records as $record) {
error_log($record['recordID']);
if ($record['recordID'] == $record_id) {
if (is_array($record) && isset($record['recordID']) && isset($record['playbacks'])) {
foreach ($record['playbacks'] as $item) {

Loading…
Cancel
Save