Minor - flint fixes

pull/2487/merge
Julio Montoya 7 years ago
parent ef4169d1de
commit a6876c440a
  1. 120
      .scrutinizer.yml
  2. 1
      main/admin/skill_translate.php
  3. 2
      main/auth/profile.php
  4. 4
      main/calendar/ical_export.php
  5. 8
      main/exercise/Draggable.php
  6. 12
      main/exercise/MatchingDraggable.php
  7. 2
      main/exercise/UniqueAnswerImage.php
  8. 2
      main/exercise/calculated_answer.class.php
  9. 3
      main/exercise/exercise.class.php
  10. 2
      main/exercise/export/scorm/scorm_classes.php
  11. 4
      main/exercise/fill_blanks.class.php
  12. 2
      main/exercise/global_multiple_answer.class.php
  13. 12
      main/exercise/matching.class.php
  14. 2
      main/exercise/multiple_answer.class.php
  15. 2
      main/exercise/multiple_answer_combination.class.php
  16. 2
      main/exercise/multiple_answer_true_false.class.php
  17. 2
      main/exercise/unique_answer.class.php
  18. 4
      main/exercise/unique_answer_no_option.class.php
  19. 2
      main/gradebook/lib/fe/flatviewtable.class.php
  20. 2
      main/inc/lib/events.lib.php
  21. 2
      main/inc/lib/usermanager.lib.php
  22. 2
      main/lp/aicc.class.php
  23. 2
      main/lp/openoffice_text.class.php
  24. 2
      main/lp/openoffice_text_document.class.php
  25. 2
      main/session/add_courses_to_session.php
  26. 1
      main/session/resume_session.php
  27. 2
      main/work/work.lib.php
  28. 4
      plugin/vchamilo/lib/Virtual.php
  29. 12
      src/CoreBundle/Entity/Usergroup.php
  30. 1
      src/CoreBundle/Form/CurriculumItemType.php
  31. 1
      src/CoreBundle/Form/JuryMembersType.php
  32. 1
      src/CoreBundle/Form/QuestionScoreNameType.php
  33. 1
      src/CoreBundle/Form/SessionTreeType.php

