Merge branch '1.10.x' of ssh://github.com/chamilo/chamilo-lms into 1.10.x

1.10.x
Julio Montoya 10 years ago
commit 7fb59283d0
  1. 13
      main/course_info/infocours.php
  2. 78
      main/css/base.css
  3. 14
      main/css/chamilo/default.css
  4. 360
      main/exercice/UniqueAnswerImage.php
  5. 1056
      main/exercice/exercice.php
  6. 712
      main/exercice/exercise.class.php
  7. 1071
      main/exercice/exercise.php
  8. 1
      main/exercice/exercise_submit.php
  9. 511
      main/exercice/question.class.php
  10. 2
      main/exercice/question_list_admin.inc.php
  11. BIN
      main/img/alt_star.png
  12. BIN
      main/img/icons/22/eyes.png
  13. 133
      main/inc/introductionSection.inc.php
  14. 1
      main/inc/lib/api.lib.php
  15. 9
      main/inc/lib/course.lib.php
  16. 68
      main/inc/lib/exercise.lib.php
  17. 2
      main/inc/lib/tracking.lib.php
  18. 2
      main/inc/local.inc.php
  19. 850
      main/install/index.php
  20. 1
      main/lang/english/trad4all.inc.php
  21. 7
      main/lang/spanish/trad4all.inc.php
  22. 10
      main/template/default/layout/head.tpl
  23. 12
      main/template/default/layout/hot_course_item.tpl
  24. 14
      main/template/default/layout/hot_courses.tpl
  25. 16
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/AgendaStudent.php
  26. 11
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Announcements.php
  27. 11
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/AssessmentsIntroduction.php
  28. 5
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Basic.php
  29. 15
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Careers.php
  30. 11
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Documents.php
  31. 15
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/DocumentsStudent.php
  32. 15
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/FAQ.php
  33. 12
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Forum.php
  34. 16
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/ForumStudent.php
  35. 11
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Glossary.php
  36. 15
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/LearningPathAuthor.php
  37. 15
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/LearningPathDocuments.php
  38. 16
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Messages.php
  39. 16
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/NotebookStudent.php
  40. 16
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/PortalNews.php
  41. 16
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Profile.php
  42. 17
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Project.php
  43. 17
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/ProjectComment.php
  44. 17
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/ProjectCommentStudent.php
  45. 17
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/ProjectStudent.php
  46. 12
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Register.php
  47. 16
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Survey.php
  48. 8
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/TermsAndConditions.php
  49. 15
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/TestAnswerFeedback.php
  50. 15
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/TestFreeAnswer.php
  51. 7
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/TestFreeAnswerStrict.php
  52. 15
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/TestProposedAnswer.php
  53. 15
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/TestQuestionDescription.php
  54. 3
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/UniqueAnswerImage.php
  55. 12
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Wiki.php
  56. 16
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/WikiStudent.php
  57. 16
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/WikiTask.php
  58. 15
      src/Chamilo/CoreBundle/Component/Editor/CkEditor/Toolbar/Work.php
  59. 20
      tests/datafiller/data_users.php

@ -155,9 +155,16 @@ if (api_get_setting('pdf_export_watermark_by_course') == 'true') {
$form->addRule('pdf_export_watermark_path', get_lang('OnlyImagesAllowed').' ('.implode(',', $allowed_picture_types).')', 'filetype', $allowed_picture_types);
}
$group = array();
$group[]=$form->createElement('SelectTheme', 'course_theme', null, array('class'=>' ', 'id'=>'course_theme_id'));
$form->addGroup($group, '', array(get_lang("Stylesheets")), '');
if (api_get_setting('allow_course_theme') == 'true') {
$group = array();
$group[] = $form->createElement(
'SelectTheme',
'course_theme',
null,
array('class' => ' ', 'id' => 'course_theme_id')
);
$form->addGroup($group, '', array(get_lang("Stylesheets")), '');
}
$form->addElement('label', get_lang('DocumentQuota'), format_file_size(DocumentManager::get_course_quota()));
$form->addButtonSave(get_lang('SaveSettings'),'submit_save');

@ -4088,9 +4088,6 @@ tr.forum_category_header a {
background-color: #a0e5fc;
}
.current {
font-weight: bold;
}
.structure {
/*border-bottom: 1px solid #666666;*/
font-weight: bold;
@ -4913,7 +4910,7 @@ i.size-32.icon-new-work{
}
.text-h3 {
font-size: 18px;
font-size: 16px;
}
.text-h4 {
@ -5793,12 +5790,40 @@ ul.holder li.bit-box{
display: block;
}
}
#settings .form-inline{
margin-bottom: 15px;
}
#search_settings{
margin-bottom: 15px;
}
.src-image {
display: none;
}
/* thematic progress */
#panel-thematic .title-topics{
font-size: 15px;
color:#00829C;
font-weight: bold;
}
#panel-thematic .current{
background-color: #E7F1F7;
}
#panel-thematic .separate{
margin-bottom: 10px;
}
#panel-thematic .date{
font-size: 11px;
color: #8A6D3B;
background: #FCF8E3;
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
padding: 5px;
}
#panel-thematic .views ul li{
font-size: 12px;
}
/* end thematic progress*/
.card {
overflow: hidden;
position: relative;
@ -5810,7 +5835,6 @@ ul.holder li.bit-box{
color: rgb(136, 172, 217);
margin-bottom: 20px;
}
.card .header-bg {
/* This stretches the canvas across the entire hero unit */
position: absolute;
@ -5841,3 +5865,41 @@ ul.holder li.bit-box{
border-radius: 50%;
border: 5px solid rgba(0,0,30,0.8);
}
.question_options .exercise-unique-answer-image {
}
@media (min-width: 768px) {
.question_options .exercise-unique-answer-image:nth-child(2n-1) {
clear: both;
}
}
@media (min-width: 992px) {
.question_options .exercise-unique-answer-image:nth-child(2n-1) {
clear: none;
}
.question_options .exercise-unique-answer-image:nth-child(3n-2) {
clear: both;
}
}
.question_options label > input + div.thumbnail {
border-color: transparent;
border-width: 5px;
}
.question_options label > input:checked + div.thumbnail {
border: 5px solid red;
}
.question_options div.thumbnail p {
margin: 0;
}
.question_options div.thumbnail img {
height: auto !important;
max-width: 100%;
}

@ -131,15 +131,17 @@ a:focus {
background-color:#00829C;
}
.nav > li > a:hover, .nav > li > a:focus{
background-color: transparent;
}
.navbar-inverse li a{
line-height: 26px !important;
background: none !important;
border-right:1px solid rgba(0, 0, 0, 0.2) !important;
border-left:1px solid rgba(255, 255, 255, 0.1) !important;
}
.nav > li > a:hover, .nav > li > a:focus{
background-color: transparent;
}
.navbar-inverse .navbar-brand:hover, .navbar-inverse .navbar-brand:focus{
color: #ffffff;
}
@ -154,6 +156,12 @@ a:focus {
filter: none !important;
border-left-color: transparent !important;
}
.navbar-inverse .dropdown-menu li a:hover,
.navbar-inverse .dropdown-menu li a:focus{
background:#3C4147 !important;
color: #fff;
}
.badge-warning{
background-color: #FD6600;
}

@ -0,0 +1,360 @@
<?php
/* For licensing terms, see /license.txt */
/**
* UniqueAnswerImage
*
* @author Angel Fernando Quiroz Campos <angel.quiroz@beeznest.com>
*/
class UniqueAnswerImage extends UniqueAnswer
{
static $typePicture = 'mcua.png';
static $explanationLangVar = 'UniqueAnswerImage';
public function __construct()
{
//this is highly important
parent::__construct();
$this->type = UNIQUE_ANSWER_IMAGE;
$this->isContent = $this->getIsContent();
}
public function createAnswersForm($form)
{
$objExercise = $_SESSION['objExercise'];
$editorConfig = array(
'ToolbarSet' => 'UniqueAnswerImage',
'Width' => '100%',
'Height' => '125'
);
//this line defines how many questions by default appear when creating a choice question
// The previous default value was 2. See task #1759.
$numberAnswers = isset($_POST['nb_answers']) ? (int) $_POST['nb_answers'] : 4;
$numberAnswers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0));
$feedbackTitle = '';
if ($objExercise->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) {
//Scenario
$commentTitle = '<th>' . get_lang('Comment') . '</th>';
$feedbackTitle = '<th>' . get_lang('Scenario') . '</th>';
} else {
$commentTitle = '<th >' . get_lang('Comment') . '</th>';
}
$html = '<table class="table table-striped table-hover">
<thead>
<tr style="text-align: center;">
<th width="10">' . get_lang('Number') . '</th>
<th>' . get_lang('True') . '</th>
<th>' . get_lang('Answer') . '</th>
' . $commentTitle . '
' . $feedbackTitle . '
<th width="10">' . get_lang('Weighting') . '</th>
</tr>
</thead>
<tbody>';
$form->addHeader(get_lang('Answers'));
$form->addHtml($html);
$defaults = array();
$correct = 0;
if (!empty($this->id)) {
$answer = new Answer($this->id);
$answer->read();
if (count($answer->nbrAnswers) > 0 && !$form->isSubmitted()) {
$numberAnswers = $answer->nbrAnswers;
}
}
$form->addElement('hidden', 'nb_answers');
//Feedback SELECT
$questionList = $objExercise->selectQuestionList();
$selectQuestion = array();
$selectQuestion[0] = get_lang('SelectTargetQuestion');
if (is_array($questionList)) {
foreach ($questionList as $key => $questionid) {
//To avoid warning messages
if (!is_numeric($questionid)) {
continue;
}
$question = Question::read($questionid);
$selectQuestion[$questionid] = 'Q' . $key . ' :' . cut(
$question->selectTitle(), 20
);
}
}
$selectQuestion[-1] = get_lang('ExitTest');
$list = new LearnpathList(api_get_user_id());
$flatList = $list->get_flat_list();
$selectLpId = array();
$selectLpId[0] = get_lang('SelectTargetLP');
foreach ($flatList as $id => $details) {
$selectLpId[$id] = cut($details['lp_name'], 20);
}
$tempScenario = array();
if ($numberAnswers < 1) {
$numberAnswers = 1;
Display::display_normal_message(
get_lang('YouHaveToCreateAtLeastOneAnswer')
);
}
for ($i = 1; $i <= $numberAnswers; ++$i) {
$form->addHtml('<tr>');
if (isset($answer) && is_object($answer)) {
if ($answer->correct[$i]) {
$correct = $i;
}
$defaults['answer[' . $i . ']'] = $answer->answer[$i];
$defaults['comment[' . $i . ']'] = $answer->comment[$i];
$defaults['weighting[' . $i . ']'] = float_format(
$answer->weighting[$i], 1
);
$itemList = explode('@@', $answer->destination[$i]);
$try = $itemList[0];
$lp = $itemList[1];
$listDestination = $itemList[2];
$url = $itemList[3];
$try = 0;
if ($try != 0) {
$tryResult = 1;
}
$urlResult = '';
if ($url != 0) {
$urlResult = $url;
}
$tempScenario['url' . $i] = $urlResult;
$tempScenario['try' . $i] = $tryResult;
$tempScenario['lp' . $i] = $lp;
$tempScenario['destination' . $i] = $listDestination;
} else {
$defaults['answer[1]'] = get_lang('DefaultUniqueAnswer1');
$defaults['weighting[1]'] = 10;
$defaults['answer[2]'] = get_lang('DefaultUniqueAnswer2');
$defaults['weighting[2]'] = 0;
$tempScenario['destination' . $i] = array('0');
$tempScenario['lp' . $i] = array('0');
}
$defaults['scenario'] = $tempScenario;
$renderer = $form->defaultRenderer();
$renderer->setElementTemplate(
'<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
'correct'
);
$renderer->setElementTemplate(
'<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
'counter[' . $i . ']'
);
$renderer->setElementTemplate(
'<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
'answer[' . $i . ']'
);
$renderer->setElementTemplate(
'<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
'comment[' . $i . ']'
);
$renderer->setElementTemplate(
'<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}</td>',
'weighting[' . $i . ']'
);
$answerNumber = $form->addElement('text', 'counter[' . $i . ']', null, ' value = "' . $i . '"');
$answerNumber->freeze();
$form->addElement('radio', 'correct', null, null, $i, 'class="checkbox"');
$form->addHtmlEditor('answer[' . $i . ']', null, null, true, $editorConfig);
$form->addRule('answer[' . $i . ']', get_lang('ThisFieldIsRequired'), 'required');
if ($objExercise->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_DIRECT) {
$form->addHtmlEditor('comment[' . $i . ']', null, null, false, $editorConfig);
// Direct feedback
//Adding extra feedback fields
$group = array();
$group['try' . $i] = $form->createElement('checkbox', 'try' . $i, null, get_lang('TryAgain'));
$group['lp' . $i] = $form->createElement(
'select',
'lp' . $i,
get_lang('SeeTheory') . ': ',
$selectLpId
);
$group['destination' . $i] = $form->createElement(
'select',
'destination' . $i,
get_lang('GoToQuestion') . ': ',
$selectQuestion
);
$group['url' . $i] = $form->createElement(
'text', 'url' . $i,
get_lang('Other') . ': ',
array(
'class' => 'col-md-2',
'placeholder' => get_lang('Other')
)
);
$form->addGroup($group, 'scenario');
$renderer->setElementTemplate(
'<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error --><br/>{element}',
'scenario'
);
} else {
$form->addHtmlEditor('comment[' . $i . ']', null, null, false, $editorConfig);
}
$form->addText('weighting[' . $i . ']', null, null, array('class' => "col-md-1", 'value' => '0'));
$form->addHtml('</tr>');
}
$form->addHtml('</tbody>');
$form->addHtml('</table>');
global $text, $class;
$buttonGroup = [];
if ($objExercise->edit_exercise_in_lp == true) {
//setting the save button here and not in the question class.php
$buttonGroup[] = $form->addButtonDelete(get_lang('LessAnswer'), 'lessAnswers', true);
$buttonGroup[] = $form->addButtonCreate(get_lang('PlusAnswer'), 'moreAnswers', true);
$buttonGroup[] = $form->addButtonSave($text, 'submitQuestion', true);
$form->addGroup($buttonGroup);
}
// We check the first radio button to be sure a radio button will be check
if ($correct == 0) {
$correct = 1;
}
$defaults['correct'] = $correct;
if (!empty($this->id)) {
$form->setDefaults($defaults);
} else {
if ($this->isContent == 1) {
// Default sample content.
$form->setDefaults($defaults);
} else {
$form->setDefaults(array('correct' => 1));
}
}
$form->setConstants(array('nb_answers' => $numberAnswers));
}
public function processAnswersCreation($form)
{
$questionWeighting = $nbrGoodAnswers = 0;
$correct = $form->getSubmitValue('correct');
$objAnswer = new Answer($this->id);
$numberAnswers = $form->getSubmitValue('nb_answers');
for ($i = 1; $i <= $numberAnswers; $i++) {
$answer = trim($form->getSubmitValue('answer[' . $i . ']'));
$comment = trim($form->getSubmitValue('comment[' . $i . ']'));
$weighting = trim($form->getSubmitValue('weighting[' . $i . ']'));
$scenario = $form->getSubmitValue('scenario');
//$listDestination = $form -> getSubmitValue('destination'.$i);
//$destinationStr = $form -> getSubmitValue('destination'.$i);
$try = $scenario['try' . $i];
$lp = $scenario['lp' . $i];
$destination = $scenario['destination' . $i];
$url = trim($scenario['url' . $i]);
/*
How we are going to parse the destination value
here we parse the destination value which is a string
1@@3@@2;4;4;@@http://www.chamilo.org
where: try_again@@lp_id@@selected_questions@@url
try_again = is 1 || 0
lp_id = id of a learning path (0 if dont select)
selected_questions= ids of questions
url= an url
$destinationStr='';
foreach ($listDestination as $destination_id)
{
$destinationStr.=$destination_id.';';
} */
$goodAnswer = ($correct == $i) ? true : false;
if ($goodAnswer) {
$nbrGoodAnswers++;
$weighting = abs($weighting);
if ($weighting > 0) {
$questionWeighting += $weighting;
}
}
if (empty($try)) {
$try = 0;
}
if (empty($lp)) {
$lp = 0;
}
if (empty($destination)) {
$destination = 0;
}
if ($url == '') {
$url = 0;
}
//1@@1;2;@@2;4;4;@@http://www.chamilo.org
$dest = $try . '@@' . $lp . '@@' . $destination . '@@' . $url;
$objAnswer->createAnswer($answer, $goodAnswer, $comment, $weighting, $i, null, null, $dest);
}
// saves the answers into the data base
$objAnswer->save();
// sets the total weighting of the question
$this->updateWeighting($questionWeighting);
$this->save();
}
public function return_header($feedback_type = null, $counter = null, $score = null)
{
return parent::return_header($feedback_type, $counter, $score);
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1128,6 +1128,7 @@ if (!empty($error)) {
echo Display::div($exercise_actions, array('class'=>'exercise_actions'));
}
echo '</form>';
echo '</div>';
}
if ($origin != 'learnpath') {

@ -32,21 +32,25 @@ abstract class Question
public static $explanationLangVar = '';
public $question_table_class = 'table table-striped';
public static $questionTypes = array(
UNIQUE_ANSWER => array('unique_answer.class.php' , 'UniqueAnswer'),
MULTIPLE_ANSWER => array('multiple_answer.class.php' , 'MultipleAnswer'),
FILL_IN_BLANKS => array('fill_blanks.class.php' , 'FillBlanks'),
MATCHING => array('matching.class.php' , 'Matching'),
FREE_ANSWER => array('freeanswer.class.php' , 'FreeAnswer'),
ORAL_EXPRESSION => array('oral_expression.class.php' , 'OralExpression'),
HOT_SPOT => array('hotspot.class.php' , 'HotSpot'),
HOT_SPOT_DELINEATION => array('hotspot.class.php' , 'HotspotDelineation'),
MULTIPLE_ANSWER_COMBINATION => array('multiple_answer_combination.class.php', 'MultipleAnswerCombination'),
UNIQUE_ANSWER_NO_OPTION => array('unique_answer_no_option.class.php', 'UniqueAnswerNoOption'),
MULTIPLE_ANSWER_TRUE_FALSE => array('multiple_answer_true_false.class.php', 'MultipleAnswerTrueFalse'),
MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE => array('multiple_answer_combination_true_false.class.php', 'MultipleAnswerCombinationTrueFalse'),
GLOBAL_MULTIPLE_ANSWER => array('global_multiple_answer.class.php' , 'GlobalMultipleAnswer'),
CALCULATED_ANSWER => array('calculated_answer.class.php' , 'CalculatedAnswer')
//MEDIA_QUESTION => array('media_question.class.php' , 'MediaQuestion')
UNIQUE_ANSWER => array('unique_answer.class.php', 'UniqueAnswer'),
MULTIPLE_ANSWER => array('multiple_answer.class.php', 'MultipleAnswer'),
FILL_IN_BLANKS => array('fill_blanks.class.php', 'FillBlanks'),
MATCHING => array('matching.class.php', 'Matching'),
FREE_ANSWER => array('freeanswer.class.php', 'FreeAnswer'),
ORAL_EXPRESSION => array('oral_expression.class.php', 'OralExpression'),
HOT_SPOT => array('hotspot.class.php', 'HotSpot'),
HOT_SPOT_DELINEATION => array('hotspot.class.php', 'HotspotDelineation'),
MULTIPLE_ANSWER_COMBINATION => array('multiple_answer_combination.class.php', 'MultipleAnswerCombination'),
UNIQUE_ANSWER_NO_OPTION => array('unique_answer_no_option.class.php', 'UniqueAnswerNoOption'),
MULTIPLE_ANSWER_TRUE_FALSE => array('multiple_answer_true_false.class.php', 'MultipleAnswerTrueFalse'),
MULTIPLE_ANSWER_COMBINATION_TRUE_FALSE => array(
'multiple_answer_combination_true_false.class.php',
'MultipleAnswerCombinationTrueFalse'
),
GLOBAL_MULTIPLE_ANSWER => array('global_multiple_answer.class.php' , 'GlobalMultipleAnswer'),
CALCULATED_ANSWER => array('calculated_answer.class.php' , 'CalculatedAnswer'),
UNIQUE_ANSWER_IMAGE => ['UniqueAnswerImage.php', 'UniqueAnswerImage']
//MEDIA_QUESTION => array('media_question.class.php' , 'MediaQuestion')
);
/**
@ -114,7 +118,7 @@ abstract class Question
$TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);
$TBL_EXERCICE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$sql = "SELECT question,description,ponderation,position,type,picture,level,extra
$sql = "SELECT question, description, ponderation, position, type, picture, level, extra
FROM $TBL_QUESTIONS
WHERE c_id = $course_id AND id = $id ";
@ -126,17 +130,17 @@ abstract class Question
$objQuestion = Question::getInstance($object->type);
if (!empty($objQuestion)) {
$objQuestion->id = $id;
$objQuestion->question = $object->question;
$objQuestion->description = $object->description;
$objQuestion->weighting = $object->ponderation;
$objQuestion->position = $object->position;
$objQuestion->type = $object->type;
$objQuestion->picture = $object->picture;
$objQuestion->level = (int) $object->level;
$objQuestion->extra = $object->extra;
$objQuestion->course = $course_info;
$objQuestion->category = TestCategory::getCategoryForQuestion($id);
$objQuestion->id = $id;
$objQuestion->question = $object->question;
$objQuestion->description = $object->description;
$objQuestion->weighting = $object->ponderation;
$objQuestion->position = $object->position;
$objQuestion->type = $object->type;
$objQuestion->picture = $object->picture;
$objQuestion->level = (int) $object->level;
$objQuestion->extra = $object->extra;
$objQuestion->course = $course_info;
$objQuestion->category = TestCategory::getCategoryForQuestion($id);
$sql = "SELECT exercice_id FROM $TBL_EXERCICE_QUESTION
WHERE c_id = $course_id AND question_id = $id";
@ -252,7 +256,7 @@ abstract class Question
public function selectPicturePath()
{
if (!empty($this->picture)) {
return api_get_path(WEB_COURSE_PATH).$this->course['path'].'/document/images/'.$this->picture;
return api_get_path(WEB_COURSE_PATH) . $this->course['path'] . '/document/images/' . $this->picture;
}
return false;
}
@ -305,7 +309,7 @@ abstract class Question
*/
public function updateDescription($description)
{
$this->description=$description;
$this->description = $description;
}
/**
@ -316,7 +320,7 @@ abstract class Question
*/
public function updateWeighting($weighting)
{
$this->weighting=$weighting;
$this->weighting = $weighting;
}
/**
@ -325,7 +329,7 @@ abstract class Question
*/
public function updateCategory($in_category)
{
$this->category=$in_category;
$this->category = $in_category;
}
/**
@ -334,7 +338,7 @@ abstract class Question
*/
public function updateScoreAlwaysPositive($in_positive)
{
$this->scoreAlwaysPositive=$in_positive;
$this->scoreAlwaysPositive = $in_positive;
}
/**
@ -343,7 +347,7 @@ abstract class Question
*/
public function updateUncheckedMayScore($in_positive)
{
$this->uncheckedMayScore=$in_positive;
$this->uncheckedMayScore = $in_positive;
}
/**
@ -365,17 +369,22 @@ abstract class Question
foreach ($category_list as $category_id) {
$category_id = intval($category_id);
$question_id = intval($this->id);
$sql = "SELECT count(*) AS nb FROM $TBL_QUESTION_REL_CATEGORY
WHERE category_id = $category_id AND question_id = $question_id AND c_id=".api_get_course_int_id();
$sql = "SELECT count(*) AS nb
FROM $TBL_QUESTION_REL_CATEGORY
WHERE
category_id = $category_id
AND question_id = $question_id
AND c_id=".api_get_course_int_id();
$res = Database::query($sql);
$row = Database::fetch_array($res);
if ($row['nb'] > 0) {
//DO nothing
//$sql = "UPDATE $TBL_QUESTION_REL_CATEGORY SET category_id = $category_id WHERE question_id=$question_id AND c_id=".api_get_course_int_id();
//$sql = "UPDATE $TBL_QUESTION_REL_CATEGORY SET category_id = $category_id
//WHERE question_id=$question_id AND c_id=".api_get_course_int_id();
//$res = Database::query($sql);
} else {
$sql = "INSERT INTO $TBL_QUESTION_REL_CATEGORY (c_id, question_id, category_id)
VALUES (".api_get_course_int_id().", $question_id, $category_id)";
VALUES (" . api_get_course_int_id() . ", $question_id, $category_id)";
Database::query($sql);
}
}
@ -399,14 +408,16 @@ abstract class Question
$category_id = intval($in_category);
$question_id = intval($this->id);
$sql = "SELECT count(*) AS nb FROM $TBL_QUESTION_REL_CATEGORY
WHERE question_id=$question_id AND c_id=".api_get_course_int_id();
WHERE question_id = $question_id AND c_id=" . api_get_course_int_id();
$res = Database::query($sql);
$row = Database::fetch_array($res);
if ($row['nb'] > 0){
$sql = "UPDATE $TBL_QUESTION_REL_CATEGORY SET category_id=$category_id WHERE question_id=$question_id AND c_id=".api_get_course_int_id();
$sql = "UPDATE $TBL_QUESTION_REL_CATEGORY SET category_id = $category_id
WHERE question_id = $question_id AND c_id = " . api_get_course_int_id();
Database::query($sql);
} else {
$sql = "INSERT INTO $TBL_QUESTION_REL_CATEGORY VALUES (".api_get_course_int_id().", $question_id, $category_id)";
$sql = "INSERT INTO $TBL_QUESTION_REL_CATEGORY
VALUES (" . api_get_course_int_id() . ", $question_id, $category_id)";
Database::query($sql);
}
}
@ -423,7 +434,7 @@ abstract class Question
$TBL_QUESTION_REL_CATEGORY = Database::get_course_table(TABLE_QUIZ_QUESTION_REL_CATEGORY);
$question_id = intval($this->id);
$sql = "DELETE FROM $TBL_QUESTION_REL_CATEGORY
WHERE question_id=$question_id AND c_id=".api_get_course_int_id();
WHERE question_id = $question_id AND c_id = " . api_get_course_int_id();
Database::query($sql);
}
@ -435,7 +446,7 @@ abstract class Question
*/
public function updatePosition($position)
{
$this->position=$position;
$this->position = $position;
}
/**
@ -446,7 +457,7 @@ abstract class Question
*/
public function updateLevel($level)
{
$this->level=$level;
$this->level = $level;
}
/**
@ -459,7 +470,7 @@ abstract class Question
public function updateType($type)
{
$TBL_REPONSES = Database::get_course_table(TABLE_QUIZ_ANSWER);
$course_id = $this->course['real_id'];
$course_id = $this->course['real_id'];
if (empty($course_id)) {
$course_id = api_get_course_int_id();
@ -467,10 +478,13 @@ abstract class Question
// if we really change the type
if ($type != $this->type) {
// if we don't change from "unique answer" to "multiple answers" (or conversely)
if (!in_array($this->type, array(UNIQUE_ANSWER,MULTIPLE_ANSWER)) || !in_array($type,array(UNIQUE_ANSWER,MULTIPLE_ANSWER))) {
if (
!in_array($this->type, array(UNIQUE_ANSWER, MULTIPLE_ANSWER)) ||
!in_array($type, array(UNIQUE_ANSWER, MULTIPLE_ANSWER))
) {
// removes old answers
$sql = "DELETE FROM $TBL_REPONSES
WHERE c_id = $course_id AND question_id = ".intval($this->id)."";
WHERE c_id = $course_id AND question_id = " . intval($this->id);
Database::query($sql);
}
@ -496,9 +510,9 @@ abstract class Question
if (mkdir($picturePath, api_get_permissions_for_new_directories())) {
// document path
$documentPath = api_get_path(SYS_COURSE_PATH) . $this->course['path'] . "/document";
$path = str_replace($documentPath,'',$picturePath);
$path = str_replace($documentPath, '', $picturePath);
$title_path = basename($picturePath);
$doc_id = add_document($this->course, $path, 'folder', 0,$title_path);
$doc_id = add_document($this->course, $path, 'folder', 0, $title_path);
api_item_property_update($this->course, TOOL_DOCUMENT, $doc_id, 'FolderCreated', api_get_user_id());
}
}
@ -506,18 +520,24 @@ abstract class Question
// if the question has got an ID
if ($this->id) {
$extension = pathinfo($PictureName, PATHINFO_EXTENSION);
$this->picture = 'quiz-'.$this->id.'.jpg';
$this->picture = 'quiz-' . $this->id . '.jpg';
$o_img = new Image($Picture);
$o_img->send_image($picturePath.'/'.$this->picture, -1, 'jpg');
$o_img->send_image($picturePath . '/' . $this->picture, -1, 'jpg');
$document_id = add_document(
$this->course,
'/images/' . $this->picture, 'file',
'/images/' . $this->picture,
'file',
filesize($picturePath . '/' . $this->picture),
$this->picture
);
if ($document_id) {
return api_item_property_update($this->course, TOOL_DOCUMENT,
$document_id, 'DocumentAdded', api_get_user_id());
return api_item_property_update(
$this->course,
TOOL_DOCUMENT,
$document_id,
'DocumentAdded',
api_get_user_id()
);
}
}
@ -525,8 +545,8 @@ abstract class Question
}
/**
* Resizes a picture || Warning!: can only be called after uploadPicture, or if picture is already available in object.
*
* Resizes a picture || Warning!: can only be called after uploadPicture,
* or if picture is already available in object.
* @author Toon Keppens
* @param string $Dimension - Resizing happens proportional according to given dimension: height|width|any
* @param integer $Max - Maximum size
@ -539,15 +559,15 @@ abstract class Question
// if the question has an ID
if ($this->id) {
// Get dimensions from current image.
$my_image = new Image($picturePath.'/'.$this->picture);
$my_image = new Image($picturePath . '/' . $this->picture);
$current_image_size = $my_image->get_image_size();
$current_width = $current_image_size['width'];
$current_height = $current_image_size['height'];
$current_width = $current_image_size['width'];
$current_height = $current_image_size['height'];
if($current_width < $Max && $current_height <$Max)
if ($current_width < $Max && $current_height < $Max)
return true;
elseif($current_height == "")
elseif ($current_height == "")
return false;
// Resize according to height.
@ -581,7 +601,7 @@ abstract class Question
}
$my_image->resize($new_width, $new_height);
$result = $my_image->send_image($picturePath.'/'.$this->picture);
$result = $my_image->send_image($picturePath . '/' . $this->picture);
if ($result) {
return true;
@ -602,11 +622,11 @@ abstract class Question
global $picturePath;
// if the question has got an ID and if the picture exists
if($this->id) {
$picture=$this->picture;
$this->picture='';
if ($this->id) {
$picture = $this->picture;
$this->picture = '';
return @unlink($picturePath.'/'.$picture)?true:false;
return @unlink($picturePath . '/' . $picture) ? true : false;
}
return false;
@ -621,26 +641,38 @@ abstract class Question
*/
public function exportPicture($questionId, $course_info)
{
$course_id = $course_info['real_id'];
$TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);
$destination_path = api_get_path(SYS_COURSE_PATH).$course_info['path'].'/document/images';
$source_path = api_get_path(SYS_COURSE_PATH).$this->course['path'].'/document/images';
$course_id = $course_info['real_id'];
$TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);
$destination_path = api_get_path(SYS_COURSE_PATH) . $course_info['path'] . '/document/images';
$source_path = api_get_path(SYS_COURSE_PATH) . $this->course['path'] . '/document/images';
// if the question has got an ID and if the picture exists
if ($this->id && !empty($this->picture)) {
$picture=explode('.',$this->picture);
$extension = $picture[sizeof($picture)-1];
$picture = 'quiz-'.$questionId.'.'.$extension;
$result = @copy($source_path.'/'.$this->picture, $destination_path.'/'.$picture) ? true : false;
$picture = explode('.', $this->picture);
$extension = $picture[sizeof($picture) - 1];
$picture = 'quiz-' . $questionId . '.' . $extension;
$result = @copy($source_path . '/' . $this->picture, $destination_path . '/' . $picture) ? true : false;
//If copy was correct then add to the database
if ($result) {
$sql = "UPDATE $TBL_QUESTIONS SET picture='".Database::escape_string($picture)."'
WHERE c_id = $course_id AND id='".intval($questionId)."'";
$sql = "UPDATE $TBL_QUESTIONS SET picture='" . Database::escape_string($picture) . "'
WHERE c_id = $course_id AND id='" . intval($questionId) . "'";
Database::query($sql);
$document_id = add_document($course_info, '/images/'.$picture, 'file', filesize($destination_path.'/'.$picture), $picture);
$document_id = add_document(
$course_info,
'/images/' . $picture,
'file',
filesize($destination_path . '/' . $picture),
$picture
);
if ($document_id) {
return api_item_property_update($course_info, TOOL_DOCUMENT, $document_id, 'DocumentAdded', api_get_user_id());
return api_item_property_update(
$course_info,
TOOL_DOCUMENT,
$document_id,
'DocumentAdded',
api_get_user_id()
);
}
}
@ -658,14 +690,14 @@ abstract class Question
* @param string $Picture - temporary path of the picture to move
* @param string $PictureName - Name of the picture
*/
public function setTmpPicture($Picture,$PictureName)
public function setTmpPicture($Picture, $PictureName)
{
global $picturePath;
$PictureName = explode('.',$PictureName);
$Extension = $PictureName[sizeof($PictureName)-1];
$PictureName = explode('.', $PictureName);
$Extension = $PictureName[sizeof($PictureName) - 1];
// saves the picture into a temporary file
@move_uploaded_file($Picture,$picturePath.'/tmp.'.$Extension);
@move_uploaded_file($Picture, $picturePath . '/tmp.' . $Extension);
}
/**
@ -697,15 +729,15 @@ abstract class Question
// if the question has got an ID and if the picture exists
if ($this->id) {
if (file_exists($picturePath.'/tmp.jpg')) {
$Extension='jpg';
} elseif(file_exists($picturePath.'/tmp.gif')) {
$Extension='gif';
} elseif(file_exists($picturePath.'/tmp.png')) {
$Extension='png';
if (file_exists($picturePath . '/tmp.jpg')) {
$Extension = 'jpg';
} elseif (file_exists($picturePath . '/tmp.gif')) {
$Extension = 'gif';
} elseif (file_exists($picturePath . '/tmp.png')) {
$Extension = 'png';
}
$this->picture='quiz-'.$this->id.'.'.$Extension;
return @rename($picturePath.'/tmp.'.$Extension,$picturePath.'/'.$this->picture)?true:false;
$this->picture = 'quiz-' . $this->id . '.' . $Extension;
return @rename($picturePath . '/tmp.' . $Extension, $picturePath . '/' . $this->picture) ? true : false;
}
return false;
}
@ -736,16 +768,17 @@ abstract class Question
// question already exists
if(!empty($id)) {
$sql="UPDATE $TBL_QUESTIONS SET
question ='".Database::escape_string($question)."',
description ='".Database::escape_string($description)."',
ponderation ='".Database::escape_string($weighting)."',
position ='".Database::escape_string($position)."',
type ='".Database::escape_string($type)."',
picture ='".Database::escape_string($picture)."',
extra ='".Database::escape_string($extra)."',
level ='".Database::escape_string($level)."'
WHERE c_id = $c_id AND id = ".intval($id)."";
$sql = "UPDATE $TBL_QUESTIONS
SET
question = '" . Database::escape_string($question) . "',
description = '" . Database::escape_string($description) . "',
ponderation = '" . Database::escape_string($weighting) . "',
position = '" . Database::escape_string($position) . "',
type = '" . Database::escape_string($type) . "',
picture = '" . Database::escape_string($picture) . "',
extra = '" . Database::escape_string($extra) . "',
level = '" . Database::escape_string($level) . "'
WHERE c_id = $c_id AND id = " . intval($id);
Database::query($sql);
$this->saveCategory($category);
@ -758,7 +791,7 @@ abstract class Question
api_get_user_id()
);
}
if (api_get_setting('search_enabled')=='true') {
if (api_get_setting('search_enabled') == 'true') {
if ($exerciseId != 0) {
$this -> search_engine_edit($exerciseId);
} else {
@ -772,27 +805,30 @@ abstract class Question
// creates a new question
$sql = "SELECT max(position)
FROM $TBL_QUESTIONS as question,
$TBL_EXERCICE_QUESTION as test_question
$TBL_EXERCICE_QUESTION as test_question
WHERE
question.id = test_question.question_id AND
test_question.exercice_id = ".intval($exerciseId)." AND
question.c_id = $c_id AND
test_question.c_id = $c_id ";
test_question.exercice_id = " . intval($exerciseId) . " AND
question.c_id = $c_id AND
test_question.c_id = $c_id ";
$result = Database::query($sql);
$current_position = Database::result($result,0,0);
$this->updatePosition($current_position+1);
$position = $this->position;
$sql = "INSERT INTO $TBL_QUESTIONS (c_id, question, description, ponderation, position, type, picture, extra, level) VALUES (
$c_id,
'".Database::escape_string($question)."',
'".Database::escape_string($description)."',
'".Database::escape_string($weighting)."',
'".Database::escape_string($position)."',
'".Database::escape_string($type)."',
'".Database::escape_string($picture)."',
'".Database::escape_string($extra)."',
'".Database::escape_string($level)."'
)";
$sql = "INSERT INTO $TBL_QUESTIONS (
c_id, question, description, ponderation, position, type, picture, extra, level
)
VALUES (
$c_id,
'" . Database::escape_string($question) . "',
'" . Database::escape_string($description) . "',
'" . Database::escape_string($weighting) . "',
'" . Database::escape_string($position) . "',
'" . Database::escape_string($type) . "',
'" . Database::escape_string($picture) . "',
'" . Database::escape_string($extra) . "',
'" . Database::escape_string($level) . "'
)";
Database::query($sql);
$this->id = Database::insert_id();
@ -814,8 +850,21 @@ abstract class Question
$TBL_ANSWERS = Database::get_course_table(
TABLE_QUIZ_ANSWER
);
$sql = "INSERT INTO $TBL_ANSWERS (c_id, question_id , answer, correct, comment, ponderation, position, hotspot_coordinates, hotspot_type)
VALUES (".$c_id.", ".intval($this->id).", '', NULL , '', '10' , '1', '0;0|0|0', 'square')";
$sql = "INSERT INTO $TBL_ANSWERS (
c_id, question_id , answer, correct, comment, ponderation, position, hotspot_coordinates,
hotspot_type
)
VALUES (
$c_id,
" . intval($this->id) . ",
'',
NULL,
'',
'10',
'1',
'0;0|0|0',
'square'
)";
Database::query($sql);
$id = Database::insert_id();
if ($id) {
@ -828,8 +877,13 @@ abstract class Question
$TBL_ANSWERS = Database::get_course_table(
TABLE_QUIZ_ANSWER
);
$sql = "INSERT INTO $TBL_ANSWERS (c_id, question_id , answer , correct , comment , ponderation , position , hotspot_coordinates , hotspot_type )
VALUES (".$c_id.", ".intval($this->id).", '', NULL , '', '10' , '1', '0;0|0|0', 'delineation')";
$sql = "INSERT INTO $TBL_ANSWERS (
c_id, question_id, answer, correct, comment, ponderation, position, hotspot_coordinates,
hotspot_type
)
VALUES (
$c_id, " . intval($this->id) . ", '', NULL , '', '10' , '1', '0;0|0|0', 'delineation'
)";
Database::query($sql);
$id = Database::insert_id();
@ -875,10 +929,13 @@ abstract class Question
$tbl_se_ref = Database::get_main_table(TABLE_MAIN_SEARCH_ENGINE_REF);
if ($addQs || $rmQs) {
//there's only one row per question on normal db and one document per question on search engine db
$sql = 'SELECT * FROM %s WHERE course_code=\'%s\' AND tool_id=\'%s\' AND ref_id_second_level=%s LIMIT 1';
$sql = 'SELECT * FROM %
WHERE course_code=\'%s\' AND tool_id=\'%s\' AND ref_id_second_level=%s LIMIT 1';
$sql = sprintf($sql, $tbl_se_ref, $course_id, TOOL_QUIZ, $this->id);
} else {
$sql = 'SELECT * FROM %s WHERE course_code=\'%s\' AND tool_id=\'%s\' AND ref_id_high_level=%s AND ref_id_second_level=%s LIMIT 1';
$sql = 'SELECT * FROM %s
WHERE course_code=\'%s\' AND tool_id=\'%s\'
AND ref_id_high_level=%s AND ref_id_second_level=%s LIMIT 1';
$sql = sprintf($sql, $tbl_se_ref, $course_id, TOOL_QUIZ, $exerciseId, $this->id);
}
$res = Database::query($sql);
@ -889,21 +946,27 @@ abstract class Question
$di = new ChamiloIndexer();
if ($addQs) {
$question_exercises = array((int)$exerciseId);
$question_exercises = array((int) $exerciseId);
} else {
$question_exercises = array();
}
isset($_POST['language'])? $lang=Database::escape_string($_POST['language']): $lang = 'english';
isset($_POST['language']) ? $lang = Database::escape_string($_POST['language']) : $lang = 'english';
$di->connectDb(NULL, NULL, $lang);
// retrieve others exercise ids
$se_ref = Database::fetch_array($res);
$se_doc = $di->get_document((int)$se_ref['search_did']);
if ($se_doc !== FALSE) {
if ( ($se_doc_data=$di->get_document_data($se_doc)) !== FALSE ) {
if (($se_doc_data = $di->get_document_data($se_doc)) !== FALSE) {
$se_doc_data = unserialize($se_doc_data);
if (isset($se_doc_data[SE_DATA]['type']) && $se_doc_data[SE_DATA]['type'] == SE_DOCTYPE_EXERCISE_QUESTION) {
if (isset($se_doc_data[SE_DATA]['exercise_ids']) && is_array($se_doc_data[SE_DATA]['exercise_ids'])) {
if (
isset($se_doc_data[SE_DATA]['type']) &&
$se_doc_data[SE_DATA]['type'] == SE_DOCTYPE_EXERCISE_QUESTION
) {
if (
isset($se_doc_data[SE_DATA]['exercise_ids']) &&
is_array($se_doc_data[SE_DATA]['exercise_ids'])
) {
foreach ($se_doc_data[SE_DATA]['exercise_ids'] as $old_value) {
if (!in_array($old_value, $question_exercises)) {
$question_exercises[] = $old_value;
@ -914,7 +977,7 @@ abstract class Question
}
}
if ($rmQs) {
while ( ($key=array_search($exerciseId, $question_exercises)) !== FALSE) {
while (($key = array_search($exerciseId, $question_exercises)) !== FALSE) {
unset($question_exercises[$key]);
}
}
@ -927,7 +990,11 @@ abstract class Question
$xapian_data = array(
SE_COURSE_ID => $course_id,
SE_TOOL_ID => TOOL_QUIZ,
SE_DATA => array('type' => SE_DOCTYPE_EXERCISE_QUESTION, 'exercise_ids' => $question_exercises, 'question_id' => (int)$this->id),
SE_DATA => array(
'type' => SE_DOCTYPE_EXERCISE_QUESTION,
'exercise_ids' => $question_exercises,
'question_id' => (int)$this->id
),
SE_USER => (int)api_get_user_id(),
);
$ic_slide->xapian_data = serialize($xapian_data);
@ -946,23 +1013,46 @@ abstract class Question
if ($did || $rmQs) {
// save it to db
if ($addQs || $rmQs) {
$sql = 'DELETE FROM %s WHERE course_code=\'%s\' AND tool_id=\'%s\' AND ref_id_second_level=\'%s\'';
$sql = "DELETE FROM %s
WHERE course_code = '%s' AND tool_id = '%s' AND ref_id_second_level = '%s'";
$sql = sprintf($sql, $tbl_se_ref, $course_id, TOOL_QUIZ, $this->id);
} else {
$sql = 'DELETE FROM %s WHERE course_code=\'%s\' AND tool_id=\'%s\' AND ref_id_high_level=\'%s\' AND ref_id_second_level=\'%s\'';
$sql = "DELETE FROM %S
WHERE
course_code = '%s'
AND tool_id = '%s'
AND tool_id = '%s'
AND ref_id_high_level = '%s'
AND ref_id_second_level = '%s'";
$sql = sprintf($sql, $tbl_se_ref, $course_id, TOOL_QUIZ, $exerciseId, $this->id);
}
Database::query($sql);
if ($rmQs) {
if (!empty($question_exercises)) {
$sql = 'INSERT INTO %s (id, course_code, tool_id, ref_id_high_level, ref_id_second_level, search_did)
VALUES (NULL , \'%s\', \'%s\', %s, %s, %s)';
$sql = sprintf($sql, $tbl_se_ref, $course_id, TOOL_QUIZ, array_shift($question_exercises), $this->id, $did);
$sql = "INSERT INTO %s (
id, course_code, tool_id, ref_id_high_level, ref_id_second_level, search_did
)
VALUES (
NULL, '%s', '%s', %s, %s, %s
)";
$sql = sprintf(
$sql,
$tbl_se_ref,
$course_id,
TOOL_QUIZ,
array_shift($question_exercises),
$this->id,
$did
);
Database::query($sql);
}
} else {
$sql = 'INSERT INTO %s (id, course_code, tool_id, ref_id_high_level, ref_id_second_level, search_did)
VALUES (NULL , \'%s\', \'%s\', %s, %s, %s)';
$sql = "INSERT INTO %s (
id, course_code, tool_id, ref_id_high_level, ref_id_second_level, search_did
)
VALUES (
NULL , '%s', '%s', %s, %s, %s
)";
$sql = sprintf($sql, $tbl_se_ref, $course_id, TOOL_QUIZ, $exerciseId, $this->id, $did);
Database::query($sql);
}
@ -984,14 +1074,14 @@ abstract class Question
$exerciseRelQuestionTable = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$id = $this->id;
// checks if the exercise ID is not in the list
if (!in_array($exerciseId,$this->exerciseList)) {
$this->exerciseList[]= $exerciseId;
if (!in_array($exerciseId, $this->exerciseList)) {
$this->exerciseList[] = $exerciseId;
$new_exercise = new Exercise();
$new_exercise->read($exerciseId);
$count = $new_exercise->selectNbrQuestions();
$count++;
$sql="INSERT INTO $exerciseRelQuestionTable (c_id, question_id, exercice_id, question_order) VALUES
({$this->course['real_id']}, ".intval($id).", ".intval($exerciseId).", '$count' )";
$sql="INSERT INTO $exerciseRelQuestionTable (c_id, question_id, exercice_id, question_order)
VALUES ({$this->course['real_id']}, " . intval($id) . ", " . intval($exerciseId) . ", '$count')";
Database::query($sql);
// we do not want to reindex if we had just saved adnd indexed the question
@ -1015,7 +1105,7 @@ abstract class Question
$id = $this->id;
// searches the position of the exercise ID in the list
$pos=array_search($exerciseId,$this->exerciseList);
$pos = array_search($exerciseId, $this->exerciseList);
$course_id = api_get_course_int_id();
@ -1026,20 +1116,31 @@ abstract class Question
// deletes the position in the array containing the wanted exercise ID
unset($this->exerciseList[$pos]);
//update order of other elements
$sql = "SELECT question_order FROM $TBL_EXERCICE_QUESTION
WHERE c_id = $course_id AND question_id = ".intval($id)." AND exercice_id = ".intval($exerciseId)."";
$sql = "SELECT question_order
FROM $TBL_EXERCICE_QUESTION
WHERE
c_id = $course_id
AND question_id = " . intval($id) . "
AND exercice_id = " . intval($exerciseId);
$res = Database::query($sql);
if (Database::num_rows($res)>0) {
$row = Database::fetch_array($res);
if (!empty($row['question_order'])) {
$sql = "UPDATE $TBL_EXERCICE_QUESTION SET question_order = question_order-1
WHERE c_id = $course_id AND exercice_id = ".intval($exerciseId)." AND question_order > ".$row['question_order'];
$sql = "UPDATE $TBL_EXERCICE_QUESTION
SET question_order = question_order-1
WHERE
c_id = $course_id
AND exercice_id = " . intval($exerciseId) . "
AND question_order > " . $row['question_order'];
$res = Database::query($sql);
}
}
$sql = "DELETE FROM $TBL_EXERCICE_QUESTION
WHERE c_id = $course_id AND question_id = ".intval($id)." AND exercice_id = ".intval($exerciseId)."";
WHERE
c_id = $course_id
AND question_id = " . intval($id) . "
AND exercice_id = " . intval($exerciseId);
Database::query($sql);
return true;
@ -1058,9 +1159,9 @@ abstract class Question
{
$course_id = api_get_course_int_id();
$TBL_EXERCICE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);
$TBL_REPONSES = Database::get_course_table(TABLE_QUIZ_ANSWER);
$TBL_EXERCICE_QUESTION = Database::get_course_table(TABLE_QUIZ_TEST_QUESTION);
$TBL_QUESTIONS = Database::get_course_table(TABLE_QUIZ_QUESTION);
$TBL_REPONSES = Database::get_course_table(TABLE_QUIZ_ANSWER);
$TBL_QUIZ_QUESTION_REL_CATEGORY = Database::get_course_table(TABLE_QUIZ_QUESTION_REL_CATEGORY);
$id = $this->id;
@ -1077,27 +1178,30 @@ abstract class Question
if (!empty($row['question_order'])) {
$sql = "UPDATE $TBL_EXERCICE_QUESTION
SET question_order = question_order-1
WHERE c_id = $course_id AND exercice_id = ".intval($row['exercice_id'])." AND question_order > ".$row['question_order'];
WHERE
c_id= $course_id
AND exercice_id = " . intval($row['exercice_id']) . "
AND question_order > " . $row['question_order'];
Database::query($sql);
}
}
}
$sql = "DELETE FROM $TBL_EXERCICE_QUESTION WHERE c_id = $course_id AND question_id = ".intval($id)."";
$sql = "DELETE FROM $TBL_EXERCICE_QUESTION WHERE c_id = $course_id AND question_id = " . intval($id) . "";
Database::query($sql);
$sql = "DELETE FROM $TBL_QUESTIONS WHERE c_id = $course_id AND id = ".intval($id)."";
$sql = "DELETE FROM $TBL_QUESTIONS WHERE c_id = $course_id AND id = " . intval($id) . "";
Database::query($sql);
$sql = "DELETE FROM $TBL_REPONSES WHERE c_id = $course_id AND question_id = ".intval($id)."";
$sql = "DELETE FROM $TBL_REPONSES WHERE c_id = $course_id AND question_id = " . intval($id) . "";
Database::query($sql);
// remove the category of this question in the question_rel_category table
$sql = "DELETE FROM $TBL_QUIZ_QUESTION_REL_CATEGORY
WHERE c_id = $course_id AND question_id = ".intval($id)." AND c_id=".api_get_course_int_id();
WHERE c_id = $course_id AND question_id = " . intval($id) . " AND c_id=" . api_get_course_int_id();
Database::query($sql);
api_item_property_update($this->course, TOOL_QUIZ, $id,'QuizQuestionDeleted',api_get_user_id());
api_item_property_update($this->course, TOOL_QUIZ, $id, 'QuizQuestionDeleted', api_get_user_id());
$this->removePicture();
// resets the object
@ -1105,11 +1209,11 @@ abstract class Question
} else {
// just removes the exercise from the list
$this->removeFromList($deleteFromEx);
if (api_get_setting('search_enabled')=='true' && extension_loaded('xapian')) {
if (api_get_setting('search_enabled') == 'true' && extension_loaded('xapian')) {
// disassociate question with this exercise
$this -> search_engine_edit($deleteFromEx, FALSE, TRUE);
$this->search_engine_edit($deleteFromEx, FALSE, TRUE);
}
api_item_property_update($this->course, TOOL_QUIZ, $id,'QuizQuestionDeleted',api_get_user_id());
api_item_property_update($this->course, TOOL_QUIZ, $id, 'QuizQuestionDeleted', api_get_user_id());
}
}
@ -1159,8 +1263,19 @@ abstract class Question
$options = self::readQuestionOption($this->id, $this->course['real_id']);
//Inserting in the new course db / or the same course db
$sql = "INSERT INTO $TBL_QUESTIONS (c_id, question, description, ponderation, position, type, level, extra )
VALUES('$course_id', '".Database::escape_string($question)."','".Database::escape_string($description)."','".Database::escape_string($weighting)."','".Database::escape_string($position)."','".Database::escape_string($type)."' ,'".Database::escape_string($level)."' ,'".Database::escape_string($extra)."' )";
$sql = "INSERT INTO $TBL_QUESTIONS (
c_id, question, description, ponderation, position, type, level, extra
)
VALUES (
'$course_id',
'" . Database::escape_string($question) . "',
'" . Database::escape_string($description) . "',
'" . Database::escape_string($weighting) . "',
'" . Database::escape_string($position) . "',
'" . Database::escape_string($type) . "',
'" . Database::escape_string($level) . "',
'" . Database::escape_string($extra) . "'
)";
Database::query($sql);
$new_question_id = Database::insert_id();
@ -1236,7 +1351,7 @@ abstract class Question
if (class_exists($class_name)) {
return new $class_name();
} else {
echo 'Can\'t instanciate class '.$class_name.' of type '.$type;
echo 'Can\'t instanciate class ' . $class_name . ' of type ' . $type;
}
}
}
@ -1252,8 +1367,8 @@ abstract class Question
public function createForm(&$form)
{
echo '<style>
.media { display:none;}
</style>';
.media { display:none;}
</style>';
echo '<script>
// hack to hide http://cksource.com/forums/viewtopic.php?f=6&t=8700
function FCKeditor_OnComplete( editorInstance ) {
@ -1267,8 +1382,7 @@ abstract class Question
document.getElementById ( \'HiddenFCK\' + editorInstanceName ).className = "media";
}
}
</script>';
</script>';
// question name
$form->addElement('text', 'questionName', get_lang('Question'), array('class' => 'span6'));
@ -1436,17 +1550,17 @@ abstract class Question
require_once $a_type[0];
// get the picture of the type and the langvar which describes it
$img = $explanation = '';
eval('$img = '.$a_type[1].'::$typePicture;');
eval('$explanation = get_lang('.$a_type[1].'::$explanationLangVar);');
eval('$img = ' . $a_type[1] . '::$typePicture;');
eval('$explanation = get_lang(' . $a_type[1] . '::$explanationLangVar);');
echo '<li>';
echo '<div class="icon-image">';
if ($objExercise->exercise_was_added_in_lp == true) {
$img = pathinfo($img);
$img = $img['filename'].'_na.'.$img['extension'];
$img = $img['filename'] . '_na.' . $img['extension'];
echo Display::return_icon($img, $explanation, null, ICON_SIZE_BIG);
} else {
echo '<a href="admin.php?'.api_get_cidreq().'&newQuestion=yes&answerType='.$i.'">'.
Display::return_icon($img, $explanation, null, ICON_SIZE_BIG).'</a>';
echo '<a href="admin.php?' . api_get_cidreq() . '&newQuestion=yes&answerType=' . $i . '">' .
Display::return_icon($img, $explanation, null, ICON_SIZE_BIG) . '</a>';
}
echo '</div>';
echo '</li>';
@ -1457,10 +1571,10 @@ abstract class Question
if ($objExercise->exercise_was_added_in_lp == true) {
echo Display::return_icon('database_na.png', get_lang('GetExistingQuestion'), null, ICON_SIZE_BIG);
} else {
if ($feedback_type==1) {
echo $url = '<a href="question_pool.php?'.api_get_cidreq().'&type=1&fromExercise='.$exerciseId.'">';
if ($feedback_type == 1) {
echo $url = "<a href=\"question_pool.php?" . api_get_cidreq() . "&type=1&fromExercise=$exerciseId\">";
} else {
echo $url = '<a href="question_pool.php?'.api_get_cidreq().'&fromExercise='.$exerciseId.'">';
echo $url = '<a href="question_pool.php?' . api_get_cidreq() . '&fromExercise=' . $exerciseId . '">';
}
echo Display::return_icon('database.png', get_lang('GetExistingQuestion'), null, ICON_SIZE_BIG);
}
@ -1484,7 +1598,7 @@ abstract class Question
$params['name'] = $name;
$params['position'] = $position;
$params['c_id'] = $course_id;
$result = self::readQuestionOption($question_id, $course_id);
$result = self::readQuestionOption($question_id, $course_id);
$last_id = Database::insert($TBL_EXERCICE_QUESTION_OPTION, $params);
if ($last_id) {
$sql = "UPDATE $TBL_EXERCICE_QUESTION_OPTION SET id = iid WHERE iid = $last_id";
@ -1597,9 +1711,12 @@ abstract class Question
$header .= $this->show_media_content();
}
$header .= Display::page_subheader2($counter_label.". ".$question_title);
$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'));
$header .= Display::page_subheader2($counter_label . ". " . $question_title);
$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;
}
@ -1639,11 +1756,21 @@ abstract class Question
r.c_id = $course_id";
$rs_max = Database::query($sql);
$row_max = Database::fetch_object($rs_max);
$max_position = $row_max->max_position +1;
$max_position = $row_max->max_position + 1;
// Insert the new question
$sql = "INSERT INTO $tbl_quiz_question (c_id, question, description, ponderation, position, type, level)
VALUES ($course_id, '".Database::escape_string($question_name)."', '".Database::escape_string($question_description)."', '$max_score', $max_position, $type, $level)";
$sql = "INSERT INTO $tbl_quiz_question (
c_id, question, description, ponderation, position, type, level
)
VALUES (
$course_id,
'" . Database::escape_string($question_name) . "',
'" . Database::escape_string($question_description) . "',
'$max_score',
$max_position,
$type,
$level
)";
Database::query($sql);
// Get the question ID
@ -1674,12 +1801,12 @@ abstract class Question
*/
public function get_type_icon_html()
{
$type = $this->selectType();
$type = $this->selectType();
$tabQuestionList = Question::get_question_type_list(); // [0]=file to include [1]=type name
require_once $tabQuestionList[$type][0];
eval('$img = '.$tabQuestionList[$type][1].'::$typePicture;');
eval('$explanation = get_lang('.$tabQuestionList[$type][1].'::$explanationLangVar);');
eval('$img = ' . $tabQuestionList[$type][1] . '::$typePicture;');
eval('$explanation = get_lang(' . $tabQuestionList[$type][1] . '::$explanationLangVar);');
return array($img, $explanation);
}
@ -1687,15 +1814,25 @@ abstract class Question
* Get course medias
* @param int course id
*/
static function get_course_medias($course_id, $start = 0, $limit = 100, $sidx = "question", $sord = "ASC", $where_condition = array())
static function get_course_medias(
$course_id,
$start = 0,
$limit = 100,
$sidx = "question",
$sord = "ASC",
$where_condition = array()
)
{
$table_question = Database::get_course_table(TABLE_QUIZ_QUESTION);
$default_where = array('c_id = ? AND parent_id = 0 AND type = ?' => array($course_id, MEDIA_QUESTION));
$result = Database::select('*', $table_question,
$result = Database::select(
'*',
$table_question,
array(
'limit' => " $start, $limit",
'where' => $default_where,
'order' => "$sidx $sord")
'order' => "$sidx $sord"
)
);
return $result;
}
@ -1710,9 +1847,9 @@ abstract class Question
{
$table_question = Database::get_course_table(TABLE_QUIZ_QUESTION);
$result = Database::select(
'count(*) as count',
'count(*) as count',
$table_question,
array('where'=>array('c_id = ? AND parent_id = 0 AND type = ?' => array($course_id, MEDIA_QUESTION))),
array('where' => array('c_id = ? AND parent_id = 0 AND type = ?' => array($course_id, MEDIA_QUESTION))),
'first'
);

@ -100,7 +100,7 @@ $ajax_url = api_get_path(WEB_AJAX_PATH)."exercise.ajax.php?".api_get_cidreq()."&
$( "#question_list" ).accordion({
icons: icons,
autoHeight: false,
heightStyle: "content",
active: false, // all items closed by default
collapsible: true,
header: ".header_operations"

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 767 B

@ -219,100 +219,61 @@ if ($tool == TOOL_COURSE_HOMEPAGE && !isset($_GET['intro_cmdEdit'])) {
$userInfo = $_SESSION['_user'];
$courseInfo = api_get_course_info();
//die('<pre>'.print_r($courseInfo,1).'</pre>');
$thematic_description_html =
'<div class="thematic-postit">
<div class="row"><div class="col-md-12">
<div class="accordion" id="progress-bar-course">
<div class="accordion-group">
<div class="accordion-heading">
<div class="title-accordion">
<div class="row score-thematic">
<div class="col-md-12">';
$thematic_description_html .= '<div class="col-md-3 name-student">
<h2>' . $userInfo['firstName'] . '</h2>
<h3>' . $userInfo['lastName'] . '</h3>
</div>
<div class="col-md-3 score">
<h1>' . $thematicScore . '</h1>
</div>
<div class="col-md-3">
<h3>' . $thematic_advance . '</h3>
<p>' . $courseInfo['name'] . '</p>
</div>
';
$thematic_description_html .= '<div class="col-md-3">
<a id="thematic-show" class="btn btn-small btn-primary accordion-toggle btn-hide-thematic" href="#pross" data-toggle="collapse" data-parent="#progress-bar-course">
' . get_lang('SeeDetail') . '
</a>
<a id="thematic-hide" class="btn btn-small accordion-toggle btn-show-thematic" href="#pross" data-toggle="collapse" data-parent="#progress-bar-course" style="display:none;">
' . get_lang('Hide') . '
</a>
</div>
$thematic_description_html = '
<div class="panel-group" id="accordion" role="tablist" aria-multiselectable="true">
<div id="panel-thematic" class="panel panel-default">
<div class="panel-heading">
<a data-toggle="collapse" data-parent="#accordion" href="#collapseOne" aria-expanded="true" aria-controls="collapseOne">
<h4>
'. $thematic_advance .' : '. $courseInfo['name'] . ' <b>( '. $thematicScore .' )</b>
</h4>
</a>
</div>
<div id="collapseOne" class="panel-collapse collapse in" role="tabpanel" aria-labelledby="headingOne">
<div class="panel-body">
<div class="row">
<div class="col-md-3">
<div class="thumbnail">
<img src="' . $userInfo['avatar'] . '" class="img-responsive">
</div>
<div class="progress">
<div class="progress-bar progress-bar-success progress-bar-striped" role="progressbar" style="width: ' . $thematicScore . ';">
'.$thematicScore.'
</div>
</div>
</div>
</div>';
$thematic_description_html .=
'<div class="accordion-body collapse in" id="pross" style="height: auto !important;">
<div class="accordion-inner">
<div class="row">
<div class="col-md-12">
<div class="row">
<div class="col-md-4">
<div class="thumbnail">
<img src="' . $userInfo['avatar'] . '" class="img-polaroid">
</div>
</div>
<div class="col-md-8">
<div class="info-progress">
<div class="tittle-score">' . $thematic_advance . '&nbsp;' . $thematicScore .'
</div>
<div class="progress progress-striped">
<div class="bar" style="width: ' . $thematicScore . ';"></div>
</div>
<a href="' . $thematicUrl . '" class="btn btn-info">' . get_lang('ShowFullCourseAdvance') . '</a>
</div>
</div>
</div>
</div>';
$thematic_description_html .=
'<div class="col-md-8">
<div class="row">';
$thematic_description_html .=
'<div class="col-md-6 items-progress'.$class1.'">
<div class="topics">' . $subTitle1 . '</div>
<p class="title_topics">' . $thematic_info['title'] . '</p>
<p class="date">' . $thematic_advance_info['start_date'] . '</p>
<h3 class="title">' . $thematic_advance_info['content'] . '</h3>
<p class="time">' . get_lang('DurationInHours') . ' : ' . $thematic_advance_info['duration'] . ' - <a href="' . $thematicUrl . '">' . get_lang('SeeDetail') . '</a></p>
</div>';
</div>
<div class="separate"><a href="' . $thematicUrl . '" class="btn btn-block btn-info">' . get_lang('ShowFullCourseAdvance') . '</a></div>
</div>';
$thematic_description_html .= '<div class="col-md-9">';
$thematic_description_html .= '<div class="row">';
$thematic_description_html .= '<div class="col-md-6 items-progress'.$class1.'">
<div class="topics">' . $subTitle1 . '</div>
<h4 class="title-topics">' . $thematic_info['title'] . '</h4>
<p class="date">' . $thematic_advance_info['start_date'] . '</p>
<div class="views">' . $thematic_advance_info['content'] . '</div>
<p class="time">' . get_lang('DurationInHours') . ' : ' . $thematic_advance_info['duration'] . ' - <a href="' . $thematicUrl . '">' . get_lang('SeeDetail') . '</a></p>
</div>';
if (!empty($thematic_advance_info2)) {
$thematic_info2 = $thematic->get_thematic_list($thematic_advance_info2['thematic_id']);
$thematic_advance_info2['start_date'] = api_get_local_time($thematic_advance_info2['start_date']);
$thematic_advance_info2['start_date'] = api_format_date($thematic_advance_info2['start_date'], DATE_TIME_FORMAT_LONG);
$thematic_description_html .=
'<div class="col-md-6 items-progress">
<div class="topics">'.$subTitle2.'</div>
<p class="title_topics">'.$thematic_info2['title'].'</p>
<p class="date">'.$thematic_advance_info2['start_date'].'</p>
<h3 class="title">'.$thematic_advance_info2['content'].'</h3>
<p class="time">'.get_lang('DurationInHours').' : '.$thematic_advance_info2['duration'].' - <a href="'.$thematicUrl.'">'.get_lang('SeeDetail').'</a></p>
</div>';
$thematic_description_html .= '<div class="col-md-6 items-progress">
<div class="topics">'.$subTitle2.'</div>
<h4 class="title-topics">'.$thematic_info2['title'].'</h4>
<p class="date">'.$thematic_advance_info2['start_date'].'</p>
<div class="views">'.$thematic_advance_info2['content'].'</div>
<p class="time">'.get_lang('DurationInHours').' : '.$thematic_advance_info2['duration'].' - <a href="'.$thematicUrl.'">'.get_lang('SeeDetail').'</a></p>
</div>';
}
$thematic_description_html.=
'</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>';
$thematic_description_html.='</div>';
$thematic_description_html.='</div></div></div></div></div></div>';
}
}

@ -472,6 +472,7 @@ define('ORAL_EXPRESSION', 13);
define('GLOBAL_MULTIPLE_ANSWER', 14);
define('MEDIA_QUESTION', 15);
define('CALCULATED_ANSWER', 16);
define('UNIQUE_ANSWER_IMAGE', 17);
//Some alias used in the QTI exports
define('MCUA', 1);

@ -3259,7 +3259,7 @@ class CourseManager
$tableSessionRelCourse = Database::get_main_table(TABLE_MAIN_SESSION_COURSE);
$orderBy = ' ORDER BY position';
$extraInnerJoin = " INNER JOIN $tableSessionRelCourse src
ON (c.code = src.course_code AND session_id = $sessionId) ";
ON (c.id = src.c_id AND session_id = $sessionId) ";
}
}
@ -3512,8 +3512,10 @@ class CourseManager
$html .= '</div>';
$notifications = isset($params['notifications']) ? $params['notifications'] : null;
$param_class = isset($params['class']) ? $params['class'] : null;
$params['right_actions'] = isset($params['right_actions']) ? $params['right_actions'] : null;
$html .= '<div class="col-md-10 ' . $param_class . '">';
$html .= '<div class="pull-right">' . $params['right_actions'] . '</div>';
$html .= '<h4 class="title">' . $params['title'] . $notifications . '</h4> ';
if (isset($params['show_description'], $params['description']) && $params['show_description'] == 1) {
@ -3535,8 +3537,7 @@ class CourseManager
$html .= '</div>';
$html .= '</div>';
$params['right_actions'] = isset($params['right_actions']) ? $params['right_actions'] : null;
$html .= '<div class="pull-right">' . $params['right_actions'] . '</div>';
$html .= '</div>';
$html .= '</div>';
return $html;
@ -4804,7 +4805,7 @@ class CourseManager
) {
$my_course['extra_info']['description_button'] = Display::url(get_lang('Description'),
api_get_path(WEB_AJAX_PATH) . 'course_home.ajax.php?a=show_course_information&amp;code=' . $course_info['code'],
array('class' => 'ajax btn'));
array('class' => 'btn btn-default ajax'));
}
$my_course['extra_info']['teachers'] = CourseManager::get_teacher_list_from_course_code_to_string($course_info['code']);

@ -82,7 +82,8 @@ class ExerciseLib
return '';
}
echo '<div class="question_options">';
echo '<div class="question_options row">';
// construction of the Answer object (also gets all answers details)
$objAnswerTmp = new Answer($questionId);
@ -104,7 +105,7 @@ class ExerciseLib
$num_suggestions = 0;
if ($answerType == MATCHING) {
$s .= '<table class="data_table">';
$s .= '<table class="table table-hover table-striped">';
// Iterate through answers
$x = 1;
//mark letters for each answer
@ -213,7 +214,7 @@ class ExerciseLib
if ($show_comment) {
$header .= Display::tag('th', get_lang('Feedback'));
}
$s .= '<table class="data_table">';
$s .= '<table class="table table-hover table-striped">';
$s .= Display::tag(
'tr',
$header,
@ -222,22 +223,24 @@ class ExerciseLib
}
if ($show_comment) {
if (in_array(
$answerType,
array(
MULTIPLE_ANSWER,
MULTIPLE_ANSWER_COMBINATION,
UNIQUE_ANSWER,
UNIQUE_ANSWER_NO_OPTION,
GLOBAL_MULTIPLE_ANSWER
if (
in_array(
$answerType,
array(
MULTIPLE_ANSWER,
MULTIPLE_ANSWER_COMBINATION,
UNIQUE_ANSWER,
UNIQUE_ANSWER_IMAGE,
UNIQUE_ANSWER_NO_OPTION,
GLOBAL_MULTIPLE_ANSWER
)
)
)
) {
$header = Display::tag('th', get_lang('Options'));
if ($exercise_feedback == EXERCISE_FEEDBACK_TYPE_END) {
$header .= Display::tag('th', get_lang('Feedback'));
}
$s .= '<table class="data_table">';
$s .= '<table class="table table-hover table-striped">';
$s .= Display::tag(
'tr',
$header,
@ -263,7 +266,7 @@ class ExerciseLib
$attributes = array();
// Unique answer
if ($answerType == UNIQUE_ANSWER || $answerType == UNIQUE_ANSWER_NO_OPTION) {
if (in_array($answerType, [UNIQUE_ANSWER, UNIQUE_ANSWER_NO_OPTION, UNIQUE_ANSWER_IMAGE])) {
$input_id = 'choice-' . $questionId . '-' . $answerId;
if (isset($user_choice[0]['answer']) && $user_choice[0]['answer'] == $numAnswer) {
$attributes = array(
@ -282,6 +285,25 @@ class ExerciseLib
}
}
if ($show_comment) {
$s .= '<tr><td>';
}
if ($answerType == UNIQUE_ANSWER_IMAGE) {
if ($show_comment) {
if (empty($comment)) {
$s .= '<div id="answer' . $questionId . $numAnswer . '" '
. 'class="exercise-unique-answer-image col-xs-6" style="text-align: center">';
} else {
$s .= '<div id="answer' . $questionId . $numAnswer . '" '
. 'class="exercise-unique-answer-image col-xs-6 col-sm-12" style="text-align: center">';
}
} else {
$s .= '<div id="answer' . $questionId . $numAnswer . '" '
. 'class="exercise-unique-answer-image col-xs-6 col-md-4" style="text-align: center">';
}
}
$answer = Security::remove_XSS($answer, STUDENT);
$s .= Display::input(
'hidden',
@ -289,7 +311,15 @@ class ExerciseLib
'0'
);
$answer_input = '<label class="radio">';
$answer_input = null;
if ($answerType == UNIQUE_ANSWER_IMAGE) {
$attributes['style'] = 'display: none;';
$answer = '<div class="thumbnail">' . $answer . '</div>';
}
$answer_input .= '<label class="radio">';
$answer_input .= Display::input(
'radio',
'choice[' . $questionId . ']',
@ -299,8 +329,11 @@ class ExerciseLib
$answer_input .= $answer;
$answer_input .= '</label>';
if ($answerType == UNIQUE_ANSWER_IMAGE) {
$answer_input .= "</div>";
}
if ($show_comment) {
$s .= '<tr><td>';
$s .= $answer_input;
$s .= '</td>';
$s .= '<td>';
@ -311,7 +344,8 @@ class ExerciseLib
$s .= $answer_input;
}
} elseif ($answerType == MULTIPLE_ANSWER ||
} elseif (
$answerType == MULTIPLE_ANSWER ||
$answerType == MULTIPLE_ANSWER_TRUE_FALSE ||
$answerType == GLOBAL_MULTIPLE_ANSWER
) {

@ -3078,7 +3078,7 @@ class Tracking
$sql = "SELECT DISTINCT code, c_id
FROM $tbl_session_course sc
INNER JOIN $courseTable c
sc.c_id = c.id
ON sc.c_id = c.id
WHERE session_id= $session_id";
$result = Database::query($sql);

@ -1089,7 +1089,7 @@ if ((isset($uidReset) && $uidReset) || (isset($cidReset) && $cidReset)) {
$is_sessionAdmin = true;
} else {
// Am I a session coach for this session?
$sql = "SELECT id, id_coach FROM $tbl_session session
$sql = "SELECT session.id, session.id_coach FROM $tbl_session session
INNER JOIN $tbl_session_course sc
ON sc.session_id = session.id
WHERE session.id = $session_id

File diff suppressed because it is too large Load Diff

@ -7084,4 +7084,5 @@ $BadgesManagement = "Badges management";
$CurrentBadges = "Current badges";
$SaveBadge = "Save badge";
$BadgeMeasuresXPixelsInPNG = "Badge measures 200x200 pixels in PNG";
$UniqueAnswerImage = "Unique answer image";
?>

@ -6826,7 +6826,7 @@ $NumberOfPublishedExercises = "Nro de ejercicios publicados";
$NumberOfPublishedLps = "Nro de Lecciones publicadas";
$ChatConnected = "Chat (Conectado)";
$ChatDisconnected = "Chat (Desconectado)";
$AddCourseDescription = "Agregar descripción del curso";
$AddCourseDescription = "Describir el curso";
$ThingsToDo = "Primeras actividades sugeridas";
$RecordAnswer = "Grabar respuesta";
$UseTheMessageBelowToAddSomeComments = "Utilizar el siguiente campo de texto para escribir un comentario al profesor";
@ -7100,6 +7100,9 @@ $WorkEmailAlertActivateOnlyForTeachers = "Activar sólo para profesores el aviso
$WorkEmailAlertActivateOnlyForStudents = "Activar sólo para alumnos el aviso por correo electrónico del envío de una nueva tarea";
$Uncategorized = "Sin categoría";
$NaturalYear = "Año natural";
$AutoWeight = "Auto-ponderación";
$AutoWeightExplanation = "La ponderación automática permite ganar algo de tiempo. Esta funcionalidad distribuirá el peso total entre los elementos a bajo de manera equilibrada.";
$EditWeight = "Editar ponderación";
$TheSkillHasBeenCreated = "La competencia ha sido creada";
$CreateSkill = "Crear competencia";
$CannotCreateSkill = "No se puede crear la competencia";
@ -7110,4 +7113,6 @@ $BadgesManagement = "Gestionar las insignias";
$CurrentBadges = "Insignias actuales";
$SaveBadge = "Guardar insignia";
$BadgeMeasuresXPixelsInPNG = "Medidas de la insignia 200x200 píxeles en formato PNG";
$SetTutor = "Hacer tutor";
$UniqueAnswerImage = "Respuesta de imagen única";
?>

@ -454,16 +454,6 @@ $(function() {
},200);
}
);
/*
$(".td_actions").hide();
$(".td_actions").parent('tr').mouseover(function() {
$(".td_actions").show();
});
$(".td_actions").parent('tr').mouseout(function() {
$(".td_actions").hide();
});*/
/* Make responsive image maps */
$('map').imageMapResize();

@ -1,14 +1,14 @@
{% for hot_course in hot_courses %}
{% if hot_course.extra_info.title %}
<div class="col-md-12 hot-course-box">
<div class="well_border">
<div class="row">
<div class="span2">
<div class="col-md-2">
<div class="thumbnail">
<img src="{{ hot_course.extra_info.course_image }}" alt="{{ hot_course.extra_info.title|e }}" />
</div>
</div>
<div class="span6">
<div class="col-md-10">
<div class="categories-course-description">
<div class="text-h3">{{ hot_course.extra_info.title}}</div>
<div class="text-h5">{{ hot_course.extra_info.teachers }}</div>
@ -22,7 +22,7 @@
</p>
</div>
</div>
</div>
</div>
{% endif %}
{% endfor %}

@ -21,19 +21,21 @@ $(document).ready( function() {
});
</script>
<section id="hot_courses">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading">
{{ "HottestCourses"|get_lang}}
{% if _u.is_admin %}
<span class="pull-right">
<a title="{{ "Hide"|get_lang }}" alt="{{ "Hide"|get_lang }}" href="{{ _p.web_main }}admin/settings.php?search_field=show_hot_courses&submit_button=&_qf__search_settings=&category=search_setting">
<img src="{{ "visible.png"|icon(32) }}">
<img src="{{ "eyes.png"|icon(22) }}">
</a>
</span>
{% endif %}
{{ "HottestCourses"|display_page_subheader }}
</div>
{% include template ~ '/layout/hot_course_item.tpl' %}
</div>
<div class="panel-body">
{% include template ~ '/layout/hot_course_item.tpl' %}
</div>
</div>
</section>
{% endif %}

@ -14,6 +14,10 @@ class AgendaStudent extends Basic
public $plugins = array(
);
/**
* Get the toolbar config
* @return array
*/
public function getConfig()
{
if (api_get_setting('more_buttons_maximized_mode') != 'true') {
@ -27,6 +31,10 @@ class AgendaStudent extends Basic
return $config;
}
/**
* Get the toolbar configuration when CKEditor is maximized
* @return array
*/
protected function getMaximizedToolbar()
{
return [
@ -60,6 +68,10 @@ class AgendaStudent extends Basic
];
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -88,6 +100,10 @@ class AgendaStudent extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -12,7 +12,8 @@ class Announcements extends Basic
{
/**
* @return mixed
* Get the toolbar config
* @return array
*/
public function getConfig()
{
@ -25,6 +26,10 @@ class Announcements extends Basic
return $config;
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -54,6 +59,10 @@ class Announcements extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -11,7 +11,8 @@ namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
class AssessmentsIntroduction extends Basic
{
/**
* @return mixed
* Get the toolbar config
* @return array
*/
public function getConfig()
{
@ -24,6 +25,10 @@ class AssessmentsIntroduction extends Basic
return $config;
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -40,6 +45,10 @@ class AssessmentsIntroduction extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -77,7 +77,7 @@ class Basic extends Toolbar
// Adding plugins depending of platform conditions
$plugins = array();
if (api_get_setting('show_glossary_in_documents') != 'none') {
if (api_get_setting('show_glossary_in_documents') == 'ismanual') {
$plugins[] = 'glossary';
}
@ -131,6 +131,7 @@ class Basic extends Toolbar
}
/**
* Get the toolbar config
* @return array
*/
public function getConfig()
@ -191,7 +192,7 @@ class Basic extends Toolbar
}
/**
* Get the small toolbar configuration
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()

@ -12,7 +12,8 @@ class Careers extends Basic
{
/**
* @return mixed
* Get the toolbar config
* @return array
*/
public function getConfig()
{
@ -26,6 +27,10 @@ class Careers extends Basic
return $config;
}
/**
* Get the toolbar configuration when CKEditor is maximized
* @return array
*/
protected function getMaximizedToolbar()
{
return [
@ -57,6 +62,10 @@ class Careers extends Basic
];
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -70,6 +79,10 @@ class Careers extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -13,7 +13,8 @@ class Documents extends Basic
public $plugins = array();
/**
* @return mixed
* Get the toolbar config
* @return array
*/
public function getConfig()
{
@ -45,6 +46,10 @@ class Documents extends Basic
return $plugins;
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -72,6 +77,10 @@ class Documents extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -12,7 +12,8 @@ class DocumentsStudent extends Basic
{
/**
* @return mixed
* Get the toolbar config
* @return array
*/
public function getConfig()
{
@ -28,6 +29,10 @@ class DocumentsStudent extends Basic
return $config;
}
/**
* Get the toolbar configuration when CKEditor is maximized
* @return array
*/
protected function getMaximizedToolbar()
{
return [
@ -61,6 +66,10 @@ class DocumentsStudent extends Basic
];
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -77,6 +86,10 @@ class DocumentsStudent extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -12,7 +12,8 @@ class FAQ extends Basic
{
/**
* @return mixed
* Get the toolbar config
* @return array
*/
public function getConfig()
{
@ -27,6 +28,10 @@ class FAQ extends Basic
return $config;
}
/**
* Get the toolbar configuration when CKEditor is maximized
* @return array
*/
protected function getMaximizedToolbar()
{
return [
@ -58,6 +63,10 @@ class FAQ extends Basic
];
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -65,6 +74,10 @@ class FAQ extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -11,6 +11,10 @@ namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
class Forum extends Basic
{
/**
* Get the toolbar config
* @return array
*/
public function getConfig()
{
if (api_get_setting('more_buttons_maximized_mode') != 'true') {
@ -22,6 +26,10 @@ class Forum extends Basic
return $config;
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -51,6 +59,10 @@ class Forum extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -11,6 +11,10 @@ namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
class ForumStudent extends Basic
{
/**
* Get the toolbar config
* @return array
*/
public function getConfig()
{
if (api_get_setting('more_buttons_maximized_mode') != 'true') {
@ -24,6 +28,10 @@ class ForumStudent extends Basic
return $config;
}
/**
* Get the toolbar configuration when CKEditor is maximized
* @return array
*/
protected function getMaximizedToolbar()
{
return [
@ -57,6 +65,10 @@ class ForumStudent extends Basic
];
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -73,6 +85,10 @@ class ForumStudent extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -12,7 +12,8 @@ class Glossary extends Basic
{
/**
* @return mixed
* Get the toolbar config
* @return array
*/
public function getConfig()
{
@ -25,6 +26,10 @@ class Glossary extends Basic
return $config;
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -40,6 +45,10 @@ class Glossary extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -12,7 +12,8 @@ class LearningPathAuthor extends Basic
{
/**
* @return mixed
* Get the toolbar config
* @return array
*/
public function getConfig()
{
@ -28,6 +29,10 @@ class LearningPathAuthor extends Basic
return $config;
}
/**
* Get the toolbar configuration when CKEditor is maximized
* @return array
*/
protected function getMaximizedToolbar()
{
return [
@ -36,6 +41,10 @@ class LearningPathAuthor extends Basic
];
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -43,6 +52,10 @@ class LearningPathAuthor extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -12,7 +12,8 @@ class LearningPathDocuments extends Basic
{
/**
* @return mixed
* Get the toolbar config
* @return array
*/
public function getConfig()
{
@ -28,6 +29,10 @@ class LearningPathDocuments extends Basic
return $config;
}
/**
* Get the toolbar configuration when CKEditor is maximized
* @return array
*/
protected function getMaximizedToolbar()
{
return [
@ -61,6 +66,10 @@ class LearningPathDocuments extends Basic
];
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -96,6 +105,10 @@ class LearningPathDocuments extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -10,8 +10,10 @@ namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
*/
class Messages extends Basic
{
/**
* @return mixed
* Get the toolbar config
* @return array
*/
public function getConfig()
{
@ -28,6 +30,10 @@ class Messages extends Basic
return $config;
}
/**
* Get the toolbar configuration when CKEditor is maximized
* @return array
*/
protected function getMaximizedToolbar()
{
return [
@ -62,6 +68,10 @@ class Messages extends Basic
];
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -77,6 +87,10 @@ class Messages extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -11,6 +11,10 @@ namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
class NotebookStudent extends Basic
{
/**
* Get the toolbar config
* @return array
*/
public function getConfig()
{
if (api_get_setting('more_buttons_maximized_mode') != 'true') {
@ -23,6 +27,10 @@ class NotebookStudent extends Basic
return $config;
}
/**
* Get the toolbar configuration when CKEditor is maximized
* @return array
*/
protected function getMaximizedToolbar()
{
return [
@ -56,6 +64,10 @@ class NotebookStudent extends Basic
];
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -72,6 +84,10 @@ class NotebookStudent extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -11,6 +11,10 @@ namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
class PortalNews extends Basic
{
/**
* Get the toolbar config
* @return array
*/
public function getConfig()
{
if (api_get_setting('more_buttons_maximized_mode') != 'true') {
@ -23,6 +27,10 @@ class PortalNews extends Basic
return $config;
}
/**
* Get the toolbar configuration when CKEditor is maximized
* @return array
*/
protected function getMaximizedToolbar()
{
return [
@ -57,6 +65,10 @@ class PortalNews extends Basic
];
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -72,6 +84,10 @@ class PortalNews extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -10,8 +10,10 @@ namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
*/
class Profile extends Basic
{
/**
* @return mixed
* Get the toolbar config
* @return array
*/
public function getConfig()
{
@ -25,6 +27,10 @@ class Profile extends Basic
return $config;
}
/**
* Get the toolbar configuration when CKEditor is maximized
* @return array
*/
protected function getMaximizedToolbar()
{
return [
@ -56,6 +62,10 @@ class Profile extends Basic
];
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -71,6 +81,10 @@ class Profile extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -10,6 +10,11 @@ namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
*/
class Project extends Basic
{
/**
* Get the toolbar config
* @return array
*/
public function getConfig()
{
if (api_get_setting('more_buttons_maximized_mode') != 'true') {
@ -22,6 +27,10 @@ class Project extends Basic
return $config;
}
/**
* Get the toolbar configuration when CKEditor is maximized
* @return array
*/
protected function getMaximizedToolbar()
{
return [
@ -54,6 +63,10 @@ class Project extends Basic
];
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -68,6 +81,10 @@ class Project extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -10,6 +10,11 @@ namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
*/
class ProjectComment extends Basic
{
/**
* Get the toolbar config
* @return array
*/
public function getConfig()
{
if (api_get_setting('more_buttons_maximized_mode') != 'true') {
@ -22,6 +27,10 @@ class ProjectComment extends Basic
return $config;
}
/**
* Get the toolbar configuration when CKEditor is maximized
* @return array
*/
protected function getMaximizedToolbar()
{
return [
@ -54,6 +63,10 @@ class ProjectComment extends Basic
];
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -67,6 +80,10 @@ class ProjectComment extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -10,6 +10,11 @@ namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
*/
class ProjectCommentStudent extends Basic
{
/**
* Get the toolbar config
* @return array
*/
public function getConfig()
{
if (api_get_setting('more_buttons_maximized_mode') != 'true') {
@ -22,6 +27,10 @@ class ProjectCommentStudent extends Basic
return $config;
}
/**
* Get the toolbar configuration when CKEditor is maximized
* @return array
*/
protected function getMaximizedToolbar()
{
return [
@ -54,6 +63,10 @@ class ProjectCommentStudent extends Basic
];
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -67,6 +80,10 @@ class ProjectCommentStudent extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -10,6 +10,11 @@ namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
*/
class ProjectStudent extends Basic
{
/**
* Get the toolbar config
* @return array
*/
public function getConfig()
{
if (api_get_setting('more_buttons_maximized_mode') != 'true') {
@ -22,6 +27,10 @@ class ProjectStudent extends Basic
return $config;
}
/**
* Get the toolbar configuration when CKEditor is maximized
* @return array
*/
protected function getMaximizedToolbar()
{
return [
@ -54,6 +63,10 @@ class ProjectStudent extends Basic
];
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -68,6 +81,10 @@ class ProjectStudent extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -14,6 +14,10 @@ class Register extends Basic
public $plugins = array(
);
/**
* Get the toolbar config
* @return array
*/
public function getConfig()
{
if (api_get_setting('more_buttons_maximized_mode') != 'true') {
@ -26,6 +30,10 @@ class Register extends Basic
return $config;
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -36,6 +44,10 @@ class Register extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -11,6 +11,10 @@ namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
class Survey extends Basic
{
/**
* Get the toolbar config
* @return array
*/
public function getConfig()
{
if (api_get_setting('more_buttons_maximized_mode') != 'true') {
@ -23,6 +27,10 @@ class Survey extends Basic
return $config;
}
/**
* Get the toolbar configuration when CKEditor is maximized
* @return array
*/
protected function getMaximizedToolbar()
{
return [
@ -56,6 +64,10 @@ class Survey extends Basic
];
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -70,6 +82,10 @@ class Survey extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -11,6 +11,10 @@ namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
class TermsAndConditions extends Basic
{
/**
* Get the toolbar config
* @return array
*/
public function getConfig()
{
if (api_get_setting('more_buttons_maximized_mode') != 'true') {
@ -23,6 +27,10 @@ class TermsAndConditions extends Basic
return $config;
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [

@ -11,7 +11,8 @@ namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
class TestAnswerFeedback extends Basic
{
/**
* @return mixed
* Get the toolbar config
* @return array
*/
public function getConfig()
{
@ -53,6 +54,10 @@ class TestAnswerFeedback extends Basic
return $config;
}
/**
* Get the toolbar configuration when CKEditor is maximized
* @return array
*/
protected function getMaximizedToolbar()
{
return [
@ -73,6 +78,10 @@ class TestAnswerFeedback extends Basic
];
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -80,6 +89,10 @@ class TestAnswerFeedback extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -11,7 +11,8 @@ namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
class TestFreeAnswer extends Basic
{
/**
* @return mixed
* Get the toolbar config
* @return array
*/
public function getConfig()
{
@ -42,6 +43,10 @@ class TestFreeAnswer extends Basic
return $config;
}
/**
* Get the toolbar configuration when CKEditor is maximized
* @return array
*/
protected function getMaximizedToolbar()
{
return [
@ -62,6 +67,10 @@ class TestFreeAnswer extends Basic
];
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -80,6 +89,10 @@ class TestFreeAnswer extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -11,7 +11,8 @@ namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
class TestFreeAnswerStrict extends Basic
{
/**
* @return mixed
* Get the toolbar config
* @return array
*/
public function getConfig()
{
@ -42,6 +43,10 @@ class TestFreeAnswerStrict extends Basic
return $config;
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [];

@ -11,7 +11,8 @@ namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
class TestProposedAnswer extends Basic
{
/**
* @return mixed
* Get the toolbar config
* @return array
*/
public function getConfig()
{
@ -66,6 +67,10 @@ class TestProposedAnswer extends Basic
return $plugins;
}
/**
* Get the toolbar configuration when CKEditor is maximized
* @return array
*/
protected function getMaximizedToolbar()
{
return [
@ -99,6 +104,10 @@ class TestProposedAnswer extends Basic
];
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -117,6 +126,10 @@ class TestProposedAnswer extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -10,7 +10,8 @@ namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
class TestQuestionDescription extends Basic
{
/**
* @return mixed
* Get the toolbar config
* @return array
*/
public function getConfig()
{
@ -59,6 +60,10 @@ class TestQuestionDescription extends Basic
return $plugins;
}
/**
* Get the toolbar configuration when CKEditor is maximized
* @return array
*/
protected function getMaximizedToolbar()
{
return [
@ -92,6 +97,10 @@ class TestQuestionDescription extends Basic
];
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -107,6 +116,10 @@ class TestQuestionDescription extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -11,7 +11,8 @@ namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
class UniqueAnswerImage extends Basic
{
/**
* @return mixed
* Get the toolbar config
* @return array
*/
public function getConfig()
{

@ -11,6 +11,10 @@ namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
class Wiki extends Basic
{
/**
* Get the toolbar config
* @return array
*/
public function getConfig()
{
if (api_get_setting('more_buttons_maximized_mode') != 'true') {
@ -28,6 +32,10 @@ class Wiki extends Basic
return $config;
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -76,6 +84,10 @@ class Wiki extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -11,6 +11,10 @@ namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
class WikiStudent extends Basic
{
/**
* Get the toolbar config
* @return array
*/
public function getConfig()
{
if (api_get_setting('more_buttons_maximized_mode') != 'true') {
@ -29,6 +33,10 @@ class WikiStudent extends Basic
return $config;
}
/**
* Get the toolbar configuration when CKEditor is maximized
* @return array
*/
protected function getMaximizedToolbar()
{
return [
@ -62,6 +70,10 @@ class WikiStudent extends Basic
];
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -107,6 +119,10 @@ class WikiStudent extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -11,6 +11,10 @@ namespace Chamilo\CoreBundle\Component\Editor\CkEditor\Toolbar;
class WikiTask extends Basic
{
/**
* Get the toolbar config
* @return array
*/
public function getConfig()
{
if (api_get_setting('more_buttons_maximized_mode') != 'true') {
@ -23,6 +27,10 @@ class WikiTask extends Basic
return $config;
}
/**
* Get the toolbar configuration when CKEditor is maximized
* @return array
*/
protected function getMaximizedToolbar()
{
return [
@ -54,6 +62,10 @@ class WikiTask extends Basic
];
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -67,6 +79,10 @@ class WikiTask extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -15,7 +15,8 @@ class Work extends Basic
);
/**
* @return mixed
* Get the toolbar config
* @return array
*/
public function getConfig()
{
@ -30,6 +31,10 @@ class Work extends Basic
return $config;
}
/**
* Get the toolbar configuration when CKEditor is maximized
* @return array
*/
protected function getMaximizedToolbar()
{
return [
@ -62,6 +67,10 @@ class Work extends Basic
];
}
/**
* Get the default toolbar configuration when the setting more_buttons_maximized_mode is false
* @return array
*/
protected function getNormalToolbar()
{
return [
@ -77,6 +86,10 @@ class Work extends Basic
];
}
/**
* Get the toolbar configuration when CKEditor is minimized
* @return array
*/
protected function getMinimizedToolbar()
{
return [

@ -201,26 +201,26 @@ $users[] = array('username' => 'tsandyman', 'pass'=> 'tsandyman', 'firstname' =>
$users[] = array('username' => 'wgamwich', 'pass'=> 'wgamwich', 'firstname' => 'Wiseman', 'lastname' => 'Gamwich', 'status' => 5, 'auth_source' => 'platform', 'email' => 'wgamwich@example.com', 'creator_id' => 1, 'active' => 1);
$users[] = array('username' => 'mhalles','pass' => 'mhalles','firstname' => 'Maria','lastname' => 'Halles','status' => 5,'auth_source' => 'platform','email' => 'mhalles@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'adaniel','pass' => 'adaniel','firstname' => 'Annaa','lastname' => 'Daniel','status' => 5,'auth_source' => 'platform','email' => 'adaniel@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'ppiedra','pass' => 'ppiedra','firstname' => 'Pirot','lastname' => 'Piedra','status' => 5,'auth_source' => 'platform','email' => 'ppiedra@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'adaniel','pass' => 'adaniel','firstname' => 'Anna','lastname' => 'Daniel','status' => 5,'auth_source' => 'platform','email' => 'adaniel@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'hstein','pass' => 'ppiedra','firstname' => 'Hansel','lastname' => 'Stein','status' => 5,'auth_source' => 'platform','email' => 'ppiedra@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'amartin','pass' => 'amartin','firstname' => 'Angel','lastname' => 'Martin','status' => 5,'auth_source' => 'platform','email' => 'amartin@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'mhingis','pass' => 'mhingis','firstname' => 'Marsi','lastname' => 'Hingis','status' => 5,'auth_source' => 'platform','email' => 'mhingis@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'jlennon','pass' => 'jlennon','firstname' => 'Johny','lastname' => 'Lennon','status' => 5,'auth_source' => 'platform','email' => 'jlennon@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'mhiggins','pass' => 'mhingis','firstname' => 'Marc','lastname' => 'Higgins','status' => 5,'auth_source' => 'platform','email' => 'mhingis@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'jlennon','pass' => 'jlennon','firstname' => 'Johnny','lastname' => 'Lennon','status' => 5,'auth_source' => 'platform','email' => 'jlennon@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'pchavez','pass' => 'pchavez','firstname' => 'Parol','lastname' => 'Chavez','status' => 5,'auth_source' => 'platform','email' => 'pchavez@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'cvallejo','pass' => 'cvallejo','firstname' => 'César','lastname' => 'Vallejo','status' => 5,'auth_source' => 'platform','email' => 'cvallejo@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'ftruffaut','pass'=> 'ftruffaut','firstname' => 'François','lastname' => 'Truffaut','status' => 5,'auth_source' => 'platform','email' => 'ftruffaut@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'mjoy','pass'=> 'mjoy','firstname' => 'Marion','lastname' => 'Joy','status' => 5,'auth_source' => 'platform','email' => 'marion@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'mjoy','pass'=> 'mjoy','firstname' => 'Mary','lastname' => 'Joy','status' => 5,'auth_source' => 'platform','email' => 'marion@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'dmassa','pass'=> 'dmassa','firstname' => 'Diego','lastname' => 'Massa','status' => 5,'auth_source' => 'platform','email' => 'dmassa@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'mjagger','pass'=> 'mjagger','firstname' => 'Mick','lastname' => 'Jag','status' => 5,'auth_source' => 'platform','email' => 'mjagger@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'mjagger','pass'=> 'mjagger','firstname' => 'Mick','lastname' => 'Jagger','status' => 5,'auth_source' => 'platform','email' => 'mjagger@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'mcotilla','pass'=> 'mcotilla','firstname' => 'Marion','lastname' => 'Cotillard','status' => 5,'auth_source' => 'platform','email' => 'mcotilla@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'pepelepew','pass'=> 'pepelepew','firstname' => 'Pepe','lastname' => 'Le Pew','status' => 5,'auth_source' => 'platform','email' => 'pepelepew@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'nrubia','pass'=> 'nrubia','firstname' => 'Nathalie','lastname' => 'Rubia','status' => 5,'auth_source' => 'platform','email' => 'nrubia@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'nrubio','pass'=> 'nrubia','firstname' => 'Nathalie','lastname' => 'Rubio','status' => 5,'auth_source' => 'platform','email' => 'nrubia@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'psanchez','pass'=> 'psanchez','firstname' => 'Peri','lastname' => 'Sanchez','status' => 5,'auth_source' => 'platform','email' => 'psanchez@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'acostea','pass'=> 'acostea','firstname' => 'Andreea','lastname' => 'Costea','status' => 5,'auth_source' => 'platform','email' => 'acostea@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'acostea','pass'=> 'acostea','firstname' => 'Andrea','lastname' => 'Costea','status' => 5,'auth_source' => 'platform','email' => 'acostea@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'telera','pass'=> 'telera','firstname' => 'Tania','lastname' => 'Helera','status' => 5,'auth_source' => 'platform','email' => 'telera@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'dstrauss','pass'=> 'dstrauss','firstname' => 'Domingo','lastname' => 'Strauss','status' => 5,'auth_source' => 'platform','email' => 'dstrauss@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'helena','pass'=> 'helena','firstname' => 'Helena','lastname' => 'Duarte','status' => 5,'auth_source' => 'platform','email' => 'helena@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'cgonzales','pass'=> 'cgonzales','firstname' => 'Cecilia','lastname' => 'Gonzales','status' => 5,'auth_source' => 'platform','email' => 'cgonzales@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'amann','pass'=> 'amann','firstname' => 'Aimee','lastname' => 'Mann','status' => 5,'auth_source' => 'platform','email' => 'amann@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'zazup','pass'=> 'zazup','firstname' => 'Zazup','lastname' => 'Zazupar','status' => 5,'auth_source' => 'platform','email' => 'zazup@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'amann','pass'=> 'amann','firstname' => 'Aimée','lastname' => 'Mann','status' => 5,'auth_source' => 'platform','email' => 'amann@example.com','creator_id' => 1,'active' => 1);
$users[] = array('username' => 'zzaouidi','pass'=> 'zazup','firstname' => 'Zatar','lastname' => 'Zaouidi','status' => 5,'auth_source' => 'platform','email' => 'zazup@example.com','creator_id' => 1,'active' => 1);

Loading…
Cancel
Save