Compare commits
2 Commits
3b153838ef
...
b84017614f
Author | SHA1 | Date |
---|---|---|
Gregory Trullemans | b84017614f | |
Gregory Trullemans | b4f71b86f0 |
|
@ -30,27 +30,44 @@ class Command(BaseCommand):
|
|||
age_girl_chained = 0
|
||||
age_girl_masterised = 0
|
||||
|
||||
print(str(count) + ' - Traitement de ' + str(educative.long_label))
|
||||
breadcrumb = educative.breadcrumb()
|
||||
print(str(count) + " - Traitement de " + str(educative.long_label))
|
||||
|
||||
breadcrumb = educative.breadcrumb()
|
||||
for path in range(0, len(breadcrumb)):
|
||||
tree = set(PrerequisiteClosure.objects.filter(descendant=educative, path=path))
|
||||
tree = set(
|
||||
PrerequisiteClosure.objects.filter(descendant=educative, path=path)
|
||||
)
|
||||
|
||||
for position, ancestor in enumerate(breadcrumb[path]):
|
||||
tree_path, _ = PrerequisiteClosure.objects.get_or_create(
|
||||
ancestor=ancestor, descendant=educative, level=position, path=path
|
||||
ancestor=ancestor,
|
||||
descendant=educative,
|
||||
level=position,
|
||||
path=path,
|
||||
)
|
||||
max_level = max(max_level, position)
|
||||
max_rank = max(max_rank, ancestor.rank + 1)
|
||||
age_boy_with_help = max(age_boy_with_help, ancestor.age_boy_with_help)
|
||||
age_boy_without_help = max(age_boy_without_help, ancestor.age_boy_without_help)
|
||||
max_rank = max(max_rank, max_level, ancestor.rank + 1)
|
||||
age_boy_with_help = max(
|
||||
age_boy_with_help, ancestor.age_boy_with_help
|
||||
)
|
||||
age_boy_without_help = max(
|
||||
age_boy_without_help, ancestor.age_boy_without_help
|
||||
)
|
||||
age_boy_chained = max(age_boy_chained, ancestor.age_boy_chained)
|
||||
age_boy_masterised = max(age_boy_masterised, ancestor.age_boy_masterised)
|
||||
age_boy_masterised = max(
|
||||
age_boy_masterised, ancestor.age_boy_masterised
|
||||
)
|
||||
|
||||
age_girl_with_help = max(age_girl_with_help, ancestor.age_girl_with_help)
|
||||
age_girl_without_help = max(age_girl_without_help, ancestor.age_girl_without_help)
|
||||
age_girl_with_help = max(
|
||||
age_girl_with_help, ancestor.age_girl_with_help
|
||||
)
|
||||
age_girl_without_help = max(
|
||||
age_girl_without_help, ancestor.age_girl_without_help
|
||||
)
|
||||
age_girl_chained = max(age_girl_chained, ancestor.age_girl_chained)
|
||||
age_girl_masterised = max(age_girl_masterised, ancestor.age_girl_masterised)
|
||||
age_girl_masterised = max(
|
||||
age_girl_masterised, ancestor.age_girl_masterised
|
||||
)
|
||||
|
||||
if tree_path in tree:
|
||||
tree.remove(tree_path)
|
||||
|
|
|
@ -18,8 +18,9 @@ class Educative(Markdownizable):
|
|||
|
||||
|
||||
Rank : Le rang permet, en plus du `level` (niveau), de classer les figures entre elles, de leur
|
||||
donner un ordre (informatif). Le rang d’une figure est calculé par rapport aux prérequis : par
|
||||
défaut le rang d’une figure est égal au niveau maximum de ses prérequis plus un.
|
||||
donner un ordre (informatif). Le rang d’une figure est calculé par rapport aux prérequis et au
|
||||
niveau : par défaut le rang d’une figure est le maximum entre le niveau maximum de ses
|
||||
prérequis plus un et le niveau de la figure.
|
||||
Le rang, avec le niveau, ont pour but d’aider les coaches à planifier l’évolution et
|
||||
l’apprentissage des figures les unes par rapport aux autres.
|
||||
|
||||
|
|
Loading…
Reference in New Issue