Saturday, 5 October 2013

Assignment #1 cio_tester, test 4.2 vs 4.17

I'm having problem with test 4.2 vs 4.17; Test 4.2 and 4.17 are exactly the same but their return key. When I get 4.2, 4.17 won't work because it returns the 'RETURN' key and my test fails. On the other hand, if i change this code to return '0', my test 4.2 will fail. the screenshot of these two tests shows there is no difference except the return key.
Test 4.2

Test 4.17

 does anyone have an idea about this? your comments on this would be great.


  1. In test 4.2 InTextEditor is set to false so strOffset is changed and the program returns the value of the exit key (in this case ENTER). In test 4.17 InTextEditor is set to true so when strOffset is changed the program should exit and return 0.

  2. thank you bakoomerang, you solved my problem.

  3. Hey Mohammed,

    I'm currently having the same issue.
    After reading this I definitely understand WHAT it is this part of the test needs. But am at a loss for HOW I implement the logic.

    Where in the order of things do we put this check? Is it after all the other "initial corrections"? Is it within the while(!done) Input loop?

    I may have been staring at this screen too long but I feel like I need a hint.

    Thanks and good luck with the rest of your assignment man!

  4. Hi nickramkay,
    you need to check InTextEditor right away after the user presses Escape or Enter. Also, you need to check it after getKey();
    let me know if you need more help.
    Thanks my friend you too.

    1. This comment has been removed by the author.

    2. Hey Mohammad

      Looks like I got a similar problem, but I cant seem to figure it out. Are we supposed to reset the *strOffset to original values if InTextEditor is true?

    3. hi,
      absolutely, when you check getKey() the first thing you check the InTextEditor and reset *strOffset