competency_iena_competencies.php 2.17 KB
Newer Older
Thomas Fradet's avatar
folder  
Thomas Fradet committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
	
	require_once('../../config.php');

// ENLEVER SI NON NECESSAIRE :
	require_once('entity/block_competency_iena_competency.php');
	require_once('entity/block_competency_iena_module.php');
	require_once('entity/block_competency_iena_ressource.php');
	require_once('entity/block_competency_iena_section.php');
	require_once('entity/block_competency_iena_student.php');
	require_once('entity/block_competency_iena_cron_roles.php');
	require_once('entity/block_competency_iena_cron_competency.php');
	require_once('view/view_competency_iena_competencies.php');
	
	
	global $COURSE, $DB, $USER;
	
	try {
		$courseid = required_param('courseid', PARAM_INT);
	} catch (coding_exception $e) {
	}
	try {
		$studentid = optional_param('studentid', $USER->id, PARAM_INT);
	} catch (coding_exception $e) {
	}
	try {
		$url = new moodle_url('/blocks/competency_iena/competency_iena_competencies.php', array('courseid' => $courseid, 'studentid' => $studentid));
	} catch (moodle_exception $e) {
	}
	
	$PAGE->set_pagelayout('course');
	try {
		$PAGE->set_url($url);
	} catch (coding_exception $e) {
	}
	
	try {
		$course = $DB->get_record('course', array('id' => $courseid), '*', MUST_EXIST);
	} catch (dml_exception $e) {
	}
	try {
		require_login($course, false, NULL);
	} catch (coding_exception $e) {
	} catch (require_login_exception $e) {
	} catch (moodle_exception $e) {
	}
	
	try {
		$PAGE->set_title(get_string('title_plugin', 'block_competency_iena'));
	} catch (coding_exception $e) {
	}
	try {
		$PAGE->set_heading($OUTPUT->heading($COURSE->fullname, 2, 'headingblock header outline'));
	} catch (coding_exception $e) {
	}
	try {
		echo $OUTPUT->header();
	} catch (coding_exception $e) {
	}
Thomas Fradet's avatar
Thomas Fradet committed
60
	// echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"styles.css\">";
Thomas Fradet's avatar
folder  
Thomas Fradet committed
61
62
63
64
65
66
67
68
69
70
71
72
73
	
	/*$cron_test = new block_competency_iena_cron_roles();
	$cron_test->attribute_roles_iena_complete();*/
	/*$cron_test = new block_competency_iena_cron_competency();
	$cron_test->attribute_competency_iena();*/
	
	$view = new view_competency_iena_competencies();
	echo $view->get_content($studentid);
	
	try {
		echo $OUTPUT->footer();
	} catch (coding_exception $e) {
	}