Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Spelling Test

Spelling Test

Scheduled Pinned Locked Moved C#
csharpquestionlearning
12 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    dennycrane
    wrote on last edited by
    #1

    I´m making a C# spelling test. I´m having trouble with the grading process. My idea is not having a spell check but rather compare two texts and count the errors. One text is hidden of course. How would you think the easiest way to do this would be?

    E C L L 4 Replies Last reply
    0
    • D dennycrane

      I´m making a C# spelling test. I´m having trouble with the grading process. My idea is not having a spell check but rather compare two texts and count the errors. One text is hidden of course. How would you think the easiest way to do this would be?

      E Offline
      E Offline
      Edmundisme
      wrote on last edited by
      #2

      Out of curiosity, how will the user know what words she is supposed to spell for the test?

      D L 2 Replies Last reply
      0
      • E Edmundisme

        Out of curiosity, how will the user know what words she is supposed to spell for the test?

        L Offline
        L Offline
        led mike
        wrote on last edited by
        #3

        LMAO Spelling Test, enter the correct spelling for the following words: 1) hyperbole :laugh::laugh:

        led mike

        1 Reply Last reply
        0
        • E Edmundisme

          Out of curiosity, how will the user know what words she is supposed to spell for the test?

          D Offline
          D Offline
          dennycrane
          wrote on last edited by
          #4

          Oh, I forgot to mention. A mp3 file will be played where the text is read out. But do you have any ideas on what the easiest way to do this would be?

          1 Reply Last reply
          0
          • D dennycrane

            I´m making a C# spelling test. I´m having trouble with the grading process. My idea is not having a spell check but rather compare two texts and count the errors. One text is hidden of course. How would you think the easiest way to do this would be?

            C Offline
            C Offline
            ChrisKo 0
            wrote on last edited by
            #5

            Use character arrays for the strings and check each character. You need to decide if you give points for a correct word with different length and handle that scenario. correct answer: hyperbole user enetered: hyperboole The lengths are different so a straight char comparison won't work. You should probably search the rest of the entered text for the char. Good luck as there's plenty of ways you can give points.

            E 1 Reply Last reply
            0
            • C ChrisKo 0

              Use character arrays for the strings and check each character. You need to decide if you give points for a correct word with different length and handle that scenario. correct answer: hyperbole user enetered: hyperboole The lengths are different so a straight char comparison won't work. You should probably search the rest of the entered text for the char. Good luck as there's plenty of ways you can give points.

              E Offline
              E Offline
              Edmundisme
              wrote on last edited by
              #6

              why would you do a char by char comparison instead of just comparing the strings? I misunderstood... I didn't realize this was more than a "right" or "wrong" problem... :-O if (string.Equals(sUserAnswer, sCorrectAnswer, StringComparison.OrdinalIgnoreCase)) { // code for a right answer } else { // code for a wrong answer } I suggest that you create an XML file that specifies the word to spell along with the location of the media file that corresponds to the spoken word. Something like: <words> <word media="C:\Words\Hello.mp3">Hello</word> <word media="C:\Words\Hyperbole.mp3">Hyperbole</word> ... </words> The application should then allow you to load the XML file that corresponds to the test you want to take.

              modified on Thursday, April 17, 2008 4:37 PM

              D 1 Reply Last reply
              0
              • E Edmundisme

                why would you do a char by char comparison instead of just comparing the strings? I misunderstood... I didn't realize this was more than a "right" or "wrong" problem... :-O if (string.Equals(sUserAnswer, sCorrectAnswer, StringComparison.OrdinalIgnoreCase)) { // code for a right answer } else { // code for a wrong answer } I suggest that you create an XML file that specifies the word to spell along with the location of the media file that corresponds to the spoken word. Something like: <words> <word media="C:\Words\Hello.mp3">Hello</word> <word media="C:\Words\Hyperbole.mp3">Hyperbole</word> ... </words> The application should then allow you to load the XML file that corresponds to the test you want to take.

                modified on Thursday, April 17, 2008 4:37 PM

                D Offline
                D Offline
                dennycrane
                wrote on last edited by
                #7

                My idea was to have a test where the student or who ever is taking the test, would listen to a mp3 file. I was thinking about having the mp3 played on an external player. It is a block of text, so I´m thinking is it possible to compare two sentences? Could any of you guys show me some example of how this is done?

                modified on Thursday, April 17, 2008 3:49 PM

                E 1 Reply Last reply
                0
                • D dennycrane

                  My idea was to have a test where the student or who ever is taking the test, would listen to a mp3 file. I was thinking about having the mp3 played on an external player. It is a block of text, so I´m thinking is it possible to compare two sentences? Could any of you guys show me some example of how this is done?

                  modified on Thursday, April 17, 2008 3:49 PM

                  E Offline
                  E Offline
                  Edmundisme
                  wrote on last edited by
                  #8

                  Of course it's possible to compare two sentences. A sentence is just a string, right? But how will comparing sentences solve your problem? The user will be spelling words, not sentences, right? Don't start solving the wrong problem! I think you need to take a step back and think about what you're trying to do. Spend some time with paper and pencil and sketch out some use-cases. This will help you conceptualize the problem. For example, what do you want the user experience to be? Pretend that you are going to take a spelling test. How would you expect the application to behave? Once you jot down the basic use case, start considering edge cases. For example, what if I decide to change my answer after I've already typed it in? Will the words be checked immediately after they are entered? Or will they be checked all at once when the user "finishes" the test? If the audio is not associated with the words in your program, how will you know which word the user was trying to spell? What if the user spells the words in the wrong order (the application expected them to spell "Hello" then "Hyperbole" but they spelled "Hyperbole" then "Hello")? Going through the use cases will help you conceptualize the problem and prevent you from being short-sighted in your solution. Good luck!

                  D 1 Reply Last reply
                  0
                  • E Edmundisme

                    Of course it's possible to compare two sentences. A sentence is just a string, right? But how will comparing sentences solve your problem? The user will be spelling words, not sentences, right? Don't start solving the wrong problem! I think you need to take a step back and think about what you're trying to do. Spend some time with paper and pencil and sketch out some use-cases. This will help you conceptualize the problem. For example, what do you want the user experience to be? Pretend that you are going to take a spelling test. How would you expect the application to behave? Once you jot down the basic use case, start considering edge cases. For example, what if I decide to change my answer after I've already typed it in? Will the words be checked immediately after they are entered? Or will they be checked all at once when the user "finishes" the test? If the audio is not associated with the words in your program, how will you know which word the user was trying to spell? What if the user spells the words in the wrong order (the application expected them to spell "Hello" then "Hyperbole" but they spelled "Hyperbole" then "Hello")? Going through the use cases will help you conceptualize the problem and prevent you from being short-sighted in your solution. Good luck!

                    D Offline
                    D Offline
                    dennycrane
                    wrote on last edited by
                    #9

                    I have some use cases. How would you do this?

                    E 1 Reply Last reply
                    0
                    • D dennycrane

                      I have some use cases. How would you do this?

                      E Offline
                      E Offline
                      Edmundisme
                      wrote on last edited by
                      #10

                      Show me one of your use-cases and I'll be glad to help you think through this.

                      1 Reply Last reply
                      0
                      • D dennycrane

                        I´m making a C# spelling test. I´m having trouble with the grading process. My idea is not having a spell check but rather compare two texts and count the errors. One text is hidden of course. How would you think the easiest way to do this would be?

                        L Offline
                        L Offline
                        Lost User
                        wrote on last edited by
                        #11

                        I'd use the Levensthtein distance[^] to count the number of different characters between the correct and given answer. regards

                        1 Reply Last reply
                        0
                        • D dennycrane

                          I´m making a C# spelling test. I´m having trouble with the grading process. My idea is not having a spell check but rather compare two texts and count the errors. One text is hidden of course. How would you think the easiest way to do this would be?

                          L Offline
                          L Offline
                          Luc Pattyn
                          wrote on last edited by
                          #12

                          Hi, seems to me you need to: - split both texts into words (split on spaces and puctuation); - match the words (resync when a word is missing in one of the texts); - count the differences (each pair of matching words that are not identical count as one mistake). Why match words: the sucker under test may connect two words, split a word in two, just forget one, etc. remaining problems: - punctuation: do you check those chars too? can you hear the difference between say a semi-colon and a period? - capitals: are the rules strict in your language? is it the same for the first letter following a semi-colon and a period? :)

                          Luc Pattyn [Forum Guidelines] [My Articles]


                          This month's tips: - before you ask a question here, search CodeProject, then Google; - the quality and detail of your question reflects on the effectiveness of the help you are likely to get; - use PRE tags to preserve formatting when showing multi-line code snippets.


                          1 Reply Last reply
                          0
                          Reply
                          • Reply as topic
                          Log in to reply
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes


                          • Login

                          • Don't have an account? Register

                          • Login or register to search.
                          • First post
                            Last post
                          0
                          • Categories
                          • Recent
                          • Tags
                          • Popular
                          • World
                          • Users
                          • Groups