diff options
-rw-r--r-- | Changelog | 1 | ||||
-rw-r--r-- | GradeBook.js | 20 | ||||
-rwxr-xr-x | GradeBook.tcl | 3 | ||||
-rwxr-xr-x | GradeBook_lib.tcl | 6 |
4 files changed, 30 insertions, 0 deletions
@@ -5,6 +5,7 @@ v2.6.2pre * Grade and histogram have their own styles * Using skipAplus settings from config * More elegant display of the grading scheme + * Added javascript to toggle visibility of histogram marker and grading scheme v2.6.1 * Users can see grading scheme * Added grades in the column histogram calculation (not yet displayed) diff --git a/GradeBook.js b/GradeBook.js new file mode 100644 index 0000000..269f008 --- /dev/null +++ b/GradeBook.js @@ -0,0 +1,20 @@ +function toggleHTMLClassVisibility(className) { + var x = document.getElementsByClassName(className); + var i; + for (i = 0; i < x.length; i++) { + if (x[i].style.display === "none") { + x[i].style.display = "block"; + } else { + x[i].style.display = "none"; + } + } +}; + +function toggleHistogramMarker() { + toggleHTMLClassVisibility("histogram_marker"); +}; + +function toggleGradingScheme() { + toggleHTMLClassVisibility("grading_scheme"); +}; + diff --git a/GradeBook.tcl b/GradeBook.tcl index 54e112e..a646987 100755 --- a/GradeBook.tcl +++ b/GradeBook.tcl @@ -107,6 +107,9 @@ if { [file exists $dbfile] && ("$coursedbfname" ne "") } { sqlite3 db $dbfile htmlHeader puts "<body>" + puts {\ + <script src="/~evmik/GradeBook.js"></script> + } set permission_list [ AccessGroupRights db $user ] htmlTop $permission_list diff --git a/GradeBook_lib.tcl b/GradeBook_lib.tcl index 5c5900d..7ebf701 100755 --- a/GradeBook_lib.tcl +++ b/GradeBook_lib.tcl @@ -2794,6 +2794,12 @@ proc ShowControls { permission_list user } { } } + # buttons to call javascript styles + puts {\ + <br> + <button onclick="toggleHistogramMarker()">Toggle histogram marker</button> + <button onclick="toggleGradingScheme()">Toggle grading scheme</button> + } puts "</div>" } |