Changeset 551 in tmcsimulator for trunk/webapps/einotebook/script/scrollframe.js
- Timestamp:
- 12/26/2019 03:14:52 PM (6 years ago)
- File:
-
- 1 edited
-
trunk/webapps/einotebook/script/scrollframe.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/webapps/einotebook/script/scrollframe.js
r548 r551 12 12 } 13 13 14 // Collect all the ratings from the events 14 15 function collectRatings() 15 16 { 17 var output = "" 18 var ratingCount = 0 16 19 // Consider each event in the incident script 17 20 for (var evtidx = 0; evtidx < events.length; evtidx++) … … 27 30 // If it not the default value we want to save it 28 31 if (item.rating > 0) 29 { 30 console.log("collecting event"+evtidx + " at " + events[evtidx].time.format() +" "+item.type + " " + item.rating) 32 { // Build a string for the log in this format: 33 //03:01:00, Evaluation, CMS, Poor 34 output += events[evtidx].time.format() +", Evaluation, "+item.type + ", " + item.ratingQualities[item.rating] + "\n" 35 ratingCount += 1; 31 36 } 32 37 } 33 38 } 34 39 } 40 submitRatings(output); 41 alert(ratingCount + " rating were saved.") 35 42 } 36 43 … … 55 62 */ 56 63 57 // TODO58 function submitRatings( )64 // Send the string of ratings to the server 65 function submitRatings(logString) 59 66 { 60 67 // Using POST to send the data 61 68 var xhr = new XMLHttpRequest(); 62 xhr.open("POST", " ../../cgi-bin/saveRatings.py", true);69 xhr.open("POST", "/cgi-bin/saveRatingsToLog.py", true); 63 70 xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 64 71 // send the collected data 65 xhr.send("msg="+ outString);72 xhr.send("msg="+logString); 66 73 }
Note: See TracChangeset
for help on using the changeset viewer.
