datacamp-content / courses-introduction-to-shell

Introduction to Shell by Greg Wilson
Other
47 stars 47 forks source link

Solution code doesn't pass the grader | Chapter 4 Exercise 3 #110

Closed Hadrien-lcrx closed 6 years ago

Hadrien-lcrx commented 6 years ago

In How else does the shell store information?, the provided solution for Quiz 2 won't pass the grader.

Suggestion

Update the solution, or update the SCT.

Solution code

testing=seasonal/winter.csv head -n 1 $testing

Screenshot

image

Cf amin.chowdhury@gmail.com, #83094 Cc @bakera81

Hadrien-lcrx commented 6 years ago

I found the issue. The problem is that the SCT for the second quiz will offer the following solution:

testing=seasonal/winter.csv head -n 1 $testing

When this solution is inputted, the SCT will throw an error. The reason for this is that testing=seasonal/winter.csv is the answer for the first quiz, and there's no need to input it a second time: only inputting head -n 1 $testing will pass the grader.

Suggestions

Update the hints / solution / SCT for this exercise. Repeating the first quiz command may not be an issue as the output seems identical, but the SCT apparently won't accept the whole statement on just one line as correct.

Screenshots

Provided solution

image

Solution rejected

image

Passing the grader

image

Cc @bakera81

sumedh10 commented 6 years ago

@Hadrien-lcrx Thanks for debugging! I think you are right. Having both commands on the same line is creating an issue. I will discuss this w/ Greg.

gvwilson commented 6 years ago

Thanks @Hadrien-lcrx for the debugging - much appreciated. solution2 for this exercise isn't supposed to be a single line: if you look in chapter4.md, the text is:

*** =solution2
```{shell}
testing=seasonal/winter.csv
head -n 1 $testing
```

It appears that something is removing the newline between the first and second line. I've just pushed a change to the 2017-12-15 branch that removes the extra testing=seasonal/winter.csv line.