/** * Returns a string indicating how long ago something happened * * @param int $time * in unixtime * @param string $small * indicates if the time should be enclosed in a div with a small font * @return string */ function emarking_time_ago($time, $small = false) { return emarking_time_difference(time(), $time, $small); }
/** * Creates an especial array with the navigation tabs for emarking markers training mode * * @param unknown $context * The course context to validate capabilit * @param unknown $cm * The course module (emarking activity) * @return multitype:tabobject */ function emarking_tabs_markers_training($context, $cm, $emarking, $generalprogress, $delphiprogress) { global $CFG; global $USER; global $OUTPUT; //tab's icons $timeicon = $OUTPUT->pix_icon('i/scheduled', null); $scalesicon = $OUTPUT->pix_icon('i/scales', null); //array for tabs data $tabs = array(); $firststagetable = new html_table(); $firststagetable->data[] = array(get_string('stage', 'mod_emarking'), $timeicon . " " . get_string('marking_deadline', 'mod_emarking'), $scalesicon . " " . get_string('stage_general_progress', 'mod_emarking')); if ($generalprogress >= 100) { $firststagetable->data[] = array(get_string('delphi_stage_one', 'mod_emarking'), " ", $OUTPUT->pix_icon('i/grade_correct', "")); } else { $firststagetable->data[] = array(get_string('delphi_stage_one', 'mod_emarking'), emarking_time_difference($emarking->firststagedate, time(), false), emarking_create_progress_graph($generalprogress)); } $firststagetable->data[] = array(get_string('delphi_stage_two', 'mod_emarking'), emarking_time_difference($emarking->secondstagedate, time(), false), emarking_create_progress_graph($delphiprogress)); return html_writer::table($firststagetable); }