middlebury/moodle-mod_adaptivequiz

Adaptive Quiz: Fix unit test failures

Closed this issue · 2 comments

cg923 commented

Hi Adam my name is Derek Henderson, and I work for remote learner. Part of my job is to evaluate plugins for newer versions of Moodle, and I was noticing that your Adaptive Quiz plugin fails a unit test in M30, and M31.

The details are below..

Just wondering if you are going to issuing a fix at any time - or if there is something that I am doing wrong with the tests etc.

The unit test failures look minor - like something is not being reset in the database...

Cheers

Derek Henderson
vendor/bin/phpunit mod_adaptivequiz_locallib_testcase mod/adaptivequiz/tests/locallib_test.php

  1. mod_adaptivequiz_locallib_testcase::test_adaptivequiz_complete_attempt
    dml_write_exception: Error writing to database (Duplicate entry '16' for key 'PRIMARY'
    INSERT INTO phpu2_context (id,contextlevel,instanceid,path,depth) VALUES(?,?,?,?,?)
    [array (
    0 => '16',
    1 => '50',
    2 => '2',
    3 => '/1/3/16',
    4 => '3',
    )])

/var/www/html/m31/lib/dml/moodle_database.php:446
/var/www/html/m31/lib/dml/mysqli_native_moodle_database.php:1164
/var/www/html/m31/lib/dml/mysqli_native_moodle_database.php:1353
/var/www/html/m31/lib/phpunit/classes/advanced_testcase.php:219
/var/www/html/m31/mod/adaptivequiz/tests/locallib_test.php:64
/var/www/html/m31/mod/adaptivequiz/tests/locallib_test.php:275
/var/www/html/m31/lib/phpunit/classes/advanced_testcase.php:80

To re-run:
vendor/bin/phpunit mod_adaptivequiz_locallib_testcase mod/adaptivequiz/tests/locallib_test.php

  1. mod_adaptivequiz_locallib_testcase::test_adaptivequiz_min_attempts_reached
    dml_write_exception: Error writing to database (Duplicate entry '16' for key 'PRIMARY'
    INSERT INTO phpu2_context (id,contextlevel,instanceid,path,depth) VALUES(?,?,?,?,?)
    [array (
    0 => '16',
    1 => '50',
    2 => '2',
    3 => '/1/3/16',
    4 => '3',
    )])

/var/www/html/m31/lib/dml/moodle_database.php:446
/var/www/html/m31/lib/dml/mysqli_native_moodle_database.php:1164
/var/www/html/m31/lib/dml/mysqli_native_moodle_database.php:1353
/var/www/html/m31/lib/phpunit/classes/advanced_testcase.php:219
/var/www/html/m31/mod/adaptivequiz/tests/locallib_test.php:64
/var/www/html/m31/mod/adaptivequiz/tests/locallib_test.php:293
/var/www/html/m31/lib/phpunit/classes/advanced_testcase.php:80

Hello everyone,
I hope you are all doing well!
Let me first introduce myself: my name is Khalid KABCHI, Moroccan and I am preparing a thesis about adaptive testing (specifically in physics).
I plan to create an adaptive test but I find huge difficulties in this sense.
For that can you help me to create my own adaptive test?

Thank you for submitting this issue. This repository is now archived: The sponsor of this plugin, Middlebury College, is no longer using Moodle. Development is continuing on other forks of the project. See https://moodle.org/plugins/mod_adaptivequiz for more information and latest releases.