Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Conversation

@millro04
Copy link
Contributor

@millro04 millro04 commented Jun 2, 2016

Split each codeblock into separate lines, storing them in an array for each codeblock (maintaining any leading spaces that were already there). We then checked to see if all the lines had the same indentation, and if they don't, we will keep the original spacing. Otherwise, we remove all the leading spaces to make it look uniform.

@bnmnetp
Copy link
Member

bnmnetp commented Jun 2, 2016

Thanks guys.

Could you paste in your test cases you used here as a comment.

You can use three backward quotes (```) at the start and three backward quotes at the end so that github will treat it like code and not mess up indentation. The three backquotes should be on a line by themselves.

@bnmnetp
Copy link
Member

bnmnetp commented Jun 2, 2016

OK, when I put the blocks in place it tells me that the first block is not indented correctly. Are you seeing the same?

The other thing is, and this may not even be related to your changes, the characters on the line w = 10 don't really line up with the line above it.

x = 0
=====
for i in range(10):
     x = x + 1
     message = "Indent"
=====
    w = 10
    q = 15
    t = 'Test'
   =====
    for x in range(5):
        x = 2
        y = 5
=====

@ericsonga do you have a couple of good test cases for us?

@bnmnetp
Copy link
Member

bnmnetp commented Jun 2, 2016

Oh, never mind about the first point. I had an extra space before the x = 0

@bnmnetp
Copy link
Member

bnmnetp commented Jun 2, 2016

The other thing I noticed is that the two lines inside the second four loop are now indented too far. It looks like they are indented 8 characters instead of 4

@bnmnetp
Copy link
Member

bnmnetp commented Jun 3, 2016

I also used the following code to make sure that distractors still work. They do.

   The following has the correct code for a method called insertInOrder plus at least one extra unneeded code statement. This method should add the passed name in alphabetic order to a private list field called nameList.  Drag the needed blocks from the left into the correct order on the right. Check your solution by clicking on the <i>Check Me</i> button.  You will be told if any of the blocks are in the wrong order or if you need to remove one or more blocks.
   -----
   public void insertInOrder(String name)
   {
   =====
     int index = 0;
   =====
     while (index < nameList.size() &&
            nameList.get(index).compareTo(name) < 0)
     {
   =====
       index++;
   =====
     } // end while
   =====
     nameList.add(index,name);
   =====
   } // end method
   =====
   nameList.add(name); #distractor

I think this one is ready to be accepted.

@bnmnetp bnmnetp merged commit 81ad3ce into RunestoneInteractive:master Jun 3, 2016
@bnmnetp bnmnetp removed the ready label Jun 3, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants