Hmm, odd we only get this error if we go through the PluginModuleSubmissions::add_submission() function. And the 2 calls to this function are wrapped in a check that a group id exists.
Ah, reading the bug report again it sounds like we need to somehow differentiate the add submission when dealing with an internal group versus dealing with a 'fake' LTI group when Submissions plugin is active.
Looking at the 'lti_assessment' table there is a 'group' column we can use - so if the id of the group we are dealing with is not listed there then it's not an LTI group.
So we to change the places from:
if (PluginModuleSubmissions::is_active() && $group) { ... }
To something along the lines of:
if (PluginModuleSubmissions::is_active() && $group !group_external_group($group)) { ... }
and have a new function in lib/groups.php file:
function group_external_group($group) {
if (is_str($group)) {
$group = get_record('group', 'id', $group);
}
if (record_exists('lti_assessment', 'group', $group->id)) {
return true;
}
return false;
}
Hmm, odd we only get this error if we go through the PluginModuleSub missions: :add_submission () function. And the 2 calls to this function are wrapped in a check that a group id exists.
Ah, reading the bug report again it sounds like we need to somehow differentiate the add submission when dealing with an internal group versus dealing with a 'fake' LTI group when Submissions plugin is active.
Looking at the 'lti_assessment' table there is a 'group' column we can use - so if the id of the group we are dealing with is not listed there then it's not an LTI group.
So we to change the places from:
if (PluginModuleSu bmissions: :is_active( ) && $group) { ... }
To something along the lines of:
if (PluginModuleSu bmissions: :is_active( ) && $group !group_ external_ group($ group)) { ... }
and have a new function in lib/groups.php file:
function group_external_ group($ group) { exists( 'lti_assessment ', 'group', $group->id)) {
if (is_str($group)) {
$group = get_record('group', 'id', $group);
}
if (record_
return true;
}
return false;
}