{"action":"created","comment":{"url":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/comments/203023841","pull_request_review_id":137831003,"id":203023841,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIwMzAyMzg0MQ==","diff_hunk":"@@ -0,0 +1,1297 @@\n+<?php\n+/* For licensing terms, see /license.txt */\n+\n+use ChamiloSession as Session;\n+\n+/**\n+ * Class MultipleAnswerTrueFalseDegreeCertainty\n+ * This class allows to instantiate an object of type MULTIPLE_ANSWER\n+ * (MULTIPLE CHOICE, MULTIPLE ANSWER), extending the class question.\n+ *\n+ * @package chamilo.exercise\n+ */\n+class MultipleAnswerTrueFalseDegreeCertainty extends Question\n+{\n+    const LEVEL_DARKGREEN = 1;\n+    const LEVEL_LIGHTGREEN = 2;\n+    const LEVEL_WHITE = 3;\n+    const LEVEL_LIGHTRED = 4;\n+    const LEVEL_DARKRED = 5;\n+\n+    public static $typePicture = 'mccert.png';\n+    public static $explanationLangVar = 'MultipleAnswerTrueFalseDegreeCertainty';\n+    public $optionsTitle;\n+    public $options;\n+\n+    /**\n+     * Constructor.\n+     */\n+    public function __construct()\n+    {\n+        parent::__construct();\n+        $this->type = MULTIPLE_ANSWER_TRUE_FALSE_DEGREE_CERTAINTY;\n+        $this->isContent = $this->getIsContent();\n+        $this->optionsTitle = [1 => 'Answers', 2 => 'DegreeOfCertaintyThatMyAnswerIsCorrect'];\n+        $this->options = [\n+            1 => 'True',\n+            2 => 'False',\n+            3 => '50%',\n+            4 => '60%',\n+            5 => '70%',\n+            6 => '80%',\n+            7 => '90%',\n+            8 => '100%',\n+        ];\n+    }\n+\n+    /**\n+     * Redefines Question::createAnswersForm: creates the HTML form to answer the question.\n+     *\n+     * @uses \\globals $text and $class, defined in the calling script\n+     *\n+     * @param FormValidator $form\n+     *\n+     * @throws Exception\n+     * @throws HTML_QuickForm_Error\n+     */\n+    public function createAnswersForm($form)\n+    {\n+        global $text, $class;\n+        $nbAnswers = isset($_POST['nb_answers']) ? (int) $_POST['nb_answers'] : 4;\n+        // The previous default value was 2. See task #1759.\n+        $nbAnswers += (isset($_POST['lessAnswers']) ? -1 : (isset($_POST['moreAnswers']) ? 1 : 0));\n+\n+        $courseId = api_get_course_int_id();\n+        $objEx = Session::read('objExercise');\n+        $renderer = &$form->defaultRenderer();\n+        $defaults = [];\n+\n+        $html = '<table class=\"data_table\"><tr style=\"text-align: center;\"><th>'\n+            .get_lang('Number')\n+            .'</th><th>'\n+            .get_lang('True')\n+            .'</th><th>'\n+            .get_lang('False')\n+            .'</th><th>'\n+            .get_lang('Answer')\n+            .'</th>';\n+\n+        // show column comment when feedback is enable\n+        if ($objEx->selectFeedbackType() != EXERCISE_FEEDBACK_TYPE_EXAM) {\n+            $html .= '<th>'.get_lang('Comment').'</th>';\n+        }\n+        $html .= '</tr>';\n+        $form->addElement('label', get_lang('Answers').'<br /> <img src=\"../img/fill_field.png\">', $html);\n+\n+        $correct = 0;\n+        $answer = null;\n+        if (!empty($this->id)) {\n+            $answer = new Answer($this->id);\n+            $answer->read();\n+            if (count($answer->nbrAnswers) > 0 && !$form->isSubmitted()) {\n+                $nbAnswers = $answer->nbrAnswers;\n+            }\n+        }\n+\n+        $form->addElement('hidden', 'nb_answers');\n+        $boxesNames = [];\n+\n+        if ($nbAnswers < 1) {\n+            $nbAnswers = 1;\n+            echo Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));\n+        }\n+\n+        // Can be more options\n+        $optionData = Question::readQuestionOption($this->id, $courseId);\n+\n+        for ($i = 1; $i <= $nbAnswers; ++$i) {\n+            $renderer->setElementTemplate(\n+                '<td><!-- BEGIN error --><span class=\"form_error\">{error}</span><!-- END error --><br/>{element}</td>',\n+                'correct['.$i.']'\n+            );\n+            $renderer->setElementTemplate(\n+                '<td><!-- BEGIN error --><span class=\"form_error\">{error}</span><!-- END error --><br/>{element}</td>',\n+                'counter['.$i.']'\n+            );\n+            $renderer->setElementTemplate(\n+                '<td><!-- BEGIN error --><span class=\"form_error\">{error}</span><!-- END error --><br/>{element}</td>',\n+                'answer['.$i.']'\n+            );\n+            $renderer->setElementTemplate(\n+                '<td><!-- BEGIN error --><span class=\"form_error\">{error}</span><!-- END error --><br/>{element}</td>',\n+                'comment['.$i.']'\n+            );\n+\n+            $answerNumber = $form->addElement('text', 'counter['.$i.']', null, 'value=\"'.$i.'\"');\n+            $answerNumber->freeze();\n+\n+            if (is_object($answer)) {\n+                $defaults['answer['.$i.']'] = $answer->answer[$i];\n+                $defaults['comment['.$i.']'] = $answer->comment[$i];\n+                $defaults['weighting['.$i.']'] = float_format($answer->weighting[$i], 1);\n+\n+                $correct = $answer->correct[$i];\n+                $defaults['correct['.$i.']'] = $correct;\n+\n+                $j = 1;\n+                if (!empty($optionData)) {\n+                    foreach ($optionData as $id => $data) {\n+                        $form->addElement('radio', 'correct['.$i.']', null, null, $id);\n+                        $j++;\n+                        if ($j == 3) {\n+                            break;\n+                        }\n+                    }\n+                }\n+            } else {\n+                $form->addElement('radio', 'correct['.$i.']', null, null, 1);\n+                $form->addElement('radio', 'correct['.$i.']', null, null, 2);\n+\n+                $defaults['answer['.$i.']'] = '';\n+                $defaults['comment['.$i.']'] = '';\n+                $defaults['correct['.$i.']'] = '';\n+            }\n+\n+            $boxesNames[] = 'correct['.$i.']';\n+            $form->addElement(\n+                'html_editor',\n+                'answer['.$i.']',\n+                null,\n+                ['style' => 'vertical-align:middle;'],\n+                ['ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100']);\n+            $form->addRule('answer['.$i.']', get_lang('ThisFieldIsRequired'), 'required');\n+\n+            // show comment when feedback is enable\n+            if ($objEx->selectFeedbackType() != EXERCISE_FEEDBACK_TYPE_EXAM) {\n+                $form->addElement('html_editor',\n+                    'comment['.$i.']',\n+                    null,\n+                    ['style' => 'vertical-align:middle;'],\n+                    ['ToolbarSet' => 'TestProposedAnswer', 'Width' => '100%', 'Height' => '100']);\n+            }\n+            $form->addElement('html', '</tr>');\n+        }\n+\n+        $form->addElement('html', '</table>');\n+        $form->addElement('html', '<br />');\n+\n+        // 3 scores\n+        $form->addElement('text', 'option[1]', get_lang('Correct'), ['class' => 'span1', 'value' => '1']);\n+        $form->addElement('text', 'option[2]', get_lang('Wrong'), ['class' => 'span1', 'value' => '-0.5']);\n+\n+        $form->addElement('hidden', 'option[3]', 0);\n+\n+        $form->addRule('option[1]', get_lang('ThisFieldIsRequired'), 'required');\n+        $form->addRule('option[2]', get_lang('ThisFieldIsRequired'), 'required');\n+\n+        $form->addElement('html', '</tr><table>');\n+        $form->addElement('hidden', 'options_count', 3);\n+        $form->addElement('html', '</table><br /><br />');\n+\n+        //Extra values True, false,  Dont known\n+        if (!empty($this->extra)) {\n+            $scores = explode(':', $this->extra);\n+            if (!empty($scores)) {\n+                for ($i = 1; $i <= 3; $i++) {\n+                    $defaults['option['.$i.']'] = $scores[$i - 1];\n+                }\n+            }\n+        }\n+\n+        if ($objEx->edit_exercise_in_lp === true) {\n+            $form->addElement('submit', 'lessAnswers', get_lang('LessAnswer'), 'class=\"btn btn-danger minus\"');\n+            $form->addElement('submit', 'moreAnswers', get_lang('PlusAnswer'), 'class=\"btn btn-primary plus\"');\n+            //$text and $class defined in calling script\n+            $form->addElement('submit', 'submitQuestion', $text, 'class = \"btn btn-primary\"');\n+        }\n+        $renderer->setElementTemplate('{element}&nbsp;', 'lessAnswers');\n+        $renderer->setElementTemplate('{element}&nbsp;', 'submitQuestion');\n+        $renderer->setElementTemplate('{element}&nbsp;', 'moreAnswers');\n+        $form->addElement('html', '</div></div>');\n+        $defaults['correct'] = $correct;\n+\n+        if (!empty($this->id)) {\n+            $form->setDefaults($defaults);\n+        } else {\n+            $form->setDefaults($defaults);\n+        }\n+        $form->setConstants(['nb_answers' => $nbAnswers]);\n+    }\n+\n+    /**\n+     * abstract function which creates the form to create / edit the answers of the question.\n+     *\n+     * @param FormValidator $form\n+     * @param Exercise      $exercise\n+     */\n+    public function processAnswersCreation($form, $exercise)\n+    {\n+        $questionWeighting = 0;\n+        $objAnswer = new Answer($this->id);\n+        $nbAnswers = $form->getSubmitValue('nb_answers');\n+        $courseId = api_get_course_int_id();\n+        $correct = [];\n+        $options = Question::readQuestionOption($this->id, $courseId);\n+\n+        if (!empty($options)) {\n+            foreach ($options as $optionData) {\n+                $id = $optionData['id'];\n+                unset($optionData['id']);\n+                Question::updateQuestionOption($id, $optionData, $courseId);\n+            }\n+        } else {\n+            for ($i = 1; $i <= 8; $i++) {\n+                $lastId = Question::saveQuestionOption($this->id, $this->options[$i], $courseId, $i);\n+                $correct[$i] = $lastId;\n+            }\n+        }\n+\n+        /* Getting quiz_question_options (true, false, doubt) because\n+          it's possible that there are more options in the future */\n+        $newOptions = Question::readQuestionOption($this->id, $courseId);\n+        $sortedByPosition = [];\n+        foreach ($newOptions as $item) {\n+            $sortedByPosition[$item['position']] = $item;\n+        }\n+\n+        /* Saving quiz_question.extra values that has the correct scores of\n+          the true, false, doubt options registered in this format\n+          XX:YY:ZZZ where XX is a float score value. */\n+        $extraValues = [];\n+        for ($i = 1; $i <= 3; $i++) {\n+            $score = trim($form->getSubmitValue('option['.$i.']'));\n+            $extraValues[] = $score;\n+        }\n+        $this->setExtra(implode(':', $extraValues));\n+\n+        for ($i = 1; $i <= $nbAnswers; $i++) {\n+            $answer = trim($form->getSubmitValue('answer['.$i.']'));\n+            $comment = trim($form->getSubmitValue('comment['.$i.']'));\n+            $goodAnswer = trim($form->getSubmitValue('correct['.$i.']'));\n+            if (empty($options)) {\n+                // If this is the first time that the question is created then change\n+                // the default values from the form 1 and 2 by the correct \"option id\" registered\n+                $goodAnswer = $sortedByPosition[$goodAnswer]['id'];\n+            }\n+            $questionWeighting += $extraValues[0]; //By default 0 has the correct answers\n+            $objAnswer->createAnswer($answer, $goodAnswer, $comment, '', $i);\n+        }\n+\n+        // saves the answers into the data base\n+        $objAnswer->save();\n+\n+        // sets the total weighting of the question\n+        $this->updateWeighting($questionWeighting);\n+        $this->save($exercise);\n+    }\n+\n+    /**\n+     * Show result table headers.\n+     *\n+     * @param int   $feedbackType\n+     * @param int   $counter\n+     * @param float $score\n+     *\n+     * @return null|string\n+     */\n+    public function return_header($exercise, $counter = null, $score = null)\n+    {\n+        $header = parent::return_header($exercise, $counter, $score);\n+        $header .= '<table class=\"'\n+            .$this->question_table_class\n+            .'\"><tr><th>'\n+            .get_lang('Choice')\n+            .'</th><th>'\n+            .get_lang('ExpectedChoice')\n+            .'</th><th>'\n+            .get_lang('Answer')\n+            .'</th><th>'\n+            .get_lang('YourDegreeOfCertainty')\n+            .'</th><th>&nbsp;</th>'\n+        ;\n+        if ($exercise->feedback_type != EXERCISE_FEEDBACK_TYPE_EXAM) {\n+            $header .= '<th>'.get_lang('Comment').'</th>';\n+        } else {\n+            $header .= '<th>&nbsp;</th>';\n+        }\n+        $header .= '</tr>';\n+\n+        return $header;\n+    }\n+\n+    /**\n+     * Method to recovery color to show by precision of the student's answer.\n+     *\n+     * @param $studentAnwser\n+     * @param $expectedAnswer\n+     * @param $studentDegreeChoicePosition\n+     *\n+     * @return string\n+     */\n+    public function getColorResponse($studentAnwser, $expectedAnswer, $studentDegreeChoicePosition)\n+    {\n+        $checkResult = ($studentAnwser == $expectedAnswer) ? true : false;\n+        if ($checkResult) {\n+            if ($studentDegreeChoicePosition >= 6) {\n+                return '#088A08';\n+            }\n+            if ($studentDegreeChoicePosition >= 4 && $studentDegreeChoicePosition <= 5) {\n+                return '#A9F5A9';\n+            }\n+            if ($studentDegreeChoicePosition == 3) {\n+                return '#FFFFFF';\n+            }\n+        } else {\n+            if ($studentDegreeChoicePosition >= 6) {\n+                return '#FE2E2E';\n+            }\n+            if ($studentDegreeChoicePosition >= 4 && $studentDegreeChoicePosition <= 5) {\n+                return '#F6CECE';\n+            }\n+            if ($studentDegreeChoicePosition == 3) {\n+                return '#FFFFFF';\n+            }\n+        }\n+    }\n+\n+    /**\n+     * Return the color code for student answer.\n+     *\n+     * @param $studentAnwser\n+     * @param $expectedAnswer\n+     * @param $studentDegreeChoicePosition\n+     *\n+     * @return int\n+     */\n+    public function getStatusResponse($studentAnwser, $expectedAnswer, $studentDegreeChoicePosition)\n+    {\n+        $checkResult = $studentAnwser == $expectedAnswer ? true : false;\n+        if ($checkResult) {\n+            if ($studentDegreeChoicePosition >= 6) {\n+                return self::LEVEL_DARKGREEN;\n+            }\n+            if ($studentDegreeChoicePosition >= 4 && $studentDegreeChoicePosition <= 5) {\n+                return self::LEVEL_LIGHTGREEN;\n+            }\n+            if ($studentDegreeChoicePosition == 3) {\n+                return self::LEVEL_WHITE;\n+            }\n+        } else {\n+            if ($studentDegreeChoicePosition >= 6) {\n+                return self::LEVEL_DARKRED;\n+            }\n+            if ($studentDegreeChoicePosition >= 4 && $studentDegreeChoicePosition <= 5) {\n+                return self::LEVEL_LIGHTRED;\n+            }\n+            if ($studentDegreeChoicePosition == 3) {\n+                return self::LEVEL_WHITE;\n+            }\n+        }\n+    }\n+\n+    /**\n+     * Method to recover labels for color codes.\n+     *\n+     * @param $studentAnswer\n+     * @param  $expectedAnswer\n+     * @param  $studentDegreeChoicePosition\n+     *\n+     * @return string\n+     */\n+    public function getCodeResponse($studentAnswer, $expectedAnswer, $studentDegreeChoicePosition)\n+    {\n+        $checkResult = $studentAnswer == $expectedAnswer ? true : false;\n+        if ($checkResult) {\n+            if ($studentDegreeChoicePosition >= 6) {\n+                return get_lang('DegreeOfCertaintyVerySure');\n+            }\n+            if ($studentDegreeChoicePosition >= 4 && $studentDegreeChoicePosition <= 5) {\n+                return get_lang('DegreeOfCertaintyPrettySure');\n+            }\n+            if ($studentDegreeChoicePosition == 3) {\n+                return get_lang('DegreeOfCertaintyDeclaredIgnorance');\n+            }\n+        } else {\n+            if ($studentDegreeChoicePosition >= 6) {\n+                return get_lang('DegreeOfCertaintyVeryUnsure');\n+            }\n+            if ($studentDegreeChoicePosition >= 4 && $studentDegreeChoicePosition <= 5) {\n+                return get_lang('DegreeOfCertaintyUnsure');\n+            }\n+            if ($studentDegreeChoicePosition == 3) {\n+                return get_lang('DegreeOfCertaintyIgnorance');\n+            }\n+        }\n+    }\n+\n+    /**\n+     * Method to show the code color and his meaning for the test result.\n+     */\n+    public static function showColorCode()\n+    {\n+        ?>\n+        <table class=\"fc-border-separate\" cellspacing=\"0\" style=\"width:600px;\n+            margin: auto; border: 3px solid #A39E9E;\" >\n+            <tr style=\"border-bottom: 1px solid #A39E9E;\">\n+                <td style=\"width:15%; height:30px; background-color: #088A08; border-right: 1px solid #A39E9E;\">\n+                    &nbsp;\n+                </td>\n+                <td style=\"padding-left:10px;\">\n+                    <b><?php echo get_lang('DegreeOfCertaintyVerySure'); ?> :</b>\n+                    <?php echo get_lang('DegreeOfCertaintyVerySureDescription'); ?>\n+                </td>\n+            </tr>\n+            <tr style=\"border-bottom: 1px solid #A39E9E;\">\n+                <td style=\"width:15%; height:30px; background-color: #A9F5A9; border-right: 1px solid #A39E9E;\">\n+                    &nbsp;\n+                </td>\n+                <td style=\"padding-left:10px;\">\n+                    <b><?php echo get_lang('DegreeOfCertaintyPrettySure'); ?> :</b>\n+                    <?php echo get_lang('DegreeOfCertaintyPrettySureDescription'); ?>\n+                </td>\n+            </tr>\n+            <tr style=\"border: 1px solid #A39E9E;\">\n+                <td style=\"width:15%; height:30px; background-color: #FFFFFF; border-right: 1px solid #A39E9E;\">\n+                    &nbsp;\n+                </td>\n+                <td style=\"padding-left:10px;\">\n+                    <b><?php echo get_lang('DegreeOfCertaintyDeclaredIgnorance'); ?> :</b>\n+                    <?php echo get_lang('DegreeOfCertaintyDeclaredIgnoranceDescription'); ?>\n+                </td>\n+            </tr>\n+            <tr style=\"border: 1px solid #A39E9E;\">\n+                <td style=\"width:15%; height:30px; background-color: #F6CECE; border-right: 1px solid #A39E9E;\">\n+                    &nbsp;\n+                </td>\n+                <td style=\"padding-left:10px;\">\n+                    <b><?php echo get_lang('DegreeOfCertaintyUnsure'); ?> :</b>\n+                    <?php echo get_lang('DegreeOfCertaintyUnsureDescription'); ?>\n+                </td>\n+            </tr>\n+            <tr style=\"border-bottom: 1px solid #A39E9E;\">\n+                <td style=\"width:15%; height:30px; background-color: #FE2E2E; border-right: 1px solid #A39E9E;\">\n+                    &nbsp;\n+                </td>\n+                <td style=\"padding-left:10px;\">\n+                    <b><?php echo get_lang('DegreeOfCertaintyVeryUnsure'); ?> :</b>\n+                    <?php echo get_lang('DegreeOfCertaintyVeryUnsureDescription'); ?>\n+                </td>\n+            </tr>\n+        </table><br/>\n+        <?php\n+    }\n+\n+    /**\n+     * Display basic bar charts of results by category of questions.\n+     *\n+     * @param array    $scoreListAll\n+     * @param string   $title        The block title\n+     * @param int      $sizeRatio\n+     * @param Exercise $objExercise\n+     *\n+     * @return string The HTML/CSS code for the charts block\n+     */\n+    public static function displayDegreeChartByCategory($scoreListAll, $title, $sizeRatio = 1, $objExercise)\n+    {\n+        $maxHeight = 0;\n+        $groupCategoriesByBracket = false;\n+        if ($groupCategoriesByBracket) {\n+            $scoreList = [];\n+            $categoryPrefixList = [];  // categoryPrefix['Math'] = firstCategoryId for this prefix\n+            // rebuild $scoreList factorizing data with category prefix\n+            foreach ($scoreListAll as $categoryId => $scoreListForCategory) {\n+                $objCategory = new Testcategory();\n+                $objCategoryNum = $objCategory->getCategory($categoryId);\n+                preg_match(\"/^\\[([^]]+)\\]/\", $objCategoryNum->name, $matches);\n+\n+                if (count($matches) > 1) {\n+                    // check if we have already see this prefix\n+                    if (array_key_exists($matches[1], $categoryPrefixList)) {\n+                        // add the result color for this entry\n+                        $scoreList[$categoryPrefixList[$matches[1]]][self::LEVEL_DARKGREEN] +=\n+                            $scoreListForCategory[self::LEVEL_DARKGREEN];\n+                        $scoreList[$categoryPrefixList[$matches[1]]][self::LEVEL_LIGHTGREEN] +=\n+                            $scoreListForCategory[self::LEVEL_LIGHTGREEN];\n+                        $scoreList[$categoryPrefixList[$matches[1]]][self::LEVEL_WHITE] +=\n+                            $scoreListForCategory[self::LEVEL_WHITE];\n+                        $scoreList[$categoryPrefixList[$matches[1]]][self::LEVEL_LIGHTRED] +=\n+                            $scoreListForCategory[self::LEVEL_LIGHTRED];\n+                        $scoreList[$categoryPrefixList[$matches[1]]][self::LEVEL_DARKRED] +=\n+                            $scoreListForCategory[self::LEVEL_DARKRED];\n+                    } else {\n+                        $categoryPrefixList[$matches[1]] = $categoryId;\n+                        $scoreList[$categoryId] = $scoreListAll[$categoryId];\n+                    }\n+                } else {\n+                    // doesn't match the prefix '[math] Math category'\n+                    $scoreList[$categoryId] = $scoreListAll[$categoryId];\n+                }\n+            }\n+        } else {\n+            $scoreList = $scoreListAll;\n+        }\n+\n+        // get the max height of item to have each table the same height if displayed side by side\n+        $testCategory = new TestCategory();\n+        foreach ($scoreList as $categoryId => $scoreListForCategory) {\n+            $category = $testCategory->getCategory($categoryId);\n+            if ($category) {\n+                $categoryQuestionName = $category->name;\n+            }\n+            list($null, $height) = self::displayDegreeChart(","path":"main/exercise/MultipleAnswerTrueFalseDegreeCertainty.php","position":541,"original_position":541,"commit_id":"be61e7b1ea584372f15474e896b8de7e087778d9","original_commit_id":"be61e7b1ea584372f15474e896b8de7e087778d9","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: [Avoid unused local variables such as '$null'.](https://app.codacy.com/app/chamilo/chamilo-lms/pullRequest?prid=1910143)","created_at":"2018-07-17T13:37:42Z","updated_at":"2018-07-17T13:37:43Z","html_url":"https://github.com/chamilo/chamilo-lms/pull/2591#discussion_r203023841","pull_request_url":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/2591","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/comments/203023841"},"html":{"href":"https://github.com/chamilo/chamilo-lms/pull/2591#discussion_r203023841"},"pull_request":{"href":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/2591"}}},"pull_request":{"url":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/2591","id":201820491,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAxODIwNDkx","html_url":"https://github.com/chamilo/chamilo-lms/pull/2591","diff_url":"https://github.com/chamilo/chamilo-lms/pull/2591.diff","patch_url":"https://github.com/chamilo/chamilo-lms/pull/2591.patch","issue_url":"https://api.github.com/repos/chamilo/chamilo-lms/issues/2591","number":2591,"state":"open","locked":false,"title":"Multiple answer with degree of certainty","user":{"login":"ywarnier","id":609839,"node_id":"MDQ6VXNlcjYwOTgzOQ==","avatar_url":"https://avatars3.githubusercontent.com/u/609839?v=4","gravatar_id":"","url":"https://api.github.com/users/ywarnier","html_url":"https://github.com/ywarnier","followers_url":"https://api.github.com/users/ywarnier/followers","following_url":"https://api.github.com/users/ywarnier/following{/other_user}","gists_url":"https://api.github.com/users/ywarnier/gists{/gist_id}","starred_url":"https://api.github.com/users/ywarnier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ywarnier/subscriptions","organizations_url":"https://api.github.com/users/ywarnier/orgs","repos_url":"https://api.github.com/users/ywarnier/repos","events_url":"https://api.github.com/users/ywarnier/events{/privacy}","received_events_url":"https://api.github.com/users/ywarnier/received_events","type":"User","site_admin":false},"body":"This is the (shared) extension of PR2485, to finish its integration.\r\n3 problems remaining. See last comment of https://github.com/chamilo/chamilo-lms/pull/2485 for more info.","created_at":"2018-07-17T04:18:51Z","updated_at":"2018-07-17T13:37:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6b3490f9b5079877b81c718a348997ab3533e185","assignee":{"login":"ywarnier","id":609839,"node_id":"MDQ6VXNlcjYwOTgzOQ==","avatar_url":"https://avatars3.githubusercontent.com/u/609839?v=4","gravatar_id":"","url":"https://api.github.com/users/ywarnier","html_url":"https://github.com/ywarnier","followers_url":"https://api.github.com/users/ywarnier/followers","following_url":"https://api.github.com/users/ywarnier/following{/other_user}","gists_url":"https://api.github.com/users/ywarnier/gists{/gist_id}","starred_url":"https://api.github.com/users/ywarnier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ywarnier/subscriptions","organizations_url":"https://api.github.com/users/ywarnier/orgs","repos_url":"https://api.github.com/users/ywarnier/repos","events_url":"https://api.github.com/users/ywarnier/events{/privacy}","received_events_url":"https://api.github.com/users/ywarnier/received_events","type":"User","site_admin":false},"assignees":[{"login":"ywarnier","id":609839,"node_id":"MDQ6VXNlcjYwOTgzOQ==","avatar_url":"https://avatars3.githubusercontent.com/u/609839?v=4","gravatar_id":"","url":"https://api.github.com/users/ywarnier","html_url":"https://github.com/ywarnier","followers_url":"https://api.github.com/users/ywarnier/followers","following_url":"https://api.github.com/users/ywarnier/following{/other_user}","gists_url":"https://api.github.com/users/ywarnier/gists{/gist_id}","starred_url":"https://api.github.com/users/ywarnier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ywarnier/subscriptions","organizations_url":"https://api.github.com/users/ywarnier/orgs","repos_url":"https://api.github.com/users/ywarnier/repos","events_url":"https://api.github.com/users/ywarnier/events{/privacy}","received_events_url":"https://api.github.com/users/ywarnier/received_events","type":"User","site_admin":false}],"requested_reviewers":[{"login":"baelmyhu","id":4034795,"node_id":"MDQ6VXNlcjQwMzQ3OTU=","avatar_url":"https://avatars0.githubusercontent.com/u/4034795?v=4","gravatar_id":"","url":"https://api.github.com/users/baelmyhu","html_url":"https://github.com/baelmyhu","followers_url":"https://api.github.com/users/baelmyhu/followers","following_url":"https://api.github.com/users/baelmyhu/following{/other_user}","gists_url":"https://api.github.com/users/baelmyhu/gists{/gist_id}","starred_url":"https://api.github.com/users/baelmyhu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/baelmyhu/subscriptions","organizations_url":"https://api.github.com/users/baelmyhu/orgs","repos_url":"https://api.github.com/users/baelmyhu/repos","events_url":"https://api.github.com/users/baelmyhu/events{/privacy}","received_events_url":"https://api.github.com/users/baelmyhu/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/2591/commits","review_comments_url":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/2591/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/2591/comments","statuses_url":"https://api.github.com/repos/chamilo/chamilo-lms/statuses/be61e7b1ea584372f15474e896b8de7e087778d9","head":{"label":"chamilo:certainty","ref":"certainty","sha":"be61e7b1ea584372f15474e896b8de7e087778d9","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-17T13:29:31Z","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":808313,"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":257,"mirror_url":null,"archived":false,"open_issues_count":186,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":257,"open_issues":186,"watchers":273,"default_branch":"master"}},"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-17T13:29:31Z","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":808313,"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":257,"mirror_url":null,"archived":false,"open_issues_count":186,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":257,"open_issues":186,"watchers":273,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/2591"},"html":{"href":"https://github.com/chamilo/chamilo-lms/pull/2591"},"issue":{"href":"https://api.github.com/repos/chamilo/chamilo-lms/issues/2591"},"comments":{"href":"https://api.github.com/repos/chamilo/chamilo-lms/issues/2591/comments"},"review_comments":{"href":"https://api.github.com/repos/chamilo/chamilo-lms/pulls/2591/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/2591/commits"},"statuses":{"href":"https://api.github.com/repos/chamilo/chamilo-lms/statuses/be61e7b1ea584372f15474e896b8de7e087778d9"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"codacy-bot"}}