AdaptiveQuiz partially correct it is seen as correct.

AdaptiveQuiz partially correct it is seen as correct.

by Seth Mengal -
Number of replies: 16

Hi


https://github.com/middlebury/moodle-mod_adaptivequiz/blob/921db48834d5c2399a3a0d7aea74ba93ab64b79a/adaptiveattempt.class.php#L621


     * This function determins whether the user answered the question correctly or incorrectly.
     * If the answer is partially correct it is seen as correct.
     * @param quesiton_usage_by_activity $quba an object loaded with the unique id of the attempt
     * @param int $slotid the slot id of the question
     * @return float a float representing the user's mark.  Or null if there was no mark
     */
    public function get_question_mark($quba, $slotid) {
        $mark = $quba->get_question_mark($slotid);

        if (is_float($mark)) {
            return $mark;
        }

        $this->print_debug('get_question_mark() - Question mark was not a float slot id: '.$slotid.'.  Returning zero');
        return 0;
    }

Can somebody help me out, to make this partially correct as incorrect? Even if one of the cloze answer is solved, it marks it correct and moves to a higher difficulty level

Average of ratings: -
In reply to Seth Mengal

Re: AdaptiveQuiz partially correct it is seen as correct.

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
Your question asks about question states (correct/incorrect), but you are referring to a funcition that is to do with marks.

And, you don't tell us anything about what you are really trying to do (from an educational point of view).

So, you need to give us more information before we can possibly help you.
In reply to Tim Hunt

Re: AdaptiveQuiz partially correct it is seen as correct.

by Seth Mengal -

Hi Tim.

So basicly, its an adaptive assesment where if you correctly answer you move to a more difficult question and if you answer it wrong you go to a lower level of difficulty how adaptivequiz works.


But the problem here is in cloze type of question, even if a student gives one correct answer, it proceeds and gives the result as a right and gives the higher difficulty question which should'nt be the case.


In the adaptivequiz code, it says there as i mentioned that partial correct is treated as correct. I want to reverse that, to partial correct treats as incorrect or gives correct if 75% score or above. But even partial correct treating as incorrect would do the trick.

We are using to test the skills of our students skills, to determine how they perform by adaptive levels.


Thanks. smile

In reply to Seth Mengal

Re: AdaptiveQuiz partially correct it is seen as correct.

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I don't know anything about this module. However, I just had a quick look at the code, and the change you want seems easy to make here: https://github.com/middlebury/moodle-mod_adaptivequiz/blob/921db48834d5c2399a3a0d7aea74ba93ab64b79a/catalgo.class.php#L297

In reply to Tim Hunt

Re: AdaptiveQuiz partially correct it is seen as correct.

by Seth Mengal -

Hi Tim,

Thanks for looking at it, its a rare module it seems hardly people have worked on it. I looked at line 297, is this for the cloze type of answers? I make it false for partialcorrect to be treated as a wrong


Am i right?

In reply to Seth Mengal

Re: AdaptiveQuiz partially correct it is seen as correct.

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I hope you looked at the whole method, not just the one line of code. And where that method was called from.

In reply to Seth Mengal

Re: AdaptiveQuiz partially correct it is seen as correct.

by Seth Mengal -
In reply to Seth Mengal

Re: AdaptiveQuiz partially correct it is seen as correct.

by Seth Mengal -

https://github.com/moodle/moodle/blob/95751e81ac32bdea938cc8423c7f11eb1da3bee3/question/type/multianswer/question.php#L244


Here i edited

return question_state::$gradedpartial;
}
}

gradepartial to gradedwrong

It shows incorrect now on adaptivequiz but still marks it Right and proceeds to a higher level of question.



But marks it correct on adaptivequiz and proceeds to a higher difficulty


In reply to Seth Mengal

Re: AdaptiveQuiz partially correct it is seen as correct.

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

I did not see any evidence that mod_adaptive quiz looked at the question state. It seems to just look at the mark. I don't think you should change how questions (== resuable components) work just to make a small change in bahaviour in adaptive quiz.

In reply to Tim Hunt

Re: AdaptiveQuiz partially correct it is seen as correct.

by Seth Mengal -
Yeah true Tim. But i can't find where i can edit the behavior of the adaptive quiz. Can you guide me a bit more? As you indicated before 


// Return true if the question was marked correct.
if ((float) 0 < $mark) {
// Increment questions attempted.
$this->questattempted++;
return true;
}
// Increment questions attempted.
$this->questattempted++;
return false;

If i choose cloze, with 4 options, the grades are out of 4, and one being correct makes the score 1/4, making it more then 0 and hence a right option for the adaptive.

In reply to Seth Mengal

Re: AdaptiveQuiz partially correct it is seen as correct.

by Seth Mengal -

I am sadly getting no response from either adaptivequiz github nor RemoteLearner in this regard.

In reply to Seth Mengal

Re: AdaptiveQuiz partially correct it is seen as correct.

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Ah yes. That is a key point which is explained in the docs here: https://docs.moodle.org/dev/Overview_of_the_Moodle_question_engine#A_note_about_scores

The mod_adaptivemode code seems to spend a lot of unnecessary effort checking whether the mark is null or not. It is pretty simple. If the question has not been graded yet, the mark is null. Once it has been graded it is a number.

Anyway, if you switch from mark to fraction, then you get a score that is between 0 and 1.

$quba->get_question_fraction($slot)

Basically Mark = Fraction * [Max mark]

In reply to Tim Hunt

Re: AdaptiveQuiz partially correct it is seen as correct.

by Seth Mengal -

So, if i am not wrong i should replace 

$quba->get_question_mark($slotid) to $quba->get_question_fraction($slotid); 

wherever i find the get_question_mark

https://github.com/middlebury/moodle-mod_adaptivequiz/search?utf8=%E2%9C%93&q=%24quba-%3Eget_question_mark&type=Code

In reply to Seth Mengal

Re: AdaptiveQuiz partially correct it is seen as correct.

by Seth Mengal -

I edited two files adaptiveattempt.class.php and catalgo.class.php


    /**

     * This function determins whether the user answered the question correctly or incorrectly.

     * If the answer is partially correct it is seen as correct.

     * @param quesiton_usage_by_activity $quba an object loaded using the unique id of the attempt

     * @param int $slotid the slot id of the question

     * @return float|null a float representing the user's mark.  Or null if there was no mark

     */

    public function get_question_mark($quba, $slotid) {

        $mark = $quba->get_question_fraction($slotid);


        if (is_float($mark)) {

            return $mark;

        }


        $this->print_debug('get_question_mark() - Question mark was not a float slot id: '.$slotid);

        return null;

    }


But sadly no change, i think i am missing something.

In reply to Tim Hunt

Re: AdaptiveQuiz partially correct it is seen as correct.

by Seth Mengal -
I edited line number 305 of adaptiveassement class


from             if ($this->quba->get_question_mark($this->slot) > 0) {

to             if ($this->quba->get_question_fraction($this->slot) > 0.9) {


Seems to do the trick smile And i also changed renderer.php to show the right marks on calculation table too.

In reply to Seth Mengal

Re: AdaptiveQuiz partially correct it is seen as correct.

by Seth Mengal -

Ouch Tim!


I changed that, now my other questions which are not cloze, multiple answer are giving me an error sad