Commit 8888f6b8 authored by Ratnadeep Rajendra Kharade's avatar Ratnadeep Rajendra Kharade
Browse files

changed readerCategory to category and readelLevel to school level

parent 7b929697
Pipeline #1110 passed with stages
in 2 seconds
......@@ -58,26 +58,28 @@
</div>
</div>
<div>
<label for="readerLevel">Reader Level:</label>
<select class="box-input" id="readerLevel" onchange="readerLevelChangeEvent(event)">
<label for="schoolLevel">School Level:</label>
<select class="box-input" id="schoolLevel" onchange="schoolLevelChangeEvent(event)">
<option value="0">Select level</option>
<option value="1">First Year</option>
<option value="2">Second Year</option>
<option value="3">Third Year</option>
<option value="4">Fourth Year</option>
</select>
<div id="readerLevel-validation" class="error-message">Please select the reader level.</div>
<div id="schoolLevel-validation" class="error-message">Please select the school level.</div>
</div>
<div>
<label for="readerCategory">Reader Category:</label>
<select class="box-input" id="readerCategory" onchange="readerCategoryChangeEvent(event)">
<label for="category">Category:</label>
<select class="box-input" id="category" onchange="categoryChangeEvent(event)">
<option value="0">Select category</option>
<option value="1">Mixed-ability group</option>
<option value="2">High-ability group</option>
<option value="3">Good-ability group</option>
<option value="4">Average-ability group</option>
<option value="5">Low-ability group</option>
</select>
<div id="readerCategory-validation" class="error-message">Please select the reader category.</div>
<div id="category-validation" class="error-message">Please select the category.</div>
</div>
<div>
<div>
......
......@@ -3,8 +3,8 @@ let inputObj = {
textChoice: 'manual', // choice of text entry initially set as manual. Can have values manual, calculated
text: '', // User entered text in case of manual
textLength: '', // number of characters in text. Either from user entered text or user entered number
readerLevel: '', // Value of reader level selected from dropdown
readerCategory: '' // Value of reader category selected from dropdown
schoolLevel: '', // Value of school level selected from dropdown
category: '' // Value of category selected from dropdown
};
......@@ -80,18 +80,18 @@ function isFormValid() {
document.getElementById('textCharacters-validation').style.display = 'none';
}
if (inputObj.readerLevel === '' || inputObj.readerLevel === 0) {
if (inputObj.schoolLevel === '' || inputObj.schoolLevel === 0) {
invalidFields++;
document.getElementById('readerLevel-validation').style.display = 'block';
document.getElementById('schoolLevel-validation').style.display = 'block';
} else {
document.getElementById('readerLevel-validation').style.display = 'none';
document.getElementById('schoolLevel-validation').style.display = 'none';
}
if (inputObj.readerCategory === ''|| inputObj.readerCategory === 0) {
if (inputObj.category === ''|| inputObj.category === 0) {
invalidFields++;
document.getElementById('readerCategory-validation').style.display = 'block';
document.getElementById('category-validation').style.display = 'block';
} else {
document.getElementById('readerCategory-validation').style.display = 'none';
document.getElementById('category-validation').style.display = 'none';
}
return invalidFields < 1
......@@ -105,16 +105,16 @@ function showFeedbackForm() {
}
// function readerLevelChangeEvent: listens for change in reader level dropdown
// and sets selected value to property readerLevel on inputObj
function readerLevelChangeEvent(event) {
inputObj.readerLevel = parseInt(event.target.value);
// function schoolLevelChangeEvent: listens for change in school level dropdown
// and sets selected value to property schoolLevel on inputObj
function schoolLevelChangeEvent(event) {
inputObj.schoolLevel = parseInt(event.target.value);
}
// function readerCategoryChangeEvent: listens for change in reader category dropdown
// and sets selected value to property readerCategory on inputObj
function readerCategoryChangeEvent(event) {
inputObj.readerCategory = parseInt(event.target.value);
// function categoryChangeEvent: listens for change in category dropdown
// and sets selected value to property category on inputObj
function categoryChangeEvent(event) {
inputObj.category = parseInt(event.target.value);
}
......@@ -131,12 +131,12 @@ function calculateReadingTime() {
// TODO: logic or algorithm for calculating reading time goes here
// inputObj.textLength has number of characters (number data type)
// inputObj.readerLevel has level of reader (number data type)
// inputObj.readerCategory has category of reader (number data type)
// inputObj.schoolLevel has level of school (number data type)
// inputObj.category has category of reader (number data type)
// example calculation
x = (inputObj.textLength * inputObj.readerLevel * inputObj.readerCategory);
x = (inputObj.textLength * inputObj.schoolLevel * inputObj.category);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment