Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Page 2 of 3 FirstFirst 123 LastLast
Results 16 to 30 of 31
  1. #16
    New Coder
    Join Date
    Mar 2013
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Okay, I think I got it up and running. Going to test at school tomorrow so wish me luck. Yes, I did put new audio in separate folder. Here is new link. Again, I can't thank you enough!

    Spelling List 1

  2. #17
    New Coder
    Join Date
    Mar 2013
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Tested at school and it works! There's one thing I forgot to do, though. In the old program, the kids received 1 point for each word, 1 point for each word in every sentence, and 1point on each sentence for every capital letter and punctuation. I total the values and put them in a hidden field below student's name and date. I've been able to give each sentences another object (var assigning each one a total point possibility. Right now I added input fields down with the sentences and the program is grabbing the sentence (var and showing the number in the fields that I named values1, values2, values3, values4, and values5. I now want to add those values together and stick them in another hidden form at the top. I can get the values to list side by side in the chosen field, but I'm not sure how to get it to add those values together along with an addition 20 pts to give me a total for the whole test.

  3. #18
    Regular Coder
    Join Date
    May 2012
    Location
    France
    Posts
    216
    Thanks
    0
    Thanked 29 Times in 27 Posts
    I have build this page about ICAOCode with a mini dev-Player. This can be usefull ...

  4. #19
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,775
    Thanks
    55
    Thanked 519 Times in 516 Posts


    sorry, you lost me.

    You said that the kids do the actual test with pen and paper. So where does the points thing come in? If it's just one point for each question won't the test always be worth 25 points? Or is it that you (ie, the teacher) fill in a field and post the form back to the kids, to show them their result (in which case all you need is an input box that you can enter a value into)?

  5. #20
    New Coder
    Join Date
    Mar 2013
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts
    sorry, I figured I was confusion. The form comes to me so I know what words they were given. At the top of the old form, it gave me the total points possible. That way I'd just set my grader to that many points and I could get the percentage quickly. The kids never see it, just a teacher tool to make my life easier rather than count points up. The sentences are worth more than one point each: (1 pt. for each word in the sentence and then 1 pt. each for remembering capital letters at the beginning of sentences and punctuation). Test on average total about 60 points (20 pts for words and 5 sentences worth about 8 pts on average each). I have the input field at the top that is hidden from view. I added another object to the sentence array with .txt and .aud called .var.

    Now when i submit, it shows me the txt sentence and below it shows the value in points for that sentence, but then it takes all 5 values for the sentences pulled and just writes them as 898710 (8, 9, 8, 7, 10) instead of adding together.

  6. #21
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,775
    Thanks
    55
    Thanked 519 Times in 516 Posts
    ah, ok I get it now.

    Please don't try to monopolise confusion. I feel very comfortable in that space.

    It sounds to me like you are concantenating strings (input values will always be strings, regardless of if digits are input) instead of adding numbers. Compare the results:

    Code:
    var res1 = 8 + 9 + 8 + 7 + 10; // adding real numbers
    var res2 ="8" + "9" + "8" + "7" + "10"; //adding strings that just look like numbers
    var res3 =Number("8") + Number("9") + Number("8") + Number("7") + Number("10"); //converting number strings to real numbers then adding them
    alert(res1);
    alert(res2); 
    alert(res3);
    so I'm guessing you need to convert the values to real numbers before adding them. You may want to do it in a loop if you have alot.

    I would also be wary of using variable manes like .var, which is a reserved keyword in javascript. You can probably get away with it here, but it's a bad habit to get into.
    Last edited by xelawho; 04-02-2013 at 08:06 PM.

  7. #22
    New Coder
    Join Date
    Mar 2013
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Thanks for the advice on var, didn't know that about it being a keyword (I don't think I know a whole lot about this javaScript stuff anyway but I sure find it fascinating).

    I had come close with using the Number thing last night, but I don't think I assigned a variable or put what I wanted in "".

    I was trying to pull it from the value of the hidden forms: Number(document.spelling1.name.values1) - something like that anyway (at work now so can't check). would it work if I added the variable and quotations?

  8. #23
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,775
    Thanks
    55
    Thanked 519 Times in 516 Posts
    no, that's just an example. The point is that the values come as strings, so you need to convert them to numbers.

    But thinking about it, you already have a loop going, so you might as well do it all in one hit:

    Code:
    // an array of objects containing the sentence file paths and their text and points they are worth
    var sentenceArray = [
    {aud:'senone.wav',
     txt:'The cat sat on the mat',
     pnts:5},
    {aud:'sentwo.wav',
     txt:'The quick brown fox did something',
     pnts:7},
     {aud:'senthree.wav',
     txt:'Peter Piper picked a peck',
     pnts:12},
     {aud:'senfour.wav',
     txt:'The rain in Spain',
     pnts:9},
     {aud:'senfive.wav',
     txt:'Once a Jolly Jumbuck...',
     pnts:1},
     {aud:'sensix.wav',
     txt:'She sells sea shells',
     pnts:8} // the last one in the list should not have a comma after it - all the others should.
    ]
    
    // shuffle function, play word buttons, etc...
    
    var maxpoints=0; //initialise maximum score possible
    thecontent.innerHTML+='Sentences<br>'
    for (var a = 1; a < 6; a++) {
    var theaudio=sentenceArray[a].aud;
    var thephrase=sentenceArray[a].txt;
    thecontent.innerHTML+='<input type="button" class="wrdbtn" onclick="playSound(\''+theaudio+'\')" value="Play Sentence '+a+'"/><input value="'+thephrase+'" type="hidden" name="hidphrase'+a+'"/>'; //remove type="hidden" here to see answers
    maxpoints+=sentenceArray[a].pnts; //add that sentence's score to maxpoints
    }
    document.getElementById("maxscore").value=maxpoints; // loop is finished - insert total possible score into input box with ID "maxscore"
    }());
    
    
    </script>

  9. #24
    Regular Coder patryk's Avatar
    Join Date
    Oct 2012
    Location
    /dev/couch
    Posts
    398
    Thanks
    2
    Thanked 64 Times in 64 Posts
    hey wouldn't it be easier for you to use TTS instead of pre-recorded words?
    you have little demo here: http://freedockstar.com/spelling/test.php

    it's using google's tts, and needs little php script to run

    yeah i know i know it's flash player, but i already had it working

    -------------------------------------------------------------------------------
    "Real Programmers can write assembly code in any language" - Larry Wall

  10. #25
    Senior Coder rnd me's Avatar
    Join Date
    Jun 2007
    Location
    Urbana
    Posts
    4,190
    Thanks
    10
    Thanked 569 Times in 550 Posts
    Quote Originally Posted by patryk View Post
    hey wouldn't it be easier for you to use TTS instead of pre-recorded words?

    i don't think kids should be taught poor pronunciation and emphasis.
    my site (updated 13/9/26)
    BROWSER STATS [% share] (2014/1/19) IE7:0.2, IE8:6.7, IE11:7.4, IE9:3.8, IE10:4.4, FF:18.3, CH:43.6, SF:7.8, MOBILE:27.5

  11. #26
    Regular Coder patryk's Avatar
    Join Date
    Oct 2012
    Location
    /dev/couch
    Posts
    398
    Thanks
    2
    Thanked 64 Times in 64 Posts
    cmon google's pronunciation is better than that of 95% americans anyways

    -------------------------------------------------------------------------------
    "Real Programmers can write assembly code in any language" - Larry Wall

  12. #27
    New Coder
    Join Date
    Mar 2013
    Posts
    12
    Thanks
    3
    Thanked 0 Times in 0 Posts
    I don't know which version of the program you heard, my own voice from many moons ago, or the new one with TTS sound. if you heard my voice, I'm a mix of east coast and west coast upbringing. My mom's sister was my aunt (pronounced ah-nt). My dad' sister was my aunt (ant). I grew up learning my "R" sound as "ah" sound. I went for the TTS voice because it sounded pretty good, considering. I can also spell words that don't seem to quite sound right phonetically and the voice says them much better (example bed sounded like bid, so I spelled it behd and it said it right!

    I couldn't make freedockstar site work on my computer - no sound when I pushed button so I couldn't hear what it sounded like.
    Last edited by pbeaking; 04-02-2013 at 10:55 PM.

  13. #28
    Regular Coder patryk's Avatar
    Join Date
    Oct 2012
    Location
    /dev/couch
    Posts
    398
    Thanks
    2
    Thanked 64 Times in 64 Posts
    go to google translate then. the same TTS
    http://translate.google.com/translat...is+sample+text open in chrome
    or this one http://translate.google.com/translat...is+sample+text

    --edit--
    when you can't hear audio after you hit button on my site, you have to wait - it runs from under my bed on crappy broadband
    Last edited by patryk; 04-02-2013 at 11:01 PM.

    -------------------------------------------------------------------------------
    "Real Programmers can write assembly code in any language" - Larry Wall

  14. Users who have thanked patryk for this post:

    pbeaking (04-03-2013)

  15. #29
    Senior Coder xelawho's Avatar
    Join Date
    Nov 2010
    Posts
    2,775
    Thanks
    55
    Thanked 519 Times in 516 Posts
    Quote Originally Posted by patryk View Post
    cmon google's pronunciation is better than that of 95% americans anyways
    Much as I have problems understanding some Americans, I would disagree with this. Try pasting these words (all taken from pbeaking's spelling list) into google translate and see if the resulting audio sounds like any kind of English you recognise, or if you think it would be fair to ask kids to try to figure out what it is saying and then spell it:

    'am',
    'an',
    'and',
    'are',
    'as',
    'at',

    'but',

    'or',

    'than',
    'to'

  16. #30
    Regular Coder patryk's Avatar
    Join Date
    Oct 2012
    Location
    /dev/couch
    Posts
    398
    Thanks
    2
    Thanked 64 Times in 64 Posts
    google's pronunciation is better than that of 95% americans
    was obviously a joke, but since entire thing uses pre-recorded TTS audio anyways, clearly it can be done directly without storing files

    -------------------------------------------------------------------------------
    "Real Programmers can write assembly code in any language" - Larry Wall


 
Page 2 of 3 FirstFirst 123 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •