diff --git a/src/core/features/grades/services/grades-helper.ts b/src/core/features/grades/services/grades-helper.ts index 202a5c75b..f75d1185e 100644 --- a/src/core/features/grades/services/grades-helper.ts +++ b/src/core/features/grades/services/grades-helper.ts @@ -118,6 +118,12 @@ export class CoreGradesHelperProvider { row.gradeClass = column.class.includes('gradepass') ? 'text-success' : (column.class.includes('gradefail') ? 'text-danger' : ''); + if (content.includes('action-menu')) { + content = CoreTextUtils.processHTML(content, (element) => { + element.querySelector('.action-menu')?.parentElement?.remove(); + }); + } + if (content.includes('fa-check')) { row.gradeIcon = 'fas-check'; row.gradeIconAlt = Translate.instant('core.grades.pass'); diff --git a/src/core/services/utils/text.ts b/src/core/services/utils/text.ts index acec137e3..ba5c93c35 100644 --- a/src/core/services/utils/text.ts +++ b/src/core/services/utils/text.ts @@ -273,6 +273,21 @@ export class CoreTextUtilsProvider { return Translate.instant('core.humanreadablesize', { size: bytes, unit: units[keys[pos]] }); } + /** + * Process HTML string. + * + * @param text HTML string. + * @param process Method to process the HTML. + * @returns Processed HTML string. + */ + processHTML(text: string, process: (element: HTMLElement) => unknown): string { + const element = this.convertToElement(text); + + process(element); + + return element.innerHTML; + } + /** * Clean HTML tags. *