Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iena-competency-block
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-competency-block
Commits
ce13f74b
Commit
ce13f74b
authored
3 years ago
by
Myriam Delaruelle
Browse files
Options
Downloads
Patches
Plain Diff
fix student view dashboard
parent
b47d0d71
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
course_competency.php
+6
-6
6 additions, 6 deletions
course_competency.php
js/dropdown.js
+1
-16
1 addition, 16 deletions
js/dropdown.js
styles.css
+6
-1
6 additions, 1 deletion
styles.css
templates/dashboard_competency_student.mustache
+34
-23
34 additions, 23 deletions
templates/dashboard_competency_student.mustache
with
47 additions
and
46 deletions
course_competency.php
+
6
−
6
View file @
ce13f74b
...
@@ -8,6 +8,7 @@ $courseid = required_param('courseid', PARAM_INT);
...
@@ -8,6 +8,7 @@ $courseid = required_param('courseid', PARAM_INT);
$studentid
=
required_param
(
'studentid'
,
PARAM_INT
);
$studentid
=
required_param
(
'studentid'
,
PARAM_INT
);
$competencyid
=
required_param
(
'competencyid'
,
PARAM_INT
);
$competencyid
=
required_param
(
'competencyid'
,
PARAM_INT
);
$url
=
new
moodle_url
(
'/blocks/competency_iena/course_competency.php'
,
array
(
'courseid'
=>
$courseid
,
'studentid'
=>
$studentid
,
'competencyid'
=>
$competencyid
));
$url
=
new
moodle_url
(
'/blocks/competency_iena/course_competency.php'
,
array
(
'courseid'
=>
$courseid
,
'studentid'
=>
$studentid
,
'competencyid'
=>
$competencyid
));
$PAGE
->
set_url
(
$url
);
$PAGE
->
set_url
(
$url
);
...
@@ -92,9 +93,10 @@ $student = user_get_users_by_id([$studentid])[$studentid];
...
@@ -92,9 +93,10 @@ $student = user_get_users_by_id([$studentid])[$studentid];
/* All students */
/* All students */
/* Only if is teacher because it's to load stud list to switch : teacher feature */
/* Only if is teacher because it's to load stud list to switch : teacher feature */
$students
=
NULL
;
$students
=
array
()
;
if
(
$is_teacher
)
{
if
(
$is_teacher
)
{
$students
=
get_enrolled_users
(
$context
);
$students
=
get_enrolled_users
(
$context
);
}
}
...
@@ -121,6 +123,7 @@ $course_cpts = \core_competency\course_competency::list_competencies($COURSE->id
...
@@ -121,6 +123,7 @@ $course_cpts = \core_competency\course_competency::list_competencies($COURSE->id
foreach
(
$course_cpts
as
$course_cpt
)
{
foreach
(
$course_cpts
as
$course_cpt
)
{
$course_cpt
->
shortname
=
$course_cpt
->
get
(
"shortname"
);
$course_cpt
->
shortname
=
$course_cpt
->
get
(
"shortname"
);
$course_cpt
->
id
=
$course_cpt
->
get
(
"id"
);
}
}
...
@@ -166,9 +169,9 @@ if ( $review_asked ) {
...
@@ -166,9 +169,9 @@ if ( $review_asked ) {
}
}
$scale
=
array
();
if
(
$is_teacher
)
{
if
(
$is_teacher
)
{
$scale
=
array
();
foreach
(
$cpt_scale
as
$key
=>
$item
)
{
foreach
(
$cpt_scale
as
$key
=>
$item
)
{
$scaleItem
=
new
StdClass
();
$scaleItem
=
new
StdClass
();
$scaleItem
->
label
=
$item
;
$scaleItem
->
label
=
$item
;
...
@@ -251,8 +254,6 @@ if ( count($all_evidences) != 0 ) {
...
@@ -251,8 +254,6 @@ if ( count($all_evidences) != 0 ) {
}
}
$ev
->
date
=
date
(
"d/m/y – H:i"
,
$ev
->
timemodified
);
$ev
->
date
=
date
(
"d/m/y – H:i"
,
$ev
->
timemodified
);
}
}
var_dump
(
$all_evidences
);
/* $chart = new core\chart_line(); */
/* $chart = new core\chart_line(); */
$chart
=
new
core\chart_bar
();
$chart
=
new
core\chart_bar
();
...
@@ -310,7 +311,6 @@ if ( count($cm_ids) !== 0 ) {
...
@@ -310,7 +311,6 @@ if ( count($cm_ids) !== 0 ) {
}
}
$data
=
array
();
$data
=
array
();
$data
[
'is_enrolled'
]
=
$is_enrolled
;
$data
[
'is_enrolled'
]
=
$is_enrolled
;
$data
[
'link_switch'
]
=
$CFG
->
wwwroot
.
"/blocks/competency_iena/course_competency.php"
;
$data
[
'link_switch'
]
=
$CFG
->
wwwroot
.
"/blocks/competency_iena/course_competency.php"
;
...
...
This diff is collapsed.
Click to expand it.
js/dropdown.js
+
1
−
16
View file @
ce13f74b
...
@@ -2,10 +2,8 @@
...
@@ -2,10 +2,8 @@
function
filter
(
e
)
{
function
filter
(
e
)
{
let
filter
=
e
.
target
.
value
.
toUpperCase
();
let
filter
=
e
.
target
.
value
.
toUpperCase
();
let
a
=
e
.
target
.
parentNode
.
querySelectorAll
(
'
a
'
);
let
a
=
e
.
target
.
parentNode
.
querySelectorAll
(
'
a
'
);
console
.
log
(
a
);
for
(
let
k
=
0
;
k
<
a
.
length
;
k
++
)
{
for
(
let
k
=
0
;
k
<
a
.
length
;
k
++
)
{
let
txtValue
=
a
[
k
].
textContent
||
a
[
k
].
innerText
;
let
txtValue
=
a
[
k
].
textContent
||
a
[
k
].
innerText
;
console
.
log
(
txtValue
);
if
(
txtValue
.
toUpperCase
().
indexOf
(
filter
)
>
-
1
)
{
if
(
txtValue
.
toUpperCase
().
indexOf
(
filter
)
>
-
1
)
{
a
[
k
].
style
.
display
=
"
block
"
;
a
[
k
].
style
.
display
=
"
block
"
;
}
else
{
}
else
{
...
@@ -15,7 +13,6 @@
...
@@ -15,7 +13,6 @@
}
}
window
.
addEventListener
(
'
load
'
,
function
()
{
window
.
addEventListener
(
'
load
'
,
function
()
{
/* Activation of dropdowns in the page */
/* Activation of dropdowns in the page */
console
.
log
(
"
on load
"
);
let
drops
=
document
.
querySelectorAll
(
'
.iena-dropdown
'
);
let
drops
=
document
.
querySelectorAll
(
'
.iena-dropdown
'
);
for
(
var
i
=
0
;
i
<
drops
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
drops
.
length
;
i
++
)
{
...
@@ -29,14 +26,9 @@
...
@@ -29,14 +26,9 @@
//Pas propre mais sinon c'est le template qui est pas propre
//Pas propre mais sinon c'est le template qui est pas propre
//pour le dashboard compétence/étudiant, on a rajouté un div inline-form
//pour le dashboard compétence/étudiant, on a rajouté un div inline-form
if
(
!
list
){
if
(
!
list
){
console
.
log
(
"
pas list
"
);
console
.
log
(
e
.
target
.
parentNode
.
parentNode
.
parentNode
);
list
=
e
.
target
.
parentNode
.
parentNode
.
parentNode
.
getElementsByClassName
(
'
iena-droplist
'
)[
0
]
list
=
e
.
target
.
parentNode
.
parentNode
.
parentNode
.
getElementsByClassName
(
'
iena-droplist
'
)[
0
]
console
.
log
(
list
);
}
}
console
.
log
(
list
);
list
.
style
.
display
=
"
block
"
;
list
.
style
.
display
=
"
block
"
;
console
.
log
(
"
c'était ici l'erreur
"
);
filter
(
e
);
filter
(
e
);
});
});
...
@@ -53,10 +45,8 @@
...
@@ -53,10 +45,8 @@
let
list
=
e
.
target
.
parentNode
;
let
list
=
e
.
target
.
parentNode
;
if
(
!
list
){
if
(
!
list
){
console
.
log
(
"
pas list
"
);
list
=
e
.
target
.
parentNode
.
parentNode
.
parentNode
;
list
=
e
.
target
.
parentNode
.
parentNode
.
parentNode
;
}
}
console
.
log
(
list
);
list
.
style
.
display
=
"
none
"
;
list
.
style
.
display
=
"
none
"
;
list
.
parentNode
.
parentNode
.
submit
();
list
.
parentNode
.
parentNode
.
submit
();
...
@@ -68,14 +58,11 @@
...
@@ -68,14 +58,11 @@
for (var i = 0; i < a.length; i++) {
for (var i = 0; i < a.length; i++) {
a[i].style.display = "none";
a[i].style.display = "none";
}*/
}*/
console
.
log
(
"
hello
"
);
let
list
=
e
.
target
.
parentNode
.
getElementsByClassName
(
'
iena-droplist
'
)[
0
];
let
list
=
e
.
target
.
parentNode
.
getElementsByClassName
(
'
iena-droplist
'
)[
0
];
if
(
!
list
){
if
(
!
list
){
console
.
log
(
"
pas list
"
);
list
=
e
.
target
.
parentNode
.
parentNode
.
parentNode
.
getElementsByClassName
(
'
iena-droplist
'
)[
0
]
list
=
e
.
target
.
parentNode
.
parentNode
.
parentNode
.
getElementsByClassName
(
'
iena-droplist
'
)[
0
]
}
}
console
.
log
(
list
);
list
.
style
.
display
=
"
none
"
;
list
.
style
.
display
=
"
none
"
;
});
});
...
@@ -134,7 +121,6 @@
...
@@ -134,7 +121,6 @@
var
opts
=
document
.
getElementById
(
'
student_list
'
).
getElementsByClassName
(
'
iena-drop-item
'
);
var
opts
=
document
.
getElementById
(
'
student_list
'
).
getElementsByClassName
(
'
iena-drop-item
'
);
var
studentid
=
document
.
getElementById
(
'
studentid
'
).
innerHTML
;
var
studentid
=
document
.
getElementById
(
'
studentid
'
).
innerHTML
;
for
(
var
i
=
0
;
i
<
opts
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
opts
.
length
;
i
++
)
{
console
.
log
(
opts
[
i
].
dataset
);
if
(
opts
[
i
].
dataset
.
value
===
studentid
)
{
if
(
opts
[
i
].
dataset
.
value
===
studentid
)
{
var
prev
=
opts
[
i
-
1
]
===
undefined
?
false
:
opts
[
i
-
1
].
dataset
.
value
;
var
prev
=
opts
[
i
-
1
]
===
undefined
?
false
:
opts
[
i
-
1
].
dataset
.
value
;
var
next
=
opts
[
i
+
1
]
===
undefined
?
false
:
opts
[
i
+
1
].
dataset
.
value
;
var
next
=
opts
[
i
+
1
]
===
undefined
?
false
:
opts
[
i
+
1
].
dataset
.
value
;
...
@@ -162,6 +148,7 @@
...
@@ -162,6 +148,7 @@
var
opts
=
document
.
getElementById
(
'
competency_list
'
).
getElementsByClassName
(
'
iena-drop-item
'
);
var
opts
=
document
.
getElementById
(
'
competency_list
'
).
getElementsByClassName
(
'
iena-drop-item
'
);
var
competencyid
=
document
.
getElementById
(
'
competencyid
'
).
innerHTML
;
var
competencyid
=
document
.
getElementById
(
'
competencyid
'
).
innerHTML
;
for
(
var
i
=
0
;
i
<
opts
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
opts
.
length
;
i
++
)
{
if
(
opts
[
i
].
dataset
.
value
===
competencyid
)
{
if
(
opts
[
i
].
dataset
.
value
===
competencyid
)
{
var
prev
=
opts
[
i
-
1
]
===
undefined
?
false
:
opts
[
i
-
1
].
dataset
.
value
;
var
prev
=
opts
[
i
-
1
]
===
undefined
?
false
:
opts
[
i
-
1
].
dataset
.
value
;
var
next
=
opts
[
i
+
1
]
===
undefined
?
false
:
opts
[
i
+
1
].
dataset
.
value
;
var
next
=
opts
[
i
+
1
]
===
undefined
?
false
:
opts
[
i
+
1
].
dataset
.
value
;
...
@@ -172,7 +159,6 @@
...
@@ -172,7 +159,6 @@
document
.
getElementById
(
'
prevCpt
'
).
onclick
=
function
()
{
document
.
getElementById
(
'
prevCpt
'
).
onclick
=
function
()
{
document
.
getElementById
(
'
competencyid_sel
'
).
value
=
document
.
getElementById
(
'
prevCpt
'
).
dataset
.
prev
;
document
.
getElementById
(
'
competencyid_sel
'
).
value
=
document
.
getElementById
(
'
prevCpt
'
).
dataset
.
prev
;
console
.
log
(
document
.
getElementById
(
'
competencyid_sel
'
).
value
);
}
}
}
}
if
(
next
===
false
)
{
if
(
next
===
false
)
{
...
@@ -181,7 +167,6 @@
...
@@ -181,7 +167,6 @@
document
.
getElementById
(
'
nextCpt
'
).
dataset
.
next
=
next
;
document
.
getElementById
(
'
nextCpt
'
).
dataset
.
next
=
next
;
document
.
getElementById
(
'
nextCpt
'
).
onclick
=
function
()
{
document
.
getElementById
(
'
nextCpt
'
).
onclick
=
function
()
{
document
.
getElementById
(
'
competencyid_sel
'
).
value
=
document
.
getElementById
(
'
nextCpt
'
).
dataset
.
next
;
document
.
getElementById
(
'
competencyid_sel
'
).
value
=
document
.
getElementById
(
'
nextCpt
'
).
dataset
.
next
;
console
.
log
(
document
.
getElementById
(
'
competencyid_sel
'
).
value
);
}
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
styles.css
+
6
−
1
View file @
ce13f74b
...
@@ -74,7 +74,7 @@
...
@@ -74,7 +74,7 @@
/* Page compétences d'un utilisateurs */
/* Page compétences d'un utilisateurs */
.list-group
{
.list-group
{
padding-bottom
:
1px
;
padding-bottom
:
1px
!important
;
}
}
.list-group-item-action
:hover
.iena-cpt-action-title
{
.list-group-item-action
:hover
.iena-cpt-action-title
{
...
@@ -358,6 +358,7 @@ table.dataTable{
...
@@ -358,6 +358,7 @@ table.dataTable{
.dashboard-chart
{
.dashboard-chart
{
grid-column
:
2
;
grid-column
:
2
;
grid-row
:
1
/
2
;
grid-row
:
1
/
2
;
overflow-y
:
auto
;
}
}
.dashboard-chart
.iena-chart
{
.dashboard-chart
.iena-chart
{
...
@@ -390,4 +391,8 @@ table.dataTable{
...
@@ -390,4 +391,8 @@ table.dataTable{
.button-assess
{
.button-assess
{
margin-top
:
15px
;
margin-top
:
15px
;
}
#modal-assess
{
text-align
:
left
;
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
templates/dashboard_competency_student.mustache
+
34
−
23
View file @
ce13f74b
<h2>
{{#
str
}}
details_competency, block_competency_iena
{{/
str
}}
</h2>
<h2>
{{#
str
}}
details_competency, block_competency_iena
{{/
str
}}
</h2>
{{#
is_enrolled
}}
{{#
is_enrolled
}}
{{#
is_teacher
}}
<div
class=
"row"
style=
"margin-top:20px; margin-bottom:20px"
>
<div
class=
"row"
style=
"margin-top:20px; margin-bottom:20px"
>
{{#
is_teacher
}}
<div
class=
"col-md-6"
>
<div
class=
"col-md-6"
>
<form
action=
'
{{
link_switch
}}
'
id=
'change_student'
class=
'm-b-1'
autocomplete=
'off'
>
<form
action=
'
{{
link_switch
}}
'
id=
'change_student'
class=
'm-b-1'
autocomplete=
'off'
>
<input
type=
'text'
hidden
name=
'courseid'
value=
'
{{
courseid
}}
'
>
<input
type=
'text'
hidden
name=
'courseid'
value=
'
{{
courseid
}}
'
>
...
@@ -23,8 +24,9 @@
...
@@ -23,8 +24,9 @@
</div>
</div>
</form>
</form>
</div>
</div>
{{/
is_teacher
}}
<div
class=
"col-md-6"
>
<div
class=
"col-md-6"
>
<form
action=
'
{{
link_switch
}}
'
id=
'change_cpt_form'
class=
'm-b-1'
autocomplete=
'off'
style=
'display: block;
height: 1.5rem;
'
>
<form
action=
'
{{
link_switch
}}
'
id=
'change_cpt_form'
class=
'm-b-1'
autocomplete=
'off'
style=
'display: block;'
>
<input
type=
'text'
hidden
name=
'courseid'
value=
'
{{
courseid
}}
'
>
<input
type=
'text'
hidden
name=
'courseid'
value=
'
{{
courseid
}}
'
>
<input
type=
'text'
hidden
name=
'studentid'
value=
'
{{
studentid
}}
'
>
<input
type=
'text'
hidden
name=
'studentid'
value=
'
{{
studentid
}}
'
>
<span
hidden
id=
'competencyid'
>
{{
competencyid
}}
</span>
<span
hidden
id=
'competencyid'
>
{{
competencyid
}}
</span>
...
@@ -45,21 +47,22 @@
...
@@ -45,21 +47,22 @@
</form>
</form>
</div>
</div>
</div>
</div>
{{/
is_teacher
}}
<div
class=
'iena-grid'
>
<div
class=
'iena-grid'
>
<div
class=
'dashboard-panel'
>
<div
class=
'dashboard-panel'
>
<div
class=
'alert alert-
{{
proficiency_class
}}
'
>
<div
class=
'alert alert-
{{
proficiency_class
}}
'
>
<h3
class=
'h4'
>
Validation
</h3>
<h3
class=
'h4'
>
Validation
</h3>
<p
class=
'm-b-0 btn
p-l-0
'
style=
'cursor: text;'
>
{{
proficiency
}}
</p>
<p
class=
'm-b-0 btn'
style=
'cursor: text;'
>
{{
proficiency
}}
</p>
</div>
</div>
</div>
</div>
<div
class=
'dashboard-panel'
>
<div
class=
'dashboard-panel'
>
<div
class=
'alert alert-secondary'
>
<div
class=
'alert alert-secondary'
>
<h3
class=
'h4'
>
Dernière évaluation
</h3>
<h3
class=
'h4'
>
Dernière évaluation
</h3>
<p
class=
'm-b-0 btn
p-l-0
'
style=
'cursor: text;'
>
{{
eval
}}
</p>
<p
class=
'm-b-0 btn'
style=
'cursor: text;'
>
{{
eval
}}
</p>
{{#
review_asked
}}
{{#
review_asked
}}
<div
class=
"iena-asked"
><small
class=
'review-badge'
>
Évaluation demandée
</small></div>
<div
class=
"iena-asked"
><small
class=
'review-badge'
>
Évaluation demandée
</small></div>
{{^
is_teacher
}}
{{^
is_teacher
}}
...
@@ -109,11 +112,12 @@
...
@@ -109,11 +112,12 @@
</div>
</div>
</div>
</div>
</div>
</div>
</div>
{{/
is_teacher
}}
{{/
is_teacher
}}
</div>
</div>
</div>
</div>
</div>
<div
class=
'dashboard-chart'
>
<div
class=
'dashboard-chart'
>
<div
class=
'iena-chart alert alert-secondary'
>
<div
class=
'iena-chart alert alert-secondary'
>
...
@@ -143,28 +147,35 @@
...
@@ -143,28 +147,35 @@
<a
class=
'nav-link'
href=
'#'
id=
'other_history_tab'
>
Hors de ce cours
</a>
<a
class=
'nav-link'
href=
'#'
id=
'other_history_tab'
>
Hors de ce cours
</a>
</li>
</li>
</ul>
</ul>
<ul
class=
'list-group'
style=
'max-height:
4
0vh; overflow-y: auto;'
>
<ul
class=
'list-group'
style=
'max-height:
6
0vh; overflow-y: auto;'
>
{{#
all_evidences
}}
{{#
all_evidences
}}
<li
class=
'list-group-item
{{
grade_make_proficient
}}
'
{{
is_course_evidence
}}
>
{{#
is_course_evidence
}}
<div
class=
'd-flex w-100 justify-content-between'
>
<li
class=
'list-group-item
{{
grade_make_proficient
}}
'
{{
is_course_evidence
}}
>
{{#
gradename
}}
<div
class=
'd-flex w-100 justify-content-between'
>
<p
class=
'mb-1'
><b>
Évaluation :
</b>
{{
gradename
}}
</p>
{{#
gradename
}}
{{/
gradename
}}
<p
class=
'mb-1'
><b>
Évaluation :
</b>
{{
gradename
}}
</p>
<small>
{{
date
}}
</small>
{{/
gradename
}}
</div>
<small>
{{
date
}}
</small>
</div>
{{#
note
}}
<p
class=
'mb-1'
><b>
Commentaire :
</b>
"
{{
note
}}
"
</p>
{{#
note
}}
{{/
note
}}
<p
class=
'mb-1'
><b>
Commentaire :
</b>
"
{{
note
}}
"
</p>
{{#
actionuser
}}
{{/
note
}}
<p><b>
Évalué par :
</b>
<a
target=
'_blank'
href=
'
{{
profileurl
}}
'
>
{{
fullname
}}
</a></p>
{{#
actionuser
}}
{{/
actionuser
}}
<p><b>
Évalué par :
</b>
<a
target=
'_blank'
href=
'
{{
profileurl
}}
'
>
{{
fullname
}}
</a></p>
<p
class=
'mb-1 font-weight-light'
><em>
{{
description
}}
</em></p>
{{/
actionuser
}}
<p
class=
'mb-1 font-weight-light'
><em>
{{
description
}}
</em></p>
</li>
{{/
is_course_evidence
}}
{{^
is_course_evidence
}}
<li>
<p>
La compétence n'a pas été évaluée dans ce contexte.
</p>
</li>
</li>
{{/
is_course_evidence
}}
{{/
all_evidences
}}
{{/
all_evidences
}}
{{^
all_evidences
}}
{{^
all_evidences
}}
<li><p><i>
La compétence n'a pas encore été évaluée
</i></p></li>
<li><p><i>
La compétence n'a pas encore été évaluée
.
</i></p></li>
{{/
all_evidences
}}
{{/
all_evidences
}}
</ul>
</ul>
</div>
</div>
...
...
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