Merge pull request #14549 from JoolsMcFly/fix/change-challenge-description

change challenge description and update tests
pull/14578/head^2
Eric Leung 2017-06-27 05:10:24 -07:00 committed by GitHub
commit 35a6cebeb5
1 changed files with 7 additions and 7 deletions

View File

@ -1360,18 +1360,18 @@
}, },
{ {
"id": "bad87fee1348bd9aed008826", "id": "bad87fee1348bd9aed008826",
"title": "Target Even Numbered Elements Using jQuery", "title": "Target Even Elements Using jQuery",
"required": [ "required": [
{ {
"link": "https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.css" "link": "https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.2.0/animate.css"
} }
], ],
"description": [ "description": [
"You can also target all the even-numbered elements.", "You can also target elements based on their positions using <code>:odd</code> or <code>:even</code> selectors.",
"Here's how you would target all the odd-numbered elements with class <code>target</code> and give them classes:", "Note that jQuery is zero-indexed which means the first element in a selection has a position of 0. This can be a little confusing as, counter-intuitively, <code>:odd</code> selects the second element (position 1), fourth element (position 3), and so on.",
"Here's how you would target all the odd elements with class <code>target</code> and give them classes:",
"<code>$(\".target:odd\").addClass(\"animated shake\");</code>", "<code>$(\".target:odd\").addClass(\"animated shake\");</code>",
"Note that jQuery is zero-indexed, meaning that, counter-intuitively, <code>:odd</code> selects the second element, fourth element, and so on.", "Try selecting all the even <code>target</code> elements and giving them the classes of <code>animated</code> and <code>shake</code>. Remember that <strong>even</strong> refers to the position of elements with a zero-based system in mind."
"Try selecting all the even-numbered <code>target</code> elements and giving them the classes of <code>animated</code> and <code>shake</code>. Even-numbered is defined here with a zero-index in mind."
], ],
"challengeSeed": [ "challengeSeed": [
"fccss", "fccss",
@ -1415,8 +1415,8 @@
], ],
"tests": [ "tests": [
"assert($('.target:even').hasClass('animated') && $('.target:even').hasClass('shake'), 'message: All of the <code>target</code> elements that jQuery considers to be even should shake.');", "assert($('.target:even').hasClass('animated') && $('.target:even').hasClass('shake'), 'message: All of the <code>target</code> elements that jQuery considers to be even should shake.');",
"assert(code.match(/\\:even/g), 'message: You should use the <code>&#58;even</code> function to modify these elements.');", "assert(code.match(/\\:even/g), 'message: You should use the <code>&#58;even</code> selector to modify these elements.');",
"assert(code.match(/<button class=\"btn btn-default target\" id=\"target3\">/g), 'message: Only use jQuery to add these classes to the element.');" "assert(code.match(/\\$\\(\".target:even\"\\)/g) || code.match(/\\$\\('.target:even'\\)/g) || code.match(/\\$\\(\".target\"\\).filter\\(\":even\"\\)/g) || code.match(/\\$\\('.target'\\).filter\\(':even'\\)/g), 'message: Only use jQuery to add these classes to the element.');"
], ],
"type": "waypoint", "type": "waypoint",
"challengeType": 0, "challengeType": 0,