Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
moodle-mod_vpl
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
caseine
moodle-mod_vpl
Commits
f49952d3
Commit
f49952d3
authored
4 years ago
by
Astor Bizard
Browse files
Options
Downloads
Patches
Plain Diff
Improved VPL groups consistency check interface for admins.
parent
c17fc680
No related branches found
Branches containing commit
No related tags found
1 merge request
!1
Dev: Submissions list rework, webservices and bugfixes
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lang/en/vpl.php
+3
-0
3 additions, 0 deletions
lang/en/vpl.php
views/checkvpls.php
+27
-7
27 additions, 7 deletions
views/checkvpls.php
with
30 additions
and
7 deletions
lang/en/vpl.php
+
3
−
0
View file @
f49952d3
...
@@ -43,6 +43,9 @@ $string ['browserupdate'] = 'Please update your browser to the last version<br /
...
@@ -43,6 +43,9 @@ $string ['browserupdate'] = 'Please update your browser to the last version<br /
$string
[
'calculate'
]
=
'Calculate'
;
$string
[
'calculate'
]
=
'Calculate'
;
$string
[
'changesNotSaved'
]
=
'Changes have not been saved'
;
$string
[
'changesNotSaved'
]
=
'Changes have not been saved'
;
$string
[
'check_jail_servers'
]
=
'Check execution servers'
;
$string
[
'check_jail_servers'
]
=
'Check execution servers'
;
$string
[
'checkforcourse'
]
=
'Check for course {$a}'
;
$string
[
'checkgroups'
]
=
'Check groups consistency'
;
$string
[
'checksitewide'
]
=
'Check sitewide'
;
$string
[
'clipboard'
]
=
'Clipboard'
;
$string
[
'clipboard'
]
=
'Clipboard'
;
$string
[
'closed'
]
=
'Closed'
;
$string
[
'closed'
]
=
'Closed'
;
$string
[
'comments'
]
=
'Comments'
;
$string
[
'comments'
]
=
'Comments'
;
...
...
This diff is collapsed.
Click to expand it.
views/checkvpls.php
+
27
−
7
View file @
f49952d3
...
@@ -38,20 +38,40 @@ if (! $course = $DB->get_record( "course", array ( 'id' => $id ) )) {
...
@@ -38,20 +38,40 @@ if (! $course = $DB->get_record( "course", array ( 'id' => $id ) )) {
require_course_login
(
$course
);
require_course_login
(
$course
);
$PAGE
->
set_url
(
'/mod/vpl/views/checkvpls.php'
,
array
(
'id'
=>
$id
)
);
$PAGE
->
set_url
(
'/mod/vpl/views/checkvpls.php'
,
array
(
'id'
=>
$id
)
);
$admin
=
is_siteadmin
();
$sitewide
=
$admin
&&
optional_param
(
'sitewide'
,
0
,
PARAM_INT
);
$strvpls
=
get_string
(
'modulenameplural'
,
VPL
);
$strvpls
=
get_string
(
'modulenameplural'
,
VPL
);
$pagetitle
=
get_string
(
'checkgroups'
,
VPL
);
$coursename
=
format_string
(
$course
->
fullname
);
if
(
!
$sitewide
)
{
$pagetitle
.
=
' ('
.
$coursename
.
')'
;
}
$PAGE
->
navbar
->
add
(
$strvpls
);
$PAGE
->
navbar
->
add
(
$strvpls
);
$PAGE
->
set_title
(
get_string
(
'checkall'
)
);
$PAGE
->
set_title
(
$pagetitle
);
$PAGE
->
set_heading
(
$course
->
full
name
);
$PAGE
->
set_heading
(
$coursename
);
echo
$OUTPUT
->
header
();
echo
$OUTPUT
->
header
();
echo
$OUTPUT
->
heading
(
get_string
(
'checkall'
)
);
echo
$OUTPUT
->
heading
(
$pagetitle
);
$einfo
=
array
(
'context'
=>
\context_course
::
instance
(
$course
->
id
),
$einfo
=
array
(
'context'
=>
\context_course
::
instance
(
$course
->
id
),
'objectid'
=>
$course
->
id
,
'objectid'
=>
$course
->
id
,
'userid'
=>
$USER
->
id
'userid'
=>
$USER
->
id
);
);
\mod_vpl\event\vpl_checkvpls
::
log
(
$einfo
);
\mod_vpl\event\vpl_checkvpls
::
log
(
$einfo
);
$admin
=
is_siteadmin
();
if
(
$admin
)
{
if
(
$admin
)
{
$url
=
$PAGE
->
url
;
$filterurls
=
array
(
$url
->
out
(
true
,
array
(
'sitewide'
=>
0
)),
$url
->
out
(
true
,
array
(
'sitewide'
=>
1
))
);
echo
$OUTPUT
->
url_select
(
array
(
$filterurls
[
0
]
=>
get_string
(
'checkforcourse'
,
VPL
,
$coursename
),
$filterurls
[
1
]
=>
get_string
(
'checksitewide'
,
VPL
)
),
$filterurls
[
$sitewide
],
null
);
echo
'<br>'
;
}
if
(
$sitewide
)
{
$ovpls
=
$DB
->
get_records
(
VPL
,
array
(),
'id'
);
$ovpls
=
$DB
->
get_records
(
VPL
,
array
(),
'id'
);
}
else
{
}
else
{
$ovpls
=
get_all_instances_in_course
(
VPL
,
$course
);
$ovpls
=
get_all_instances_in_course
(
VPL
,
$course
);
...
@@ -59,8 +79,8 @@ if ($admin) {
...
@@ -59,8 +79,8 @@ if ($admin) {
// Get and select vpls to show.
// Get and select vpls to show.
foreach
(
$ovpls
as
$ovpl
)
{
foreach
(
$ovpls
as
$ovpl
)
{
$vpl
=
new
mod_vpl
(
false
,
$ovpl
->
id
);
$vpl
=
new
mod_vpl
(
false
,
$ovpl
->
id
);
$instance
=
$vpl
->
get_instance
();
if
(
$vpl
->
is_group_activity
()
)
{
if
(
$vpl
->
is_group_activity
()
)
{
$instance
=
$vpl
->
get_instance
();
// Check groups concistence.
// Check groups concistence.
$groupingid
=
$vpl
->
get_course_module
()
->
groupingid
;
$groupingid
=
$vpl
->
get_course_module
()
->
groupingid
;
$groups
=
groups_get_all_groups
(
$vpl
->
get_course
()
->
id
,
0
,
$groupingid
);
$groups
=
groups_get_all_groups
(
$vpl
->
get_course
()
->
id
,
0
,
$groupingid
);
...
@@ -98,8 +118,8 @@ foreach ($ovpls as $ovpl) {
...
@@ -98,8 +118,8 @@ foreach ($ovpls as $ovpl) {
}
}
$title
=
''
;
$title
=
''
;
if
(
$
admin
)
{
if
(
$
sitewide
)
{
$title
=
$vpl
->
get_course
()
->
shortname
.
'
:
'
;
$title
=
$vpl
->
get_course
()
->
shortname
.
'
>
'
;
}
}
$title
.
=
$vpl
->
get_printable_name
();
$title
.
=
$vpl
->
get_printable_name
();
$icon
=
'check'
;
$icon
=
'check'
;
...
...
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