Project

General

Profile

Feature #6089

Add optional time-in-course info in header

Added by Yannick Warnier almost 6 years ago. Updated almost 3 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Course progress
Target version:
Start date:
14/04/2013
Due date:
% Done:

0%

Estimated time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

Some (mostly corporate) users are more and more pressing about having an easier-to-reach indication of how much time the user has spent in a course.

An easy way to get this (but that requires some styling) is to add the following just before the last "return" statement of banner.lib.php::return_breadcrumb():

    // Show time in course
    if ($user_id && isset($course_id) && !api_is_platform_admin() && !api_is_course_admin()) {
        $time = api_time_to_hms(Tracking::get_time_spent_on_the_course($user_id, $course_id, api_get_session_id()));
        $html .= '<span style="display:inline;float:right;margin-top:-26px;margin-right:10px;">'.$time.'</span>';
    }

The only problem is that it appears on top of the "Student View" button when admin/teacher, which is why I added the api_is_platform_admin() an api_is_course_admin() checks in the condition.

Find a good way to add it without conflicting with the button, and enabling the teacher to choose whether he wants it or not in his course (course_settings).

History

#1

Updated by Yannick Warnier almost 3 years ago

  • Target version changed from 2.0 to 3.0

Also available in: Atom PDF