Commit 8fb2c1e0 authored by Myriam Delaruelle's avatar Myriam Delaruelle
Browse files

fix timestamps course shortname

parent 9b80772d
......@@ -197,7 +197,6 @@ class block_mahara_iena_connexion
$course_name=block_mahara_iena_getCourseName($COURSE->shortname);
var_dump($course_name);
$group = new stdClass();
$group->name = get_string('course_group', 'block_mahara_iena') . " " . $course_name . " – " . $mo_group_name;
$group->description = get_string('course_group', 'block_mahara_iena') . " " . $course_name . " – " . $mo_group_name;
......
......@@ -8,9 +8,9 @@ function block_mahara_iena_isValidTimeStamp($timestamp)
function block_mahara_iena_getCourseName($coursename){
$course_name=$coursename;
$isTimeStamp=substr($coursename, -1, 11);
$isTimeStamp=substr($coursename, -10);
if(block_mahara_iena_isValidTimeStamp($isTimeStamp)){
$course_name=substr($coursename, -11);
$course_name=substr($coursename, 0, strlen($coursename)-12);
}
return $course_name;
......
......@@ -32,7 +32,7 @@ $course_ctx = context_course::instance($course->id);
$students = get_enrolled_users($course_ctx);
$usersTab = array();
$course_name=block_mahara_iena_getCourseName($COURSE->shortname);
//Here we check by email, if the student have the same email into mahara and moodle he is add to group
if (count($students) == 0) {
......
......@@ -76,7 +76,6 @@ if (count($students) == 0) {
}
$course_name=block_mahara_iena_getCourseName($COURSE->shortname);
var_dump($course_name);
array_push($mahara_groups, array(
'name' =>$course_name . " – " . $group->name,
......
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