@ -10,69 +10,69 @@ build:
command: "php -v"
dependencies:
override:
- "php -v"
- "php -v"
checks:
php: true
filter:
excluded_paths:
- 'app/config/*'
- 'app/SymfonyRequirements.php'
- 'documentation/*'
- 'app/Migrations/*'
- 'app/Resources/*'
- 'main/admin/db.php'
- 'main/admin/ldap_synchro.php'
- 'main/auth/cas/lib/*'
- 'main/auth/shibboleth/*'
- 'main/auth/openid/*'
- 'main/chat/emoji_strategy.php'
- 'main/default_course_document'
- 'main/document/Wami.swf'
- 'main/fonts/*'
- 'main/inc/ajax/Wami.swf'
- 'main/inc/lib/browser/*'
- 'main/inc/lib/freemindflashbrowser/*'
- 'main/inc/lib/internationalization_database/*'
- 'main/inc/lib/javascript/*'
- 'main/inc/lib/kses-0.2.2/*'
- 'main/inc/lib/mimetex/*'
- 'main/inc/lib/nanogong/*'
- 'main/inc/lib/nusoap/*'
- 'main/inc/lib/opengraph/*'
- 'main/inc/lib/ppt2png/*'
- 'main/inc/lib/phpseclib'
- 'main/inc/lib/pear/*'
- 'main/inc/lib/phpmailer/*'
- 'main/inc/lib/phpseclib/*'
- 'main/inc/lib/portfolio.class.php'
- 'main/inc/lib/svg-edit/*'
- 'main/inc/lib/swfobject/*'
- 'main/inc/lib/wami-recorder/*'
- 'main/inc/lib/xajax/*'
- 'main/lp/packaging/*'
- 'main/template/*'
- 'main/img/*'
- 'main/lang/*'
- 'plugin/buycourses/src/Culqi/*'
- 'plugin/buycourses/src/Requests/*'
- 'plugin/buycourses/src/paypalfunctions.php'
- 'plugin/buycourses/src/Requests.php'
- 'plugin/vchamilo/cli/*'
- 'plugin/kannelsms/vendor/*'
- 'plugin/clockworksms/vendor/*'
- 'plugin/pens/lib/'
- 'plugin/bbb/lib/bbb_api.php'
- 'plugin/ims_lti/OAuthSimple.php'
- 'plugin/sepe/src/wsse/*'
- 'plugin/test2pdf/class/*'
- 'plugin/jcapture/lib/*'
- 'plugin/jcapture/src/*'
- 'tests/*'
- 'var/cache/*'
- 'var/log/*'
- 'vendor/*'
- 'web/*'
- 'public/libs/*'
- 'public/img/*'
- 'app/config/*'
- 'app/SymfonyRequirements.php'
- 'documentation/*'
- 'app/Migrations/*'
- 'app/Resources/*'
- 'main/admin/db.php'
- 'main/admin/ldap_synchro.php'
- 'main/auth/cas/lib/*'
- 'main/auth/shibboleth/*'
- 'main/auth/openid/*'
- 'main/chat/emoji_strategy.php'
- 'main/default_course_document'
- 'main/document/Wami.swf'
- 'main/fonts/*'
- 'main/inc/ajax/Wami.swf'
- 'main/inc/lib/browser/*'
- 'main/inc/lib/freemindflashbrowser/*'
- 'main/inc/lib/internationalization_database/*'
- 'main/inc/lib/javascript/*'
- 'main/inc/lib/kses-0.2.2/*'
- 'main/inc/lib/mimetex/*'
- 'main/inc/lib/nanogong/*'
- 'main/inc/lib/nusoap/*'
- 'main/inc/lib/opengraph/*'
- 'main/inc/lib/ppt2png/*'
- 'main/inc/lib/phpseclib'
- 'main/inc/lib/pear/*'
- 'main/inc/lib/phpmailer/*'
- 'main/inc/lib/phpseclib/*'
- 'main/inc/lib/portfolio.class.php'
- 'main/inc/lib/svg-edit/*'
- 'main/inc/lib/swfobject/*'
- 'main/inc/lib/wami-recorder/*'
- 'main/inc/lib/xajax/*'
- 'main/lp/packaging/*'
- 'main/template/*'
- 'main/img/*'
- 'main/lang/*'
- 'plugin/buycourses/src/Culqi/*'
- 'plugin/buycourses/src/Requests/*'
- 'plugin/buycourses/src/paypalfunctions.php'
- 'plugin/buycourses/src/Requests.php'
- 'plugin/vchamilo/cli/*'
- 'plugin/kannelsms/vendor/*'
- 'plugin/clockworksms/vendor/*'
- 'plugin/pens/lib/'
- 'plugin/bbb/lib/bbb_api.php'
- 'plugin/ims_lti/OAuthSimple.php'
- 'plugin/sepe/src/wsse/*'
- 'plugin/test2pdf/class/*'
- 'plugin/jcapture/lib/*'
- 'plugin/jcapture/src/*'
- 'tests/*'
- 'var/cache/*'
- 'var/log/*'
- 'vendor/*'
- 'web/*'
- 'public/libs/*'
- 'public/img/*'

@ -2,7 +2,6 @@
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Component\Utils\ChamiloApi;
use Chamilo\CoreBundle\Entity\ExtraField;
use Chamilo\CoreBundle\Entity\Language;
use Chamilo\CoreBundle\Entity\Skill;

@ -398,7 +398,7 @@ function is_profile_editable()
/**
* Upload a submitted user production.
*
* @param $user_id User id
* @param $user_id User id
*
* @return The filename of the new production or FALSE if the upload has failed
*/

