Skip to content
Permalink
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<h3>Rate the paragraphs on a scale of 1 to 5</h3>
<h4>Paragraph One</h4>
<p id = "first"></p>
<h5>Rating:</h5>
<form >
<input type="radio" name="choice" value="1"> 1
<input type="radio" name="choice" value="2"> 2
<input type="radio" name="choice" value="3"> 3
<input type="radio" name="choice" value="4"> 4
<input type="radio" name="choice" value="5"> 5
</form>
<button onclick="submitAnswer()">Submit Answer</button>
<h4>Paragraph Two</h4>
<p id = "second"></p>
<h5>Rating:</h5>
<form >
<input type="radio" name="choice" value="1"> 1
<input type="radio" name="choice" value="2"> 2
<input type="radio" name="choice" value="3"> 3
<input type="radio" name="choice" value="4"> 4
<input type="radio" name="choice" value="5"> 5
</form>
<button onclick="submitAnswer()">Submit Answer</button>
<h4>Paragraph Three</h4>
<p id = "third"></p>
<h5>Rating:</h5>
<form >
<input type="radio" name="choice" value="1"> 1
<input type="radio" name="choice" value="2"> 2
<input type="radio" name="choice" value="3"> 3
<input type="radio" name="choice" value="4"> 4
<input type="radio" name="choice" value="5"> 5
</form>
<button onclick="submitAnswer()">Submit Answer</button>
<h4>Paragraph Four</h4>
<p id = "fourth"></p>
<h5>Rating:</h5>
<form >
<input type="radio" name="choice" value="1"> 1
<input type="radio" name="choice" value="2"> 2
<input type="radio" name="choice" value="3"> 3
<input type="radio" name="choice" value="4"> 4
<input type="radio" name="choice" value="5"> 5
</form>
<button onclick="submitAnswer()">Submit Answer</button>
<h4>Paragraph Five</h4>
<p id = "fifth"></p>
<h5>Rating:</h5>
<form >
<input type="radio" name="choice" value="1"> 1
<input type="radio" name="choice" value="2"> 2
<input type="radio" name="choice" value="3"> 3
<input type="radio" name="choice" value="4"> 4
<input type="radio" name="choice" value="5"> 5
</form>
<button onclick="submitAnswer()">Submit Answer</button>
<script>
getData();
async function getData() {
const response = await fetch('dyslexia_embeddings_ada.csv');
const data = await response.text();
console.log(data);
const rows1 = data.split('\n').slice(6, 7);
console.log(rows1);
rows1.forEach(elt => {
const row = elt.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
const completion = row[1];
console.log(completion);
document.getElementById("first").innerHTML = completion;
});
const rows2 = data.split('\n').slice(12, 13);
console.log(rows2);
rows2.forEach(elt => {
const row = elt.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
const completion = row[1];
console.log(completion);
document.getElementById("second").innerHTML = completion;
});
const rows3 = data.split('\n').slice(18, 19);
console.log(rows3);
rows3.forEach(elt => {
const row = elt.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
const completion = row[1];
console.log(completion);
document.getElementById("third").innerHTML = completion;
});
const rows4 = data.split('\n').slice(24, 25);
console.log(rows4);
rows4.forEach(elt => {
const row = elt.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
const completion = row[1];
console.log(completion);
document.getElementById("fourth").innerHTML = completion;
});
const rows5 = data.split('\n').slice(30, 31);
console.log(rows5);
rows5.forEach(elt => {
const row = elt.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);
const completion = row[1];
console.log(completion);
document.getElementById("fifth").innerHTML = completion;
});
};
var submitAnswer = function() {
var radios = document.getElementsByName('choice');
var val= "";
for (var i = 0, length = radios.length; i < length; i++) {
if (radios[i].checked) {
val = radios[i].value;
break;
}
}
};
</script>
</body>
</html>