Changeset 631 in tmcsimulator for trunk/webapps/einotebook/scripts/Evaluation.js
- Timestamp:
- 02/03/2021 06:19:49 AM (5 years ago)
- File:
-
- 1 edited
-
trunk/webapps/einotebook/scripts/Evaluation.js (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/webapps/einotebook/scripts/Evaluation.js
r551 r631 4 4 * @param data Array(label1, text1, label2, text2, ...) 5 5 */ 6 function Evaluation(type, data)6 function Evaluation(type, evttime, data) 7 7 { 8 8 //========== private static members ==========// … … 16 16 this.type = type; 17 17 this.data = data; 18 this.evttime = evttime; 18 19 19 20 //========== public read-only members ==========// … … 25 26 this.recordText = recordText; 26 27 this.recordRating = recordRating; 28 this.writeRating = writeRating; 27 29 28 30 //========== private methods ==========// … … 70 72 71 73 /** 72 * Stores the rating given by the evaluation scale radio button form. 74 * Stores the rating given by the evaluation scale radio button form. --OBSOLETE 73 75 */ 74 76 function recordRating(givenRating) … … 77 79 this.rating = givenRating; 78 80 //console.log(this.ratingGroupName + " recordRating of " + this.rating ) 81 } 82 /** 83 * Write an individual rating to a log file 84 */ 85 function writeRating(givenRating) 86 { 87 //alert("writeRating: " + givenRating + " : " + this.evttime.format()) 88 // Build a string for the log in this format: 89 //03:01:00, Evaluation, CMS, Poor 90 logString = this.evttime.format() + ", Evaluation, " + this.type + ", " + this.ratingQualities[givenRating] + "\n" 91 // Using POST to send the data 92 var xhr = new XMLHttpRequest(); 93 xhr.open("POST", "/cgi-bin/appendRatingToLog.py", true); 94 xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 95 // send the collected data 96 xhr.send("msg="+logString); 79 97 } 80 98 … … 113 131 (this.rating == 5 ? "checked='true'" : "") + 114 132 " onchange='events.getEvaluation(" + this.id + 115 "). recordRating(5)' name='" + this.ratingGroupName +116 "' value=' 1'></td>" +133 ").writeRating(5)' name='" + this.ratingGroupName + 134 "' value='5'></td>" + 117 135 "<td align='center'><input type='radio' " + 118 136 (this.rating == 4 ? "checked='true'" : "") + 119 137 " onchange='events.getEvaluation(" + this.id + 120 "). recordRating(4)' name='" + this.ratingGroupName +121 "' value=' 2'></td>" +138 ").writeRating(4)' name='" + this.ratingGroupName + 139 "' value='4'></td>" + 122 140 "<td align='center'><input type='radio' " + 123 141 (this.rating == 3 ? "checked='true'" : "") + 124 142 " onchange='events.getEvaluation(" + this.id + 125 "). recordRating(3)' name='" + this.ratingGroupName +143 ").writeRating(3)' name='" + this.ratingGroupName + 126 144 "' value='3'></td>" + 127 145 "<td align='center'><input type='radio' " + 128 146 (this.rating == 2 ? "checked='true'" : "") + 129 147 " onchange='events.getEvaluation(" + this.id + 130 "). recordRating(2)' name='" + this.ratingGroupName +131 "' value=' 4'></td>" +148 ").writeRating(2)' name='" + this.ratingGroupName + 149 "' value='2'></td>" + 132 150 "<td align='center'><input type='radio' " + 133 151 (this.rating == 1 ? "checked='true'" : "") + 134 152 " onchange='events.getEvaluation(" + this.id + 135 "). recordRating(1)' name='" + this.ratingGroupName +136 "' value=' 5'></td>" +153 ").writeRating(1)' name='" + this.ratingGroupName + 154 "' value='1'></td>" + 137 155 "</tr>" + 138 156 "</table>" +
Note: See TracChangeset
for help on using the changeset viewer.
