Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Pado
Behira Younes
Commits
8888f6b8
Commit
8888f6b8
authored
Oct 29, 2020
by
Ratnadeep Rajendra Kharade
Browse files
changed readerCategory to category and readelLevel to school level
parent
7b929697
Pipeline
#1110
passed with stages
in 2 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
public/index.html
View file @
8888f6b8
...
@@ -58,26 +58,28 @@
...
@@ -58,26 +58,28 @@
</div>
</div>
</div>
</div>
<div>
<div>
<label
for=
"
reader
Level"
>
Reader
Level:
</label>
<label
for=
"
school
Level"
>
School
Level:
</label>
<select
class=
"box-input"
id=
"
reader
Level"
onchange=
"
reader
LevelChangeEvent(event)"
>
<select
class=
"box-input"
id=
"
school
Level"
onchange=
"
school
LevelChangeEvent(event)"
>
<option
value=
"0"
>
Select level
</option>
<option
value=
"0"
>
Select level
</option>
<option
value=
"1"
>
First Year
</option>
<option
value=
"1"
>
First Year
</option>
<option
value=
"2"
>
Second Year
</option>
<option
value=
"2"
>
Second Year
</option>
<option
value=
"3"
>
Third Year
</option>
<option
value=
"3"
>
Third Year
</option>
<option
value=
"4"
>
Fourth Year
</option>
<option
value=
"4"
>
Fourth Year
</option>
</select>
</select>
<div
id=
"
reader
Level-validation"
class=
"error-message"
>
Please select the
reader
level.
</div>
<div
id=
"
school
Level-validation"
class=
"error-message"
>
Please select the
school
level.
</div>
</div>
</div>
<div>
<div>
<label
for=
"
readerC
ategory"
>
Reader
Category:
</label>
<label
for=
"
c
ategory"
>
Category:
</label>
<select
class=
"box-input"
id=
"
readerC
ategory"
onchange=
"
readerC
ategoryChangeEvent(event)"
>
<select
class=
"box-input"
id=
"
c
ategory"
onchange=
"
c
ategoryChangeEvent(event)"
>
<option
value=
"0"
>
Select category
</option>
<option
value=
"0"
>
Select category
</option>
<option
value=
"1"
>
Mixed-ability group
</option>
<option
value=
"1"
>
Mixed-ability group
</option>
<option
value=
"2"
>
High-ability group
</option>
<option
value=
"2"
>
High-ability group
</option>
<option
value=
"3"
>
Good-ability group
</option>
<option
value=
"3"
>
Good-ability group
</option>
<option
value=
"4"
>
Average-ability group
</option>
<option
value=
"4"
>
Average-ability group
</option>
<option
value=
"5"
>
Low-ability group
</option>
</select>
</select>
<div
id=
"
readerC
ategory-validation"
class=
"error-message"
>
Please select the
reader
category.
</div>
<div
id=
"
c
ategory-validation"
class=
"error-message"
>
Please select the category.
</div>
</div>
</div>
<div>
<div>
<div>
<div>
...
...
public/index.js
View file @
8888f6b8
...
@@ -3,8 +3,8 @@ let inputObj = {
...
@@ -3,8 +3,8 @@ let inputObj = {
textChoice
:
'
manual
'
,
// choice of text entry initially set as manual. Can have values manual, calculated
textChoice
:
'
manual
'
,
// choice of text entry initially set as manual. Can have values manual, calculated
text
:
''
,
// User entered text in case of manual
text
:
''
,
// User entered text in case of manual
textLength
:
''
,
// number of characters in text. Either from user entered text or user entered number
textLength
:
''
,
// number of characters in text. Either from user entered text or user entered number
reader
Level
:
''
,
// Value of
reader
level selected from dropdown
school
Level
:
''
,
// Value of
school
level selected from dropdown
readerC
ategory
:
''
// Value of
reader
category selected from dropdown
c
ategory
:
''
// Value of category selected from dropdown
};
};
...
@@ -80,18 +80,18 @@ function isFormValid() {
...
@@ -80,18 +80,18 @@ function isFormValid() {
document
.
getElementById
(
'
textCharacters-validation
'
).
style
.
display
=
'
none
'
;
document
.
getElementById
(
'
textCharacters-validation
'
).
style
.
display
=
'
none
'
;
}
}
if
(
inputObj
.
reader
Level
===
''
||
inputObj
.
reader
Level
===
0
)
{
if
(
inputObj
.
school
Level
===
''
||
inputObj
.
school
Level
===
0
)
{
invalidFields
++
;
invalidFields
++
;
document
.
getElementById
(
'
reader
Level-validation
'
).
style
.
display
=
'
block
'
;
document
.
getElementById
(
'
school
Level-validation
'
).
style
.
display
=
'
block
'
;
}
else
{
}
else
{
document
.
getElementById
(
'
reader
Level-validation
'
).
style
.
display
=
'
none
'
;
document
.
getElementById
(
'
school
Level-validation
'
).
style
.
display
=
'
none
'
;
}
}
if
(
inputObj
.
readerC
ategory
===
''
||
inputObj
.
readerC
ategory
===
0
)
{
if
(
inputObj
.
c
ategory
===
''
||
inputObj
.
c
ategory
===
0
)
{
invalidFields
++
;
invalidFields
++
;
document
.
getElementById
(
'
readerC
ategory-validation
'
).
style
.
display
=
'
block
'
;
document
.
getElementById
(
'
c
ategory-validation
'
).
style
.
display
=
'
block
'
;
}
else
{
}
else
{
document
.
getElementById
(
'
readerC
ategory-validation
'
).
style
.
display
=
'
none
'
;
document
.
getElementById
(
'
c
ategory-validation
'
).
style
.
display
=
'
none
'
;
}
}
return
invalidFields
<
1
return
invalidFields
<
1
...
@@ -105,16 +105,16 @@ function showFeedbackForm() {
...
@@ -105,16 +105,16 @@ function showFeedbackForm() {
}
}
// function
reader
LevelChangeEvent: listens for change in
reader
level dropdown
// function
school
LevelChangeEvent: listens for change in
school
level dropdown
// and sets selected value to property
reader
Level on inputObj
// and sets selected value to property
school
Level on inputObj
function
reader
LevelChangeEvent
(
event
)
{
function
school
LevelChangeEvent
(
event
)
{
inputObj
.
reader
Level
=
parseInt
(
event
.
target
.
value
);
inputObj
.
school
Level
=
parseInt
(
event
.
target
.
value
);
}
}
// function
readerC
ategoryChangeEvent: listens for change in
reader
category dropdown
// function
c
ategoryChangeEvent: listens for change in category dropdown
// and sets selected value to property
readerC
ategory on inputObj
// and sets selected value to property
c
ategory on inputObj
function
readerC
ategoryChangeEvent
(
event
)
{
function
c
ategoryChangeEvent
(
event
)
{
inputObj
.
readerC
ategory
=
parseInt
(
event
.
target
.
value
);
inputObj
.
c
ategory
=
parseInt
(
event
.
target
.
value
);
}
}
...
@@ -131,12 +131,12 @@ function calculateReadingTime() {
...
@@ -131,12 +131,12 @@ function calculateReadingTime() {
// TODO: logic or algorithm for calculating reading time goes here
// TODO: logic or algorithm for calculating reading time goes here
// inputObj.textLength has number of characters (number data type)
// inputObj.textLength has number of characters (number data type)
// inputObj.
reader
Level has level of
reader
(number data type)
// inputObj.
school
Level has level of
school
(number data type)
// inputObj.
readerC
ategory has category of reader (number data type)
// inputObj.
c
ategory has category of reader (number data type)
// example calculation
// example calculation
x
=
(
inputObj
.
textLength
*
inputObj
.
reader
Level
*
inputObj
.
readerC
ategory
);
x
=
(
inputObj
.
textLength
*
inputObj
.
school
Level
*
inputObj
.
c
ategory
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment