MOBILE-2858 grades: Improve course grades preformat
parent
92419e2799
commit
442c184ac0
|
@ -85,6 +85,10 @@ export class CoreGradesHelperProvider {
|
||||||
let content = String(tableRow[name].content);
|
let content = String(tableRow[name].content);
|
||||||
|
|
||||||
if (name == 'itemname') {
|
if (name == 'itemname') {
|
||||||
|
row['id'] = parseInt(tableRow[name].id.split('_')[1], 10);
|
||||||
|
row['colspan'] = tableRow[name].colspan;
|
||||||
|
row['rowspan'] = (tableRow['leader'] && tableRow['leader'].rowspan) || 1;
|
||||||
|
|
||||||
this.setRowIcon(row, content);
|
this.setRowIcon(row, content);
|
||||||
row['rowclass'] = tableRow[name].class.indexOf('leveleven') < 0 ? 'odd' : 'even';
|
row['rowclass'] = tableRow[name].class.indexOf('leveleven') < 0 ? 'odd' : 'even';
|
||||||
row['rowclass'] += tableRow[name].class.indexOf('hidden') >= 0 ? ' hidden' : '';
|
row['rowclass'] += tableRow[name].class.indexOf('hidden') >= 0 ? ' hidden' : '';
|
||||||
|
@ -92,10 +96,6 @@ export class CoreGradesHelperProvider {
|
||||||
|
|
||||||
content = content.replace(/<\/span>/gi, '\n');
|
content = content.replace(/<\/span>/gi, '\n');
|
||||||
content = this.textUtils.cleanTags(content);
|
content = this.textUtils.cleanTags(content);
|
||||||
|
|
||||||
row['id'] = parseInt(tableRow[name].id.split('_')[1], 10);
|
|
||||||
row['colspan'] = tableRow[name].colspan;
|
|
||||||
row['rowspan'] = (tableRow['leader'] && tableRow['leader'].rowspan) || 1;
|
|
||||||
name = 'gradeitem';
|
name = 'gradeitem';
|
||||||
} else {
|
} else {
|
||||||
content = this.textUtils.replaceNewLines(content, '<br>');
|
content = this.textUtils.replaceNewLines(content, '<br>');
|
||||||
|
@ -439,9 +439,17 @@ export class CoreGradesHelperProvider {
|
||||||
row['image'] = this.courseProvider.getModuleIconSrc(module[1],
|
row['image'] = this.courseProvider.getModuleIconSrc(module[1],
|
||||||
this.domUtils.convertToElement(text).querySelector('img').getAttribute('src'));
|
this.domUtils.convertToElement(text).querySelector('img').getAttribute('src'));
|
||||||
}
|
}
|
||||||
} else if (text.indexOf('src=') > -1) {
|
} else {
|
||||||
const src = text.match(/src="([^"]*)"/);
|
if (row['rowspan']) {
|
||||||
row['image'] = src[1];
|
row['itemtype'] = 'category';
|
||||||
|
row['icon'] = 'fa-folder';
|
||||||
|
} else if (text.indexOf('src=') > -1) {
|
||||||
|
const src = text.match(/src="([^"]*)"/);
|
||||||
|
row['image'] = src[1];
|
||||||
|
} else if (text.indexOf('<i ') > -1) {
|
||||||
|
const src = text.match(/class="fa-([^ ]*)"/);
|
||||||
|
row['icon'] = src[1];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return row;
|
return row;
|
||||||
|
|
Loading…
Reference in New Issue