chamilo/chamilo-lms

View on GitHub
public/main/exercise/question_pool.php

Summary

Maintainability
A
0 mins
Test Coverage

The function getQuestions has 13 parameters. Consider reducing the number of parameters to less than 10.
Open

function getQuestions(
    $getCount,
    $start,
    $length,
    $exerciseId,

The function getQuestions() has an NPath complexity of 1728. The configured NPath complexity threshold is 200.
Open

function getQuestions(
    $getCount,
    $start,
    $length,
    $exerciseId,

NPathComplexity

Since: 0.1

The NPath complexity of a method is the number of acyclic execution paths through that method. A threshold of 200 is generally considered the point where measures should be taken to reduce complexity.

Example

class Foo {
    function bar() {
        // lots of complicated code
    }
}

Source https://phpmd.org/rules/codesize.html#npathcomplexity

The function get_action_icon_for_question has 12 parameters. Consider reducing the number of parameters to less than 10.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

Missing class import via use statement (line '530', column '23').
Open

    $extraField = new ExtraField('question');

MissingImport

Since: 2.7.0

Importing all external classes in a file through use statements makes them clearly visible.

Example

function make() {
    return new \stdClass();
}

Source http://phpmd.org/rules/cleancode.html#MissingImport

The method get_action_icon_for_question uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                $res = "<a href='".api_get_self()."?".
                api_get_cidreq().$getParams."&delete=$in_questionid' onclick='return confirm_your_choice()'>";
                $res .= Display::getMdiIcon(ActionIcon::DELETE, 'ch-tool-icon', null, ICON_SIZE_SMALL, get_lang('Delete'));
                $res .= "</a>";

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

The method getQuestions uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

    } else {
        $qb->select('qq.iid as id', 'qq.question', 'qq.type', 'qq.level', 'IDENTITY(qr.quiz) as exerciseId')
            ->setFirstResult($start)
            ->setMaxResults($length);

ElseExpression

Since: 1.4.0

An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

Example

class Foo
{
    public function bar($flag)
    {
        if ($flag) {
            // one branch
        } else {
            // another branch
        }
    }
}

Source https://phpmd.org/rules/cleancode.html#elseexpression

Avoid unused parameters such as '$selectedCourse'.
Open

    $selectedCourse,

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$sessionId'.
Open

    $sessionId,

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$formValues'.
Open

    $formValues = []

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

Avoid unused parameters such as '$in_questionname'.
Open

    $in_questionname,

UnusedFormalParameter

Since: 0.2

Avoid passing parameters to methods or constructors and then not using those parameters.

Example

class Foo
{
    private function bar($howdy)
    {
        // $howdy is not used
    }
}

Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

The parameter $in_session_id is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $in_courseCategoryId is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $in_questionid is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $in_answerType is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $in_exercise_id is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $in_action is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $in_questiontype is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $in_selected_course is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $in_exerciseLevel is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $from_exercise is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $in_questionname is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $in_questionid is not named in camelCase.
Open

function get_question_type_for_question($in_selectedcourse, $in_questionid)
{
    $courseInfo = api_get_course_info_by_id($in_selectedcourse);
    $question = Question::read($in_questionid, $courseInfo);
    $questionType = null;

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $in_selectedcourse is not named in camelCase.
Open

function get_question_type_for_question($in_selectedcourse, $in_questionid)
{
    $courseInfo = api_get_course_info_by_id($in_selectedcourse);
    $question = Question::read($in_questionid, $courseInfo);
    $questionType = null;

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

The parameter $in_addA is not named in camelCase.
Open

function getLinkForQuestion(
    $in_addA,
    $fromExercise,
    $questionId,
    $questionType,

CamelCaseParameterName

Since: 0.2

It is considered best practice to use the camelCase notation to name parameters.

Example

class ClassName {
    public function doSomething($user_name) {
    }
}

Source

Variable "is_allowedToEdit" is not in valid camel caps format
Open

if ($is_allowedToEdit) {

Variable "origin_course_info" is not in valid camel caps format
Open

            $origin_course_info = api_get_course_info_by_id($origin_course_id);

Variable "new_answer_obj" is not in valid camel caps format
Open

                    $new_answer_obj->read();

Variable "old_question_obj" is not in valid camel caps format
Open

        $old_question_obj = Question::read($old_question_id, $origin_course_info);

Variable "course_id" is not in valid camel caps format
Open

        foreach ($list_recup as $course_id => $question_data) {

Variable "is_allowedToEdit" is not in valid camel caps format
Open

$is_allowedToEdit = api_is_allowed_to_edit(null, true);

Variable "exercise_id_changed" is not in valid camel caps format
Open

$exercise_id_changed = isset($_GET['exercise_id_changed']) ? (int) $_GET['exercise_id_changed'] : null;

Variable "current_course" is not in valid camel caps format
Open

            $current_course = api_get_course_info();

Variable "new_id" is not in valid camel caps format
Open

                    $new_question_obj = Question::read($new_id);

Variable "origin_course_id" is not in valid camel caps format
Open

        $origin_course_id = (int) $_GET['course_id'];

Variable "old_question_id" is not in valid camel caps format
Open

        $old_question_obj = Question::read($old_question_id, $origin_course_info);

Variable "old_question_obj" is not in valid camel caps format
Open

            $new_id = $old_question_obj->duplicate($current_course);

Variable "new_question_obj" is not in valid camel caps format
Open

                    $new_question_obj->addToList($fromExercise);

Variable "origin_course_info" is not in valid camel caps format
Open

        $old_question_obj = Question::read($old_question_id, $origin_course_info);

Variable "current_course" is not in valid camel caps format
Open

        $courseId = $current_course['real_id'];

Variable "new_id" is not in valid camel caps format
Open

            $new_id = $old_question_obj->duplicate($current_course);

Variable "old_question_obj" is not in valid camel caps format
Open

            unset($old_question_obj);

Variable "current_course" is not in valid camel caps format
Open

                    $new_answer_obj->duplicate($new_question_obj, $current_course);

Variable "_course" is not in valid camel caps format
Open

$_course = api_get_course_info();

Variable "old_question_obj" is not in valid camel caps format
Open

            $old_question_obj->updateTitle($old_question_obj->selectTitle().' - '.get_lang('Copy'));

Variable "old_question_obj" is not in valid camel caps format
Open

                    $old_question_obj->updateTitle(

Variable "new_id" is not in valid camel caps format
Open

                    $new_id = $old_question_obj->duplicate($current_course);

Variable "current_course" is not in valid camel caps format
Open

                    $new_id = $old_question_obj->duplicate($current_course);

Variable "question_copy" is not in valid camel caps format
Open

$question_copy = isset($_REQUEST['question_copy']) ? (int) $_REQUEST['question_copy'] : 0;

Variable "origin_course_info" is not in valid camel caps format
Open

        $origin_course_info = api_get_course_info_by_id($origin_course_id);

Variable "old_question_obj" is not in valid camel caps format
Open

        if ($old_question_obj) {

Variable "new_answer_obj" is not in valid camel caps format
Open

            $new_answer_obj = new Answer($old_question_id, $origin_course_id);

Variable "new_answer_obj" is not in valid camel caps format
Open

            $new_answer_obj->duplicate($new_question_obj, $current_course);

Variable "new_question_obj" is not in valid camel caps format
Open

            $new_answer_obj->duplicate($new_question_obj, $current_course);

Variable "question_data" is not in valid camel caps format
Open

        foreach ($list_recup as $course_id => $question_data) {

Variable "course_id" is not in valid camel caps format
Open

            $origin_course_id = (int) $course_id;

Variable "origin_course_info" is not in valid camel caps format
Open

                $old_question_obj = Question::read($old_question_id, $origin_course_info);

Variable "session_id" is not in valid camel caps format
Open

$session_id = isset($_REQUEST['session_id']) ? (int) $_REQUEST['session_id'] : null;

Variable "course_id_changed" is not in valid camel caps format
Open

$course_id_changed = isset($_GET['course_id_changed']) ? (int) $_GET['course_id_changed'] : null;

Variable "current_course" is not in valid camel caps format
Open

            $new_id = $old_question_obj->duplicate($current_course);

Variable "old_question_obj" is not in valid camel caps format
Open

                        $old_question_obj->selectTitle().' - '.get_lang('Copy')

Variable "old_question_id" is not in valid camel caps format
Open

                    $new_answer_obj = new Answer($old_question_id, $origin_course_id);

Variable "old_question_obj" is not in valid camel caps format
Open

                if ($old_question_obj) {

Variable "origin_course_id" is not in valid camel caps format
Open

                    $new_answer_obj = new Answer($old_question_id, $origin_course_id);

Variable "new_question_obj" is not in valid camel caps format
Open

                    $new_answer_obj->duplicate($new_question_obj, $current_course);

Variable "origin_course_id" is not in valid camel caps format
Open

        $origin_course_info = api_get_course_info_by_id($origin_course_id);

Variable "old_question_id" is not in valid camel caps format
Open

            $new_answer_obj = new Answer($old_question_id, $origin_course_id);

Variable "new_answer_obj" is not in valid camel caps format
Open

                    $new_answer_obj->duplicate($new_question_obj, $current_course);

Variable "new_question_obj" is not in valid camel caps format
Open

            $new_question_obj->addToList($fromExercise);

Variable "list_recup" is not in valid camel caps format
Open

        foreach ($list_recup as $course_id => $question_data) {

Variable "question_copy" is not in valid camel caps format
Open

    if (!isset($_POST['recup']) && 0 != $question_copy && isset($fromExercise)) {

Variable "current_course" is not in valid camel caps format
Open

        $current_course = api_get_course_info();

Variable "question_copy" is not in valid camel caps format
Open

        $old_question_id = $question_copy;

Variable "new_question_obj" is not in valid camel caps format
Open

            $new_question_obj = Question::read($new_id);

Variable "new_id" is not in valid camel caps format
Open

            $new_question_obj = Question::read($new_id);

Variable "origin_course_id" is not in valid camel caps format
Open

            $new_answer_obj = new Answer($old_question_id, $origin_course_id);

Variable "new_question_obj" is not in valid camel caps format
Open

            unset($new_question_obj);

Variable "question_data" is not in valid camel caps format
Open

            foreach ($question_data as $old_question_id) {

Variable "old_question_id" is not in valid camel caps format
Open

                $old_question_obj = Question::read($old_question_id, $origin_course_info);

Variable "selected_course" is not in valid camel caps format
Open

    $selected_course = api_get_course_int_id();

Variable "new_answer_obj" is not in valid camel caps format
Open

            $new_answer_obj->read();

Variable "origin_course_id" is not in valid camel caps format
Open

            $origin_course_info = api_get_course_info_by_id($origin_course_id);

Variable "old_question_obj" is not in valid camel caps format
Open

                    $new_id = $old_question_obj->duplicate($current_course);

Variable "old_question_obj" is not in valid camel caps format
Open

                $old_question_obj = Question::read($old_question_id, $origin_course_info);

Variable "new_question_obj" is not in valid camel caps format
Open

                    $new_question_obj = Question::read($new_id);

Variable "this_section" is not in valid camel caps format
Open

$this_section = SECTION_COURSES;

Variable "selected_course" is not in valid camel caps format
Open

$selected_course = isset($_GET['selected_course']) ? (int) $_GET['selected_course'] : null;

Variable "current_course" is not in valid camel caps format
Open

            $new_answer_obj->duplicate($new_question_obj, $current_course);

Variable "list_recup" is not in valid camel caps format
Open

        $list_recup = $_POST['recup'];

Variable "origin_course_id" is not in valid camel caps format
Open

            $origin_course_id = (int) $course_id;

Variable "old_question_id" is not in valid camel caps format
Open

        $old_question_id = $question_copy;

Variable "old_question_obj" is not in valid camel caps format
Open

            $old_question_obj->updateTitle($old_question_obj->selectTitle().' - '.get_lang('Copy'));

Variable "old_question_id" is not in valid camel caps format
Open

            foreach ($question_data as $old_question_id) {

Variable "new_answer_obj" is not in valid camel caps format
Open

                    $new_answer_obj = new Answer($old_question_id, $origin_course_id);

Variable "session_id" is not in valid camel caps format
Open

        'session_id' => $session_id,

Variable "course_list" is not in valid camel caps format
Open

                $course_list = array_merge($course_list, [$courseInfo]);

Variable "course_list" is not in valid camel caps format
Open

                $course_list = array_merge($course_list, [$courseInfo]);

Variable "course_select_list" is not in valid camel caps format
Open

$course_select_list = ['-1' => get_lang('Select')];

Variable "course_select_list" is not in valid camel caps format
Open

        $course_select_list[$courseItemId] = '>&nbsp;&nbsp;&nbsp;&nbsp;';

Variable "new_question_list" is not in valid camel caps format
Open

    $new_question_list,

Missing function doc comment
Open

function getQuestions(

Multi-line function call not indented correctly; expected 12 spaces but found 16
Open

                $questionId,

Variable "selected_course" is not in valid camel caps format
Open

echo '<input type="hidden" name="selected_course" value="'.$selected_course.'">';

Consider putting global function "get_action_icon_for_question" in a static class
Open

function get_action_icon_for_question(

Variable "in_questiontype" is not in valid camel caps format
Open

    $in_questiontype,

Variable "in_session_id" is not in valid camel caps format
Open

    $getParams = "&selected_course=$in_selected_course&courseCategoryId=$in_courseCategoryId&exerciseId=$in_exercise_id&exerciseLevel=$in_exerciseLevel&answerType=$in_answerType&session_id=$in_session_id";

Variable "in_exercise_id" is not in valid camel caps format
Open

                $in_exercise_id

Variable "new_question_obj" is not in valid camel caps format
Open

                    unset($new_question_obj);

Variable "old_question_obj" is not in valid camel caps format
Open

                            unset($old_question_obj);

Variable "course_select_list" is not in valid camel caps format
Open

    $course_select_list[$courseItemId] .= $courseInfo['title'];

Variable "session_id" is not in valid camel caps format
Open

    (empty($session_id) ? 0 : $session_id),

Variable "question_list" is not in valid camel caps format
Open

$question_list = Question::getQuestionTypeList();

Variable "selected_course" is not in valid camel caps format
Open

    if ($selected_course == api_get_course_int_id()) {

Variable "in_questionid" is not in valid camel caps format
Open

            if (!$myObjEx->hasQuestion($in_questionid)) {

Variable "old_question_obj" is not in valid camel caps format
Open

                        if ($old_question_obj) {

Variable "new_question_obj" is not in valid camel caps format
Open

                            unset($new_question_obj);

Variable "course_list" is not in valid camel caps format
Open

            $course_list = [$courseInfo];

Variable "new_question_list" is not in valid camel caps format
Open

$new_question_list = [];

Variable "selected_course" is not in valid camel caps format
Open

        $question_type = get_question_type_for_question($selected_course, $questionId);

Variable "in_questiontype" is not in valid camel caps format
Open

                $in_questiontype,

Variable "origin_course_id" is not in valid camel caps format
Open

                $origin_course_id = (int) $_GET['course_id'];

Variable "course_info" is not in valid camel caps format
Open

    $course_info = api_get_course_info();

Variable "new_question_list" is not in valid camel caps format
Open

$new_question_list['-1'] = get_lang('All');

Variable "session_id" is not in valid camel caps format
Open

    $session_id,

Variable "_course" is not in valid camel caps format
Open

echo '<input type="hidden" name="cidReq" value="'.$_course['real_id'].'">';

Variable "in_courseCategoryId" is not in valid camel caps format
Open

    $in_courseCategoryId,

Variable "in_exercise_id" is not in valid camel caps format
Open

    $getParams = "&selected_course=$in_selected_course&courseCategoryId=$in_courseCategoryId&exerciseId=$in_exercise_id&exerciseLevel=$in_exerciseLevel&answerType=$in_answerType&session_id=$in_session_id";

Variable "in_exerciseLevel" is not in valid camel caps format
Open

    $getParams = "&selected_course=$in_selected_course&courseCategoryId=$in_courseCategoryId&exerciseId=$in_exercise_id&exerciseLevel=$in_exerciseLevel&answerType=$in_answerType&session_id=$in_session_id";

Variable "in_questionid" is not in valid camel caps format
Open

                    api_get_cidreq().$getParams."&recup=$in_questionid&fromExercise=$from_exercise'>";

Variable "current_course" is not in valid camel caps format
Open

                $current_course = api_get_course_info();

Variable "session_id" is not in valid camel caps format
Open

        if ($session['session_id'] == $session_id) {

Variable "selected_course" is not in valid camel caps format
Open

if (empty($selected_course) || '-1' == $selected_course) {

Variable "selected_course" is not in valid camel caps format
Open

    $course_info = api_get_course_info_by_id($selected_course);

Variable "session_select_list" is not in valid camel caps format
Open

        $session_select_list,

Variable "in_action" is not in valid camel caps format
Open

    $in_action,

Variable "origin_course_id" is not in valid camel caps format
Open

                            $new_answer_obj = new Answer($questionId, $origin_course_id);

Variable "new_answer_obj" is not in valid camel caps format
Open

                            $new_answer_obj->duplicate($new_question_obj, $current_course);

Variable "session_id" is not in valid camel caps format
Open

if (!empty($session_id) && '-1' != $session_id && !empty($sessionList)) {

Variable "course_id_changed" is not in valid camel caps format
Open

if ($course_id_changed) {

Variable "session_id" is not in valid camel caps format
Open

    (empty($session_id) ? 0 : $session_id),

Variable "question_list" is not in valid camel caps format
Open

    foreach ($question_list as $key => $item) {

Variable "new_question_list" is not in valid camel caps format
Open

            $new_question_list[$key] = get_lang($item[1]);

Variable "session_id" is not in valid camel caps format
Open

    ->setSelected($session_id);

Variable "question_type" is not in valid camel caps format
Open

        $row[] = $question_type;

Variable "in_answerType" is not in valid camel caps format
Open

    $in_answerType,

Variable "from_exercise" is not in valid camel caps format
Open

                    api_get_cidreq().$getParams."&recup=$in_questionid&fromExercise=$from_exercise'>";

Variable "course_id_changed" is not in valid camel caps format
Open

        'course_id_changed' => $course_id_changed,

Variable "origin_course_id" is not in valid camel caps format
Open

                $origin_course_info = api_get_course_info_by_id($origin_course_id);

Variable "old_question_obj" is not in valid camel caps format
Open

                            $old_question_obj->updateTitle($old_question_obj->selectTitle().' - '.get_lang('Copy'));

Variable "course_list" is not in valid camel caps format
Open

$course_list = [];

Variable "course_list" is not in valid camel caps format
Open

    $course_list = $sessionInfo['courses'];

Consider putting global function "getExtraFieldConditions" in a static class
Open

function getExtraFieldConditions(array $formValues, $queryType = 'from')

Expected 1 space after FUNCTION keyword; 0 found
Open

    $link = function($page, $text, $label, $isActive = false) use ($url) {

Variable "selected_course" is not in valid camel caps format
Open

            $selected_course,

Variable "selected_course" is not in valid camel caps format
Open

            $selected_course,

Variable "in_questionid" is not in valid camel caps format
Open

            if (isQuestionInActiveQuiz($in_questionid)) {

Variable "session_id" is not in valid camel caps format
Open

if (!empty($session_id) && '-1' != $session_id && !empty($sessionList)) {

Variable "course_select_list" is not in valid camel caps format
Open

    $course_select_list[$courseItemId] = '';

Variable "exercise_id_changed" is not in valid camel caps format
Open

if (1 == $exercise_id_changed) {

Variable "my_exercise_list" is not in valid camel caps format
Open

        $my_exercise_list[$row['iid']] .= $exerciseTitle;

Variable "session_id" is not in valid camel caps format
Open

    $session_id,

Variable "in_addA" is not in valid camel caps format
Open

    if ($in_addA) {

Variable "in_action" is not in valid camel caps format
Open

    switch ($in_action) {

Variable "in_session_id" is not in valid camel caps format
Open

                $in_session_id,

Variable "course_list" is not in valid camel caps format
Open

        if (!empty($course_list)) {

Variable "course_info" is not in valid camel caps format
Open

    $course_info = api_get_course_info_by_id($selected_course);

Variable "selected_course" is not in valid camel caps format
Open

    $selected_course,

Variable "my_exercise_list" is not in valid camel caps format
Open

        $my_exercise_list[$row['iid']] = '';

Variable "selected_course" is not in valid camel caps format
Open

    ->setSelected($selected_course);

Variable "selected_course" is not in valid camel caps format
Open

    $selected_course,

Variable "selected_course" is not in valid camel caps format
Open

    $selected_course,

Missing blank line before return statement
Open

        return '<li class="page-item'.$activeClass.'"><a class="page-link" href="'.$url.'&page='.$page.'" aria-label="'.$label.'">'.$text.'</a></li>';

Variable "session_id" is not in valid camel caps format
Open

            $session_id,

Variable "in_questionid" is not in valid camel caps format
Open

    $in_questionid,

Variable "in_selected_course" is not in valid camel caps format
Open

    $in_selected_course,

Variable "in_questionid" is not in valid camel caps format
Open

                api_get_cidreq().$getParams."&delete=$in_questionid' onclick='return confirm_your_choice()'>";

Consider putting global function "isQuestionInActiveQuiz" in a static class
Open

function isQuestionInActiveQuiz($questionId)

Variable "in_selectedcourse" is not in valid camel caps format
Open

    $courseInfo = api_get_course_info_by_id($in_selectedcourse);

Variable "is_allowedToEdit" is not in valid camel caps format
Open

if (!$is_allowedToEdit) {

Variable "selected_course" is not in valid camel caps format
Open

        'selected_course' => $selected_course,

Variable "origin_course_info" is not in valid camel caps format
Open

                $origin_course_info = api_get_course_info_by_id($origin_course_id);

Variable "new_id" is not in valid camel caps format
Open

                            $new_id = $old_question_obj->duplicate($current_course);

Variable "new_id" is not in valid camel caps format
Open

                            $new_question_obj = Question::read($new_id);

Variable "new_answer_obj" is not in valid camel caps format
Open

                            $new_answer_obj = new Answer($questionId, $origin_course_id);

Variable "my_exercise_list" is not in valid camel caps format
Open

$my_exercise_list['0'] = get_lang('All tests');

Variable "my_exercise_list" is not in valid camel caps format
Open

$my_exercise_list['-1'] = get_lang('Orphan questions');

Variable "session_id" is not in valid camel caps format
Open

            $session_id,

Variable "selected_course" is not in valid camel caps format
Open

if ($selected_course == api_get_course_int_id()) {

Variable "new_question_obj" is not in valid camel caps format
Open

                            $new_question_obj = Question::read($new_id);

Variable "current_course" is not in valid camel caps format
Open

                            $new_answer_obj->duplicate($new_question_obj, $current_course);

Variable "selected_course" is not in valid camel caps format
Open

$categoryList = TestCategory::getCategoriesIdAndName($selected_course);

Multi-line function call not indented correctly; expected 8 spaces but found 4
Open

    $new_question_list,

Consider putting global function "getQuestions" in a static class
Open

function getQuestions(

Variable "question_type" is not in valid camel caps format
Open

        if (empty($question_type)) {

Consider putting global function "reset_menu_exo_lvl_type" in a static class
Open

function reset_menu_exo_lvl_type()

Consider putting global function "getLinkForQuestion" in a static class
Open

function getLinkForQuestion(

Variable "in_questionid" is not in valid camel caps format
Open

function get_question_type_for_question($in_selectedcourse, $in_questionid)

Variable "current_course" is not in valid camel caps format
Open

                        $courseId = $current_course['real_id'];

Variable "old_question_obj" is not in valid camel caps format
Open

                            $new_id = $old_question_obj->duplicate($current_course);

Variable "new_question_obj" is not in valid camel caps format
Open

                            $new_question_obj->addToList($fromExercise);

Variable "course_list" is not in valid camel caps format
Open

foreach ($course_list as $item) {

Variable "selected_course" is not in valid camel caps format
Open

    if ($selected_course == api_get_course_int_id()) {

Variable "question_type" is not in valid camel caps format
Open

        $question_type = get_question_type_for_question($selected_course, $questionId);

Variable "selected_course" is not in valid camel caps format
Open

echo '<input type="hidden" name="course_id" value="'.$selected_course.'">';

Consider putting global function "reset_menu_lvl_type" in a static class
Open

function reset_menu_lvl_type()

Variable "in_session_id" is not in valid camel caps format
Open

    $in_session_id,

Variable "in_answerType" is not in valid camel caps format
Open

    $getParams = "&selected_course=$in_selected_course&courseCategoryId=$in_courseCategoryId&exerciseId=$in_exercise_id&exerciseLevel=$in_exerciseLevel&answerType=$in_answerType&session_id=$in_session_id";

Variable "old_question_obj" is not in valid camel caps format
Open

                            $old_question_obj->updateTitle($old_question_obj->selectTitle().' - '.get_lang('Copy'));

Variable "selected_course" is not in valid camel caps format
Open

        if ($row['iid'] == $fromExercise && $selected_course == api_get_course_int_id()) {

Variable "new_question_list" is not in valid camel caps format
Open

            $new_question_list[$key] = get_lang($item[1]);

Variable "in_exerciseLevel" is not in valid camel caps format
Open

    $in_exerciseLevel,

Variable "old_question_obj" is not in valid camel caps format
Open

                    unset($old_question_obj);

Variable "exercise_id_changed" is not in valid camel caps format
Open

        'exercise_id_changed' => $exercise_id_changed,

Variable "new_question_obj" is not in valid camel caps format
Open

                            $new_answer_obj->duplicate($new_question_obj, $current_course);

Variable "session_select_list" is not in valid camel caps format
Open

    $session_select_list[$item['session_id']] = $item['session_name'];

Variable "course_list" is not in valid camel caps format
Open

        $course_list = CourseManager::get_course_list_of_user_as_course_admin(api_get_user_id());

Variable "my_exercise_list" is not in valid camel caps format
Open

$my_exercise_list = [];

Variable "exercise_list" is not in valid camel caps format
Open

if (is_array($exercise_list)) {

Variable "my_exercise_list" is not in valid camel caps format
Open

            $my_exercise_list[$row['iid']] = '>&nbsp;&nbsp;&nbsp;&nbsp;';

Variable "my_exercise_list" is not in valid camel caps format
Open

        $my_exercise_list,

Variable "in_exercise_id" is not in valid camel caps format
Open

    $in_exercise_id,

Variable "from_exercise" is not in valid camel caps format
Open

                "&question_copy=$in_questionid&course_id=$in_selected_course&fromExercise=$from_exercise";

Variable "current_course" is not in valid camel caps format
Open

                            $new_id = $old_question_obj->duplicate($current_course);

Variable "course_list" is not in valid camel caps format
Open

        $course_list = CourseManager::get_courses_list(0, 0, 'title');

Variable "course_list" is not in valid camel caps format
Open

            if (!in_array($courseInfo['real_id'], $course_list)) {

Variable "exercise_list" is not in valid camel caps format
Open

    foreach ($exercise_list as $row) {

Variable "_course" is not in valid camel caps format
Open

if (!empty($_course)) {

Variable "course_select_list" is not in valid camel caps format
Open

        $course_select_list,

Multi-line function call not indented correctly; expected 8 spaces but found 4
Open

    'answerType',

Variable "selected_course" is not in valid camel caps format
Open

        $row[] = TestCategory::getCategoryNameForQuestion($questionId, $selected_course);

Variable "in_addA" is not in valid camel caps format
Open

    $in_addA,

Variable "from_exercise" is not in valid camel caps format
Open

    $from_exercise,

Variable "in_selected_course" is not in valid camel caps format
Open

    $getParams = "&selected_course=$in_selected_course&courseCategoryId=$in_courseCategoryId&exerciseId=$in_exercise_id&exerciseLevel=$in_exerciseLevel&answerType=$in_answerType&session_id=$in_session_id";

Variable "in_courseCategoryId" is not in valid camel caps format
Open

    $getParams = "&selected_course=$in_selected_course&courseCategoryId=$in_courseCategoryId&exerciseId=$in_exercise_id&exerciseLevel=$in_exerciseLevel&answerType=$in_answerType&session_id=$in_session_id";

Variable "from_exercise" is not in valid camel caps format
Open

                $from_exercise,

Variable "in_questionid" is not in valid camel caps format
Open

                $in_questionid,

Consider putting global function "get_question_type_for_question" in a static class
Open

function get_question_type_for_question($in_selectedcourse, $in_questionid)

Variable "in_action" is not in valid camel caps format
Open

            $res = $in_action;

Variable "old_question_obj" is not in valid camel caps format
Open

                        $old_question_obj = Question::read($questionId, $origin_course_info);

Variable "origin_course_info" is not in valid camel caps format
Open

                        $old_question_obj = Question::read($questionId, $origin_course_info);

Variable "new_answer_obj" is not in valid camel caps format
Open

                            $new_answer_obj->read();

Variable "session_select_list" is not in valid camel caps format
Open

$session_select_list = ['-1' => get_lang('Select')];

Variable "selected_course" is not in valid camel caps format
Open

if (empty($selected_course) || '-1' == $selected_course) {

Variable "exercise_list" is not in valid camel caps format
Open

$exercise_list = ExerciseLib::get_all_exercises_for_course_id(

Variable "in_questionname" is not in valid camel caps format
Open

    $in_questionname,

Variable "in_questionid" is not in valid camel caps format
Open

                "&question_copy=$in_questionid&course_id=$in_selected_course&fromExercise=$from_exercise";

Variable "in_selected_course" is not in valid camel caps format
Open

                "&question_copy=$in_questionid&course_id=$in_selected_course&fromExercise=$from_exercise";

Variable "in_questionid" is not in valid camel caps format
Open

    $question = Question::read($in_questionid, $courseInfo);

Variable "in_selectedcourse" is not in valid camel caps format
Open

function get_question_type_for_question($in_selectedcourse, $in_questionid)

Multi-line function call not indented correctly; expected 8 spaces but found 4
Open

    'answerType',

Multi-line function call not indented correctly; expected 12 spaces but found 16
Open

                $questionId,

Multi-line function call not indented correctly; expected 8 spaces but found 4
Open

    $new_question_list,

The variable $in_questionid is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $in_questionid is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $in_questionid is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $in_exerciseLevel is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $from_exercise is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $in_selectedcourse is not named in camelCase.
Open

function get_question_type_for_question($in_selectedcourse, $in_questionid)
{
    $courseInfo = api_get_course_info_by_id($in_selectedcourse);
    $question = Question::read($in_questionid, $courseInfo);
    $questionType = null;

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $in_courseCategoryId is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $in_addA is not named in camelCase.
Open

function getLinkForQuestion(
    $in_addA,
    $fromExercise,
    $questionId,
    $questionType,

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $in_selected_course is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $in_action is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $in_exercise_id is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $in_exercise_id is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $in_selected_course is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $in_questionid is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $from_exercise is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $from_exercise is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $in_action is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $in_session_id is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $in_questionid is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $in_questiontype is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $in_session_id is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $in_questionid is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $in_questionid is not named in camelCase.
Open

function get_question_type_for_question($in_selectedcourse, $in_questionid)
{
    $courseInfo = api_get_course_info_by_id($in_selectedcourse);
    $question = Question::read($in_questionid, $courseInfo);
    $questionType = null;

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

The variable $in_answerType is not named in camelCase.
Open

function get_action_icon_for_question(
    $in_action,
    $from_exercise,
    $in_questionid,
    $in_questiontype,

CamelCaseVariableName

Since: 0.2

It is considered best practice to use the camelCase notation to name variables.

Example

class ClassName {
    public function doSomething() {
        $data_module = new DataModule();
    }
}

Source

There are no issues that match your filters.

Category
Status