-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Math delimiters fix doesn't work for Quiz categories #322
Comments
any idea @timhunt |
Not sure. I imagine that this fix script was based on the replacedollars.php script that I wrote ages ago. Yes, it is the same script: https://github.com/maths/moodle-qtype_stack/blob/master/replacedollars.php. My memory is that worked for quiz contexts, but this is years ago, so I would not trust my recollection. Please can you turn up Moodle's Debugging setting to DEVELOPER level, so we get a full stack trace? |
Hello, here is the error with Developer-level debugging; Notice: Trying to get property of non-object in /var/www/moodle/xxx/lib/navigationlib.php on line 1219 Debug info: Stack trace: line 1023 of /lib/pagelib.php: coding_exception thrown |
The strange thing is that this line: https://github.com/maths/moodle-qtype_stack/blob/master/replacedollars.php#L40 should have already set the right cm indirectly. Then, for some reason, this line: https://github.com/maths/moodle-qtype_stack/blob/master/replacedollars.php#L56 is interectly causing it to get set to something different. Will need some debugging to work out why, based on the stack trace, and I don't have time today. |
Ok, thanks for the help. I will be waiting for the fix (I'm not a coder myself) |
I finally got around to looking at this, and have done a pull request to add the same fix that was used in bulktest.php. |
Fix replacedollars script for quiz contexts #322
Hello,
We cannot fix math delimiters on a course that has STACK-questions directly in/under Quiz categorybank. If they are in courses questionbank the fix works fine.
Stack version tested with; 4.0.1 (2017082400) & 3.5.7 (2017060600) & Moodle versions 3.1
When trying to fix delimites we get an error;
Coding error detected, it must be fixed by a programmer: The course you passed to $PAGE->set_cm does not correspond to the $cm.
`[:error] [pid 31117] [client 109.70.166.98:53474] Default exception handler: Koodivirhe havaittu, ohjelmoijan pit\xc3\xa4\xc3\xa4 korjata se: The course you passed to $PAGE->set_cm does not correspond to the $cm.
Debug: \nError code: codingerror\n* line 1023 of /lib/pagelib.php: coding_exception thrown\n*
line 4033 of /lib/navigationlib.php: call to moodle_page->set_cm()\n*
line 3537 of /lib/navigationlib.php: call to settings_navigation->load_module_settings()\n*
line 724 of /lib/pagelib.php: call to settings_navigation->initialise()\n*
line 773 of /lib/pagelib.php: call to moodle_page->magic_get_settingsnav()\n*
line 3145 of /lib/navigationlib.php: call to moodle_page->__get()\n*
line 3189 of /lib/navigationlib.php: call to navbar->has_items()\n*
line 55 of /theme/bootstrapbase/renderers/core_renderer.php: call to navbar->get_items()\n*
line 42 of /theme/herald/layout/columns1.php: call to theme_bootstrapbase_core_renderer->navbar()\n* line 1028 of /lib/outputrenderers.php: call to include()\n*
line 958 of /lib/outputrenderers.php: call to core_renderer->render_page_layout()\n*
line 1831 of /lib/setuplib.php: call to core_renderer->header()\n*
line 56 of /question/type/stack/replacedollars.php: call to bootstrap_renderer->__call()\n, referer: https://xxxx/question/type/stack/replacedollarsindex.php
Images;
The text was updated successfully, but these errors were encountered: