Skip to content

Commit

Permalink
displays proper count
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanOXDi committed Feb 2, 2024
1 parent 97692e4 commit 1596e8c
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,16 @@
isSelectAllChecked() {
// Returns true if all the resources in the topic are in the working resource pool
const workingResourceIds = this.workingResourcePool.map(wr => wr.id);
return this.contentList.every(content => workingResourceIds.includes(content.id));
if(this.contentList.every(content => workingResourceIds.includes(content.id))){
this.contentList.forEach(resource => {
if(resource.kind === ContentNodeKinds.TOPIC){
this.addToWorkingResourcePool(resource.children.results);
}
});
return true;
}else{
return false;
}
},
selectAllIndeterminate() {
// Returns true if some, but not all, of the resources in the topic are in the working
Expand Down Expand Up @@ -397,9 +406,7 @@
selectionMetadata(content) {
if (content.kind === ContentNodeKinds.TOPIC) {
const count = this.workingResourcePool.length;
const total = content.children.results.length;
console.log(content);
console.log(this.workingResourcePool);
const total = content.num_exercises;
return this.selectedResourcesInformation$({ count, total });
}
return '';
Expand Down

0 comments on commit 1596e8c

Please sign in to comment.