ndunand / moodle-qtype_matrix

Source code of https://moodle.org/plugins/qtype_matrix
2 stars 10 forks source link

Cannot select qtype_matrix in StudentQuiz #66

Closed a-kempka closed 5 months ago

a-kempka commented 7 months ago

Using Studentquiz I can't select matrix as a question type, which is a pity as it's a great question type for this scenario. Other question types (core or plugin) can be selected. In StudentQuiz settings (studentquiz | defaultqtypes) the question type qtype_matrix is missing.

In https://github.com/ndunand/moodle-qtype_matrix/blob/master/questiontype.php line 78 I see that qtype_matrix declares itself as manually graded:

    /**
     * @return boolean true if this question type sometimes requires manual grading.
     */
    public function is_manual_graded(): bool {
        return true;
    }

StudentQuiz filters out questions that are manually graded: ( see https://github.com/search?q=repo%3Astudentquiz%2Fmoodle-mod_studentquiz%20%20is_manual_graded&type=code https://github.com/studentquiz/moodle-mod_studentquiz/blob/887755224001e676cd21da7c1aa21c94edaa3a16/locallib.php#L676)

    // Filter out question types which can't be graded automatically.
    foreach ($types as $name => $qtype) {
        if (!$qtype->is_real_question_type() || $qtype->is_manual_graded()) {
            unset($types[$name]);
        }
    }

Is there any reason why matrix questions are declared as manual_graded?

NicoAlexH commented 5 months ago

Fixed by #68, thank you @a-kempka !