{"action":"created","comment":{"url":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/comments/202691156","pull_request_review_id":137436520,"id":202691156,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMjY5MTE1Ng==","diff_hunk":"@@ -0,0 +1,1220 @@\n+<?php\r\n+\r\n+    /* For licensing terms, see /license.txt */\r\n+\r\n+    /**\r\n+     * Class MultipleAnswerTrueFalseDegreeCertainty\r\n+     * This class allows to instantiate an object of type MULTIPLE_ANSWER\r\n+     * (MULTIPLE CHOICE, MULTIPLE ANSWER), extending the class question.\r\n+     *\r\n+     * @package chamilo.exercise\r\n+     */\r\n+    class MultipleAnswerTrueFalseDegreeCertainty extends Question\r\n+    {\r\n+        const LEVEL_DARKGREEN = 1;\r\n+        const LEVEL_LIGHTGREEN = 2;\r\n+        const LEVEL_WHITE = 3;\r\n+        const LEVEL_LIGHTRED = 4;\r\n+        const LEVEL_DARKRED = 5;\r\n+\r\n+        public static $typePicture = 'mccert.png';\r\n+        public static $explanationLangVar = 'MultipleAnswerTrueFalseDegreeCertainty';\r\n+        public $optionsTitle;\r\n+        public $options;\r\n+\r\n+        // const TEST = get_lang('new');\r\n+\r\n+        /**\r\n+         * Constructor.\r\n+         */\r\n+        public function __construct()\r\n+        {\r\n+            parent::__construct();\r\n+            $this->type = MULTIPLE_ANSWER_TRUE_FALSE_DEGREE_CERTAINTY;\r\n+            $this->isContent = $this->getIsContent();\r\n+            $this->optionsTitle = [1 => 'langAnswers', 2 => 'DegreeOfCertainty'];\r\n+            $this->options = [\r\n+                1 => 'True',\r\n+                2 => 'False',\r\n+                3 => '50%',\r\n+                4 => '60%',\r\n+                5 => '70%',\r\n+                6 => '80%',\r\n+                7 => '90%',\r\n+                8 => '100%',\r\n+            ];\r\n+        }\r\n+\r\n+        /**\r\n+         * function which redefines Question::createAnswersForm.\r\n+         *\r\n+         * @param FormValidator $form\r\n+         */\r\n+        public function createAnswersForm($form)\r\n+        {\r\n+            $nbAnswers = isset($_POST['nb_answers']) ? $_POST['nb_answers'] : 4;\r\n+            // The previous default value was 2. See task #1759.\r\n+            $nbAnswers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0));\r\n+\r\n+            $courseId = api_get_course_int_id();\r\n+            $objEx = $_SESSION['objExercise'];\r\n+            $renderer = &$form->defaultRenderer();\r\n+            $defaults = [];\r\n+\r\n+            $html = '<table class=\"data_table\"><tr style=\"text-align: center;\"><th>'\r\n+                .get_lang('Number')\r\n+                .'</th><th>'\r\n+                .get_lang('True')\r\n+                .'</th><th>'\r\n+                .get_lang('False')\r\n+                .'</th><th>'\r\n+                .get_lang('Answer')\r\n+                .'</th>';\r\n+\r\n+            // show column comment when feedback is enable\r\n+            if ($objEx->selectFeedbackType() != EXERCISE_FEEDBACK_TYPE_EXAM) {\r\n+                $html .= '<th>'.get_lang('Comment').'</th>';\r\n+            }\r\n+            $html .= '</tr>';\r\n+            $form->addElement('label', get_lang('Answers').'<br /> <img src=\"../img/fill_field.png\">', $html);\r\n+\r\n+            $correct = 0;\r\n+            $answer = null;\r\n+            if (!empty($this->id)) {\r\n+                $answer = new Answer($this->id);\r\n+                $answer->read();\r\n+                if (count($answer->nbrAnswers) > 0 && !$form->isSubmitted()) {\r\n+                    $nbAnswers = $answer->nbrAnswers;\r\n+                }\r\n+            }\r\n+\r\n+            $form->addElement('hidden', 'nb_answers');\r\n+            $boxesNames = [];\r\n+\r\n+            if ($nbAnswers < 1) {\r\n+                $nbAnswers = 1;\r\n+                Display::display_normal_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));\r\n+            }\r\n+\r\n+            // Can be more options\r\n+            $optionData = Question::readQuestionOption($this->id, $courseId);\r\n+\r\n+            for ($i = 1; $i <= $nbAnswers; ++$i) {\r\n+                $renderer->setElementTemplate(\r\n+                        '<td><!-- BEGIN error --><span class=\"form_error\">{error}</span><!-- END error --><br/>{element}</td>',\r\n+                        'correct['.$i.']'\r\n+                );\r\n+                $renderer->setElementTemplate(\r\n+                        '<td><!-- BEGIN error --><span class=\"form_error\">{error}</span><!-- END error --><br/>{element}</td>',\r\n+                        'counter['.$i.']'\r\n+                );\r\n+                $renderer->setElementTemplate(\r\n+                        '<td><!-- BEGIN error --><span class=\"form_error\">{error}</span><!-- END error --><br/>{element}</td>',\r\n+                        'answer['.$i.']'\r\n+                );\r\n+                $renderer->setElementTemplate(\r\n+                        '<td><!-- BEGIN error --><span class=\"form_error\">{error}</span><!-- END error --><br/>{element}</td>',\r\n+                        'comment['.$i.']'\r\n+                );\r\n+\r\n+                $answerNumber = $form->addElement('text', 'counter['.$i.']', null, 'value=\"'.$i.'\"');\r\n+                $answerNumber->freeze();\r\n+\r\n+                if (is_object($answer)) {\r\n+                    $defaults['answer['.$i.']'] = $answer->answer[$i];\r\n+                    $defaults['comment['.$i.']'] = $answer->comment[$i];\r\n+                    $defaults['weighting['.$i.']'] = float_format($answer->weighting[$i], 1);\r\n+\r\n+                    $correct = $answer->correct[$i];\r\n+                    $defaults['correct['.$i.']'] = $correct;\r\n+\r\n+                    $j = 1;\r\n+                    if (!empty($optionData)) {\r\n+                        foreach ($optionData as $id => $data) {\r\n+                            $form->addElement('radio', 'correct['.$i.']', null, null, $id);\r\n+                            $j++;\r\n+                            if ($j == 3) {\r\n+                                break;\r\n+                            }\r\n+                        }\r\n+                    }\r\n+                } else {\r\n+                    $form->addElement('radio', 'correct['.$i.']', null, null, 1);\r\n+                    $form->addElement('radio', 'correct['.$i.']', null, null, 2);\r\n+\r\n+                    $defaults['answer['.$i.']'] = '';\r\n+                    $defaults['comment['.$i.']'] = '';\r\n+                    $defaults['correct['.$i.']'] = '';\r\n+                }\r\n+\r\n+                $boxesNames[] = 'correct['.$i.']';\r\n+                $form->addElement(\r\n+                    'html_editor',\r\n+                    'answer['.$i.']',\r\n+                    null,\r\n+                    'style=\"vertical-align:middle\"',\r\n+                    ['ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100']);\r\n+                $form->addRule('answer['.$i.']', get_lang('ThisFieldIsRequired'), 'required');\r\n+\r\n+                // show comment when feedback is enable\r\n+                if ($objEx->selectFeedbackType() != EXERCISE_FEEDBACK_TYPE_EXAM) {\r\n+                    $form->addElement('html_editor',\r\n+                        'comment['.$i.']',\r\n+                        null,\r\n+                        'style=\"vertical-align:middle\"',\r\n+                        ['ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100']);\r\n+                }\r\n+                $form->addElement('html', '</tr>');\r\n+            }\r\n+\r\n+            $form->addElement('html', '</table>');\r\n+            $form->addElement('html', '<br />');\r\n+\r\n+            // 3 scores\r\n+            $form->addElement('text', 'option[1]', get_lang('Correct'), ['class' => 'span1', 'value' => '1']);\r\n+            $form->addElement('text', 'option[2]', get_lang('Wrong'), ['class' => 'span1', 'value' => '-0.5']);\r\n+\r\n+            $form->addElement('hidden', 'option[3]', 0);\r\n+\r\n+            $form->addRule('option[1]', get_lang('ThisFieldIsRequired'), 'required');\r\n+            $form->addRule('option[2]', get_lang('ThisFieldIsRequired'), 'required');\r\n+\r\n+            $form->addElement('html', '</tr><table>');\r\n+            $form->addElement('hidden', 'options_count', 3);\r\n+            $form->addElement('html', '</table><br /><br />');\r\n+\r\n+            //Extra values True, false,  Dont known\r\n+            if (!empty($this->extra)) {\r\n+                $scores = explode(':', $this->extra);\r\n+                if (!empty($scores)) {\r\n+                    for ($i = 1; $i <= 3; $i++) {\r\n+                        $defaults['option['.$i.']'] = $scores[$i - 1];\r\n+                    }\r\n+                }\r\n+            }\r\n+\r\n+            global $text, $class;\r\n+            if ($objEx->edit_exercise_in_lp == true) {\r\n+                $form->addElement('submit', 'lessAnswers', get_lang('LessAnswer'), 'class=\"btn minus\"');\r\n+                $form->addElement('submit', 'moreAnswers', get_lang('PlusAnswer'), 'class=\"btn plus\"');\r\n+                $form->addElement('submit', 'submitQuestion', $text, 'class=\"'.$class.'\"');\r\n+            }\r\n+            $renderer->setElementTemplate('{element}&nbsp;', 'lessAnswers');\r\n+            $renderer->setElementTemplate('{element}&nbsp;', 'submitQuestion');\r\n+            $renderer->setElementTemplate('{element}&nbsp;', 'moreAnswers');\r\n+            $form->addElement('html', '</div></div>');\r\n+            $defaults['correct'] = $correct;\r\n+\r\n+            if (!empty($this->id)) {\r\n+                $form->setDefaults($defaults);\r\n+            } else {\r\n+                //if ($this -> isContent == 1) {\r\n+                $form->setDefaults($defaults);\r\n+                //}\r\n+            }\r\n+            $form->setConstants(['nb_answers' => $nbAnswers]);\r\n+        }\r\n+\r\n+        /**\r\n+         * abstract function which creates the form to create / edit the answers of the question.\r\n+         *\r\n+         * @param FormValidator $form\r\n+         * @param Exercise      $exercise\r\n+         */\r\n+        public function processAnswersCreation($form, $exercise)\r\n+        {\r\n+            $questionWeighting = $nbrGoodAnswers = 0;\r\n+            $objAnswer = new Answer($this->id);\r\n+            $nbAnswers = $form->getSubmitValue('nb_answers');\r\n+\r\n+            $courseId = api_get_course_int_id();\r\n+\r\n+            $correct = [];\r\n+            $options = Question::readQuestionOption($this->id, $courseId);\r\n+\r\n+            if (!empty($options)) {\r\n+                foreach ($options as $optionData) {\r\n+                    $id = $optionData['id'];\r\n+                    unset($optionData['id']);\r\n+                    Question::updateQuestionOption($id, $optionData, $courseId);\r\n+                }\r\n+            } else {\r\n+                for ($i = 1; $i <= 8; $i++) {\r\n+                    $lastId = Question::saveQuestionOption($this->id, $this->options[$i], $courseId, $i);\r\n+                    $correct[$i] = $lastId;\r\n+                }\r\n+            }\r\n+\r\n+            /* Getting quiz_question_options (true, false, doubt) because\r\n+              it's possible that there are more options in the future */\r\n+\r\n+            $newOptions = Question::readQuestionOption($this->id, $courseId);\r\n+\r\n+            $sortedByPosition = [];\r\n+            foreach ($newOptions as $item) {\r\n+                $sortedByPosition[$item['position']] = $item;\r\n+            }\r\n+\r\n+            /* Saving quiz_question.extra values that has the correct scores of\r\n+              the true, false, doubt options registered in this format\r\n+              XX:YY:ZZZ where XX is a float score value. */\r\n+            $extraValues = [];\r\n+\r\n+            for ($i = 1; $i <= 3; $i++) {\r\n+                $score = trim($form->getSubmitValue('option['.$i.']'));\r\n+                $extraValues[] = $score;\r\n+            }\r\n+            $this->setExtra(implode(':', $extraValues));\r\n+\r\n+            for ($i = 1; $i <= $nbAnswers; $i++) {\r\n+                $answer = trim($form->getSubmitValue('answer['.$i.']'));\r\n+                $comment = trim($form->getSubmitValue('comment['.$i.']'));\r\n+                $goodAnswer = trim($form->getSubmitValue('correct['.$i.']'));\r\n+                if (empty($options)) {\r\n+                    //If this is the first time that the question is created when change the default values from the form 1 and 2 by the correct \"option id\" registered\r\n+                    $goodAnswer = $sortedByPosition[$goodAnswer]['id'];\r\n+                }\r\n+                $questionWeighting += $extraValues[0]; //By default 0 has the correct answers\r\n+                $objAnswer->createAnswer($answer, $goodAnswer, $comment, '', $i);\r\n+            }\r\n+\r\n+            // saves the answers into the data base\r\n+            $objAnswer->save();\r\n+\r\n+            // sets the total weighting of the question\r\n+            $this->updateWeighting($questionWeighting);\r\n+            $this->save($exercise);\r\n+        }\r\n+\r\n+        /**\r\n+         * @param int   $feedbackType\r\n+         * @param int   $counter\r\n+         * @param float $score\r\n+         *\r\n+         * @return null|string\r\n+         */\r\n+        public function return_header($feedbackType = null, $counter = null, $score = null)\r\n+        {\r\n+            $header = parent::return_header($feedbackType, $counter, $score);\r\n+            $header .= '<table class=\"'\r\n+                .$this->question_table_class\r\n+                .'\"><tr><th>'\r\n+                .get_lang(\"Choice\")\r\n+                .'</th><th>'\r\n+                .get_lang(\"ExpectedChoice\")\r\n+                .'</th><th>'\r\n+                .get_lang(\"Answer\")\r\n+                .'</th><th>'\r\n+                .get_lang(\"YourDegreeOfCertainty\")\r\n+                .'</th><th>&nbsp;</th>'\r\n+            ;\r\n+            if ($feedbackType != EXERCISE_FEEDBACK_TYPE_EXAM) {\r\n+                $header .= '<th>'.get_lang(\"Comment\").'</th>';\r\n+            } else {\r\n+                $header .= '<th>&nbsp;</th>';\r\n+            }\r\n+            $header .= '</tr>';\r\n+\r\n+            return $header;\r\n+        }\r\n+\r\n+        /**\r\n+         * Method to recovery color to show by precision of the student's answer.\r\n+         *\r\n+         * @param $studentAnwser\r\n+         * @param $expectedAnswer\r\n+         * @param $studentDegreeChoicePosition\r\n+         *\r\n+         * @return string\r\n+         */\r\n+        public function getColorResponse($studentAnwser, $expectedAnswer, $studentDegreeChoicePosition)\r\n+        {\r\n+            $checkResult = ($studentAnwser == $expectedAnswer) ? true : false;\r\n+            if ($checkResult) {\r\n+                if ($studentDegreeChoicePosition >= 6) {\r\n+                    return '#088A08';\r\n+                }\r\n+                if ($studentDegreeChoicePosition >= 4 && $studentDegreeChoicePosition <= 5) {\r\n+                    return '#A9F5A9';\r\n+                }\r\n+                if ($studentDegreeChoicePosition == 3) {\r\n+                    return '#FFFFFF';\r\n+                }\r\n+            } else {\r\n+                if ($studentDegreeChoicePosition >= 6) {\r\n+                    return '#FE2E2E';\r\n+                }\r\n+                if ($studentDegreeChoicePosition >= 4 && $studentDegreeChoicePosition <= 5) {\r\n+                    return '#F6CECE';\r\n+                }\r\n+                if ($studentDegreeChoicePosition == 3) {\r\n+                    return '#FFFFFF';\r\n+                }\r\n+            }\r\n+        }\r\n+\r\n+        /**\r\n+         * Return the color code for student answer.\r\n+         *\r\n+         * @param $studentAnwser\r\n+         * @param $expectedAnswer\r\n+         * @param $studentDegreeChoicePosition\r\n+         *\r\n+         * @return int\r\n+         */\r\n+        public function getStatusResponse($studentAnwser, $expectedAnswer, $studentDegreeChoicePosition)\r\n+        {\r\n+            $checkResult = ($studentAnwser == $expectedAnswer) ? true : false;\r\n+            if ($checkResult) {\r\n+                if ($studentDegreeChoicePosition >= 6) {\r\n+                    return self::LEVEL_DARKGREEN;\r\n+                }\r\n+                if ($studentDegreeChoicePosition >= 4 && $studentDegreeChoicePosition <= 5) {\r\n+                    return self::LEVEL_LIGHTGREEN;\r\n+                }\r\n+                if ($studentDegreeChoicePosition == 3) {\r\n+                    return self::LEVEL_WHITE;\r\n+                }\r\n+            } else {\r\n+                if ($studentDegreeChoicePosition >= 6) {\r\n+                    return self::LEVEL_DARKRED;\r\n+                }\r\n+                if ($studentDegreeChoicePosition >= 4 && $studentDegreeChoicePosition <= 5) {\r\n+                    return self::LEVEL_LIGHTRED;\r\n+                }\r\n+                if ($studentDegreeChoicePosition == 3) {\r\n+                    return self::LEVEL_WHITE;\r\n+                }\r\n+            }\r\n+        }\r\n+\r\n+        /**\r\n+         * Method to recovery lable for codes colors.\r\n+         *\r\n+         * @param $studentAnwser\r\n+         * @param  $expectedAnswer\r\n+         * @param  $studentDegreeChoicePosition\r\n+         *\r\n+         * @return string\r\n+         */\r\n+        public function getCodeResponse($studentAnwser, $expectedAnswer, $studentDegreeChoicePosition)\r\n+        {\r\n+            $checkResult = ($studentAnwser == $expectedAnswer) ? true : false;\r\n+            if ($checkResult) {\r\n+                if ($studentDegreeChoicePosition >= 6) {\r\n+                    return get_lang('langVerySure');\r\n+                }\r\n+                if ($studentDegreeChoicePosition >= 4 && $studentDegreeChoicePosition <= 5) {\r\n+                    return get_lang('langPrettySur');\r\n+                }\r\n+                if ($studentDegreeChoicePosition == 3) {\r\n+                    return get_lang('langIgnorance');\r\n+                }\r\n+            } else {\r\n+                if ($studentDegreeChoicePosition >= 6) {\r\n+                    return get_lang('langVeryUnsure');\r\n+                }\r\n+                if ($studentDegreeChoicePosition >= 4 && $studentDegreeChoicePosition <= 5) {\r\n+                    return get_lang('langUnsure');\r\n+                }\r\n+                if ($studentDegreeChoicePosition == 3) {\r\n+                    return get_lang('langIgnorance');\r\n+                }\r\n+            }\r\n+        }\r\n+\r\n+        /**\r\n+         * Method to show the code color and his meaning for the test result.\r\n+         */\r\n+        public static function showColorCode()\r\n+        {\r\n+            ?>\r\n+            <table class=\"fc-border-separate\" cellspacing=\"0\" style=\"width:600px; \r\n+                margin: auto; border: 3px solid #A39E9E;\" >\r\n+\r\n+                <tr style=\"border-bottom: 1px solid #A39E9E;\">\r\n+                    <td style=\"width:15%; height:30px; background-color: #088A08; border-right: 1px solid #A39E9E;\">\r\n+                        &nbsp;\r\n+                    </td>\r\n+                    <td style=\"padding-left:10px;\">\r\n+                        <b><?php echo get_lang('langVerySure'); ?> :</b>\r\n+                        <?php echo get_lang('langExplainVerySure'); ?>\r\n+                    </td>\r\n+                </tr>\r\n+                <tr style=\"border-bottom: 1px solid #A39E9E;\">\r\n+                    <td style=\"width:15%; height:30px; background-color: #A9F5A9; border-right: 1px solid #A39E9E;\">\r\n+                        &nbsp;\r\n+                    </td>\r\n+                    <td style=\"padding-left:10px;\">\r\n+                        <b><?php echo get_lang('langPrettySur'); ?> :</b>\r\n+                        <?php echo get_lang('langExplainPrettySur'); ?>\r\n+                    </td>\r\n+                </tr>\r\n+                <tr style=\"border: 1px solid #A39E9E;\">\r\n+                    <td style=\"width:15%; height:30px; background-color: #FFFFFF; border-right: 1px solid #A39E9E;\">\r\n+                        &nbsp;\r\n+                    </td>\r\n+                    <td style=\"padding-left:10px;\">\r\n+                        <b><?php echo get_lang('langIgnorance'); ?> :</b>\r\n+                        <?php echo get_lang('langExplainIgnorance'); ?>\r\n+                    </td>\r\n+                </tr>\r\n+                <tr style=\"border: 1px solid #A39E9E;\">\r\n+                    <td style=\"width:15%; height:30px; background-color: #F6CECE; border-right: 1px solid #A39E9E;\">\r\n+                        &nbsp;\r\n+                    </td>\r\n+                    <td style=\"padding-left:10px;\">\r\n+                        <b><?php echo get_lang('langUnsure'); ?> :</b>\r\n+                        <?php echo get_lang('langExplainUnsure'); ?>\r\n+                    </td>\r\n+                </tr>\r\n+                <tr style=\"border-bottom: 1px solid #A39E9E;\">\r\n+                    <td style=\"width:15%; height:30px; background-color: #FE2E2E; border-right: 1px solid #A39E9E;\">\r\n+                        &nbsp;\r\n+                    </td>\r\n+                    <td style=\"padding-left:10px;\">\r\n+                        <b><?php echo get_lang('langVeryUnsure'); ?> :</b>\r\n+                        <?php echo get_lang('langExplainVeryUnsure'); ?>\r\n+                    </td>\r\n+                </tr>\r\n+            </table><br/>\r\n+\r\n+            <?php\r\n+        }\r\n+\r\n+        public static function displayDegreeChartByCategory($scoreListAll, $title, $sizeRatio = 1, $objExercice)\r\n+        {\r\n+            $maxHeight = 0;\r\n+\r\n+            if ($objExercice->gather_questions_categories == 1) { // original\r\n+                $groupCategoriesByBracket = true;\r\n+            } else {\r\n+                $groupCategoriesByBracket = false;\r\n+            }\r\n+\r\n+            if ($groupCategoriesByBracket) {\r\n+                $scoreList = [];\r\n+                $categoryPrefixList = [];  // categoryPrefix['Math'] = firstCategoryId for this prefix\r\n+                // rebuild $scoreList factirizing datas with caregory prefix\r\n+                foreach ($scoreListAll as $categoryId => $scoreListForCategory) {\r\n+                    $objCategory = new Testcategory();\r\n+                    $objCategoryNum = $objCategory->getCategory($categoryId);\r\n+                    preg_match(\"/^\\[([^]]+)\\]/\", $objCategoryNum->name, $matches);\r\n+\r\n+                    if (count($matches) > 1) {\r\n+                        // check if we have already see this prefix\r\n+                        if (array_key_exists($matches[1], $categoryPrefixList)) {\r\n+                            // add the result color for this entry\r\n+                            $scoreList[$categoryPrefixList[$matches[1]]][self::LEVEL_DARKGREEN] += \r\n+                                $scoreListForCategory[self::LEVEL_DARKGREEN];\r\n+                            $scoreList[$categoryPrefixList[$matches[1]]][self::LEVEL_LIGHTGREEN] += \r\n+                                $scoreListForCategory[self::LEVEL_LIGHTGREEN];\r\n+                            $scoreList[$categoryPrefixList[$matches[1]]][self::LEVEL_WHITE] += \r\n+                                $scoreListForCategory[self::LEVEL_WHITE];\r\n+                            $scoreList[$categoryPrefixList[$matches[1]]][self::LEVEL_LIGHTRED] += \r\n+                                $scoreListForCategory[self::LEVEL_LIGHTRED];\r\n+                            $scoreList[$categoryPrefixList[$matches[1]]][self::LEVEL_DARKRED] += \r\n+                                $scoreListForCategory[self::LEVEL_DARKRED];\r\n+                        } else {\r\n+                            $categoryPrefixList[$matches[1]] = $categoryId;\r\n+                            $scoreList[$categoryId] = $scoreListAll[$categoryId];\r\n+                        }\r\n+                    } else {\r\n+                        // dont matche the prefix '[math] Math category'\r\n+                        $scoreList[$categoryId] = $scoreListAll[$categoryId];\r\n+                    }\r\n+                }\r\n+            } else {\r\n+                $scoreList = $scoreListAll;\r\n+            }\r\n+\r\n+            // get the max height of item to have each table the same height if displayed side by side\r\n+            foreach ($scoreList as $categoryId => $scoreListForCategory) {\r\n+                $testCategorie = new TestCategory();\r\n+                $categorieQuestionName = $testCategorie->getCategory($categoryId)->name;\r\n+                list($null, $height) = self::displayDegreeChart(\r\n+                    $scoreListForCategory,\r\n+                    300,\r\n+                    '',\r\n+                    1,\r\n+                    0,\r\n+                    false,\r\n+                    true,\r\n+                    groupCategoriesByBracket\r\n+                );\r\n+                if ($height > $maxHeight) {\r\n+                    $maxHeight = $height;\r\n+                }\r\n+            }\r\n+\r\n+            if (count($scoreList) > 1) {\r\n+                $boxWidth = $sizeRatio * 300 * 2 + 54;\r\n+            } else {\r\n+                $boxWidth = $sizeRatio * 300 + 54;\r\n+            }\r\n+\r\n+            $html = '<div style=\"width: '.$boxWidth.'px; margin : auto; padding-left : 15px;\">';\r\n+            $html .= '<h3 style=\"text-align: center; margin : 10px 0\">'.$title.'</h3>';\r\n+\r\n+            // get the html of items\r\n+            $i = 0;\r\n+            foreach ($scoreList as $categoryId => $scoreListForCategory) {\r\n+                $oCategory = new Testcategory();\r\n+                $categorieQuestionName = $oCategory->getCategory($categoryId)->name;\r\n+\r\n+                if ($categorieQuestionName == '') {\r\n+                    $categoryName = get_lang('NonCategory');\r\n+                } else {\r\n+                    $categoryName = $oCategory->name;\r\n+                }\r\n+\r\n+                $html .= '<div style=\"float:left; margin-right: 10px;\">';\r\n+                $html .= self::displayDegreeChart(\r\n+                    $scoreListForCategory,\r\n+                    300,\r\n+                    $categoryName,\r\n+                    1,\r\n+                    $maxHeight,\r\n+                    false,\r\n+                    false,\r\n+                    $groupCategoriesByBracket\r\n+                );\r\n+                $html .= '</div>';\r\n+\r\n+                if ($i == 1) {\r\n+                    $html .= '<div style=\"clear:both\">&nbsp;</div>';\r\n+                    $i = 0;\r\n+                } else {\r\n+                    $i++;\r\n+                }\r\n+            }\r\n+\r\n+            return $html.'<div style=\"clear:both\">&nbsp;</div></div>';\r\n+        }\r\n+\r\n+        /**\r\n+         * Return HTML code for the $scoreList of MultipleAnswerTrueFalseDegreeCertainty questions.\r\n+         *\r\n+         * @param $scoreList\r\n+         * @param int $sizeRatio\r\n+         *\r\n+         * @return string\r\n+         */\r\n+        public static function displayDegreeChart(\r\n+            $scoreList,\r\n+            $widthTable,\r\n+            $title = '',\r\n+            $sizeRatio = 1,\r\n+            $minHeight = 0,\r\n+            $displayExplanationText = true,\r\n+            $returnHeight = false,\r\n+            $groupCategoriesByBracket = false,\r\n+            $numberOfQuestions = 0\r\n+        ) {\r\n+            $topAndBottomMargin = 10;\r\n+\r\n+            $colorList = [self::LEVEL_DARKRED,\r\n+                self::LEVEL_LIGHTRED,\r\n+                self::LEVEL_WHITE,\r\n+                self::LEVEL_LIGHTGREEN,\r\n+                self::LEVEL_DARKGREEN,\r\n+            ];\r\n+\r\n+            // get total attempt number\r\n+            $highterColorHeight = 0;\r\n+\r\n+            foreach ($scoreList as $color => $number) {\r\n+                if ($number > $highterColorHeight) {\r\n+                    $highterColorHeight = $number;\r\n+                }\r\n+            }\r\n+\r\n+            $totalAttemptNumber = $numberOfQuestions;\r\n+\r\n+            $verticalLineHeight = $highterColorHeight * $sizeRatio * 2 + 122 + $topAndBottomMargin * 2;\r\n+            if ($verticalLineHeight < $minHeight) {\r\n+                $minHeightCorrection = $minHeight - $verticalLineHeight;\r\n+                $verticalLineHeight += $minHeightCorrection;\r\n+            }\r\n+\r\n+            // draw chart\r\n+            $html = '<style type=\"text/css\">\r\n+                    .certaintyQuizBox {\r\n+                        border : 1px solid black;\r\n+                        margin : auto;\r\n+                    }\r\n+\r\n+                    .certaintyQuizColumn {\r\n+                        float : left;\r\n+                    }\r\n+\r\n+                    /* text at the top of the column */\r\n+                    .certaintyQuizDivMiddle {\r\n+                        height : 20px;\r\n+                        margin : 0;\r\n+                        padding : 0;\r\n+                        text-align: center\r\n+                    }\r\n+\r\n+                    .certaintyQuizDivBottom {\r\n+                        border : 1px solid black;\r\n+                    }\r\n+\r\n+                    .certaintyVerticalLine {\r\n+                        float: left;\r\n+                        border-left : 1px solid black;\r\n+                        font-size: 0;\r\n+                    }\r\n+\r\n+                    .certaintyQuizClearer {\r\n+                        clear : both;\r\n+                        font-size: 0;\r\n+                        height:0\r\n+                    }\r\n+\r\n+                    .certaintyQuizLevel_'.self::LEVEL_DARKGREEN.' {\r\n+                        background-color: #088A08;\r\n+                    }\r\n+\r\n+                    .certaintyQuizLevel_'.self::LEVEL_LIGHTGREEN.' {\r\n+                        background-color: #A9F5A9;\r\n+                    }\r\n+\r\n+                    .certaintyQuizLevel_'.self::LEVEL_WHITE.' {\r\n+                        background-color: #FFFFFF;\r\n+                         width:88%\r\n+                    }\r\n+\r\n+                    .certaintyQuizLevel_'.self::LEVEL_LIGHTRED.' {\r\n+                        background-color: #F6CECE;\r\n+                    }\r\n+\r\n+                    .certaintyQuizLevel_'.self::LEVEL_DARKRED.' {\r\n+                        background-color: #FE2E2E;\r\n+                    }\r\n+                    \r\n+                    table.certaintyTable {\r\n+                        margin : auto; \r\n+                        border: 1px solid #999A9B;\r\n+                    }\r\n+                    \r\n+                    table.certaintyTable th {\r\n+                        text-align: center; \r\n+                        border-bottom: 1px solid #999A9B;\r\n+                        background-color: #cdd0d4;\r\n+                        padding : 10px;                    \r\n+                    }\r\n+                    \r\n+                    table.certaintyTable td {\r\n+                        padding : 10px;                    \r\n+                    }\r\n+                    \r\n+                    \r\n+                    table.certaintyTable td.borderRight {\r\n+                        border-right: 1px dotted #000000; \r\n+                    }\r\n+                    \r\n+                    table.certaintyTable td.firstLine {\r\n+                        vertical-align: top;\r\n+                        text-align: center;\r\n+                    }\r\n+                    \r\n+                    table.certaintyTable th.globalChart {\r\n+                        font-size : 18pt;\r\n+                        line-height : 120%;\r\n+                        padding : 20px;\r\n+                    }\r\n+                    \r\n+                    table.certaintyTable td.globalChart {\r\n+                        font-weight : bold;\r\n+                    }\r\n+                    \r\n+                </style>';\r\n+\r\n+            if ($groupCategoriesByBracket) {\r\n+                $title = api_preg_replace(\"/[^]]*$/\", \"\", $title);\r\n+                $title = ucfirst(api_preg_replace(\"/[\\[\\]]/\", \"\", $title));\r\n+            }\r\n+\r\n+            $affiche = (strpos($title, \"ensemble\") > 0) ?\r\n+                $title.\"<br/>($totalAttemptNumber questions)\" :\r\n+                $title;\r\n+            $textSize = (\r\n+                strpos($title, \"ensemble\") > 0 ||\r\n+                strpos($title, \"votre dernier résultat à ce test\") > 0\r\n+            ) ? 100 : 80;\r\n+\r\n+            if ($displayExplanationText) {\r\n+                // global chart\r\n+                $classGlobalChart = \"globalChart\";\r\n+            } else {\r\n+                $classGlobalChart = \"\";\r\n+            }\r\n+\r\n+            $html .= '<table class=\"certaintyTable\" style=\"height : '\r\n+                .$verticalLineHeight\r\n+                .'px; width : '\r\n+                .$widthTable.'px;\">'\r\n+            ;\r\n+            $html .= '<tr><th colspan=\"5\" class=\"'\r\n+                .$classGlobalChart\r\n+                .'\">'\r\n+                .$affiche\r\n+                .'</th><tr>'\r\n+            ;\r\n+\r\n+            $nbResponsesInc = (isset($scoreList[4]) || isset($scoreList[5])) ? $scoreList[4] + $scoreList[5] : 0;\r\n+            $nbResponsesIng = (isset($scoreList[3])) ? $scoreList[3] : 0;\r\n+            $nbResponsesCor = (isset($scoreList[1]) || isset($scoreList[2])) ? $scoreList[1] + $scoreList[2] : 0;\r\n+\r\n+            $colWidth = $widthTable / 5;\r\n+\r\n+            $html .= '<tr>\r\n+                    <td class=\"firstLine borderRight '.$classGlobalChart.'\" \r\n+                        colspan=\"2\" \r\n+                        style=\"width:'.($colWidth * 2).'px; font-size:'.$textSize.'%;\">'.\r\n+                get_lang('langWrongsAnswers').'&nbsp;: '.$nbResponsesInc.'\r\n+                    </td>\r\n+                    <td class=\"firstLine borderRight '.$classGlobalChart.'\" \r\n+                        style=\"width:'.$colWidth.'px; font-size :'.$textSize.'%;\">'.\r\n+                get_lang('langIgnoranceAnswers').'&nbsp;: '.$nbResponsesIng.'\r\n+                    </td>\r\n+                    <td class=\"firstLine '.$classGlobalChart.'\" \r\n+                        colspan=\"2\" \r\n+                        style=\"width:'.($colWidth * 2).'px; font-size:'.$textSize.'%;\">'.\r\n+                get_lang('langCorrectsAnswers').'&nbsp;: '.$nbResponsesCor.'\r\n+                    </td>\r\n+                </tr>';\r\n+            $html .= '<tr>';\r\n+\r\n+            foreach ($colorList as $i => $color) {\r\n+                if (array_key_exists($color, $scoreList)) {\r\n+                    $scoreOnBottom = $scoreList[$color]; // height of the colored area on the bottom\r\n+                } else {\r\n+                    $scoreOnBottom = 0;\r\n+                }\r\n+\r\n+                $sizeOnBottom = $scoreOnBottom * $sizeRatio * 2;\r\n+\r\n+                if ($i == 1 || $i == 2) {\r\n+                    $html .= '<td width=\"'\r\n+                        .$colWidth\r\n+                        .'px\" style=\"border-right: 1px dotted #000000; vertical-align: bottom;font-size: '\r\n+                        .$textSize\r\n+                        .'%;\">'\r\n+                    ;\r\n+                } else {\r\n+                    $html .= '<td width=\"'\r\n+                        .$colWidth\r\n+                        .'px\" style=\"vertical-align: bottom;font-size: '\r\n+                        .$textSize\r\n+                        .'%;\">'\r\n+                    ;\r\n+                }\r\n+                $html .= '<div class=\"certaintyQuizDivMiddle\">'\r\n+                    .$scoreOnBottom\r\n+                    .'</div><div class=\"certaintyQuizDivBottom certaintyQuizLevel_'\r\n+                    .$color\r\n+                    .'\" style=\"height: '\r\n+                    .$sizeOnBottom\r\n+                    .'px;\">&nbsp;</div>'\r\n+                ;\r\n+                $html .= '</td>';\r\n+            }\r\n+\r\n+            $html .= '</tr>';\r\n+\r\n+            if ($displayExplanationText) {\r\n+                // affichage texte histogramme\r\n+                $explainHistoList = [\r\n+                    'langVeryUnsure',\r\n+                    'langUnsure',\r\n+                    'langIgnorance',\r\n+                    'langPrettySur',\r\n+                    'langVerySure', ];\r\n+                $html .= '<tr>';\r\n+                $i = 0;\r\n+                foreach ($explainHistoList as $explain) {\r\n+                    if ($i == 1 || $i == 2) {\r\n+                        $class = \"borderRight\";\r\n+                    } else {\r\n+                        $class = \"\";\r\n+                    }\r\n+                    $html .= '<td class=\"firstLine '\r\n+                        .$class\r\n+                        .' '\r\n+                        .$classGlobalChart\r\n+                        .'\" style=\"width=\"'\r\n+                        .$colWidth\r\n+                        .'px; font-size:'\r\n+                        .$textSize\r\n+                        .'%;\">'\r\n+                    ;\r\n+                    $html .= get_lang($explain);\r\n+                    $html .= '</td>';\r\n+                    $i++;\r\n+                }\r\n+                $html .= '</tr>';\r\n+            }\r\n+\r\n+            $html .= '</table></center>';\r\n+\r\n+            if ($returnHeight) {\r\n+                return [$html, $verticalLineHeight];\r\n+            } else {\r\n+                return $html;\r\n+            }\r\n+        }\r\n+\r\n+        /**\r\n+         * return previous attempt id for this test for student, 0 if no previous attempt.\r\n+         *\r\n+         * @param $exeId\r\n+         *\r\n+         * @return int\r\n+         */\r\n+        public static function getPreviousAttemptId($exeId)\r\n+        {\r\n+            $tblTrackEExercise = Database::get_main_table(TABLE_STATISTIC_TRACK_E_EXERCISES);\r\n+            $sql = \"SELECT *\r\n+                FROM $tblTrackEExercise\r\n+                WHERE exe_id = \".intval($exeId);\r\n+            $res = Database::query($sql);\r\n+\r\n+            if (Database::num_rows($res) == 0) {\r\n+                // if we cannot find the exe_id\r\n+                return 0;\r\n+            }\r\n+\r\n+            $data = Database::fetch_assoc($res);\r\n+            $courseCode = $data['exe_cours_id'];\r\n+            $exerciseId = $data['exe_exo_id'];\r\n+            $userId = $data['exe_user_id'];\r\n+            $attemptDate = $data['exe_date'];\r\n+\r\n+            if ($attemptDate == \"0000-00-00 00:00:00\") {\r\n+                // incomplete attempt, close it before continue\r\n+                return 0;\r\n+            }\r\n+\r\n+            // look for previous attempt\r\n+            $sql = \"SELECT *\r\n+                FROM $tblTrackEExercise\r\n+                WHERE c_id = '\".$courseCode.\"'\r\n+                AND exe_exo_id = \".intval($exerciseId).\"\r\n+                AND exe_user_id = \".intval($userId).\"\r\n+                AND status = ''\r\n+                AND exe_date > '0000-00-00 00:00:00'\r\n+                AND exe_date < '\".$attemptDate.\"'\r\n+                ORDER BY exe_date DESC\";\r\n+\r\n+            $res = Database::query($sql);\r\n+\r\n+            if (Database::num_rows($res) == 0) {\r\n+                // no previous attempt\r\n+                return 0;\r\n+            }\r\n+\r\n+            $data = Database::fetch_assoc($res);\r\n+\r\n+            return $data['exe_id'];\r\n+        }\r\n+\r\n+        /**\r\n+         * return an array of number of answer color for exe attempt \r\n+         * for question type = MULTIPLE_ANSWER_TRUE_FALSE_DEGREE_CERTAINTY\r\n+         * e.g.\r\n+         * [LEVEL_DARKGREEN => 3, LEVEL_LIGHTGREEN => 0, LEVEL_WHITE => 5, LEVEL_LIGHTRED => 12, LEVEL_DARKTRED => 0].\r\n+         *\r\n+         * @param $exeId\r\n+         *\r\n+         * @return array\r\n+         */\r\n+        public static function getColorNumberListForAttempt($exeId)\r\n+        {\r\n+            $result = [self::LEVEL_DARKGREEN => 0,\r\n+                self::LEVEL_LIGHTGREEN => 0,\r\n+                self::LEVEL_WHITE => 0,\r\n+                self::LEVEL_LIGHTRED => 0,\r\n+                self::LEVEL_DARKRED => 0,\r\n+            ];\r\n+\r\n+            $attemptInfoList = self::getExerciseAttemptInfo($exeId);\r\n+\r\n+            foreach ($attemptInfoList as $i => $attemptInfo) {\r\n+                $oQuestion = new MultipleAnswerTrueFalseDegreeCertainty();\r\n+                $oQuestion->read($attemptInfo['question_id']);\r\n+                if ($oQuestion->type == MULTIPLE_ANSWER_TRUE_FALSE_DEGREE_CERTAINTY) {\r\n+                    $answerColor = self::getAnswerColor($exeId, $attemptInfo['question_id'], $attemptInfo['position']);\r\n+                    if ($answerColor) {\r\n+                        $result[$answerColor]++;\r\n+                    }\r\n+                }\r\n+            }\r\n+\r\n+            return $result;\r\n+        }\r\n+\r\n+        /**\r\n+         * return an array of number of color for question type = MULTIPLE_ANSWER_TRUE_FALSE_DEGREE_CERTAINTY\r\n+         * for each question category.\r\n+         *\r\n+         * e.g.\r\n+         * [\r\n+         *      (categoryId=)5 => [LEVEL_DARKGREEN => 3, LEVEL_WHITE => 5, LEVEL_LIGHTRED => 12]\r\n+         *      (categoryId=)2 => [LEVEL_DARKGREEN => 8, LEVEL_LIGHTRED => 2, LEVEL_DARKTRED => 8]\r\n+         *      (categoryId=)0 => [LEVEL_DARKGREEN => 1, LEVEL_LIGHTGREEN => 2, LEVEL_WHITE => 6, LEVEL_LIGHTRED => 1, LEVEL_DARKTRED => 9]\r\n+         * ]\r\n+         *\r\n+         * @param $exeId\r\n+         *\r\n+         * @return array\r\n+         */\r\n+        public static function getColorNumberListForAttemptByCategory($exeId)\r\n+        {\r\n+            $result = [];\r\n+            $attemptInfoList = self::getExerciseAttemptInfo($exeId);\r\n+\r\n+            foreach ($attemptInfoList as $i => $attemptInfo) {\r\n+                $oQuestion = new MultipleAnswerTrueFalseDegreeCertainty();\r\n+                $oQuestion->read($attemptInfo['question_id']);\r\n+                if ($oQuestion->type == MULTIPLE_ANSWER_TRUE_FALSE_DEGREE_CERTAINTY) {\r\n+                    $questionCategory = Testcategory::getCategoryForQuestion($attemptInfo['question_id']);\r\n+\r\n+                    if (!array_key_exists($questionCategory, $result)) {\r\n+                        $result[$questionCategory] = [];\r\n+                    }\r\n+\r\n+                    $answerColor = self::getAnswerColor($exeId, $attemptInfo['question_id'], $attemptInfo['position']);\r\n+                    if ($answerColor) {\r\n+                        $result[$questionCategory][$answerColor]++;\r\n+                    }\r\n+                }\r\n+            }\r\n+\r\n+            return $result;\r\n+        }\r\n+\r\n+        /**\r\n+         * Return true if answer of $exeId, $questionId, $position is correct, otherwise return false.\r\n+         *\r\n+         * @param $exeId\r\n+         * @param $questionId\r\n+         * @param $position\r\n+         *\r\n+         * @return bool\r\n+         */\r\n+        public static function getAnswerColor($exeId, $questionId, $position)\r","path":"main/exercise/multipleAnswerTrueFalseDegreeCertainty.php","position":1007,"original_position":1007,"commit_id":"9e89ca425393d005e2b1554f0588ea297afb2b68","original_commit_id":"9e89ca425393d005e2b1554f0588ea297afb2b68","user":{"login":"codacy-bot","id":19940114,"node_id":"MDQ6VXNlcjE5OTQwMTE0","avatar_url":"https://avatars1.githubusercontent.com/u/19940114?v=4","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://app.codacy.com/assets/images/favicon.png) Issue found: [The 'getAnswerColor()' method which returns a boolean should be named 'is...()' or 'has...()'](https://app.codacy.com/app/chamilo/chamilo-lms/pullRequest?prid=1519309)","created_at":"2018-07-16T13:56:07Z","updated_at":"2018-07-16T13:56:07Z","html_url":"https://github.com/chamilo/chamilo-lms/pull/2485#discussion_r202691156","pull_request_url":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/2485","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/comments/202691156"},"html":{"href":"https://github.com/chamilo/chamilo-lms/pull/2485#discussion_r202691156"},"pull_request":{"href":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/2485"}}},"pull_request":{"url":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/2485","id":180302751,"node_id":"MDExOlB1bGxSZXF1ZXN0MTgwMzAyNzUx","html_url":"https://github.com/chamilo/chamilo-lms/pull/2485","diff_url":"https://github.com/chamilo/chamilo-lms/pull/2485.diff","patch_url":"https://github.com/chamilo/chamilo-lms/pull/2485.patch","issue_url":"https://api.github.com/repos/chamilo/chamilo-lms/issues/2485","number":2485,"state":"open","locked":false,"title":"Question degre de certitude","user":{"login":"pielRouge","id":19731545,"node_id":"MDQ6VXNlcjE5NzMxNTQ1","avatar_url":"https://avatars1.githubusercontent.com/u/19731545?v=4","gravatar_id":"","url":"https://api.github.com/users/pielRouge","html_url":"https://github.com/pielRouge","followers_url":"https://api.github.com/users/pielRouge/followers","following_url":"https://api.github.com/users/pielRouge/following{/other_user}","gists_url":"https://api.github.com/users/pielRouge/gists{/gist_id}","starred_url":"https://api.github.com/users/pielRouge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pielRouge/subscriptions","organizations_url":"https://api.github.com/users/pielRouge/orgs","repos_url":"https://api.github.com/users/pielRouge/repos","events_url":"https://api.github.com/users/pielRouge/events{/privacy}","received_events_url":"https://api.github.com/users/pielRouge/received_events","type":"User","site_admin":false},"body":"Add a new kind of question for the exercises. This new questions is: Multiple answer true false degree certainty. \r\nNo changes to the database. \r\nFrench explanation of the question's behaviour : https://chamilosimsu.wordpress.com/2018/02/07/nouveau-type-de-question-vrai-faux-avec-degres-de-certitude/\r\n\r\nBest regards","created_at":"2018-04-09T12:57:41Z","updated_at":"2018-07-16T13:56:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"758df12c834e13435b0b5d69864819f43f444572","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/2485/commits","review_comments_url":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/2485/comments","review_comment_url":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chamilo/chamilo-lms/issues/2485/comments","statuses_url":"https://api.github.com/repos/chamilo/chamilo-lms/statuses/9e89ca425393d005e2b1554f0588ea297afb2b68","head":{"label":"pielRouge:question_degre_certitude_remote","ref":"question_degre_certitude_remote","sha":"9e89ca425393d005e2b1554f0588ea297afb2b68","user":{"login":"pielRouge","id":19731545,"node_id":"MDQ6VXNlcjE5NzMxNTQ1","avatar_url":"https://avatars1.githubusercontent.com/u/19731545?v=4","gravatar_id":"","url":"https://api.github.com/users/pielRouge","html_url":"https://github.com/pielRouge","followers_url":"https://api.github.com/users/pielRouge/followers","following_url":"https://api.github.com/users/pielRouge/following{/other_user}","gists_url":"https://api.github.com/users/pielRouge/gists{/gist_id}","starred_url":"https://api.github.com/users/pielRouge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pielRouge/subscriptions","organizations_url":"https://api.github.com/users/pielRouge/orgs","repos_url":"https://api.github.com/users/pielRouge/repos","events_url":"https://api.github.com/users/pielRouge/events{/privacy}","received_events_url":"https://api.github.com/users/pielRouge/received_events","type":"User","site_admin":false},"repo":{"id":85082741,"node_id":"MDEwOlJlcG9zaXRvcnk4NTA4Mjc0MQ==","name":"chamilo-lms","full_name":"pielRouge/chamilo-lms","owner":{"login":"pielRouge","id":19731545,"node_id":"MDQ6VXNlcjE5NzMxNTQ1","avatar_url":"https://avatars1.githubusercontent.com/u/19731545?v=4","gravatar_id":"","url":"https://api.github.com/users/pielRouge","html_url":"https://github.com/pielRouge","followers_url":"https://api.github.com/users/pielRouge/followers","following_url":"https://api.github.com/users/pielRouge/following{/other_user}","gists_url":"https://api.github.com/users/pielRouge/gists{/gist_id}","starred_url":"https://api.github.com/users/pielRouge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pielRouge/subscriptions","organizations_url":"https://api.github.com/users/pielRouge/orgs","repos_url":"https://api.github.com/users/pielRouge/repos","events_url":"https://api.github.com/users/pielRouge/events{/privacy}","received_events_url":"https://api.github.com/users/pielRouge/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pielRouge/chamilo-lms","description":"Chamilo is a learning management system focused on ease of use and accessibility","fork":true,"url":"https://api.github.com/repos/pielRouge/chamilo-lms","forks_url":"https://api.github.com/repos/pielRouge/chamilo-lms/forks","keys_url":"https://api.github.com/repos/pielRouge/chamilo-lms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pielRouge/chamilo-lms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pielRouge/chamilo-lms/teams","hooks_url":"https://api.github.com/repos/pielRouge/chamilo-lms/hooks","issue_events_url":"https://api.github.com/repos/pielRouge/chamilo-lms/issues/events{/number}","events_url":"https://api.github.com/repos/pielRouge/chamilo-lms/events","assignees_url":"https://api.github.com/repos/pielRouge/chamilo-lms/assignees{/user}","branches_url":"https://api.github.com/repos/pielRouge/chamilo-lms/branches{/branch}","tags_url":"https://api.github.com/repos/pielRouge/chamilo-lms/tags","blobs_url":"https://api.github.com/repos/pielRouge/chamilo-lms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pielRouge/chamilo-lms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pielRouge/chamilo-lms/git/refs{/sha}","trees_url":"https://api.github.com/repos/pielRouge/chamilo-lms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pielRouge/chamilo-lms/statuses/{sha}","languages_url":"https://api.github.com/repos/pielRouge/chamilo-lms/languages","stargazers_url":"https://api.github.com/repos/pielRouge/chamilo-lms/stargazers","contributors_url":"https://api.github.com/repos/pielRouge/chamilo-lms/contributors","subscribers_url":"https://api.github.com/repos/pielRouge/chamilo-lms/subscribers","subscription_url":"https://api.github.com/repos/pielRouge/chamilo-lms/subscription","commits_url":"https://api.github.com/repos/pielRouge/chamilo-lms/commits{/sha}","git_commits_url":"https://api.github.com/repos/pielRouge/chamilo-lms/git/commits{/sha}","comments_url":"https://api.github.com/repos/pielRouge/chamilo-lms/comments{/number}","issue_comment_url":"https://api.github.com/repos/pielRouge/chamilo-lms/issues/comments{/number}","contents_url":"https://api.github.com/repos/pielRouge/chamilo-lms/contents/{+path}","compare_url":"https://api.github.com/repos/pielRouge/chamilo-lms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pielRouge/chamilo-lms/merges","archive_url":"https://api.github.com/repos/pielRouge/chamilo-lms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pielRouge/chamilo-lms/downloads","issues_url":"https://api.github.com/repos/pielRouge/chamilo-lms/issues{/number}","pulls_url":"https://api.github.com/repos/pielRouge/chamilo-lms/pulls{/number}","milestones_url":"https://api.github.com/repos/pielRouge/chamilo-lms/milestones{/number}","notifications_url":"https://api.github.com/repos/pielRouge/chamilo-lms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pielRouge/chamilo-lms/labels{/name}","releases_url":"https://api.github.com/repos/pielRouge/chamilo-lms/releases{/id}","deployments_url":"https://api.github.com/repos/pielRouge/chamilo-lms/deployments","created_at":"2017-03-15T14:33:06Z","updated_at":"2018-04-09T12:21:55Z","pushed_at":"2018-07-16T13:45:56Z","git_url":"git://github.com/pielRouge/chamilo-lms.git","ssh_url":"git@github.com:pielRouge/chamilo-lms.git","clone_url":"https://github.com/pielRouge/chamilo-lms.git","svn_url":"https://github.com/pielRouge/chamilo-lms","homepage":"https://chamilo.org","size":628208,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"1.11.x"}},"base":{"label":"chamilo:1.11.x","ref":"1.11.x","sha":"f4f92c9d8a9c1c3cb512682941773b50b37793d5","user":{"login":"chamilo","id":3460664,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0NjA2NjQ=","avatar_url":"https://avatars1.githubusercontent.com/u/3460664?v=4","gravatar_id":"","url":"https://api.github.com/users/chamilo","html_url":"https://github.com/chamilo","followers_url":"https://api.github.com/users/chamilo/followers","following_url":"https://api.github.com/users/chamilo/following{/other_user}","gists_url":"https://api.github.com/users/chamilo/gists{/gist_id}","starred_url":"https://api.github.com/users/chamilo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chamilo/subscriptions","organizations_url":"https://api.github.com/users/chamilo/orgs","repos_url":"https://api.github.com/users/chamilo/repos","events_url":"https://api.github.com/users/chamilo/events{/privacy}","received_events_url":"https://api.github.com/users/chamilo/received_events","type":"Organization","site_admin":false},"repo":{"id":9103211,"node_id":"MDEwOlJlcG9zaXRvcnk5MTAzMjEx","name":"chamilo-lms","full_name":"chamilo/chamilo-lms","owner":{"login":"chamilo","id":3460664,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM0NjA2NjQ=","avatar_url":"https://avatars1.githubusercontent.com/u/3460664?v=4","gravatar_id":"","url":"https://api.github.com/users/chamilo","html_url":"https://github.com/chamilo","followers_url":"https://api.github.com/users/chamilo/followers","following_url":"https://api.github.com/users/chamilo/following{/other_user}","gists_url":"https://api.github.com/users/chamilo/gists{/gist_id}","starred_url":"https://api.github.com/users/chamilo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chamilo/subscriptions","organizations_url":"https://api.github.com/users/chamilo/orgs","repos_url":"https://api.github.com/users/chamilo/repos","events_url":"https://api.github.com/users/chamilo/events{/privacy}","received_events_url":"https://api.github.com/users/chamilo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/chamilo/chamilo-lms","description":"Chamilo is a learning management system focused on ease of use and accessibility","fork":false,"url":"https://api.github.com/repos/chamilo/chamilo-lms","forks_url":"https://api.github.com/repos/chamilo/chamilo-lms/forks","keys_url":"https://api.github.com/repos/chamilo/chamilo-lms/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chamilo/chamilo-lms/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chamilo/chamilo-lms/teams","hooks_url":"https://api.github.com/repos/chamilo/chamilo-lms/hooks","issue_events_url":"https://api.github.com/repos/chamilo/chamilo-lms/issues/events{/number}","events_url":"https://api.github.com/repos/chamilo/chamilo-lms/events","assignees_url":"https://api.github.com/repos/chamilo/chamilo-lms/assignees{/user}","branches_url":"https://api.github.com/repos/chamilo/chamilo-lms/branches{/branch}","tags_url":"https://api.github.com/repos/chamilo/chamilo-lms/tags","blobs_url":"https://api.github.com/repos/chamilo/chamilo-lms/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chamilo/chamilo-lms/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chamilo/chamilo-lms/git/refs{/sha}","trees_url":"https://api.github.com/repos/chamilo/chamilo-lms/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chamilo/chamilo-lms/statuses/{sha}","languages_url":"https://api.github.com/repos/chamilo/chamilo-lms/languages","stargazers_url":"https://api.github.com/repos/chamilo/chamilo-lms/stargazers","contributors_url":"https://api.github.com/repos/chamilo/chamilo-lms/contributors","subscribers_url":"https://api.github.com/repos/chamilo/chamilo-lms/subscribers","subscription_url":"https://api.github.com/repos/chamilo/chamilo-lms/subscription","commits_url":"https://api.github.com/repos/chamilo/chamilo-lms/commits{/sha}","git_commits_url":"https://api.github.com/repos/chamilo/chamilo-lms/git/commits{/sha}","comments_url":"https://api.github.com/repos/chamilo/chamilo-lms/comments{/number}","issue_comment_url":"https://api.github.com/repos/chamilo/chamilo-lms/issues/comments{/number}","contents_url":"https://api.github.com/repos/chamilo/chamilo-lms/contents/{+path}","compare_url":"https://api.github.com/repos/chamilo/chamilo-lms/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chamilo/chamilo-lms/merges","archive_url":"https://api.github.com/repos/chamilo/chamilo-lms/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chamilo/chamilo-lms/downloads","issues_url":"https://api.github.com/repos/chamilo/chamilo-lms/issues{/number}","pulls_url":"https://api.github.com/repos/chamilo/chamilo-lms/pulls{/number}","milestones_url":"https://api.github.com/repos/chamilo/chamilo-lms/milestones{/number}","notifications_url":"https://api.github.com/repos/chamilo/chamilo-lms/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chamilo/chamilo-lms/labels{/name}","releases_url":"https://api.github.com/repos/chamilo/chamilo-lms/releases{/id}","deployments_url":"https://api.github.com/repos/chamilo/chamilo-lms/deployments","created_at":"2013-03-29T17:31:19Z","updated_at":"2018-07-15T19:33:09Z","pushed_at":"2018-07-16T13:45:58Z","git_url":"git://github.com/chamilo/chamilo-lms.git","ssh_url":"git@github.com:chamilo/chamilo-lms.git","clone_url":"https://github.com/chamilo/chamilo-lms.git","svn_url":"https://github.com/chamilo/chamilo-lms","homepage":"https://chamilo.org","size":807209,"stargazers_count":273,"watchers_count":273,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":256,"mirror_url":null,"archived":false,"open_issues_count":185,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":256,"open_issues":185,"watchers":273,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/2485"},"html":{"href":"https://github.com/chamilo/chamilo-lms/pull/2485"},"issue":{"href":"https://api.github.com/repos/chamilo/chamilo-lms/issues/2485"},"comments":{"href":"https://api.github.com/repos/chamilo/chamilo-lms/issues/2485/comments"},"review_comments":{"href":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/2485/comments"},"review_comment":{"href":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/2485/commits"},"statuses":{"href":"https://api.github.com/repos/chamilo/chamilo-lms/statuses/9e89ca425393d005e2b1554f0588ea297afb2b68"}},"author_association":"NONE"}}
{"actor":{"display_login":"codacy-bot"}}