Commit 6ebf2f7c authored by Myriam Delaruelle's avatar Myriam Delaruelle
Browse files

fix shortname

parent adc9628f
......@@ -30,6 +30,14 @@ $connexion = new block_mahara_iena_connexion($CFG->wstoken,$CFG->base_mahara);
$course_ctx = context_course::instance($course->id);
$students = get_enrolled_users($course_ctx);
function isValidTimeStamp($timestamp)
{
return ((string) (int) $timestamp === $timestamp)
&& ($timestamp <= PHP_INT_MAX)
&& ($timestamp >= ~PHP_INT_MAX);
}
if (count($students) == 0) {
echo "<div class=\"alert alert-warning\" role=\"alert\">"
.get_string('err_no_stud', 'block_mahara_iena', $CFG->mahara_alias)
......@@ -71,10 +79,17 @@ if (count($students) == 0) {
continue;
}
$course_name=$COURSE_shortname;
$isTimeStamp=substr($COURSE->shortname, -1, 11);
if($isTimeStamp){
$course_name=substr($COURSE->shortname, -11);
}
var_dump($course_name);
array_push($mahara_groups, array(
'name' =>$COURSE->shortname . " – " . $group->name,
'description' => get_string('course_group', 'block_mahara_iena') . " " . $COURSE->shortname . " – " . $group->name,
'name' =>$course_name . " – " . $group->name,
'description' => get_string('course_group', 'block_mahara_iena') . " " . $course_name . " – " . $group->name,
'grouptype' => 'course',
'request' => true,
'public' => false,
......@@ -85,7 +100,7 @@ if (count($students) == 0) {
array_push($name_groups, array(
"group_id" => $group->id,
"group_name" => $COURSE->shortname . " – " . $group->name,
"group_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