Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
iena
iena-course-format
Commits
c00d8d0e
Commit
c00d8d0e
authored
Jun 20, 2019
by
Thomas Fradet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
delete old course params
parent
0d12d6c9
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
109 deletions
+10
-109
README.md
README.md
+1
-1
db/install.xml
db/install.xml
+0
-12
entity/course_format_iena_section_ressources.php
entity/course_format_iena_section_ressources.php
+9
-30
lib.php
lib.php
+0
-31
view/view_course_header.php
view/view_course_header.php
+0
-35
No files found.
README.md
View file @
c00d8d0e
...
...
@@ -12,7 +12,7 @@ This plugin is a new course format for MOODLE. It change the course page interfa
## Compatibility
MOODLE 3.
5
MOODLE 3.
7
## Contribution
...
...
db/install.xml
View file @
c00d8d0e
...
...
@@ -21,17 +21,5 @@
<KEY
NAME=
"primary"
TYPE=
"primary"
FIELDS=
"id"
/>
</KEYS>
</TABLE>
<TABLE
NAME=
"format_iena_settings"
COMMENT=
"Default comment for the table, please edit me"
>
<FIELDS>
<FIELD
NAME=
"id"
TYPE=
"int"
LENGTH=
"10"
NOTNULL=
"true"
SEQUENCE=
"true"
/>
<FIELD
NAME=
"courseid"
TYPE=
"int"
LENGTH=
"5"
NOTNULL=
"false"
SEQUENCE=
"false"
/>
<FIELD
NAME=
"cmid"
TYPE=
"int"
LENGTH=
"5"
NOTNULL=
"false"
SEQUENCE=
"false"
COMMENT=
"Course module id"
/>
<FIELD
NAME=
"hide"
TYPE=
"int"
LENGTH=
"1"
NOTNULL=
"false"
SEQUENCE=
"false"
/>
<FIELD
NAME=
"sectionid"
TYPE=
"int"
LENGTH=
"5"
NOTNULL=
"false"
SEQUENCE=
"false"
/>
</FIELDS>
<KEYS>
<KEY
NAME=
"primary"
TYPE=
"primary"
FIELDS=
"id"
/>
</KEYS>
</TABLE>
</TABLES>
</XMLDB>
\ No newline at end of file
entity/course_format_iena_section_ressources.php
View file @
c00d8d0e
...
...
@@ -110,40 +110,19 @@
// search only modules by general course format parameters
// count only if it is follewed by teacher
$if_followed
=
$course
->
restrictedbreadcrum
==
1
;
//
$if_followed = $course->restrictedbreadcrum == 1;
// count even if it is "hidden on course page but available"
$even_if_hidden_but_available
=
$course
->
allmodulesbreadcrum
==
1
;
if
(
$if_followed
)
{
if
(
$even_if_hidden_but_available
)
{
$requete
=
$DB
->
get_records_sql
(
'SELECT cm.id FROM {course_modules} as cm
INNER JOIN {format_iena_settings} as iena on cm.id = iena.cmid
WHERE cm.section = ?
AND cm.visible = 1
AND iena.hide = 1
AND cm.deletioninprogress = 0
AND cm.completion != 0'
,
array
(
$id_section
));
}
else
{
$requete
=
$DB
->
get_records_sql
(
'SELECT cm.id FROM {course_modules} as cm
INNER JOIN {format_iena_settings} as iena on cm.id = iena.cmid
WHERE cm.section = ?
AND cm.visible = 1
AND cm.visibleoncoursepage = 1
AND iena.hide = 1
AND cm.deletioninprogress = 0
AND cm.completion != 0'
,
array
(
$id_section
));
}
if
(
$even_if_hidden_but_available
)
{
$requete
=
$DB
->
get_records_sql
(
'SELECT id FROM {course_modules} WHERE section = ? AND deletioninprogress = 0
AND visible = 1
AND completion != 0'
,
array
(
$id_section
));
}
else
{
if
(
$even_if_hidden_but_available
)
{
$requete
=
$DB
->
get_records_sql
(
'SELECT id FROM {course_modules} WHERE section = ? AND deletioninprogress = 0
AND visible = 1
AND completion != 0'
,
array
(
$id_section
));
}
else
{
$requete
=
$DB
->
get_records_sql
(
'SELECT id FROM {course_modules} WHERE section = ? AND deletioninprogress = 0
AND visible = 1
AND visibleoncoursepage = 1
AND completion != 0'
,
array
(
$id_section
));
}
$requete
=
$DB
->
get_records_sql
(
'SELECT id FROM {course_modules} WHERE section = ? AND deletioninprogress = 0
AND visible = 1
AND visibleoncoursepage = 1
AND completion != 0'
,
array
(
$id_section
));
}
// if ($course->restrictedbreadcrum == 1) {
...
...
lib.php
View file @
c00d8d0e
...
...
@@ -41,26 +41,10 @@
static
$courseformatoptions
=
false
;
if
(
$courseformatoptions
===
false
)
{
// $courseconfig = get_config('moodlecourse');
// $courseformatoptions['numsections'] = array(
// 'default' => $courseconfig->numsections,
// 'type' => PARAM_INT,
// );
$courseformatoptions
[
'viewbreadcrum'
]
=
array
(
'default'
=>
1
,
'type'
=>
PARAM_INT
,
);
$courseformatoptions
[
'restrictedbreadcrum'
]
=
array
(
'default'
=>
0
,
'type'
=>
PARAM_INT
,
);
$courseformatoptions
[
'allmodulesbreadcrum'
]
=
array
(
'default'
=>
0
,
'type'
=>
PARAM_INT
,
);
$courseformatoptions
[
'autoattendance'
]
=
array
(
'default'
=>
0
,
'type'
=>
PARAM_INT
,
);
$courseformatoptions
[
'viewiconmessage'
]
=
array
(
'default'
=>
1
,
'type'
=>
PARAM_INT
,
...
...
@@ -84,26 +68,11 @@
$choiceTab
=
array
();
$choiceTab
[
'1'
]
=
get_string
(
'yes'
,
'format_iena'
);
$choiceTab
[
'0'
]
=
get_string
(
'no'
,
'format_iena'
);
$courseformatoptionsedit
[
'viewbreadcrum'
]
=
array
(
'label'
=>
get_string
(
'hide_bread_crum'
,
'format_iena'
),
'element_type'
=>
'select'
,
'element_attributes'
=>
array
(
$choiceTab
),
);
$courseformatoptionsedit
[
'restrictedbreadcrum'
]
=
array
(
'label'
=>
"N'afficher les activités dans la progression que si elles sont suivies dans une section."
,
'element_type'
=>
'select'
,
'element_attributes'
=>
array
(
$choiceTab
),
);
$courseformatoptionsedit
[
'allmodulesbreadcrum'
]
=
array
(
'label'
=>
"Afficher les activités cachées mais disponibles dans la barre de progression."
,
'element_type'
=>
'select'
,
'element_attributes'
=>
array
(
$choiceTab
),
);
$courseformatoptionsedit
[
'autoattendance'
]
=
array
(
'label'
=>
"Le bouton d'appel envoie automatiquement vers l'appel si une séance à lieu maintenant (sinon vers la liste des sessions d'appel)."
,
'element_type'
=>
'select'
,
'element_attributes'
=>
array
(
$choiceTab
),
);
$courseformatoptionsedit
[
'viewiconmessage'
]
=
array
(
'label'
=>
get_string
(
'hide_icon_message'
,
'format_iena'
),
'element_type'
=>
'select'
,
...
...
view/view_course_header.php
View file @
c00d8d0e
...
...
@@ -301,41 +301,6 @@ class view_course_header {
return
$array
;
}
private
function
get_attendance_link
()
{
global
$COURSE
,
$CFG
,
$DB
,
$USER
;
if
(
!
$this
->
is_teacher
(
$USER
)
)
{
return
false
;
}
// 23 is the id of an attendance mod
$param
[
'module'
]
=
23
;
$param
[
'course'
]
=
$COURSE
->
id
;
$param
[
'deletioninprogress'
]
=
0
;
$att_module
=
$DB
->
get_record
(
'course_modules'
,
$param
);
if
(
!
$att_module
->
id
)
{
return
false
;
}
$attendance
=
new
course_format_iena_attendance
();
$course_sessions
=
$attendance
->
get_attendance_sessions
(
$COURSE
->
id
);
$attendance_session
=
false
;
$attendance_session_group
=
false
;
foreach
(
$course_sessions
as
$session
)
{
$begin
=
$session
->
sessdate
;
$end
=
$session
->
sessdate
+
$session
->
duration
;
if
(
time
()
>
$begin
&&
time
()
<
$end
)
{
$attendance_session
=
$session
->
id
;
$attendance_session_group
=
$session
->
groupid
;
}
}
$course_params
=
course_get_format
(
$COURSE
->
id
)
->
get_course
();
$attendance_session_auto
=
$course_params
->
autoattendance
==
1
?
true
:
false
;
if
(
$attendance_session
)
{
if
(
$attendance_session_auto
)
{
$attendance_link
=
"
$CFG->wwwroot
/mod/attendance/take.php?id=
$att_module->id
&sessionid=
$attendance_session
&grouptype=
$attendance_session_group
"
;
}
else
{
$attendance_link
=
"
$CFG->wwwroot
/mod/attendance/manage.php?id=
$att_module->id
&group=0"
;
}
}
else
{
$attendance_link
=
"
$CFG->wwwroot
/mod/attendance/sessions.php?id=
$att_module->id
&action=1"
;
}
return
$attendance_link
;
}
private
function
set_html
(
$infos
)
{
global
$CFG
,
$COURSE
,
$USER
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment