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
17c8433d
Commit
17c8433d
authored
5 years ago
by
Astor Bizard
Browse files
Options
Downloads
Patches
Plain Diff
Improved group VPLs consistency check display.
parent
5d27ef24
No related branches found
No related tags found
1 merge request
!1
Dev: Submissions list rework, webservices and bugfixes
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
views/checkvpls.php
+27
-18
27 additions, 18 deletions
views/checkvpls.php
with
27 additions
and
18 deletions
views/checkvpls.php
+
27
−
18
View file @
17c8433d
...
...
@@ -25,18 +25,19 @@
require_once
(
dirname
(
__FILE__
)
.
'/../../../config.php'
);
require_once
(
dirname
(
__FILE__
)
.
'/../locallib.php'
);
require_once
(
dirname
(
__FILE__
)
.
'/../list_util.class.php'
);
require_once
(
dirname
(
__FILE__
)
.
'/../vpl_submission.class.php'
);
$id
=
required_param
(
'id'
,
PARAM_INT
);
// Course id.
global
$DB
,
$PAGE
,
$OUTPUT
,
$USER
;
// Check course existence.
if
(
!
$course
=
$DB
->
get_record
(
"course"
,
array
(
'id'
=>
$id
)
))
{
print_error
(
'invalidcourseid'
,
''
,
$id
);
}
require_course_login
(
$course
);
$PAGE
->
set_url
(
'/mod/views/checkvpls.php'
,
array
(
'id'
=>
$id
)
);
$PAGE
->
set_url
(
'/mod/
vpl/
views/checkvpls.php'
,
array
(
'id'
=>
$id
)
);
$strvpls
=
get_string
(
'modulenameplural'
,
VPL
);
$PAGE
->
navbar
->
add
(
$strvpls
);
$PAGE
->
set_title
(
get_string
(
'checkall'
)
);
...
...
@@ -55,21 +56,12 @@ if ($admin) {
}
else
{
$ovpls
=
get_all_instances_in_course
(
VPL
,
$course
);
}
$timenow
=
time
();
$vpls
=
array
();
// Get and select vpls to show.
foreach
(
$ovpls
as
$ovpl
)
{
$vpl
=
new
mod_vpl
(
false
,
$ovpl
->
id
);
$instance
=
$vpl
->
get_instance
();
$vpls
[
$instance
->
id
]
=
$vpl
;
if
(
$vpl
->
is_group_activity
()
)
{
// Check groups concistence.
$title
=
''
;
if
(
$admin
)
{
$title
=
$vpl
->
get_course
()
->
shortname
.
': '
;
}
$title
.
=
$vpl
->
get_printable_name
();
echo
'<h5>'
.
s
(
$title
)
.
'</h5>'
;
$groupingid
=
$vpl
->
get_course_module
()
->
groupingid
;
$groups
=
groups_get_all_groups
(
$vpl
->
get_course
()
->
id
,
0
,
$groupingid
);
$students
=
$vpl
->
get_students
();
...
...
@@ -104,25 +96,42 @@ foreach ($ovpls as $ovpl) {
if
(
$nogroup
>
''
)
{
$nogroup
.
=
'</ul>'
;
}
echo
$OUTPUT
->
box_start
();
if
(
$multigroup
>
''
)
{
echo
vpl_notice
(
$multigroup
,
'error'
);
$title
=
''
;
if
(
$admin
)
{
$title
=
$vpl
->
get_course
()
->
shortname
.
': '
;
}
$title
.
=
$vpl
->
get_printable_name
();
$icon
=
'check'
;
$level
=
'success'
;
$text
=
''
;
if
(
$nogroup
>
''
)
{
echo
vpl_notice
(
$nogroup
,
'warning'
);
$icon
=
'warning'
;
$level
=
'warning'
;
$text
=
$OUTPUT
->
notification
(
$nogroup
,
'warning'
)
.
$text
;
}
if
(
$multigroup
==
''
)
{
if
(
$multigroup
>
''
)
{
$icon
=
'remove'
;
$level
=
'error'
;
$text
=
$OUTPUT
->
notification
(
$multigroup
,
'error'
)
.
$text
;
}
else
{
$gradersid
=
array_keys
(
$vpl
->
get_graders
());
$ing
=
$DB
->
get_in_or_equal
(
$gradersid
);
$select
=
'( not userid '
.
$ing
[
0
]
.
' ) and vpl = ? and groupid = 0'
;
$params
=
$ing
[
1
];
$params
[]
=
$instance
->
id
;
if
(
$DB
->
count_records_select
(
VPL_SUBMISSIONS
,
$select
,
$params
)
>
0
)
{
echo
vpl_notice
(
'Fixing submissions with no group or pre V3.3 data'
);
$text
.
=
$OUTPUT
->
notification
(
'Fixing submissions with no group or pre V3.3 data'
,
'success'
);
$vpl
->
update_group_v32
();
}
}
echo
$OUTPUT
->
box_end
();
echo
'<h5>'
;
echo
'<a href="/mod/vpl/view.php?id='
.
$vpl
->
get_course_module
()
->
id
.
'" class="text-'
.
$level
.
'">'
.
s
(
$title
)
.
'</a>'
;
echo
' <i class="icon fa fa-'
.
$icon
.
' text-'
.
$level
.
' fa-fw "></i>'
;
echo
'</h5>'
;
if
(
$text
>
''
)
{
echo
$OUTPUT
->
box
(
$text
);
}
}
}
...
...
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