Changeset 631 in tmcsimulator for trunk/webapps/einotebook
- Timestamp:
- 02/03/2021 06:19:49 AM (5 years ago)
- Location:
- trunk/webapps/einotebook
- Files:
-
- 3 edited
-
script/scrollframe.js (modified) (2 diffs)
-
scripts/Evaluation.js (modified) (6 diffs)
-
scripts/LoadEvents.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/webapps/einotebook/script/scrollframe.js
r551 r631 12 12 } 13 13 14 // Collect all the ratings from the events 14 // Collect all the ratings from the events - OBSOLETE 15 15 function collectRatings() 16 16 { … … 62 62 */ 63 63 64 // Send the string of ratings to the server 64 // Send the string of ratings to the server - OBSOLETE 65 65 function submitRatings(logString) 66 66 { -
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>" + -
trunk/webapps/einotebook/scripts/LoadEvents.js
r546 r631 104 104 var evalType = tagName.replace("_EVALUATION",""); 105 105 // Build the evaluation item 106 var evalItem = new Evaluation(evalType, 106 var evalItem = new Evaluation(evalType, evtTime, 107 107 parseEvaluation(currEvt.childNodes[child]) ); 108 108 evalarray.push(evalItem); … … 110 110 111 111 case "CMS_EVALUATION": 112 var cmsEval = new Evaluation("CMS", parseCMSEvaluation(currEvt.childNodes[child]));112 var cmsEval = new Evaluation("CMS", evtTime, parseCMSEvaluation(currEvt.childNodes[child])); 113 113 evalarray.push(cmsEval); 114 114 break;
Note: See TracChangeset
for help on using the changeset viewer.
