Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing newline or incomplete reason why a multi-string isn't created correctly #199

Open
duianto opened this issue Aug 18, 2021 · 0 comments

Comments

@duianto
Copy link

duianto commented Aug 18, 2021

Missing newline or incomplete reason why a multi-string isn't created correctly.

Steps to reproduce

  • Open the lesson: Learn > Simple Types > Multi-line strings
  • Tap the top right button: Next
  • Tap the OK button on the Multi-line strings popup
  • Answer the first two questions correctly
    The third question Review (3/8) shows:
var henley = """I am the master
of my fate
I am the captain of my soul"""

(Note: That's what it looks like on the iPhone X screen. But from the definition below, the first line, from var to fate, is a single line that's line wrapped after master to fit on screen. The issue below is unrelated to how it appears on the iPhone screen.)

This question seems to be defined here:

"answer": "var henley = \"\"\"I am the master of my fate\nI am the captain of my soul\"\"\"",
"reason": "The final three quotes must be on a line by themselves."

  • Answer the question correctly: False
    The text, with the reason it was false, appears below the question.

Expected behavior

The reason should indicate both problems. The first and last three quotes should be on their own lines.

Possibly like the other questions:

"reason": "Multi-line strings must start and end with three double quotes on lines by themselves."

Or if the intention was to have a newline after the first three double quotes.
Then a \n newline should be added.

Another question with the same reason has a newline after the first three quotes:

"answer": "var coleridge = \"\"\"\nWater, water, everywhere\nand not a drop to drink\"\"\"",
"reason": "The final three quotes must be on a line by themselves."

And here the reason matches the question.

The intention might have been for the henley variable assignment question,
to also have newline \n after the first three quotes.

Because then there would be two questions with the reason:

The final three quotes must be on a line by themselves.

And three questions with the reason:

Multi-line strings must start and end with three double quotes on lines by themselves.

Actual behavior

The reason that appears when the question has been answered:

The final three quotes must be on a line by themselves.

Only mentions the second problem with the multi-line string variable assignment.
It doesn't mention that the first line with the three quotes also needs to be on its own line.

Or if, as suspected above, the reason is correct, then the question just needs a newline \n between:
""" and I am

Before

"answer": "var henley = \"\"\"I am the master of my fate\nI am the captain of my soul\"\"\"", 

After

"answer": "var henley = \"\"\"\nI am the master of my fate\nI am the captain of my soul\"\"\"", 

Environment

  • Unwrap app version: 1.5
  • iOS version: 14.7.1 (18G82)
  • Device: iPhone X
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant