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
24ede56c
Commit
24ede56c
authored
4 years ago
by
Myriam Delaruelle
Browse files
Options
Downloads
Patches
Plain Diff
Calcul pourcentage tableau suivi
parent
9068b209
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
amd/build/suivi-table.js
+31
-5
31 additions, 5 deletions
amd/build/suivi-table.js
amd/build/suivi.js
+7
-2
7 additions, 2 deletions
amd/build/suivi.js
with
38 additions
and
7 deletions
amd/build/suivi-table.js
+
31
−
5
View file @
24ede56c
...
@@ -33,12 +33,15 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/str'],
...
@@ -33,12 +33,15 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/str'],
});
});
},
},
registerSubmit
:
function
(
data
){
registerSubmit
:
function
(
data
){
$
(
"
#id_submit_iena
"
).
off
().
on
(
'
click
'
,
function
(
e
){
$
(
"
#id_submit_iena
"
).
off
().
on
(
'
click
'
,
function
(
e
){
triggerAction
(
e
,
data
);
triggerAction
(
e
,
data
);
})
});
calcPercentage
(
data
);
}
}
}
}
...
@@ -97,10 +100,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/str'],
...
@@ -97,10 +100,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/str'],
return
String
(
date
).
length
>
1
?
date
:
'
0
'
+
date
;
return
String
(
date
).
length
>
1
?
date
:
'
0
'
+
date
;
}
}
/*Number.prototype.padLeft = function(base,chr){
var len = (String(base || 10).length - String(this).length)+1;
return len > 0? new Array(len).join(chr || '0')+this : this;
}*/
function
table_download
(
data
)
{
function
table_download
(
data
)
{
...
@@ -208,4 +208,30 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/str'],
...
@@ -208,4 +208,30 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/str'],
document
.
body
.
removeChild
(
link
);
document
.
body
.
removeChild
(
link
);
}
}
//Pour chaque module non caché, on va regarder pour chaque étudiant
function
calcPercentage
(
data
){
data
.
modules
(
find
(
isHidden
));
for
(
var
i
=
0
;
i
<
data
.
students
.
length
;
i
++
)
{
var
done
=
0
;
var
nb_modules
=
0
;
for
(
var
j
=
0
;
j
<
data
.
students
[
i
].
progress
;
j
++
){
if
(
data
.
modules
.
find
(
module
=>
module
.
id
===
data
.
students
[
i
].
progress
[
j
].
idmodule
).
visibility
!=
"
hidden
"
){
nb_modules
++
if
(
data
.
students
[
i
].
progress
[
j
].
completionstate
==
1
||
data
.
students
[
i
].
progress
[
j
].
completionstate
==
2
){
done
++
;
}
}
}
data
.
students
[
i
].
percentage
=
100
*
done
/
nb_modules
;
}
}
function
isHidden
(
module
,
id
)
{
return
module
.
id
===
id
;
}
});
});
This diff is collapsed.
Click to expand it.
amd/build/suivi.js
+
7
−
2
View file @
24ede56c
...
@@ -27,14 +27,15 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/str'],
...
@@ -27,14 +27,15 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/str'],
return
{
return
{
registerSelectAll
:
function
(){
registerSelectAll
:
function
(){
$
(
"
#section-select
"
).
on
(
'
change
'
,
function
(
e
){
/*
$("#section-select").on('change', function(e){
changeFilter(e, 'section');
changeFilter(e, 'section');
});
});
*/
$
(
"
#group-select
"
).
on
(
'
change
'
,
function
(
e
){
$
(
"
#group-select
"
).
on
(
'
change
'
,
function
(
e
){
changeFilter
(
e
,
'
group
'
);
changeFilter
(
e
,
'
group
'
);
});
});
},
},
}
}
...
@@ -67,6 +68,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/str'],
...
@@ -67,6 +68,7 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/str'],
data
:
{
action
:
'
test
'
},
data
:
{
action
:
'
test
'
},
type
:
'
post
'
,
type
:
'
post
'
,
success
:
function
(
request
)
{
success
:
function
(
request
)
{
console
.
log
(
JSON
.
parse
(
request
));
templates
.
render
(
'
format_iena/suivi-table
'
,
JSON
.
parse
(
request
))
templates
.
render
(
'
format_iena/suivi-table
'
,
JSON
.
parse
(
request
))
.
done
(
function
(
html
,
js
){
.
done
(
function
(
html
,
js
){
$
(
"
#partial-table
"
).
html
(
html
);
$
(
"
#partial-table
"
).
html
(
html
);
...
@@ -86,6 +88,9 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/str'],
...
@@ -86,6 +88,9 @@ define(['jquery', 'core/ajax', 'core/templates', 'core/str'],
});
});
}
}
});
});
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