Learning Javascript

  • Thread starter Elizabeth Barnwell
  • Start date
E

Elizabeth Barnwell

We've built this tool to help with the process of learning programming
languages. You can use material on the site, or add your own to study.
We've just rolled out a lot of changes to YoYoBrain, so feedback is
much appreciated.
http://www.yoyobrain.com/subjects/show/240

Thanks,

Elizabeth
 
P

Peter Michaux

We've built this tool to help with the process of learning programming
languages. You can use material on the site, or add your own to study.
We've just rolled out a lot of changes to YoYoBrain, so feedback is
much appreciated.http://www.yoyobrain.com/subjects/show/240

The presentation has changed but the content hasn't seemed to change
which would be of interest to the contributors to
comp.lang.javascript. It seems as through previous feedback about
content has not resulted in change.

<URL: http://groups.google.com/group/comp...2fbbe5190a2/c0d02e1af7305ffe#c0d02e1af7305ffe>

Peter
 
T

Thomas 'PointedEars' Lahn

dhtml said:
A lot of the questions aren't good flashcard questions. A lot of the
answers are wrong. Peter already pointed out in an earlier thread.

Here's just an example of a few wrong answers:

The answers are not all wrong, but some questions are and some questions are
worded imprecisely.
Q: What is ECMAScript in JavaScript
A: standard extension for JavaScript that extends methods for processing XML

The answer is correct for the question "What is E4X in JavaScript 1.6 and
later?". ISTM the person devising the question has confused ECMA-262
(ECMAScript) and ECMA-357 (ECMAScript for XML).
Q: Form element property to grab the value of the element - like text in
input box
A: value

This is correct, but worded imprecisely.
Q: How do you avoid using the brittle position dependent arrays to get at
form elements:

They are _not_ arrays.
document.forms[0].elements[

This should be a syntactically valid expression, say

document.forms[0].elements[0]
A: use the name attribute for the tags, so if you had a form signup with
a field first_name

document.signup.first_name

This is correct, but worded imprecisely; attributes are on elements, not
tags, although they are set in an element's start tag. And the suggestion
should be standards-compliant --

document.forms[0].elements["first_name"]

-- to correspond with the question.
Q: Form element property to grab the form that the element belongs to
A: form

Correct, although the question is worded imprecisely. `form' is the
property of form *control objects* to do so. Those objects represent form
controls (certain interactive child elements of the `form' element) in the DOM.
Q: How do you grab an array of all the input elements on a form
A: elements[] array

`elements' is not an array but a NodeList, and the `[]' is misleading;
otherwise this is correct.
Q: Event property that gives the current node on which the event is
responding - which may be different from the target of the event
A: currentTarget

Somewhat correct.
All wrong. I'd say about half of the information there is wrong.

You may want to reevaluate your assessment.


PointedEars
 
L

Lasse Reichstein Nielsen

Thomas 'PointedEars' Lahn said:
You may want to reevaluate your assessment.

As *written*, these examples are wrong (exept the "currentTarget"
one). If we allow for a more generous interpretation of the questions,
like allowing "form element" to mean "form control" (even though "form
element" is meaningfull and means something else), then they do make
sense. Even then, "document.signup.first_name" is not an answer to
recommend.

The problem with quiz questions that are "wrong as written" is that the
only thing they test is the testee's ability to understand and correct
for the mistakes made by the test writer.

/L
 
T

Thomas 'PointedEars' Lahn

Lasse said:
The problem with quiz questions that are "wrong as written" is that the
only thing they test is the testee's ability to understand and correct
for the mistakes made by the test writer.

ACK.


Regards,

PointedEars
 
D

dhtml

The answers are not all wrong, but some questions are and some questions are
worded imprecisely.

The answers are wrong. If you misinterpret the misworded questions,
then its possible to get to what the author is thinking. That's not
good.

This is correct, but worded imprecisely.

A FORM element doesn't have a value. FORM controls (INPUT, TEXTAREA,
et c) do.
Q: How do you avoid using the brittle position dependent arrays to get at
form elements:

They are _not_ arrays.
document.forms[0].elements[

This should be a syntactically valid expression, say

  document.forms[0].elements[0]
A: use the name attribute for the tags, so if you had a form signup with
 a field first_name
document.signup.first_name

This is correct, but worded imprecisely; attributes are on elements, not
tags, although they are set in an element's start tag.  And the suggestion
should be standards-compliant --

There is no 'brittle position dependent arrays'. Making up words is
fine for chat at the grocery store, et c.
Calling an HTMLCollection an Array is very misleading. This is
harmful.

  document.forms[0].elements["first_name"]

-- to correspond with the question.

The question is misleading.
Correct, although the question is worded imprecisely.  `form' is the
property of form *control objects* to do so.

 Those objects represent form
controls (certain interactive child elements of the `form' element) in the DOM.

FORM controls don't have to be children, descendents in HTML 4, but
not children.
Q: How do you grab an array of all the input elements on a form
A: elements[] array

`elements' is not an array but a NodeList, and the `[]' is misleading;
otherwise this is correct.

Not quite. 'elements' is an HTMLCollection.
http://www.w3.org/TR/DOM-Level-2-HTML/ecma-script-binding.html
elements
This read-only property is an object that implements the
HTMLCollection interface.

'currentTarget' is the EventTarget (Node, window, et c) that the
EventListener was registered on.

Used to indicate the EventTarget whose EventListeners are currently
being processed. This is particularly useful during capturing and
bubbling.

http://www.w3.org/TR/DOM-Level-2-Events/events.html
You may want to reevaluate your assessment.

I did and I stand by that.


Garrett
 
T

Thomas 'PointedEars' Lahn

dhtml said:
The answers are wrong. If you misinterpret the misworded questions,
then its possible to get to what the author is thinking. That's not
good.

I do not follow.
A FORM element doesn't have a value. FORM controls (INPUT, TEXTAREA,
et c) do.

There is no such thing as a FORM control :) The ambiguity here is "form
element".
Those objects represent form

