Assessment -1 - no fork button

Hey Kevin,

On Assessment negative 1, it just let me hit next where it should say fork. I had previously been on that page and had decided to hold off on the assessment. At the time, the button said Fork. When returning to the page, it said Next. Thx for your help!

Ravi

Hey Ravi,

This is a weird one…I’m not sure how you would get past the task and continue through the curriculum without having forked and submitted Assessment Negative 1. We will be removing the feature blocking you from moving forward task by task in our next set of changes to App Academy Online but it hasn’t happened yet. Thank you for your patience, while we look into the issue.

In the meantime, I updated the task as incomplete so you should now see the fork button again. See if you can return to the assessment and fork to create your repo on BitBucket. Let me know if you run into any issues.

Sounds good, thx Kevin!

Unfortunately I now see a pop up box that says:
One Task at a Time
Complete all previous tasks to view this task

Hi, Kevin please check spec for luca-number when n = -4. Also I skipped the rspec 3 and 4 because no instructions on the rb file. Hard to understand by just reading the spec.

Best,
Shao

Hey Shao,

Thank you for the feedback, this will all go toward making the curriculum better for everyone. Double check the top of the spec files for rspec-3/4 where you may find some extra hints towards instructions. Let me know which exercises in particular lack enough explanation and we will get them updated. For the luca-number spec, which exercises does this refer to?

Thanks again for the feedback and keep up the great work!

Hey Kevin,

lucas-number was okay after double checking the sequence again

My mistake its rspec 2 - performance monitor, rspec-4 book title, timer, temperature_object, and dictionary. instructions were unclear or missing instructions. Thanks.

Best,
Shao

Thank you for the detailed feedback Shao,

We will make some curriculum updates so that the initial pages on the learning platform itself for these tasks shows more detailed instructions.

Awesome!

Hey Kevin, I am stuck on assessment -1 select and merge methods with proc. Please tell me where I can read and learn more about proc. Thanks!

Best,
Shao

1 Like

Shao,

AWESOME QUESTION. Procs are a notoriously weird concept in Ruby and to this day I run into all new sorts of ways to use them in my code. For now, I would like you to focus on the difference between Procs and Blocks.

Rubyists like to say that Ruby is a purely object oriented programming language, meaning EVERYTHING is an object. If there was one exception to this rule though, it would be a Block.

Blocks are just chunks of code either between {} or between do and end. If we wanted to treat this code like an object and send methods to it, we would need to turn it into a Proc. Procs are another way of grouping code in Ruby and they are more powerful than blocks because they are objects!

Question: How do we turn a block into a proc?
Answer: With an &

Example:

class Array
  def my_each(&prc)
    self.length.times do |i|
      prc.call(self[i])
    end

    self
  end
end

Notice the ampersand before the name of the parameter passed to this method called my_each. Think of the ampersand as a switch that either turns a block into a proc or a proc into a block. In this case we are expecting the user to pass a block to my_each, the ampersand then turns the block into a Proc object and we are then able to call all of these cool methods on it.

You will notice that the most important of those methods is call in which we invoke the code inside the Proc object. So to explain what is happening in this code:

We are writing an instance method on the Array class so all Arrays will be able to call the my_each method. This method is expected to receive a block like { |n| puts n }. The method then takes that block, turns it into a Proc object, and iterates over each element in the array invoking the Proc with Proc.call, passing it each element.

This is a tough concept so it is perfectly acceptable not to understand it completely at first. Like I said, I am still understanding procs more and more every day! We will go over them in more detail during the immersive bootcamp but hopefully this clears some stuff up. Let me know if you have any questions.

Thanks!

2 Likes

Hi @kevin,

I’m also at Assessment -1 and the Fork button is gone again. Ravi mentioned in the slack channel that you gave him a link to git clone in order to complete it. Could I get this link as well? Thanks!

–Rachel

Hi Rachel,

Sorry for any frustration this has caused. I forked your repo so you should be able to clone it from here:
https://rachelmoore@bitbucket.org/appacademy-online/ab632bcf-rachel-assessment-negative1.git

1 Like