Updating lang vars + fixing exercise with the new option (Question select type).

skala
Julio Montoya 13 years ago
parent 6934f1bb68
commit 995bf8f06e
  1. 10
      main/exercice/draggable.class.php
  2. 17
      main/exercice/exercise.class.php
  3. 72
      main/exercice/exercise_admin.php
  4. 18
      main/exercice/exercise_show.php
  5. 54
      main/exercice/exercise_submit.php
  6. 7
      main/exercice/fill_blanks.class.php
  7. 7
      main/exercice/freeanswer.class.php
  8. 7
      main/exercice/global_multiple_answer.class.php
  9. 10
      main/exercice/matching.class.php
  10. 10
      main/exercice/multiple_answer.class.php
  11. 7
      main/exercice/multiple_answer_combination.class.php
  12. 7
      main/exercice/multiple_answer_true_false.class.php
  13. 41
      main/exercice/oral_expression.class.php
  14. 31
      main/exercice/question.class.php
  15. 14
      main/exercice/testcategory.class.php
  16. 7
      main/exercice/unique_answer.class.php
  17. 10
      main/exercice/unique_answer_image.class.php
  18. 8
      main/exercice/unique_answer_no_option.class.php
  19. 12
      main/locale/en.po
  20. 30
      main/locale/es.po

