/************* WARNING: THIS IS A GLOBAL VARIABLE. ********************/ // Reference to the 'events' array in Events.js var events; /** * Sets the events. * @param theEvents Reference to the 'events' array in Events.js. */ function setEvents(theEvents) { events = theEvents; } // Collect all the ratings from the events function collectRatings() { var output = "" var ratingCount = 0 // Consider each event in the incident script for (var evtidx = 0; evtidx < events.length; evtidx++) { // Does this event have any evaluations? if (events[evtidx].evaluations.evaluations.length > 0) { // Examine each evaluation contained in this event for (var rating=0; rating 0) { // Build a string for the log in this format: //03:01:00, Evaluation, CMS, Poor output += events[evtidx].time.format() +", Evaluation, "+item.type + ", " + item.ratingQualities[item.rating] + "\n" ratingCount += 1; } } } } submitRatings(output); alert(ratingCount + " rating were saved.") } /* This is an alternative way to collect the ratings values by reading them directly from the radio buttons function collectRadios() { var radios = document.getElementsByTagName('input'); var count = 0; for (var j=0; j