aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changelog1
-rw-r--r--GradeBook.js20
-rwxr-xr-xGradeBook.tcl3
-rwxr-xr-xGradeBook_lib.tcl6
4 files changed, 30 insertions, 0 deletions
diff --git a/Changelog b/Changelog
index 0da87bd..2a7b68d 100644
--- a/Changelog
+++ b/Changelog
@@ -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>"
}