]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-12025, enable row markings via javascript to keep track of current row
authortoyomoyo <toyomoyo>
Wed, 7 Nov 2007 07:46:33 +0000 (07:46 +0000)
committertoyomoyo <toyomoyo>
Wed, 7 Nov 2007 07:46:33 +0000 (07:46 +0000)
grade/report/grader/functions.js [new file with mode: 0755]
grade/report/grader/index.php
grade/report/grader/styles.php

diff --git a/grade/report/grader/functions.js b/grade/report/grader/functions.js
new file mode 100755 (executable)
index 0000000..4c37491
--- /dev/null
@@ -0,0 +1,21 @@
+/**
+ * enables highlight of rows in user grade tables
+ *
+ */
+function markRowsInit() {
+    // for every table row ...
+    var rows = document.getElementById('user-grades').getElementsByTagName('tr');
+    for ( var i = 0; i < rows.length; i++ ) {
+        // ... with the class 'odd' or 'even' ...
+        // ... and to mark the row on click ...
+        rows[i].onmousedown = function() {
+            
+            if (this.className.search(/marked/) != -1) {
+                this.className = this.className.replace(' marked', '');   
+            } else {
+                this.className += ' marked';
+            }
+        }
+    }
+}
+window.onload=markRowsInit;
\ No newline at end of file
index 3425d7ea60c2de34e00075a3f614df0e3ea64f99..fd8fda9349a12d3ba6a56c83d08a9e2fa74eeb4b 100644 (file)
@@ -159,7 +159,9 @@ if (!empty($studentsperpage)) {
     print_paging_bar($numusers, $report->page, $studentsperpage, $report->pbarurl);
 }
 
-$reporthtml = '<table id="user-grades" class="gradestable flexible boxaligncenter generaltable">';
+$reporthtml = '<script src="functions.js" type="text/javascript"></script>';
+
+$reporthtml .= '<table id="user-grades" class="gradestable flexible boxaligncenter generaltable">';
 $reporthtml .= $report->get_headerhtml();
 $reporthtml .= $report->get_rangehtml();
 $reporthtml .= $report->get_studentshtml();
index 0f082fefc011a555df485e9f884c163c641c0b58..76b244d24a103cd2eb805b7304476a195996b16b 100644 (file)
@@ -1,4 +1,8 @@
 
+.grade-report-grader table#user-grades tr.marked td.cell {
+    background-color: #FFCC99 ;
+}
+
 .grade-report-grader table#user-grades .catlevel1 {
   background-color: #ffffff;
 }