Skip to content

Commit

Permalink
Id dynamique comme identifiant du module assign
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanchevrier committed Oct 7, 2024
1 parent 7055812 commit ad69e9f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions classes/task/run_orphan_submissions_report_task.php
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,15 @@ public function execute() {
global $CFG, $DB, $USER;
$table = 'report_coursemanager_orphans';

$listassigns = $DB->get_records('assign', [], 'id ASC', 'id, course');
$listassigns = $DB->get_records('assign', [], 'id ASC', 'id, course');
$assignmoduleid = $DB->get_record('modules', ['name'=> 'assign'], 'id');
foreach ($listassigns as $assign) {
$sqlcontextid = 'SELECT id
FROM {course_modules}
WHERE module = 1
WHERE module = ?
AND instance = ?
';
$dbresultcontextid = $DB->get_record_sql($sqlcontextid, [$assign->id]);
$dbresultcontextid = $DB->get_record_sql($sqlcontextid, [$assignmoduleid->id, $assign->id]);
$cm = get_coursemodule_from_id('assign', $dbresultcontextid->id);
$context = \context_module::instance($cm->id);

Expand Down

0 comments on commit ad69e9f

Please sign in to comment.