Skip to content

Coding problem: Unsupported modification of PAGE->context #261

Open
@AnupamaSarjoshi

Description

@AnupamaSarjoshi

Hi @trampgeek,

When we run the coderunner bulk tests, we are seeing some of the below errors.
We are currently using the coderunner version 2025052100, adaptive_adapted_for_coderunner version 2025012500 and Moodle version M4.5.5

These errors are thrown for the coderunner questions which are in the quiz default category. I did try purging the coderunner_grading_cache, but that didn't help. To reproduce,

  • We can create a quiz and one or more coderunner questions in the quiz default category.
  • Turn on the debugging to see the errors
  • Then when we run the bulktestall, the errors are displayed.

Errors:
Coding problem: unsupported modification of PAGE->context from 70 to 70
line 1210 of /lib/pagelib.php: call to debugging()
line 78 of /question/type/coderunner/bulktestall.php: call to moodle_page->set_context()

Coding problem: unsupported modification of PAGE->context from 70 to 50
line 1210 of /lib/pagelib.php: call to debugging()
line 78 of /question/type/coderunner/bulktestall.php: call to moodle_page->set_context()

Looks like the below code in bulktestall.php, is causing the issue.
$PAGE->set_context($testcontext); // Helps grading cache pickup right course id.

Could you please help with the issue? Kindly let me know if I can provide with any more details.

Thanks,
Anupama

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions