Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iena-course-format
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iena
iena-course-format
Commits
6f61e2f4
Commit
6f61e2f4
authored
3 years ago
by
Myriam Delaruelle
Browse files
Options
Downloads
Patches
Plain Diff
only display uservisible activities in progress bar
parent
d3cd4adb
No related branches found
No related tags found
Loading
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
entity/course_format_iena_completion.php
+6
-25
6 additions, 25 deletions
entity/course_format_iena_completion.php
with
6 additions
and
25 deletions
entity/course_format_iena_completion.php
+
6
−
25
View file @
6f61e2f4
...
@@ -42,18 +42,6 @@ class course_format_iena_completion {
...
@@ -42,18 +42,6 @@ class course_format_iena_completion {
return
false
;
return
false
;
}
}
// $modules = $DB->get_records_sql('SELECT cmc.id, cmc.coursemoduleid, cmc.userid, cmc.completionstate, cm.section
// FROM {course_modules_completion} as cmc
// inner join {course_modules} as cm on cm.id = cmc.coursemoduleid
// inner join {user} as u on u.id = cmc.userid
// inner join {modules} as m on m.id = cm.module
// where cm.course = ? and cm.deletioninprogress = 0
// and cmc.userid = ?
// order by section, coursemoduleid asc', array($course->id, $USER->id));
// echo "<pre>";
// var_dump($modules);
// echo "</pre>";
$sections
=
[];
$sections
=
[];
...
@@ -65,7 +53,9 @@ class course_format_iena_completion {
...
@@ -65,7 +53,9 @@ class course_format_iena_completion {
$module
=
$completion
->
get_data
(
$cm
,
true
,
$USER
->
id
,
$fast_modinfo
);
$module
=
$completion
->
get_data
(
$cm
,
true
,
$USER
->
id
,
$fast_modinfo
);
$module
->
url
=
"
$CFG->wwwroot
/mod/
$cm->modname
/view.php?id=
$cm->id
"
;
$module
->
url
=
"
$CFG->wwwroot
/mod/
$cm->modname
/view.php?id=
$cm->id
"
;
$module
->
section
=
$cm
->
section
;
$module
->
section
=
$cm
->
section
;
if
(
$cm
->
deletioninprogress
==
0
&&
$cm
->
completion
!=
0
)
{
if
(
$cm
->
deletioninprogress
==
0
&&
$cm
->
completion
!=
0
&&
$cm
->
uservisible
)
{
$module
->
name
=
$cm
->
name
;
$module
->
url
=
"
$CFG->wwwroot
/mod/
$cm->modname
/view.php?id=
$cm->id
"
;
$modules
[]
=
$module
;
$modules
[]
=
$module
;
}
}
}
}
...
@@ -81,19 +71,15 @@ class course_format_iena_completion {
...
@@ -81,19 +71,15 @@ class course_format_iena_completion {
$inner_modules
=
[];
$inner_modules
=
[];
$inner_completed
=
0
;
$inner_completed
=
0
;
foreach
(
$modules
as
$module
)
{
foreach
(
$modules
as
$module
)
{
if
(
$module
->
section
==
$section_id
)
{
if
(
$module
->
section
==
$section_id
)
{
$mod
=
new
StdClass
();
$mod
=
new
StdClass
();
$mod
->
coursemoduleid
=
$module
->
coursemoduleid
;
$mod
->
coursemoduleid
=
$module
->
coursemoduleid
;
$mod
->
completion
=
$module
->
completionstate
;
$mod
->
completion
=
$module
->
completionstate
;
$mod
->
name
=
$module
->
name
;
$mod
->
url
=
$module
->
url
;
if
(
$mod
->
completion
==
1
||
$mod
->
completion
==
2
)
{
if
(
$mod
->
completion
==
1
||
$mod
->
completion
==
2
)
{
$inner_completed
++
;
$inner_completed
++
;
}
}
foreach
(
$modinfos_cms
as
$cm
)
{
if
(
$cm
->
id
==
$mod
->
coursemoduleid
)
{
$mod
->
name
=
$cm
->
name
;
$mod
->
url
=
"
$CFG->wwwroot
/mod/
$cm->modname
/view.php?id=
$cm->id
"
;
}
}
$inner_modules
[]
=
$mod
;
$inner_modules
[]
=
$mod
;
}
}
}
}
...
@@ -111,11 +97,6 @@ class course_format_iena_completion {
...
@@ -111,11 +97,6 @@ class course_format_iena_completion {
$progress
=
new
StdClass
();
$progress
=
new
StdClass
();
$progress
->
total
=
number_format
(
100
*
$total_completed
/
$total_modules
,
0
);
$progress
->
total
=
number_format
(
100
*
$total_completed
/
$total_modules
,
0
);
$progress
->
sections
=
$sections
;
$progress
->
sections
=
$sections
;
// echo "<pre>";
// var_dump($progress);
// echo "</pre>";
return
$progress
;
return
$progress
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment