Giter Site home page Giter Site logo

moodle-local_deleteoldquizattempts's Issues

Hi, i have error while cli command, how can I fix it

Hi, i have error while cli command, how can I fix it
Default exception handler: Не знайдено запис в таблиці бази даних context. Debug: SELECT * FROM {context} WHERE id = ?
[array (
0 => '153809',
)]
Error code: invalidrecord

line 1562 of /lib/dml/moodle_database.php: dml_missing_record_exception thrown
line 1538 of /lib/dml/moodle_database.php: call to moodle_database->get_record_select()
line 5213 of /lib/accesslib.php: call to moodle_database->get_record()
line 5602 of /lib/accesslib.php: call to context::instance_by_id()
line 7128 of /lib/accesslib.php: call to context->get_parent_context()
line 232 of /lib/classes/event/base.php: call to context_module->get_course_context()
line 436 of /mod/quiz/locallib.php: call to core\event\base::create()
line 60 of /local/deleteoldquizattempts/classes/helper.php: call to quiz_delete_attempt()
line 228 of /local/deleteoldquizattempts/classes/helper.php: call to local_deleteoldquizattempts\helper->delete_attempts()
line 52 of /local/deleteoldquizattempts/cli/delete_attempts.php: call to local_deleteoldquizattempts\helper->delete_attempts_cli_handler()

Prepare for phpunit 10

The at() matcher has been deprecated. It will be removed in PHPUnit 10. Please refactor your test to not rely on the order in which methods are invoked.

$ vendor/bin/phpunit --colors
Moodle 3.11 (Build: 20210517), a9d942ff42f7485ba38af794087cf35ba3a24818
Php: 7.4.3, pgsql: 12.6 
PHPUnit 9.5.2 by Sebastian Bergmann and contributors.

There were 4 warnings:
1) local_deleteoldquizattempts_locallib_testcase::test_delete_attempts_with_timelimit
2) local_deleteoldquizattempts_locallib_testcase::test_delete_attempts_with_quizid
3) local_deleteoldquizattempts_locallib_testcase::test_delete_attempts_with_courseid
4) local_deleteoldquizattempts_delete_questions_testcase::test_delete_questions_with_timelimit

Unknown column 'hidden' in 'where clause'

Hi,
I am getting following debug information when attempting to delete ..
`Execute scheduled task: Old quiz and question attempts deletion (local_deleteoldquizattempts\task\delete_attempts_task)
... started 18:20:01. Current memory use 20.7 MB.
Deleted 0 quiz attempts.
... used 2 dbqueries
... used 0.036534070968628 seconds
Scheduled task failed: Old quiz and question attempts deletion (local_deleteoldquizattempts\task\delete_attempts_task),Error reading from database
Debug info:
Unknown column 'hidden' in 'where clause'
SELECT * FROM mdl_question WHERE
hidden = ?
AND NOT EXISTS (
SELECT 1
FROM mdl_question_attempts
WHERE mdl_question_attempts.questionid = mdl_question.id
)
AND NOT EXISTS (
SELECT 1
FROM mdl_quiz_slots
WHERE mdl_quiz_slots.questionid = mdl_question.id
)
[array (
0 => 1,
)]
Backtrace:

  • line 1212 of /lib/dml/mysqli_native_moodle_database.php: call to moodle_database->query_end()
  • line 1394 of /lib/dml/moodle_database.php: call to mysqli_native_moodle_database->get_recordset_sql()
  • line 132 of /local/deleteoldquizattempts/classes/helper.php: call to moodle_database->get_recordset_select()
  • line 184 of /local/deleteoldquizattempts/classes/helper.php: call to local_deleteoldquizattempts\helper->delete_unused_questions()
  • line 55 of /local/deleteoldquizattempts/classes/task/delete_attempts_task.php: call to local_deleteoldquizattempts\helper->task_handler()
  • line 253 of /lib/cronlib.php: call to local_deleteoldquizattempts\task\delete_attempts_task->execute()
  • line 120 of /lib/cronlib.php: call to cron_run_inner_scheduled_task()
  • line 73 of /lib/cronlib.php: call to cron_run_scheduled_tasks()
  • line 178 of /admin/cli/cron.php: call to cron_run()
    `

Quizid as a parameter

Hi,

could you upgrade this plugin to have a possibility to give quizid as a parameter? We have just few quizzes where we would like to delete quiz attempts.

thanks and bye

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.