Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 457c0ab

Browse files
committed
Fix bug in formatting of new questions
1 parent e5f6f45 commit 457c0ab

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Misc/renumber.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,12 @@ def main():
4343
if n < 0: n = newquestionprog.match(line) - 3
4444
if n >= 0:
4545
question = question + 1
46-
line = '%d.%d. '%(chapter, question) + line[n:]
46+
number = '%d.%d. '%(chapter, question)
47+
line = number + line[n:]
4748
lines[i] = line
4849
questions.append(' ' + line)
4950
# Add up to 4 continuations of the question
51+
n = len(number)
5052
for j in range(i+1, i+5):
5153
if blankprog.match(lines[j]) >= 0:
5254
break

0 commit comments

Comments
 (0)