FORM controls don't have to be children, descendents in HTML 4, but
not children.

Isn't it interesting that you complain about wrong terminology but are
unable to use correct terminology yourself?
'currentTarget' is the EventTarget (Node, window, et c) that the
EventListener was registered on.

The statement above is not that different.

I do not think you are in a position to lecture anyone here, nor was that
necessary. I was merely pointing out that not everything of this test needs
to be written from scratch.


PointedEars
 
D

dhtml

I do not follow.

It's bad to have to guess as to try and figure out what the person
writing the question meant.

Should the questions be clear and unambiguous?
Isn't it interesting that you complain about wrong terminology but are
unable to use correct terminology yourself?

?


I do not think you are in a position to lecture anyone here, nor was that

My arguments are what they are. They shouldn't seem insulting.

Whatever position you're imagining me to be in in is not relevant.
 
T

Thomas 'PointedEars' Lahn

dhtml said:

As I have said before, there is no such thing as a "FORM control" in HTML.
That is splitting hairs, of course; but you started it, so don't you
complain now.


PointedEars
 
L

Lasse Reichstein Nielsen

Thomas 'PointedEars' Lahn said:
As I have said before, there is no such thing as a "FORM control" in HTML.

Sure there is. CapitaliZATION in NORMAL words (not proper names or
trademarks) can change the emphasis, but does not change the meaning.
Form controls exist in HTML, capital letters or not.

/L
 
T

Thomas 'PointedEars' Lahn

Lasse said:
Sure there is. CapitaliZATION in NORMAL words (not proper names or
trademarks) can change the emphasis, but does not change the meaning.
Form controls exist in HTML, capital letters or not.

They do change the meaning when talking about HTML; read the Spec. A form
control is a different thing than a FORM control, because there is, e.g.,
and INPUT control. But I am really getting tired of this.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top