This was brought up on the Contributor's Chat Page by @Dangeranger. Seems that a number of the Rosetta Code challenges have minor/major layout issues, and also problems with the tests. Here's @Dangeranger's screenshot of the tests throwing errors:
Seems like this is because some challenges rely on an array of tests named tests in the tail section to fill in parts of the texts for the test suite section of the page. However, because the Curriculum JSON has a field named tests, when a solution is submitted on the page it instead calls the JSON tests array rather than the one from the tail.
The easiest way to fix this is by going through the existing problems, giving the tests array in the tail a unique name and adjusting the layout as needed. For many of the problems I removed the unnecessary paragraph tags.
Below is a list of challenges I made more major formatting changes to:
"9 billion names of God the integer": Fixed the number triangle
"Averages/Pythagorean means": Fixed the example output object
"ABC Problem": Fixed pre section
"Align columns": Fixed pre section and lists
"Closest-pair problem": Fixed pre sections
"Combinations": Fixed pre section
"Comma quibbling": Fixed ordered and list
"Compare a list of strings": Fixed list and i tag
"Convert seconds to compound duration": Fixed lists and tables
"Count occurrences of a substring": Fixed list
"Count the coins": Fixed list
"Cramer's rule": Fixed math function
"Date Format": Fixed list and spacing
"Date manipulation": Made headings bold
"Deal cards for FreeCell": Fixed lists
"Deep copy": Fixed lists
"Department numbers": Fixed lists
"Execute Brain****": Added a table
"Element-wise operations": Fixed list
"Emirp primes": Fixed list
"Ethiopian multiplication": Fixed pre sections and lists
"Euler method": Fixed lists
"Execute a Markov algorithm": Fixed pre sections
"Factors of a Mersenne number": Fixed spacing and pre section
"Farey sequence": Rearranged sentences and fixed list
"Fibonacci n-step number sequences": Added a table
"Fibonacci word": Fixed pre section
"Hailstone sequence": Fixed lists
"Hash join": Fixed pseudo code and added table
"Sailors, coconuts and a monkey problem": Fixed spacing
"SEDOLs": Fixed spacing
"Tokenize a string with escaping": Reformatted description and added code tags
"Top rank per group": Fixed pre tags
"Tower of Hanoi": Fixed spacing
"Vector cross product": Fixed spacing
"Vector dot product": Fixed spacing
"Word wrap": Fixed spacing and pre tags
"Y combinator": Fixed spacing
"Zeckendorf number representation": Fixed spacing and i tag
"Zhang-Suen thinning algorithm": Fixed pre tags and spacing
"Zig-zag matrix": Fixed spacing and pre tags
And challenges that had problems with the tests or challengeType:
"Date manipulation": Renamed the tests arr and hard coded the tests and answer strings
"Define a primitive data type": Moved throws function to tail section so the tests work
"Execute a Markov algorithm": Moved rules, markovTests (renamed from tests), and outputs to tail section
"Fractran": Changed challenge type to 5, renamed the tests array in the tail, and hard coded the test strings and answers into the individual tests
"Gamma function": Renamed tests array in tail and hard coded the test strings and answers into the individual tests
"Gaussian elimination": Renamed tests array in tail and hard coded the test strings and answers into the individual tests
"General FizzBuzz": Renamed tests array in tail and hard coded the test strings and answers into the individual tests
"Greatest subsequential sum": Renamed tests array in tail and hard coded the test strings and answers into the individual tests
"IBAN": Renamed tests array in tail and hard coded the test strings and answers into the individual tests
"Jaro distance": Renamed tests array in tail and hard coded the test strings and answers into the individual tests
"JortSort": Renamed tests array in tail and hard coded the test strings and answers into the individual tests
Note that none of these fixes address the mathematical functions. We would need to re-enable the MathJax over on the Learn platform for those to render properly. There's already a PR to render mathematical functions only on the Rosetta Code pages that's waiting for QA/approval.
Describe the bug
This was brought up on the Contributor's Chat Page by @Dangeranger. Seems that a number of the Rosetta Code challenges have minor/major layout issues, and also problems with the tests. Here's @Dangeranger's screenshot of the tests throwing errors:
Seems like this is because some challenges rely on an array of tests named tests in the tail section to fill in parts of the texts for the test suite section of the page. However, because the Curriculum JSON has a field named tests, when a solution is submitted on the page it instead calls the JSON tests array rather than the one from the tail.
The easiest way to fix this is by going through the existing problems, giving the tests array in the tail a unique name and adjusting the layout as needed. For many of the problems I removed the unnecessary paragraph tags.
Below is a list of challenges I made more major formatting changes to:
And challenges that had problems with the tests or challengeType:
Note that none of these fixes address the mathematical functions. We would need to re-enable the MathJax over on the Learn platform for those to render properly. There's already a PR to render mathematical functions only on the Rosetta Code pages that's waiting for QA/approval.