chamilo/chamilo-lms

View on GitHub
public/main/exercise/answer.class.php

Summary

Maintainability
A
0 mins
Test Coverage

The method readOrderedBy() has an NPath complexity of 288. The configured NPath complexity threshold is 200.
Open

    public function readOrderedBy($field, $order = 'ASC')
    {
        $field = Database::escape_string($field);
        if (empty($field)) {
            $field = 'position';
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 method save() has an NPath complexity of 91413. The configured NPath complexity threshold is 200.
Open

    public function save()
    {
        $answerTable = Database::get_course_table(TABLE_QUIZ_ANSWER);
        $em = Database::getManager();
        $questionId = (int) $this->questionId;
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 method duplicate() has an NPath complexity of 3740. The configured NPath complexity threshold is 200.
Open

    public function duplicate(Question $newQuestion, $courseInfo = null)
    {
        $newQuestionId = $newQuestion->id;

        $em = Database::getManager();
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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

Avoid using undefined variables such as '$newOptionList' which will lead to PHP notices.
Open

                    $newOptionList[] = $item['iid'];
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Avoid using undefined variables such as '$newOptionList' which will lead to PHP notices.
Open

                    $fixedList[$newOptionList[$i]] = $item['iid'];
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

UndefinedVariable

Since: 2.8.0

Detects when a variable is used that has not been defined before.

Example

class Foo
{
    private function bar()
    {
        // $message is undefined
        echo $message;
    }
}

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

Missing class import via use statement (line '83', column '32').
Open

            $objExercise = new Exercise($this->course_id);
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                $this->read(); // natural order
            }
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $courseInfo = api_get_course_info();
        }
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 __construct uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            $objExercise = $exercise;
        }
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 save uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

            } else {
                // https://support.chamilo.org/issues/6558
                // function updateAnswers already escape_string, error if we do it twice.
                // Feed function updateAnswers with none escaped strings
                $this->updateAnswers(
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 duplicate uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

        } else {
            for ($i = 1; $i <= $this->nbrAnswers; $i++) {
                if ($this->course['id'] != $courseInfo['id']) {
                    $this->answer[$i] = DocumentManager::replaceUrlWithNewCourseCode(
                        $this->answer[$i],
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 save uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

                        } else {
                            $correct = $status;
                        }
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 property $new_destination is not named in camelCase.
Open

class Answer
{
    public $questionId;

    // these are arrays
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The parameter $course_id is not named in camelCase.
Open

    public function __construct($questionId, $course_id = 0, $exercise = null, $readAnswer = true)
    {
        $this->questionId = (int) $questionId;
        $this->answer = [];
        $this->correct = [];
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 property $new_correct is not named in camelCase.
Open

class Answer
{
    public $questionId;

    // these are arrays
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The property $new_nbrAnswers is not named in camelCase.
Open

class Answer
{
    public $questionId;

    // these are arrays
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The property $new_hotspot_coordinates is not named in camelCase.
Open

class Answer
{
    public $questionId;

    // these are arrays
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The property $new_answer is not named in camelCase.
Open

class Answer
{
    public $questionId;

    // these are arrays
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The property $new_hotspot_type is not named in camelCase.
Open

class Answer
{
    public $questionId;

    // these are arrays
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The property $hotspot_coordinates is not named in camelCase.
Open

class Answer
{
    public $questionId;

    // these are arrays
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The property $new_comment is not named in camelCase.
Open

class Answer
{
    public $questionId;

    // these are arrays
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The property $hotspot_type is not named in camelCase.
Open

class Answer
{
    public $questionId;

    // these are arrays
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The property $new_weighting is not named in camelCase.
Open

class Answer
{
    public $questionId;

    // these are arrays
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The property $new_position is not named in camelCase.
Open

class Answer
{
    public $questionId;

    // these are arrays
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

CamelCasePropertyName

Since: 0.2

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

Example

class ClassName {
    protected $property_name;
}

Source

The parameter $auto_id is not named in camelCase.
Open

    public function selectAnswerByAutoId($auto_id)
    {
        $table = Database::get_course_table(TABLE_QUIZ_ANSWER);
        $auto_id = (int) $auto_id;
        $sql = "SELECT iid, answer FROM $table
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $new_hotspot_type is not named in camelCase.
Open

    public function createAnswer(
        $answer,
        $correct,
        $comment,
        $weighting,
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $new_hotspot_coordinates is not named in camelCase.
Open

    public function createAnswer(
        $answer,
        $correct,
        $comment,
        $weighting,
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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

Member variable "new_weighting" is not in valid camel caps format
Open

    public $new_weighting;

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

        $this->hotspot_coordinates = [];

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

        $this->new_comment = [];

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

        $result_question = Database::query($sql);

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

                FROM $TBL_ANSWER

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

            $this->hotspot_coordinates[$i] = $object->hotspot_coordinates;

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

        return isset($this->hotspot_type[$id]) ? $this->hotspot_type[$id] : null;

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

        $this->new_answer[$id] = $answer;

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

        $this->new_correct = [];

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

        $doubt_data = null;

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

    public function selectAnswerByAutoId($auto_id)

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

        $new_hotspot_coordinates = null,

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

        $new_hotspot_type = null,

Member variable "new_correct" is not in valid camel caps format
Open

    public $new_correct;

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

            $courseInfo = api_get_course_info_by_id($course_id);

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

        $questionType = Database::fetch_array($result_question);

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

            $this->hotspot_coordinates[$i] = $object->hotspot_coordinates;

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

        if (UNIQUE_ANSWER_NO_OPTION == $questionType['type'] && !empty($doubt_data)) {

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

        $this->new_nbrAnswers++;

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

        $this->new_hotspot_coordinates[$id] = $new_hotspot_coordinates;

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

        $this->new_hotspot_type[$id] = $new_hotspot_type;

Member variable "new_comment" is not in valid camel caps format
Open

    public $new_comment;

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

            if ('1' == $objExercise->random_answers && CALCULATED_ANSWER != $this->getQuestionType()) {

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

            $this->iid[$i] = $doubt_data->iid;

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

                    'hotspot_type' => $this->hotspot_type[$i],

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

        $this->new_hotspot_coordinates = [];

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

        $this->new_hotspot_type = [];

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

            $this->hotspot_coordinates[$i] = $object->hotspot_coordinates;

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

        $this->new_correct[$id] = $correct;

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

        $this->new_weighting[$id] = $weighting;

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

        $this->new_destination[$id] = $destination;

Member variable "new_hotspot_coordinates" is not in valid camel caps format
Open

    public $new_hotspot_coordinates;

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

        $this->course_id = $courseInfo['real_id'];

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

        $TBL_ANSWER = Database::get_course_table(TABLE_QUIZ_ANSWER);

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

            $this->hotspot_type[$i] = $object->hotspot_type;

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

            $this->hotspot_coordinates[$i] = isset($object->hotspot_coordinates) ? $object->hotspot_coordinates : 0;

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

            $this->hotspot_coordinates[$i] = isset($object->hotspot_coordinates) ? $object->hotspot_coordinates : 0;

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

            $this->comment[$i] = $doubt_data->comment;

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

        $auto_id = (int) $auto_id;

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

        $TBL_QUIZ = Database::get_course_table(TABLE_QUIZ_QUESTION);

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

            $this->hotspot_coordinates[$i] = isset($object->hotspot_coordinates) ? $object->hotspot_coordinates : 0;

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

            $this->hotspot_type[$i] = isset($object->hotspot_type) ? $object->hotspot_type : 0;

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

        return isset($this->hotspot_coordinates[$id]) ? $this->hotspot_coordinates[$id] : null;

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

        $id = $this->new_nbrAnswers;

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

        if (!empty($course_id)) {

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

        $this->new_answer = [];

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

        $this->new_nbrAnswers = 0;

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

        return isset($this->hotspot_type[$id]) ? $this->hotspot_type[$id] : null;

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

        $this->new_hotspot_type[$id] = $new_hotspot_type;

Member variable "new_position" is not in valid camel caps format
Open

    public $new_position;

Member variable "new_hotspot_type" is not in valid camel caps format
Open

    public $new_hotspot_type;

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

        $this->hotspot_type = [];

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

        $this->new_position[$id] = $position;

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

        $this->new_hotspot_coordinates[$id] = $new_hotspot_coordinates;

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

        for ($i = 1; $i <= $this->new_nbrAnswers; $i++) {

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

            $answer = (string) $this->new_answer[$i];

Member variable "hotspot_coordinates" is not in valid camel caps format
Open

    public $hotspot_coordinates;

Member variable "new_nbrAnswers" is not in valid camel caps format
Open

    public $new_nbrAnswers;

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

            $this->hotspot_type[$i] = isset($object->hotspot_type) ? $object->hotspot_type : 0;

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

        return isset($this->hotspot_coordinates[$id]) ? $this->hotspot_coordinates[$id] : null;

Member variable "hotspot_type" is not in valid camel caps format
Open

    public $hotspot_type;

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

        $sql = "SELECT type FROM $TBL_QUIZ

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

            $this->destination[$i] = $doubt_data->destination;

Member variable "new_answer" is not in valid camel caps format
Open

    public $new_answer;

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

        $this->new_weighting = [];

Member variable "new_destination" is not in valid camel caps format
Open

    public $new_destination; // id of the next question if feedback option is set to Directfeedback

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

        $this->new_destination = [];

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

            $this->hotspot_type[$i] = $object->hotspot_type;

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

            $this->hotspot_type[$i] = $object->hotspot_type;

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

            $this->hotspot_type[$i] = isset($object->hotspot_type) ? $object->hotspot_type : 0;

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

            $this->answer[$i] = $doubt_data->answer;

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

            $this->weighting[$i] = $doubt_data->ponderation;

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

                WHERE iid='$auto_id'";

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

    public function __construct($questionId, $course_id = 0, $exercise = null, $readAnswer = true)

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

                $doubt_data = $object;

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

            $this->hotspot_type[$i] = $object->hotspot_type;

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

            $this->correct[$i] = $doubt_data->correct;

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

                    'hotspot_coord' => $this->hotspot_coordinates[$i],

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

            $objExercise = new Exercise($this->course_id);

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

        $this->new_position = [];

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

            $this->hotspot_coordinates[$i] = $object->hotspot_coordinates;

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

            $this->position[$i] = $doubt_data->position;

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

            $this->autoId[$i] = $doubt_data->iid;

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

        $auto_id = (int) $auto_id;

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

        $this->new_comment[$id] = $comment;

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

            $correct = isset($this->new_correct[$i]) ? (int) $this->new_correct[$i] : null;

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

        $this->hotspot_coordinates = $this->new_hotspot_coordinates;

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

            $position = isset($this->new_position[$i]) ? $this->new_position[$i] : null;

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

                    $this->new_weighting[$i],

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

                    $this->new_position[$i],

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

        $this->destination = $this->new_destination;

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

                    $this->new_correct[$i],

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

                foreach ($this->new_correct as $value => $status) {

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

                foreach ($this->new_correct as $value => $status) {

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

            $hotspot_coordinates = isset($this->new_hotspot_coordinates[$i]) ? $this->new_hotspot_coordinates[$i] : null;

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

                    'hotspot_coordinates' => $this->hotspot_coordinates[$i],

Doc comment for parameter $courseInfo does not match actual variable name $newQuestion
Open

     * @param null $courseInfo destination course info (result of the function api_get_course_info() )

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

            $position = isset($this->new_position[$i]) ? $this->new_position[$i] : null;

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

            $destination = isset($this->new_destination[$i]) ? $this->new_destination[$i] : null;

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

            $destination = isset($this->new_destination[$i]) ? $this->new_destination[$i] : null;

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

                    ->setHotspotCoordinates($hotspot_coordinates)

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

                    $this->new_destination[$i],

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

        if (count($this->position) > $this->new_nbrAnswers) {

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

        $this->correct = $this->new_correct;

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

        $this->comment = $this->new_comment;

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

        $this->nbrAnswers = $this->new_nbrAnswers;

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

            $hotspot_type = isset($this->new_hotspot_type[$i]) ? $this->new_hotspot_type[$i] : null;

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

            $weighting = isset($this->new_weighting[$i]) ? (float) $this->new_weighting[$i] : null;

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

            $i = $this->new_nbrAnswers + 1;

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

        $this->position = $this->new_position;

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

            $correct = isset($this->new_correct[$i]) ? (int) $this->new_correct[$i] : null;

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

            $hotspot_type = isset($this->new_hotspot_type[$i]) ? $this->new_hotspot_type[$i] : null;

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

            $hotspot_type = isset($this->new_hotspot_type[$i]) ? $this->new_hotspot_type[$i] : null;

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

                    $this->new_answer[$i],

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

                    ->setHotspotCoordinates($this->hotspot_coordinates[$i])

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

                    ->setHotspotType($this->hotspot_type[$i])

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

            $comment = isset($this->new_comment[$i]) ? $this->new_comment[$i] : null;

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

        $this->hotspot_type = $this->new_hotspot_type;

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

            $weighting = isset($this->new_weighting[$i]) ? (float) $this->new_weighting[$i] : null;

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

            $hotspot_coordinates = isset($this->new_hotspot_coordinates[$i]) ? $this->new_hotspot_coordinates[$i] : null;

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

                    ->setHotspotType($hotspot_type)

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

        $this->hotspot_coordinates = $this->new_hotspot_coordinates;

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

        $this->hotspot_type = $this->new_hotspot_type;

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

                    $this->new_comment[$i],

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

                    'hotspot_type' => $this->hotspot_type[$i],

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

            $hotspot_coordinates = isset($this->new_hotspot_coordinates[$i]) ? $this->new_hotspot_coordinates[$i] : null;

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

                    $this->new_hotspot_coordinates[$i],

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

        $this->answer = $this->new_answer;

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

            $comment = isset($this->new_comment[$i]) ? $this->new_comment[$i] : null;

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

                    $this->new_hotspot_type[$i]

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

        $this->weighting = $this->new_weighting;

The variable $result_question is not named in camelCase.
Open

    public function readOrderedBy($field, $order = 'ASC')
    {
        $field = Database::escape_string($field);
        if (empty($field)) {
            $field = 'position';
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $result_question is not named in camelCase.
Open

    public function readOrderedBy($field, $order = 'ASC')
    {
        $field = Database::escape_string($field);
        if (empty($field)) {
            $field = 'position';
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $course_id is not named in camelCase.
Open

    public function __construct($questionId, $course_id = 0, $exercise = null, $readAnswer = true)
    {
        $this->questionId = (int) $questionId;
        $this->answer = [];
        $this->correct = [];
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $TBL_ANSWER is not named in camelCase.
Open

    public function readOrderedBy($field, $order = 'ASC')
    {
        $field = Database::escape_string($field);
        if (empty($field)) {
            $field = 'position';
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $TBL_QUIZ is not named in camelCase.
Open

    public function readOrderedBy($field, $order = 'ASC')
    {
        $field = Database::escape_string($field);
        if (empty($field)) {
            $field = 'position';
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $doubt_data is not named in camelCase.
Open

    public function readOrderedBy($field, $order = 'ASC')
    {
        $field = Database::escape_string($field);
        if (empty($field)) {
            $field = 'position';
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $course_id is not named in camelCase.
Open

    public function __construct($questionId, $course_id = 0, $exercise = null, $readAnswer = true)
    {
        $this->questionId = (int) $questionId;
        $this->answer = [];
        $this->correct = [];
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $TBL_ANSWER is not named in camelCase.
Open

    public function readOrderedBy($field, $order = 'ASC')
    {
        $field = Database::escape_string($field);
        if (empty($field)) {
            $field = 'position';
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $TBL_QUIZ is not named in camelCase.
Open

    public function readOrderedBy($field, $order = 'ASC')
    {
        $field = Database::escape_string($field);
        if (empty($field)) {
            $field = 'position';
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $new_hotspot_coordinates is not named in camelCase.
Open

    public function createAnswer(
        $answer,
        $correct,
        $comment,
        $weighting,
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $doubt_data is not named in camelCase.
Open

    public function readOrderedBy($field, $order = 'ASC')
    {
        $field = Database::escape_string($field);
        if (empty($field)) {
            $field = 'position';
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $auto_id is not named in camelCase.
Open

    public function selectAnswerByAutoId($auto_id)
    {
        $table = Database::get_course_table(TABLE_QUIZ_ANSWER);
        $auto_id = (int) $auto_id;
        $sql = "SELECT iid, answer FROM $table
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $auto_id is not named in camelCase.
Open

    public function selectAnswerByAutoId($auto_id)
    {
        $table = Database::get_course_table(TABLE_QUIZ_ANSWER);
        $auto_id = (int) $auto_id;
        $sql = "SELECT iid, answer FROM $table
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $doubt_data is not named in camelCase.
Open

    public function readOrderedBy($field, $order = 'ASC')
    {
        $field = Database::escape_string($field);
        if (empty($field)) {
            $field = 'position';
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $auto_id is not named in camelCase.
Open

    public function selectAnswerByAutoId($auto_id)
    {
        $table = Database::get_course_table(TABLE_QUIZ_ANSWER);
        $auto_id = (int) $auto_id;
        $sql = "SELECT iid, answer FROM $table
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $new_hotspot_type is not named in camelCase.
Open

    public function createAnswer(
        $answer,
        $correct,
        $comment,
        $weighting,
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $hotspot_coordinates is not named in camelCase.
Open

    public function save()
    {
        $answerTable = Database::get_course_table(TABLE_QUIZ_ANSWER);
        $em = Database::getManager();
        $questionId = (int) $this->questionId;
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $doubt_data is not named in camelCase.
Open

    public function readOrderedBy($field, $order = 'ASC')
    {
        $field = Database::escape_string($field);
        if (empty($field)) {
            $field = 'position';
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $doubt_data is not named in camelCase.
Open

    public function readOrderedBy($field, $order = 'ASC')
    {
        $field = Database::escape_string($field);
        if (empty($field)) {
            $field = 'position';
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $doubt_data is not named in camelCase.
Open

    public function readOrderedBy($field, $order = 'ASC')
    {
        $field = Database::escape_string($field);
        if (empty($field)) {
            $field = 'position';
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $doubt_data is not named in camelCase.
Open

    public function readOrderedBy($field, $order = 'ASC')
    {
        $field = Database::escape_string($field);
        if (empty($field)) {
            $field = 'position';
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $hotspot_type is not named in camelCase.
Open

    public function save()
    {
        $answerTable = Database::get_course_table(TABLE_QUIZ_ANSWER);
        $em = Database::getManager();
        $questionId = (int) $this->questionId;
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $doubt_data is not named in camelCase.
Open

    public function readOrderedBy($field, $order = 'ASC')
    {
        $field = Database::escape_string($field);
        if (empty($field)) {
            $field = 'position';
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $doubt_data is not named in camelCase.
Open

    public function readOrderedBy($field, $order = 'ASC')
    {
        $field = Database::escape_string($field);
        if (empty($field)) {
            $field = 'position';
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $doubt_data is not named in camelCase.
Open

    public function readOrderedBy($field, $order = 'ASC')
    {
        $field = Database::escape_string($field);
        if (empty($field)) {
            $field = 'position';
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $doubt_data is not named in camelCase.
Open

    public function readOrderedBy($field, $order = 'ASC')
    {
        $field = Database::escape_string($field);
        if (empty($field)) {
            $field = 'position';
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $hotspot_type is not named in camelCase.
Open

    public function save()
    {
        $answerTable = Database::get_course_table(TABLE_QUIZ_ANSWER);
        $em = Database::getManager();
        $questionId = (int) $this->questionId;
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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 $hotspot_coordinates is not named in camelCase.
Open

    public function save()
    {
        $answerTable = Database::get_course_table(TABLE_QUIZ_ANSWER);
        $em = Database::getManager();
        $questionId = (int) $this->questionId;
Severity: Minor
Found in public/main/exercise/answer.class.php by phpmd

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