@ -90,7 +90,7 @@ if (!empty($event)) {
$s2 = $s;
if ($M2 > 60) {
$M2 = $M2 - 60;
$h2 += 1;
$h2++;
}
} else {
list($y2, $m2, $d2, $h2, $M2, $s2) = preg_split('/[\s:-]/', $event['end_date']);
@ -129,7 +129,7 @@ if (!empty($event)) {
$s2 = $s;
if ($M2 > 60) {
$M2 = $M2 - 60;
$h2 += 1;
$h2++;
}
} else {
list($y2, $m2, $d2, $h2, $M2, $s2) = preg_split('/[\s:-]/', $event['end_date']);

@ -79,7 +79,7 @@ class Draggable extends Question
$defaults['orientation'] = 'h';
}
for ($i = 1; $i <= $nb_matches; ++$i) {
for ($i = 1; $i <= $nb_matches; $i++) {
$matches[$i] = $i;
}
@ -111,7 +111,7 @@ class Draggable extends Question
echo Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'), 'normal');
}
for ($i = 1; $i <= $nb_matches; ++$i) {
for ($i = 1; $i <= $nb_matches; $i++) {
$renderer = &$form->defaultRenderer();
$renderer->setElementTemplate(
'<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error -->{element}</td>',
@ -182,13 +182,13 @@ class Draggable extends Question
$position = 0;
$objAnswer = new Answer($this->id);
// Insert the options
for ($i = 1; $i <= $nb_matches; ++$i) {
for ($i = 1; $i <= $nb_matches; $i++) {
$position++;
$objAnswer->createAnswer($position, 0, '', 0, $position);
}
// Insert the answers
for ($i = 1; $i <= $nb_matches; ++$i) {
for ($i = 1; $i <= $nb_matches; $i++) {
$position++;
$answer = $form->getSubmitValue('answer['.$i.']');
$matches = $form->getSubmitValue('matches['.$i.']');

@ -81,12 +81,12 @@ class MatchingDraggable extends Question
}
if (empty($matches)) {
for ($i = 1; $i <= $nb_options; ++$i) {
for ($i = 1; $i <= $nb_options; $i++) {
// fill the array with A, B, C.....
$matches[$i] = chr(64 + $i);
}
} else {
for ($i = $counter; $i <= $nb_options; ++$i) {
for ($i = $counter; $i <= $nb_options; $i++) {
// fill the array with A, B, C.....
$matches[$i] = chr(64 + $i);
}
@ -121,7 +121,7 @@ class MatchingDraggable extends Question
'Height' => '125',
];
for ($i = 1; $i <= $nb_matches; ++$i) {
for ($i = 1; $i <= $nb_matches; $i++) {
$renderer = &$form->defaultRenderer();
$renderer->setElementTemplate(
'<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error -->{element}</td>',
@ -174,7 +174,7 @@ class MatchingDraggable extends Question
echo Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'), 'normal');
}
for ($i = 1; $i <= $nb_options; ++$i) {
for ($i = 1; $i <= $nb_options; $i++) {
$renderer = &$form->defaultRenderer();
$renderer->setElementTemplate(
@ -232,14 +232,14 @@ class MatchingDraggable extends Question
$objAnswer = new Answer($this->id);
// Insert the options
for ($i = 1; $i <= $nb_options; ++$i) {
for ($i = 1; $i <= $nb_options; $i++) {
$position++;
$option = $form->getSubmitValue("option[$i]");
$objAnswer->createAnswer($option, 0, '', 0, $position);
}
// Insert the answers
for ($i = 1; $i <= $nb_matches; ++$i) {
for ($i = 1; $i <= $nb_matches; $i++) {
$position++;
$answer = $form->getSubmitValue("answer[$i]");
$matches = $form->getSubmitValue("matches[$i]");

@ -122,7 +122,7 @@ class UniqueAnswerImage extends UniqueAnswer
echo Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
}
for ($i = 1; $i <= $numberAnswers; ++$i) {
for ($i = 1; $i <= $numberAnswers; $i++) {
$form->addHtml('<tr>');
if (isset($answer) && is_object($answer)) {
if ($answer->correct[$i]) {

@ -209,7 +209,7 @@ class CalculatedAnswer extends Question
$auxFormula = $formula;
$nb = preg_match_all('/\[[^\]]*\]/', $auxAnswer, $blanks);
if ($nb > 0) {
for ($i = 0; $i < $nb; ++$i) {
for ($i = 0; $i < $nb; $i++) {
$blankItem = $blanks[0][$i];
// take random float values when one or both edge values have a decimal point

@ -2,7 +2,6 @@
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\TrackEHotspot;
use Chamilo\CourseBundle\Entity\CQuizCategory;
use ChamiloSession as Session;
/**
@ -1753,7 +1752,7 @@ class Exercise
// random all questions
if ($this->isRandom() && $this->isRandomByCat() == 0) {
if (count($this->questionList) >= $this->random && $this->random > 0) {
$this->random -= 1;
$this->random--;
$this->save();
}
}

@ -1144,7 +1144,7 @@ class ScormSection
list($jstmp, $htmltmp) = ScormQuestion::export_question($q, false, $js_id);
$js .= $jstmp."\n";
$html .= $htmltmp."\n";
++$js_id;
$js_id++;
}
return [$js, $html];

@ -436,7 +436,7 @@ class FillBlanks extends Question
if ($nb > 0) {
$answer .= '::';
// weighting
for ($i = 0; $i < $nb; ++$i) {
for ($i = 0; $i < $nb; $i++) {
// enter the weighting of word $i
$answer .= $form->getSubmitValue('weighting['.$i.']');
// not the last word, add ","
@ -449,7 +449,7 @@ class FillBlanks extends Question
// input width
$answer .= ":";
for ($i = 0; $i < $nb; ++$i) {
for ($i = 0; $i < $nb; $i++) {
// enter the width of input for word $i
$answer .= $form->getSubmitValue('sizeofinput['.$i.']');
// not the last word, add ","

@ -78,7 +78,7 @@ class GlobalMultipleAnswer extends Question
$scoreG = "0"; //Global
/* boucle pour sauvegarder les donn<EFBFBD>es dans le tableau defaults */
for ($i = 1; $i <= $nb_answers; ++$i) {
for ($i = 1; $i <= $nb_answers; $i++) {
/* si la reponse est de type objet */
if (is_object($answer)) {
$defaults['answer['.$i.']'] = $answer->answer[$i];

@ -88,12 +88,12 @@ class Matching extends Question
}
if (empty($matches)) {
for ($i = 1; $i <= $nb_options; ++$i) {
for ($i = 1; $i <= $nb_options; $i++) {
// fill the array with A, B, C.....
$matches[$i] = chr(64 + $i);
}
} else {
for ($i = $counter; $i <= $nb_options; ++$i) {
for ($i = $counter; $i <= $nb_options; $i++) {
// fill the array with A, B, C.....
$matches[$i] = chr(64 + $i);
}
@ -130,7 +130,7 @@ class Matching extends Question
'Height' => '125',
];
for ($i = 1; $i <= $nb_matches; ++$i) {
for ($i = 1; $i <= $nb_matches; $i++) {
$renderer = &$form->defaultRenderer();
$renderer->setElementTemplate(
'<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error -->{element}</td>',
@ -193,7 +193,7 @@ class Matching extends Question
);
}
for ($i = 1; $i <= $nb_options; ++$i) {
for ($i = 1; $i <= $nb_options; $i++) {
$renderer = &$form->defaultRenderer();
$renderer->setElementTemplate(
'<td><!-- BEGIN error --><span class="form_error">{error}</span><!-- END error -->{element}</td>',
@ -251,14 +251,14 @@ class Matching extends Question
$objAnswer = new Answer($this->id);
// Insert the options
for ($i = 1; $i <= $nb_options; ++$i) {
for ($i = 1; $i <= $nb_options; $i++) {
$position++;
$option = $form->getSubmitValue('option['.$i.']');
$objAnswer->createAnswer($option, 0, '', 0, $position);
}
// Insert the answers
for ($i = 1; $i <= $nb_matches; ++$i) {
for ($i = 1; $i <= $nb_matches; $i++) {
$position++;
$answer = $form->getSubmitValue('answer['.$i.']');
$matches = $form->getSubmitValue('matches['.$i.']');

@ -80,7 +80,7 @@ class MultipleAnswer extends Question
echo Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
}
for ($i = 1; $i <= $nb_answers; ++$i) {
for ($i = 1; $i <= $nb_answers; $i++) {
$form->addHtml('<tr>');
if (is_object($answer)) {
$defaults['answer['.$i.']'] = $answer->answer[$i];

@ -72,7 +72,7 @@ class MultipleAnswerCombination extends Question
echo Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
}
for ($i = 1; $i <= $nb_answers; ++$i) {
for ($i = 1; $i <= $nb_answers; $i++) {
$form->addHtml('<tr>');
if (is_object($answer)) {

@ -83,7 +83,7 @@ class MultipleAnswerTrueFalse extends Question
// Can be more options
$optionData = Question::readQuestionOption($this->id, $course_id);
for ($i = 1; $i <= $nb_answers; ++$i) {
for ($i = 1; $i <= $nb_answers; $i++) {
$form->addHtml('<tr>');
$renderer->setElementTemplate(

@ -130,7 +130,7 @@ class UniqueAnswer extends Question
);
}
for ($i = 1; $i <= $nb_answers; ++$i) {
for ($i = 1; $i <= $nb_answers; $i++) {
$form->addHtml('<tr>');
if (isset($answer) && is_object($answer)) {
if (isset($answer->correct[$i]) && $answer->correct[$i]) {

@ -105,14 +105,14 @@ class UniqueAnswerNoOption extends Question
$nb_answers--;
}
}
for ($k = 1; $k <= $nb_answers; ++$k) {
for ($k = 1; $k <= $nb_answers; $k++) {
if ($answer->position[$k] != '666') {
$new_list[$count] = $count;
$count++;
}
}
} else {
for ($k = 1; $k <= $nb_answers; ++$k) {
for ($k = 1; $k <= $nb_answers; $k++) {
$new_list[$k] = $k;
}
}

@ -148,7 +148,7 @@ class FlatViewTable extends SortableTable
if (!isset($resource_list[$key][$userResult])) {
$resource_list[$key][$userResult] = 0;
}
$resource_list[$key][$userResult] += 1;
$resource_list[$key][$userResult]++;
$key_list[] = $userResult;
}

@ -455,7 +455,7 @@ class Event
* @param int Position
* @param int Exercise ID (from c_quiz)
* @param bool update results?
* @param $fileName string Filename (for audio answers - using nanogong)
* @param $fileName string Filename (for audio answers - using nanogong)
* @param int User ID The user who's going to get this score. Default value of null means "get from context".
* @param int Course ID (from the "id" column of course table). Default value of null means "get from context".
* @param int Session ID (from the session table). Default value of null means "get from context".

@ -2211,7 +2211,7 @@ class UserManager
/**
* Returns an array with the user's productions.
*
* @param $user_id User id
* @param $user_id User id
*
* @return array An array containing the user's productions
*/

@ -1065,7 +1065,7 @@ class aicc extends learnpath
case $enclosure:
if ($enclosed && $data[$i + 1] == $enclosure) {
$fldval .= $chr;
++$i; // Skip the next character.
$i++; // Skip the next character.
} else {
$enclosed = !$enclosed;
}

@ -223,7 +223,7 @@ class OpenofficeText extends OpenofficeDocument
$first_item = 0;
foreach ($pages as $key => $page_content) {
// For every pages, we create a new file.
$key += 1;
$key++;
$page_content = $this->format_page_content($header, $page_content, $this->base_work_dir.$this->created_dir);
$html_file = $this->created_dir.'-'.$key.'.html';
$handle = fopen($this->base_work_dir.$this->created_dir.'/'.$html_file, 'w+');

@ -213,7 +213,7 @@ class OpenOfficeTextDocument extends OpenofficeDocument
$pages = explode('||page_break||', $body);
foreach ($pages as $key => $page_content) {
// For every pages, we create a new file.
$key += 1;
$key++;
$page_content = $this->format_page_content(
$header,
$page_content,

@ -1,8 +1,6 @@
<?php
/* For licensing terms, see /license.txt */
use ChamiloSession as Session;
/**
* @package chamilo.admin
*

@ -2,7 +2,6 @@
/* For licensing terms, see /license.txt */
use Chamilo\CoreBundle\Entity\Course;
use Chamilo\CoreBundle\Entity\Promotion;
use Chamilo\CoreBundle\Entity\Repository\SequenceRepository;
use Chamilo\CoreBundle\Entity\Repository\SessionRepository;
use Chamilo\CoreBundle\Entity\SequenceResource;

@ -759,7 +759,7 @@ function create_unexisting_work_directory($workDir, $desiredDirName)
$workDir = (substr($workDir, -1, 1) == '/' ? $workDir : $workDir.'/');
$checkDirName = $desiredDirName;
while (file_exists($workDir.$checkDirName)) {
$counter += 1;
$counter++;
$checkDirName = $desiredDirName.$counter;
}

@ -475,8 +475,8 @@ class Virtual
/**
* Backups a database for having a snapshot.
*
* @param $vchamilo object The Vchamilo object
* @param $outputfilerad string The output SQL file radical
* @param $vchamilo object The Vchamilo object
* @param $outputfilerad string The output SQL file radical
*
* @return bool if TRUE, dumping database was a success, otherwise FALSE
*/

@ -27,7 +27,7 @@ class Usergroup
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=255, precision=0, scale=0, nullable=false, unique=false)
* @ORM\Column(name="name", type="string", length=255, nullable=false, unique=false)
*/
protected $name;
@ -66,6 +66,13 @@ class Usergroup
*/
protected $visibility;
/**
* @var string
*
* ORM\Column(name="author_id", type="integer", nullable=true)
*/
//protected $authorId;
/**
* @var int
*
@ -94,6 +101,9 @@ class Usergroup
*/
protected $users;
/**
* Usergroup constructor.
*/
public function __construct()
{
//$this->users = new ArrayCollection();

@ -9,6 +9,7 @@ use Symfony\Component\OptionsResolver\OptionsResolverInterface;
/**
* Class CurriculumItemType.
*
* @package Chamilo\CoreBundle\Form
*/
class CurriculumItemType extends AbstractType

@ -4,7 +4,6 @@
namespace Chamilo\CoreBundle\Form;
use Doctrine\ORM\EntityRepository;
use Entity;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Form\FormEvents;

@ -3,7 +3,6 @@
namespace Chamilo\CoreBundle\Form;
use Entity;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

@ -4,7 +4,6 @@
namespace Chamilo\CoreBundle\Form;
use Doctrine\ORM\EntityRepository;
use Entity;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

Loading…
Cancel
Save