Commit 82c6ff75 authored by Myriam Delaruelle's avatar Myriam Delaruelle
Browse files

fix doublons matrice

parent f161cd61
......@@ -80,7 +80,7 @@
foreach($value[0] as $activity){
$is_insert = $moduleI->add_matrix_module($activity['id'], $activity['section_id']);
if (!$is_insert) {
$resultInsert.=" ".$activity->id.",";
$resultInsert.=" ".$activity['id'].",";
$errorInsert=true;
}
......
......@@ -166,12 +166,16 @@ class block_competency_iena_module {
$record = new stdClass();
$record->cmid=$cmid;
$record->sectionid=$sectionid;
try {
$exists=$DB->get_records('block_competency_iena', array('cmid'=>$record->cmid, 'sectionid'=>$record->sectionid));
var_dump($exists);
if(!$exists){
try {
$DB->insert_record('block_competency_iena', $record, false);
} catch (dml_exception $e) {
} catch (dml_exception $e) {
}
return true;
}
return true;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment