cancel
Showing results for 
Search instead for 
Did you mean: 

Advanced Capstone quizzes 2.4.2 and 2.5.1

User
Not applicable

I was wondering if I could see the functionality that tests whether there is a pass or a fail for 2.4.2 and 2.5.1. My function seems to be delivering the exact outputs desired by the quizzes. Yesterday I was passing both quizzes, but now I am failing 2.5.1. I have not changed my code at all. I'm thinking that the order in which I execute my code may have an effect. Perhaps there are sections within the section at large which store local variables and then assess pass/fail with this information?

1 ACCEPTED SOLUTION

Michaela
Community Manager Community Manager
Community Manager

Hi Andrew,

Yes .test.time2.5 should be preloaded on launch and you should not be resetting it. If you logout (saving your code down) and start a fresh session you should see it has a value.

I pasted the test case for 2.5 in my previous reply.

View solution in original post

5 REPLIES 5

User
Not applicable

In addition to my previous post, I would like to add that my section 2.5.2 quiz is now failing after it had successfully ran yesterday. I am able to execute the .viz.createDashboard[] function in ~260 ms, which to my belief was less than half the original time (~750 ms) that was obtained before any modifications were made to the nested functions or to the underlying tables. This was accepted as a "pass" yesterday when I was running my code but for some reason is not a passing when I submit it now. If anyone has encountered a similar issue I would be happy to hear about your difficulties and how you may have resolved them.

Cheers,

Andrew 

Michaela
Community Manager Community Manager
Community Manager

Test cases are:

2.4

Spoiler
feature exercise2.4
should when given the wrong option return error "<mysensor> is not a valid option for mysensor - valid options include `temp`tyre`wind`all"
expect
"hello is not a valid option for mysensor - valid options include `temp`tyre`wind`all" ~ .[.f1.checkSensor;(raceDay;lapTable;`hello);{x}]
   

 2.5

Spoiler
feature exercise2.5
should func should return same result as before
expect
.test.table2.5~.viz.createDashboard[]
should .viz.createDashboard should run in half the time expect
0.5>((system"t:5 .viz.createDashboard[]")%5)%.test.time2.5\
  

  W.r.t pass having now becoming a fail I would advise logging out and restarting a new session. And then running all your changes from scratch, as its a performance based one sometime other changes can impact so testing is a little more fragile.

User
Not applicable

Hi Michaela.

Thank you for the help. Thoroughly appreciated. A few quick questions.

With regards to quiz 2.5.2, should .test.time2.5 be preloaded with an integer value of time in ms, or is this derived from the first execution of \t .viz.createDashboard? If I execute the code: .test.time2.5, nothing is returned. If I assign assign .test.time2.5 to the integer value in milliseconds that the execution of \t .viz.createDashboard (unmodified version) generates, then I pass quiz 2.5.2. 

 

Could I possibly see the test case for quiz 2.5.2, "func should return same result as before"? I've compared the output of my original .f1.checkSensor function (with [raceDay;lapTable;`wind] with the output of my modified (added error trapping functionality) .f1.checkSensor function and was shown a 1b. My understanding was that this is what this quiz is testing.

Cheers,

Andrew

Michaela
Community Manager Community Manager
Community Manager

Hi Andrew,

Yes .test.time2.5 should be preloaded on launch and you should not be resetting it. If you logout (saving your code down) and start a fresh session you should see it has a value.

I pasted the test case for 2.5 in my previous reply.

User
Not applicable

Hi Michaela. I've got it all working now! Thank you very much. Not sure why that all was happening.