Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

MDL-12025, enable row markings via javascript to keep track of curren…

…t row
  • Loading branch information...
commit cc95d22fd8a1dadf82c77c3a1788aefb8c248679 1 parent a900582
toyomoyo authored
21 grade/report/grader/functions.js
... ... @@ -0,0 +1,21 @@
  1 +/**
  2 + * enables highlight of rows in user grade tables
  3 + *
  4 + */
  5 +function markRowsInit() {
  6 + // for every table row ...
  7 + var rows = document.getElementById('user-grades').getElementsByTagName('tr');
  8 + for ( var i = 0; i < rows.length; i++ ) {
  9 + // ... with the class 'odd' or 'even' ...
  10 + // ... and to mark the row on click ...
  11 + rows[i].onmousedown = function() {
  12 +
  13 + if (this.className.search(/marked/) != -1) {
  14 + this.className = this.className.replace(' marked', '');
  15 + } else {
  16 + this.className += ' marked';
  17 + }
  18 + }
  19 + }
  20 +}
  21 +window.onload=markRowsInit;
4 grade/report/grader/index.php
@@ -159,7 +159,9 @@
159 159 print_paging_bar($numusers, $report->page, $studentsperpage, $report->pbarurl);
160 160 }
161 161
162   -$reporthtml = '<table id="user-grades" class="gradestable flexible boxaligncenter generaltable">';
  162 +$reporthtml = '<script src="functions.js" type="text/javascript"></script>';
  163 +
  164 +$reporthtml .= '<table id="user-grades" class="gradestable flexible boxaligncenter generaltable">';
163 165 $reporthtml .= $report->get_headerhtml();
164 166 $reporthtml .= $report->get_rangehtml();
165 167 $reporthtml .= $report->get_studentshtml();
4 grade/report/grader/styles.php
... ... @@ -1,4 +1,8 @@
1 1
  2 +.grade-report-grader table#user-grades tr.marked td.cell {
  3 + background-color: #FFCC99 ;
  4 +}
  5 +
2 6 .grade-report-grader table#user-grades .catlevel1 {
3 7 background-color: #ffffff;
4 8 }

0 comments on commit cc95d22

Please sign in to comment.
Something went wrong with that request. Please try again.