OK, I have asked php to output the array as a text file and it seems that the array is arriving truncated from the javascript!
// ------------------------- using AJAX request ----------------------------//
function postIt() {
var http = new XMLHttpRequest();
var url = “…/mail/testSum.php”;
var params = “realname=”+myName+"&rightAnswers="+correct+"&percentageScore="+percentage+"&wrongArray="+wstore+"&asked="+numq+"&mins="+minutes+"&secs="+seconds+"&deliver="+destination+"&testName="+test;
http.open(“GET”, url+"?"+params, true);
http.onreadystatechange = function() { //Call a function when the state changes.
if(http.readyState == 4 && http.status == 200) {
//alert(http.responseText);
}
}
http.send(null);
}
// --------------------------------- end AJAX ------------------------------
If I alert the array (string) in Javascript I get:
1. How many moles of an ideal gas are in a volume of 195.2 dm3 with a temperature of 450 Kelvin and a pressure of 71.6 kPa ?
Answer = 3.74 mol
,
2. What is the temperature of an ideal gas in °C, if a 1.063 mol sample occupies a volume of 119.8 dm3 at a pressure of 74.9 kPa ?
Answer = 743 °C
,
3. What is the volume in cm3 of an ideal gas, if a 0.024 mol sample has a temperature of 574 °C at a pressure of 156.7 kPa ?
Answer = 1080 cm3
,
4. How many moles of an ideal gas are in a volume of 26.1 cm3 with a temperature of 490 °C and a pressure of 84.2 kPa ?
Answer = 0.35 mol
,
5. What is the pressure of an ideal gas in kPa ,if a 0.019 mol sample occupies a volume of 108.5 cm3 at a temperature of 567 °C ?
Answer = 1.22 kPa
You see that the degree signs are in there …
BUT the text file output from php reads:
Incorrectly answered:
1. How many moles of an ideal gas are in a volume of 195.2 dm3 with a temperature of 450 Kelvin and a pressure of 71.6 kPa ?
Answer = 3.74 mol
,
2. What is the temperature of an ideal gas in ,