@ -194,15 +194,11 @@ class Draggable extends Matching
}
/**
* @param null $feedback_type
* @param null $counter
* @param null $score
* @param bool $show_media
* @return string
* {@inheritdoc}
*/
public function return_header($feedback_type = null, $counter = null, $score = null, $show_media = false)
public function return_header($feedback_type = null, $counter = null, $score = null, $show_media = false, $hideTitle = 0)
{
$header = parent::return_header($feedback_type, $counter, $score, $show_media);
$header = parent::return_header($feedback_type, $counter, $score, $show_media, $hideTitle);
$header .= '<table class="'.$this->question_table_class.'">';
$header .= '<tr>
<th>'.get_lang('ElementList').'</th>

@ -4,7 +4,7 @@
* Exercise class: This class allows to instantiate an object of type Exercise
* @package chamilo.exercise
* @author Olivier Brouckaert
* @author Julio Montoya Cleaning exercises
* @author Julio Montoya Cleaning exercises, adding multiple categories, media questions, commitee
* Modified by Hubert Borderiou #294
*/
/**
@ -734,7 +734,11 @@ class Exercise
if (isset($questions_by_category[$category_id])) {
// How many question will be picked from this category.
$count = $category_info['count_questions'];
if ($count != -1) {
// -1 means all questions
if ($count == -1) {
$categoryCountArray[$category_id] = 999;
} else {
$categoryCountArray[$category_id] = $count;
}
}
@ -808,6 +812,7 @@ class Exercise
$categoriesAddedInExercise = $cat->getCategoryExerciseTree($this->id, $this->course['real_id'], 'title DESC', false, true);
$questions_by_category = Testcategory::getQuestionsByCat($this->id, $question_list, $categoriesAddedInExercise);
$question_list = $this->pickQuestionsPerCategory($categoriesAddedInExercise, $question_list, $questions_by_category, true, false);
break;
case EX_Q_SELECTION_CATEGORIES_RANDOM_QUESTIONS_ORDERED: // 4
case EX_Q_SELECTION_CATEGORIES_RANDOM_QUESTIONS_ORDERED_NO_GROUPED: // 7
@ -4625,8 +4630,8 @@ class Exercise
return false;
}
if (0) {
//if (!empty($this->emailNotificationTemplate)) {
//if (0) {
if (!empty($this->emailNotificationTemplate)) {
$twig = new \Twig_Environment(new \Twig_Loader_String());
$twig->addFilter('var_dump', new Twig_Filter_Function('var_dump'));
$template = $this->emailNotificationTemplate;
@ -6436,8 +6441,8 @@ class Exercise
$tempParentId = $objQuestionTmp->parent_id;
}
//Shows question title an description
$question_content .= $objQuestionTmp->return_header(null, $counterToShow, $score, $show_media);
// Shows question title an description.
$question_content .= $objQuestionTmp->return_header(null, $counterToShow, $score, $show_media, $this->getHideQuestionTitle());
// display question category, if any
$question_content .= Testcategory::getCategoryNamesForQuestion($questionId);

@ -19,8 +19,8 @@ require_once 'answer.class.php';
require_once '../inc/global.inc.php';
$this_section = SECTION_COURSES;
if (!api_is_allowed_to_edit(null,true)) {
api_not_allowed(true);
if (!api_is_allowed_to_edit(null, true)) {
api_not_allowed(true);
}
$url = api_get_path(WEB_AJAX_PATH).'exercise.ajax.php?1=1';
@ -232,12 +232,12 @@ $course_id = api_get_course_int_id();
//INIT FORM
if (isset($_GET['exerciseId'])) {
$form = new FormValidator('exercise_admin', 'post', api_get_self().'?'.api_get_cidreq().'&exerciseId='.intval($_GET['exerciseId']));
$objExercise->read($_GET['exerciseId']);
$form->addElement('hidden','edit','true');
$form = new FormValidator('exercise_admin', 'post', api_get_self().'?'.api_get_cidreq().'&exerciseId='.intval($_GET['exerciseId']));
$objExercise->read($_GET['exerciseId']);
$form->addElement('hidden', 'edit', 'true');
} else {
$form = new FormValidator('exercise_admin','post',api_get_self().'?'.api_get_cidreq());
$form->addElement('hidden','edit','false');
$form = new FormValidator('exercise_admin','post',api_get_self().'?'.api_get_cidreq());
$form->addElement('hidden', 'edit', 'false');
}
$objExercise->createForm($form);
@ -256,48 +256,48 @@ if ($form->validate()) {
exit;
} else {
// DISPLAY FORM
if (isset($_SESSION['gradebook'])) {
$gradebook= $_SESSION['gradebook'];
}
if (isset($_SESSION['gradebook'])) {
$gradebook= $_SESSION['gradebook'];
}
if (!empty($gradebook) && $gradebook=='view') {
$interbreadcrumb[]= array ('url' => '../gradebook/'.$_SESSION['gradebook_dest'],'name' => get_lang('ToolGradebook'));
}
$nameTools = get_lang('ExerciseManagement');
$interbreadcrumb[] = array("url"=>'exercice.php', 'name'=> get_lang('Exercices'));
if (!empty($gradebook) && $gradebook=='view') {
$interbreadcrumb[]= array ('url' => '../gradebook/'.$_SESSION['gradebook_dest'],'name' => get_lang('ToolGradebook'));
}
$nameTools = get_lang('ExerciseManagement');
$interbreadcrumb[] = array("url"=>'exercice.php', 'name'=> get_lang('Exercices'));
$interbreadcrumb[] = array("url"=>"admin.php?exerciseId=".$objExercise->id, "name" => $objExercise->name);
Display::display_header($nameTools,get_lang('Exercise'));
Display::display_header($nameTools,get_lang('Exercise'));
echo '<div class="actions">';
if ($objExercise->id != 0) {
echo '<a href="admin.php?'.api_get_cidReq().'&exerciseId='.$objExercise->id.'">' . Display :: return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).'</a>';
} else {
if (!empty($_GET['lp_id']) || !empty($_POST['lp_id'])){
if (!empty($_POST['lp_id'])){
$lp_id = Security::remove_XSS($_POST['lp_id']);//TODO:this remains to be implemented after press the first post
} else {
$lp_id = Security::remove_XSS($_GET['lp_id']);
}
echo "<a href=\"../newscorm/lp_controller.php?".api_get_cidreq()."&gradebook=&action=add_item&type=step&lp_id=".$lp_id."#resource_tab-2\">".Display::return_icon('back.png', get_lang("BackTo").' '.get_lang("LearningPaths"),'',ICON_SIZE_MEDIUM)."</a>";
if ($objExercise->id != 0) {
echo '<a href="admin.php?'.api_get_cidReq().'&exerciseId='.$objExercise->id.'">' . Display :: return_icon('back.png', get_lang('GoBackToQuestionList'),'',ICON_SIZE_MEDIUM).'</a>';
} else {
if (!empty($_GET['lp_id']) || !empty($_POST['lp_id'])){
if (!empty($_POST['lp_id'])){
$lp_id = Security::remove_XSS($_POST['lp_id']);//TODO:this remains to be implemented after press the first post
} else {
$lp_id = Security::remove_XSS($_GET['lp_id']);
}
echo "<a href=\"../newscorm/lp_controller.php?".api_get_cidreq()."&gradebook=&action=add_item&type=step&lp_id=".$lp_id."#resource_tab-2\">".Display::return_icon('back.png', get_lang("BackTo").' '.get_lang("LearningPaths"),'',ICON_SIZE_MEDIUM)."</a>";
} else {
echo '<a href="exercice.php">' . Display :: return_icon('back.png', get_lang('BackToExercisesList'),'',ICON_SIZE_MEDIUM).'</a>';
}
}
echo '<a href="exercice.php">' . Display :: return_icon('back.png', get_lang('BackToExercisesList'),'',ICON_SIZE_MEDIUM).'</a>';
}
}
echo '</div>';
if ($objExercise->feedback_type == 1)
Display::display_normal_message(get_lang('DirectFeedbackCantModifyTypeQuestion'));
if ($objExercise->feedback_type == 1) {
Display::display_normal_message(get_lang('DirectFeedbackCantModifyTypeQuestion'));
}
if (api_get_setting('search_enabled')=='true' && !extension_loaded('xapian')) {
Display::display_error_message(get_lang('SearchXapianModuleNotInstalled'));
}
if (api_get_setting('search_enabled')=='true' && !extension_loaded('xapian')) {
Display::display_error_message(get_lang('SearchXapianModuleNotInstalled'));
}
if ($objExercise->id != 0 && $objExercise->edit_exercise_in_lp == false) {
$form->freeze();
}
$form->display();
$form->display();
}
Display::display_footer();

@ -285,6 +285,7 @@ foreach ($questionList as $questionId) {
$choice = $exerciseResult[$questionId];
// creates a temporary Question object
/** @var Question $objQuestionTmp */
$objQuestionTmp = Question::read($questionId);
$questionWeighting = $objQuestionTmp->selectWeighting();
@ -579,13 +580,6 @@ foreach ($questionList as $questionId) {
$category_was_added_for_this_test = false;
// We use now category_list instead of a unique category
/*if (isset($objQuestionTmp->category) && !empty($objQuestionTmp->category)) {
$category_list[$objQuestionTmp->category]['score'] += $my_total_score;
$category_list[$objQuestionTmp->category]['total'] += $my_total_weight;
$category_was_added_for_this_test = true;
}*/
if (isset($objQuestionTmp->category_list) && !empty($objQuestionTmp->category_list)) {
foreach ($objQuestionTmp->category_list as $category_id) {
@ -630,11 +624,8 @@ foreach ($questionList as $questionId) {
$i++;
$contents = ob_get_clean();
$question_content = '<div class="question_row">';
$show_media = false;
$counterToShow = $counter;
if ($objQuestionTmp->parent_id != 0) {
@ -653,9 +644,10 @@ foreach ($questionList as $questionId) {
}
if ($show_results) {
//Shows question title an description
// Shows question title an description
//$question_content .= $objQuestionTmp->return_header(null, $counterToShow, $score, $show_media, $mediaCounter, );
$question_content .= $objQuestionTmp->return_header(null, $counterToShow, $score, $show_media, $mediaCounter);
$question_content .= $objQuestionTmp->return_header(null, $counterToShow, $score, $show_media, $objExercise->getHideQuestionTitle());
// display question category, if any
$question_content .= Testcategory::getCategoryNamesForQuestion($questionId);
@ -712,7 +704,7 @@ if ($is_allowedToEdit && $locked == false && !api_is_drh()) {
echo '<input type = "hidden" name="total_score" value="'.$totalScore.'"> ';
echo '<input type = "hidden" name="my_exe_exo_id" value="'.$exercise_id.'"> ';
} else {
echo ' <form name="myform" id="myform" action="'.$urlMainExercise.'exercise_report.php?exerciseId='.$exercise_id.'&filter=1&comments=update&exeid='.$id.'" method="post">';
echo '<form name="myform" id="myform" action="'.$urlMainExercise.'exercise_report.php?exerciseId='.$exercise_id.'&filter=1&comments=update&exeid='.$id.'" method="post">';
}
if ($origin !='learnpath' && $origin!='student_progress') {

@ -340,8 +340,6 @@ if (api_is_allowed_to_edit(null, true) && isset($_GET['preview']) && $_GET['prev
/** @var \Exercise $exerciseInSession */
$exerciseInSession = Session::read('objExercise');
// 1. Loading the $objExercise variable
if (!isset($exerciseInSession) || isset($exerciseInSession) && ($exerciseInSession->id != $_GET['exerciseId'])) {
// Construction of Exercise
@ -369,11 +367,13 @@ if (!isset($exerciseInSession) || isset($exerciseInSession) && ($exerciseInSessi
}
}
// $objExercise = new Exercise(); $objExercise->read($exerciseId);
//$objExercise = new Exercise(); $objExercise->read($exerciseId);
//2. Checking if $objExercise is set
if (!isset($objExercise) && isset($exerciseInSession)) {
if ($debug) { error_log('2. Loading $objExercise from session'); };
if ($debug) {
error_log('2. Loading $objExercise from session');
}
$objExercise = $exerciseInSession;
}
@ -403,7 +403,7 @@ if ($objExercise->expired_time != 0) {
$time_control = true;
}
//Generating the time control key for the user
// Generating the time control key for the user.
$current_expired_time_key = ExerciseLib::get_time_control_key($objExercise->id, $learnpath_id, $learnpath_item_id);
if ($debug) {
error_log("4. current_expired_time_key: $current_expired_time_key");
@ -485,7 +485,7 @@ if ($objExercise->selectAttempts() > 0) {
if ($origin == 'learnpath') {
Display::display_reduced_header();
} else {
Display::display_header($nameTools,'Exercises');
Display::display_header($nameTools, 'Exercises');
}
echo $attempt_html;
@ -517,9 +517,9 @@ if (!isset($questionListInSession)) {
error_log('$_SESSION[questionList] was set');
}
} else {
if (isset($objExercise) && isset($exerciseInSession)) {
if (isset($objExercise) && isset($exerciseInSession)) {
$questionList = Session::read('questionList');
}
}
}
//Fix in order to get the correct question list
@ -530,7 +530,7 @@ Session::write('question_list_uncompressed', $questionListUncompressed);
$clock_expired_time = null;
if (empty($exercise_stat_info)) {
if ($debug) {
if ($debug) {
error_log('5 $exercise_stat_info is empty ');
}
$total_weight = 0;
@ -542,19 +542,18 @@ if (empty($exercise_stat_info)) {
if ($time_control) {
$expected_time = $current_timestamp + $total_seconds;
if ($debug) error_log('5.1. $current_timestamp '.$current_timestamp);
if ($debug) error_log('5.2. $expected_time '.$expected_time);
$clock_expired_time = api_get_utc_datetime($expected_time);
if ($debug) error_log('5.3. $expected_time '.$clock_expired_time);
//Sessions that contain the expired time
$expiredTime = array(
$current_expired_time_key => $clock_expired_time
);
Session::write('expired_time', $expiredTime);
if ($debug) { error_log('5.4. Setting the $expiredTime: '.$expiredTime[$current_expired_time_key] ); };
if ($debug) {
error_log('5.1. $current_timestamp '.$current_timestamp);
error_log('5.2. $expected_time '.$expected_time);
error_log('5.3. $expected_time '.$clock_expired_time);
error_log('5.4. Setting the $expiredTime: '.$expiredTime[$current_expired_time_key]);
}
}
$exe_id = $objExercise->save_stat_track_exercise_info($clock_expired_time, $learnpath_id, $learnpath_item_id, $learnpath_item_view_id, $questionListUncompressed, $total_weight);
$exercise_stat_info = $objExercise->getStatTrackExerciseInfo($learnpath_id, $learnpath_item_id, $learnpath_item_view_id);
@ -567,13 +566,16 @@ if (empty($exercise_stat_info)) {
// Array to check in order to block the chat
ExerciseLib::create_chat_exercise_session($exe_id);
if ($debug) { error_log('6. $objExercise->getStatTrackExerciseInfo function called:: '.print_r($exercise_stat_info, 1)); };
if ($debug) {
error_log('6. $objExercise->getStatTrackExerciseInfo function called:: '.print_r($exercise_stat_info, 1));
}
if (!empty($exercise_stat_info['questions_to_check'])) {
$my_remind_list = $exercise_stat_info['questions_to_check'];
$my_remind_list = explode(',', $my_remind_list);
$my_remind_list = array_filter($my_remind_list);
}
if ($debug) { error_log("6.0 my_remind_list array: ".print_r($my_remind_list, 1)); }
$params = "exe_id=$exe_id&exerciseId=$exerciseId&origin=$origin&learnpath_id=$learnpath_id&learnpath_item_id=$learnpath_item_id&learnpath_item_view_id=$learnpath_item_view_id&".api_get_cidreq();
@ -593,8 +595,10 @@ if ($reminder == 2 && empty($my_remind_list)) {
if ($time_control) {
$expiredTimeInSession = Session::read('expired_time');
if ($debug) error_log('7.1. Time control is enabled.');
if ($debug) error_log('7.2. $current_expired_time_key:'.$current_expired_time_key);
if ($debug) {
error_log('7.1. Time control is enabled.');
error_log('7.2. $current_expired_time_key:'.$current_expired_time_key);
}
if (!isset($expiredTimeInSession[$current_expired_time_key])) {
if ($debug) error_log('7.3. $expiredTimeInSession[$current_expired_time_key] not set.');
//Timer - Get expired_time for a student
@ -716,8 +720,10 @@ if ($formSent && isset($_POST)) {
}
}
}
if ($debug) { error_log('9.3. $choice is an array - end'); }
if ($debug) { error_log('9.4. $exerciseResult '.print_r($exerciseResult,1)); }
if ($debug) {
error_log('9.3. $choice is an array - end');
error_log('9.4. $exerciseResult '.print_r($exerciseResult,1));
}
}
// the script "exercise_result.php" will take the variable $exerciseResult from the session
@ -950,7 +956,7 @@ if (isset($_custom['exercises_hidden_when_no_start_date']) && $_custom['exercise
}
}
//Timer control
// Timer control.
if ($time_control) {
echo $objExercise->returnTimeLeftDiv();
echo '<div style="display:none" class="warning-message" id="expired-message-id">'.get_lang('ExerciceExpiredTimeMessage').'</div>';
@ -1023,7 +1029,7 @@ if ($objExercise->review_answers) {
if (!empty($error)) {
Display :: display_error_message($error, false);
Display::display_error_message($error, false);
} else {
if (!empty($exercise_sound)) {
echo '<a href="'.api_get_path(WEB_CODE_PATH).'document/download.php?doc_url=%2Faudio%2F'.Security::remove_XSS($exercise_sound).'" target="_blank">

@ -193,9 +193,12 @@ class FillBlanks extends Question
$objAnswer->save();
}
function return_header($feedback_type = null, $counter = null, $score = null, $show_media = false)
/**
* {@inheritdoc}
*/
function return_header($feedback_type = null, $counter = null, $score = null, $show_media = false, $hideTitle = 0)
{
$header = parent::return_header($feedback_type, $counter, $score, $show_media);
$header = parent::return_header($feedback_type, $counter, $score, $show_media, $hideTitle);
$header .= '<table class="'.$this->question_table_class.'">
<tr>
<th>'.get_lang("Answer").'</th>

@ -63,14 +63,17 @@ class FreeAnswer extends Question
$this->save();
}
function return_header($feedback_type = null, $counter = null, $score = null, $show_media = false)
/**
* {@inheritdoc}
*/
function return_header($feedback_type = null, $counter = null, $score = null, $show_media = false, $hideTitle = 0)
{
if (!empty($score['comments']) || $score['score'] > 0) {
$score['revised'] = true;
} else {
$score['revised'] = false;
}
$header = parent::return_header($feedback_type, $counter, $score, $show_media);
$header = parent::return_header($feedback_type, $counter, $score, $show_media, $hideTitle);
$header .= '<table class="'.$this->question_table_class.'" >
<tr>
<th>'.get_lang("Answer").'</th>

@ -269,9 +269,12 @@ class GlobalMultipleAnswer extends Question
$this->save();
}
function return_header($feedback_type = null, $counter = null, $score = null, $show_media = false)
/**
* {@inheritdoc}
*/
function return_header($feedback_type = null, $counter = null, $score = null, $show_media = false, $hideTitle = 0)
{
$header = parent::return_header($feedback_type, $counter, $score, $show_media);
$header = parent::return_header($feedback_type, $counter, $score, $show_media, $hideTitle);
$header .= '<table class="'.$this->question_table_class.'">
<tr>
<th>'.get_lang("Choice").'</th>

@ -255,15 +255,11 @@ class Matching extends Question
}
/**
* @param null $feedback_type
* @param null $counter
* @param null $score
* @param bool $show_media
* @return string
* {@inheritdoc}
*/
function return_header($feedback_type = null, $counter = null, $score = null, $show_media = false)
function return_header($feedback_type = null, $counter = null, $score = null, $show_media = false, $hideTitle = 0)
{
$header = parent::return_header($feedback_type, $counter, $score, $show_media);
$header = parent::return_header($feedback_type, $counter, $score, $show_media, $hideTitle);
if ($this->type == MATCHING) {
$header .= '<table class="'.$this->question_table_class.'">';
$header .= '<tr>

@ -255,15 +255,11 @@ class MultipleAnswer extends Question
}
/**
* @param int $feedback_type
* @param int $counter
* @param string $score
* @param bool $show_media
* @return string
* {@inheritdoc}
*/
public function return_header($feedback_type = null, $counter = null, $score = null, $show_media = false)
public function return_header($feedback_type = null, $counter = null, $score = null, $show_media = false, $hideTitle = 0)
{
$header = parent::return_header($feedback_type, $counter, $score, $show_media);
$header = parent::return_header($feedback_type, $counter, $score, $show_media, $hideTitle);
$header .= '<table class="'.$this->question_table_class.'">
<tr>
<th>'.get_lang("Choice").'</th>

@ -250,9 +250,12 @@ class MultipleAnswerCombination extends Question
$this->save();
}
function return_header($feedback_type = null, $counter = null, $score = null, $show_media = false)
/**
* {@inheritdoc}
*/
function return_header($feedback_type = null, $counter = null, $score = null, $show_media = false, $hideTitle = 0)
{
$header = parent::return_header($feedback_type, $counter, $score, $show_media);
$header = parent::return_header($feedback_type, $counter, $score, $show_media, $hideTitle);
$header .= '<table class="'.$this->question_table_class.'">
<tr>
<th>'.get_lang("Choice").'</th>

@ -343,9 +343,12 @@ class MultipleAnswerTrueFalse extends Question
$this->save();
}
function return_header($feedback_type = null, $counter = null, $score = null, $show_media = false)
/**
* {@inheritdoc}
*/
function return_header($feedback_type = null, $counter = null, $score = null, $show_media = false, $hideTitle = 0)
{
$header = parent::return_header($feedback_type, $counter, $score, $show_media);
$header = parent::return_header($feedback_type, $counter, $score, $show_media, $hideTitle);
$header .= '<table class="'.$this->question_table_class.'">
<tr>
<th>'.get_lang("Choice").'</th>

@ -47,27 +47,32 @@ class OralExpression extends Question
}
}
/**
* abstract function which creates the form to create / edit the answers of the question
* @param the formvalidator instance
*/
function processAnswersCreation($form) {
$this->weighting = $form -> getSubmitValue('weighting');
$this->save();
}
/**
* abstract function which creates the form to create / edit the answers of the question
* @param FormValidator instance
*/
function processAnswersCreation($form)
{
$this->weighting = $form -> getSubmitValue('weighting');
$this->save();
}
function return_header($feedback_type = null, $counter = null, $score = null, $show_media = false) {
$header = parent::return_header($feedback_type, $counter, $score, $show_media);
$header .= '<table class="'.$this->question_table_class.'">
<tr>
/**
* {@inheritdoc}
*/
function return_header($feedback_type = null, $counter = null, $score = null, $show_media = false, $hideTitle = 0)
{
$header = parent::return_header($feedback_type, $counter, $score, $show_media, $hideTitle);
$header .= '<table class="'.$this->question_table_class.'">
<tr>
<th>&nbsp;</th>
</tr>
<tr>
</tr>
<tr>
<th>'.get_lang("Answer").'</th>
</tr>
<tr>
</tr>
<tr>
<th>&nbsp;</th>
</tr>';
</tr>';
return $header;
}
}
}

@ -39,7 +39,8 @@ abstract class Question
public static $explanationLangVar = '';
public $question_table_class = 'table table-striped';
public $editionMode = 'normal';
public $exercise; // exercise obj
/** @var Exercise $exercise */
public $exercise;
public $setDefaultValues = false;
public $submitClass;
public $submitText;
@ -129,7 +130,7 @@ abstract class Question
}
/**
* Reads question informations from the data base
* Reads question information from the database
*
* @author Olivier Brouckaert
* @param int $id - question ID
@ -1770,47 +1771,53 @@ abstract class Question
*
* @param int $feedback_type
* @param int $counter
* @param type $score
* @param array $score
* @param bool $show_media
* @param int $hideTitle
*
* @return string
*/
public function return_header($feedback_type = null, $counter = null, $score = null, $show_media)
public function return_header($feedbackType = null, $counter = null, $score = null, $show_media = false, $hideTitle = 0)
{
$counterLabel = '';
$counterLabel = null;
if (!empty($counter)) {
$counterLabel = $counter;
}
$score_label = get_lang('Wrong');
$class = 'error';
$class = 'error';
if ($score['pass'] == true) {
$score_label = get_lang('Correct');
$class = 'success';
$class = 'success';
}
if ($this->type == FREE_ANSWER || $this->type == ORAL_EXPRESSION) {
if ($score['revised'] == true) {
$score_label = get_lang('Revised');
$class = '';
$class = '';
} else {
$score_label = get_lang('NotRevised');
$class = 'error';
$class = 'error';
}
}
$question_title = $this->question;
$header = null;
// Display question category, if any
if ($show_media) {
$header .= $this->show_media_content();
}
$header .= Display::page_subheader2($counterLabel.". ".$question_title);
if ($hideTitle == 1) {
$header .= Display::page_subheader2($counterLabel);
} else {
$header .= Display::page_subheader2($counterLabel.". ".$this->question);
}
$header .= Display::div(
'<div class="rib rib-'.$class.'"><h3>'.$score_label.'</h3></div><h4>'.$score['result'].' </h4>',
array('class' => 'ribbon')
);
$header .= Display::div($this->description, array('id' => 'question_description'));
return $header;

@ -1039,9 +1039,12 @@ class Testcategory
//$list = array();
while ($row = Database::fetch_array($result, 'ASSOC')) {
if ($excludeCategoryWithNoQuestions) {
if ($row['count_questions'] == 0 || $row['count_questions'] == -1) {
continue;
}
//if ($row['count_questions'] == 0 || $row['count_questions'] == -1) {
/*0 means no questions selected this options is also filtered in the function:
Exercise::pickQuestionsPerCategory() */
if ($row['count_questions'] == 0) {
continue;
}
}
$categories[$row['category_id']] = $row;
}
@ -1073,6 +1076,7 @@ class Testcategory
$real_question_count = count($exercise_obj->getQuestionList());
$warning = null;
if ($nbQuestionsTotal != $real_question_count) {
$warning = Display::return_message(get_lang('CheckThatYouHaveEnoughQuestionsInYourCategories'), 'warning');
}
@ -1090,12 +1094,14 @@ class Testcategory
$return .= Display::div($category['parent_path']);
$return .= '</td>';
$return .= '<td>';
$value = isset($saved_categories) && isset($saved_categories[$cat_id]) ? $saved_categories[$cat_id]['count_questions'] : 0;
$value = isset($saved_categories) && isset($saved_categories[$cat_id]) ? $saved_categories[$cat_id]['count_questions'] : -1;
$return .= '<input name="category['.$cat_id.']" value="' .$value.'" />';
$return .= '</td>';
$return .= '</tr>';
}
$return .= '</table>';
$return .= get_lang('ZeroMeansNoQuestionWillBeSelectedMinusOneMeansThatAllQuestionsWillBeSelected');
return $return;
}
}

@ -414,9 +414,12 @@ class UniqueAnswer extends Question
$this->save();
}
public function return_header($feedback_type = null, $counter = null, $score = null, $show_media = false)
/**
* {@inheritdoc}
*/
public function return_header($feedback_type = null, $counter = null, $score = null, $show_media = false, $hideTitle = 0)
{
$header = parent::return_header($feedback_type, $counter, $score, $show_media);
$header = parent::return_header($feedback_type, $counter, $score, $show_media, $hideTitle);
$header .= '<table class="'.$this->question_table_class.'">
<tr>
<th>'.get_lang("Choice").'</th>

@ -354,14 +354,10 @@ class UniqueAnswerImage extends UniqueAnswer
}
/**
* @param int $feedback_type
* @param int $counter
* @param int $score
* @param bool $show_media
* @return string
* {@inheritdoc}
*/
public function return_header($feedback_type = null, $counter = null, $score = null, $show_media = false)
public function return_header($feedback_type = null, $counter = null, $score = null, $show_media = false, $hideTitle = 0)
{
return parent::return_header($feedback_type, $counter, $score, $show_media);
return parent::return_header($feedback_type, $counter, $score, $show_media, $hideTitle);
}
}

@ -396,8 +396,12 @@ class UniqueAnswerNoOption extends Question
$this -> save();
}
function return_header($feedback_type = null, $counter = null, $score = null, $show_media = false) {
$header = parent::return_header($feedback_type, $counter, $score, $show_media);
/**
* {@inheritdoc}
*/
function return_header($feedback_type = null, $counter = null, $score = null, $show_media = false, $hideTitle = 0)
{
$header = parent::return_header($feedback_type, $counter, $score, $show_media, $hideTitle);
$header .= '<table class="'.$this->question_table_class .'">
<tr>
<th>'.get_lang("Choice").'</th>

@ -8719,11 +8719,11 @@ msgstr "Skills ranking updated"
msgid "CertificateWCertifiesStudentXFinishedCourseYWithGradeZ"
msgstr "%s certifies that
%s
%s
has successfully completed the course
has successfully completed the course
'%s'
'%s'
with a grade of
@ -19454,7 +19454,7 @@ msgid "ButtonPublishAnnouncement"
msgstr "Send announcement"
msgid "YourAccountIsActiveYouCanLoginAndCheckYourCourses"
msgstr "Dear user,
msgstr "Dear user,
Your account has now been activated on the platform. Please login and enjoy your courses."
@ -20881,7 +20881,7 @@ msgid "langAddress"
msgstr "The address of"
msgid "langSettings"
msgstr "with the following settings :
msgstr "with the following settings :
Login :"
msgid "langYouAreReg"
@ -23634,3 +23634,5 @@ msgstr "Description updated"
msgid "CourseDescriptions"
msgstr "Course descriptions"
msgid "ZeroMeansNoQuestionWillBeSelectedMinusOneMeansThatAllQuestionsWillBeSelected"
msgstr "-1 = All questions will be selected. 0 = No questions will be selected."

@ -3062,7 +3062,7 @@ La carpeta de los usuarios y las carpetas que contiene de cada uno de ellos, se
Si se hace visible la carpeta de los usuarios y la carpeta de uno o más alumnos, el resto de los alumnos podrán ver todo su contenido. En este caso, el alumno propietario de la carpeta también podrá desde la herramienta documentos (sólo dentro de su carpeta): crear y editar documentos web, convertir un documento web en una plantilla para uso personal, crear y editar dibujos SVG y PNG, grabar archivos de audio en formato WAV, convertir texto en audio en formato MP3, realizar capturas a través de su webcam, enviar documentos, crear carpetas, mover carpetas y archivos, borrar carpetas y archivos, y descargar copias de seguridad de su carpeta.
Por otra parte, la herramienta documentos se sincroniza con el gestor de archivos del editor web, así que los cambios en la gestión de los documentos realizados en una u otra afectarán a ambas.
Por otra parte, la herramienta documentos se sincroniza con el gestor de archivos del editor web, así que los cambios en la gestión de los documentos realizados en una u otra afectarán a ambas.
Así pues, la carpeta de usuario no sólo es un lugar para depositar los archivos, sino que se convierte en un completo gestor de los documentos que los estudiantes utilizan durante el curso. Además, recuerde que cualquier usuario podrá copiar un archivo, que sea visible, de cualquier carpeta de la herramienta documentos (sea o no la suya) a su portafolios o área personal de documentos de la red social, donde estará disponible para que lo pueda usar en otros cursos."
@ -8721,13 +8721,13 @@ msgstr "Puntuación actualizada"
msgid "CertificateWCertifiesStudentXFinishedCourseYWithGradeZ"
msgstr "%s certifica que
%s
%s
ha realizado el curso
ha realizado el curso
'%s'
'%s'
con la calificación de
con la calificación de
'%s'"
@ -12864,7 +12864,7 @@ msgid "UseUsersTimezoneTitle"
msgstr "Utilizar las zonas horarias de los usuarios"
msgid "UseUsersTimezoneComment"
msgstr "Activar la selección por los usuarios de su zona horaria. El campo de zona horaria debe seleccionarse como visible y modificable antes de que los usuarios elijan su cuenta.
msgstr "Activar la selección por los usuarios de su zona horaria. El campo de zona horaria debe seleccionarse como visible y modificable antes de que los usuarios elijan su cuenta.
Una vez configurada los usuarios podrán verla."
msgid "FieldTypeTimezone"
@ -13484,7 +13484,7 @@ msgstr "Herramienta de videoconferencia BigBlueButton"
msgid "BigBlueButtonEnableComment"
msgstr "Seleccione si desea habilitar la herramienta de videoconferencia BigBlueButton. Una vez activada, se mostrará como una herramienta en la página principal todos los curso. Los profesores podrán lanzar una videoconferencia en cualquier momento, pero los estudiantes sólo podrán unirse a una ya lanzada.
Si no dispone de un servidor BigBlueButton, pruebe a
Si no dispone de un servidor BigBlueButton, pruebe a
<a href=\"http://bigbluebutton.org/\" target=\"_blank\">configurar uno</a> o pida ayuda a los <a href=\"http://www.chamilo.org/en/providers\" target=\"_blank\">proveedores oficiales de Chamilo</a>.
BigBlueButton es libre, pero su instalación requiere ciertas habilidades técnicas que no todo el mundo posee. Puede instalarlo por su cuenta o buscar ayuda profesional con el consiguiente costo. En la lógica del software libre, nosotros le ofrecemos las herramientas para hacer más fácil su trabajo y le recomendamos profesionales (los proveedores oficiales de Chamilo) que serán capaces de ayudarle."
@ -16261,13 +16261,13 @@ msgstr "Aceptar los términos legales"
msgid "EmailNotificationTemplateDescription"
msgstr "Puede modificar el correo enviado a los usuarios al terminar el ejercicio. Puede usar los siguientes términos:
msgstr "Puede modificar el correo enviado a los usuarios al terminar el ejercicio. Puede usar los siguientes términos:
{{ student.username }}
{{ student.firstname }}
{{ student.firstname }}
{{ student.lastname }}
{{ student.official_code }}
{{ exercise.title }}
{{ student.official_code }}
{{ exercise.title }}
{{ exercise.start_time }}
{{ exercise.end_time }}
{{ course.title }}
@ -22853,12 +22853,12 @@ msgid "ReservationDenied"
msgstr "Su reserva #ITEM# ha sido negada"
msgid "ReservationForItemAccepted"
msgstr "Estimado/a Señor(a),
msgstr "Estimado/a Señor(a),
Su reserva para #ITEM# de #BEGIN hasta #END ha sido aceptado."
msgid "ReservationForItemDenied"
msgstr "Estado/a Señor(a),
msgstr "Estado/a Señor(a),
su reservación para #ITEM# de #BEGIN hasta #END ha sido rechazada."
@ -22875,7 +22875,7 @@ msgstr "Estimado/a Señor(a),
Usted recibirá un correo electrónico cuando este disponible nuevamente, disculpenos por los inconvenientes."
msgid "ReservationAvailable"
msgstr "Estimado/a Señor(a),
msgstr "Estimado/a Señor(a),
Queremos informarle que #NAME# está disponible otra vez por lo que su reserva de #BEGIN# hasta #END# está de nuevamente activa."
@ -23514,3 +23514,5 @@ msgstr "Descripción actualizada"
msgid "CourseDescriptions"
msgstr "Descripción del curso"
msgid "ZeroMeansNoQuestionWillBeSelectedMinusOneMeansThatAllQuestionsWillBeSelected"
msgstr "-1 = Todas las preguntas serán seleccionadas. 0 = Ninguna pregunta será seleccionada."

Loading…
Cancel
Save