# Assessment wanted for Events skill test

**URL:** <https://discourse.mozilla.org/t/assessment-wanted-for-events-skill-test/64612>\
**Category:** Learn\
**Tags:** learning\
**Created:** [July 26, 2020, 9:05pm UTC](https://discourse.mozilla.org/t/assessment-wanted-for-events-skill-test/64612 "2020-07-26T21:05:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sindhuja\_G](https://avatars.discourse-cdn.com/v4/letter/s/74df32/32.png) [@Sindhuja\_G](https://discourse.mozilla.org/u/Sindhuja_G)\
**Post date:** [July 26, 2020, 9:05pm UTC](https://discourse.mozilla.org/t/assessment-wanted-for-events-skill-test/64612/1 "2020-07-26T21:05:13Z")

</div>

Hi,  
I have taken up the assessment for “[Test Your Skills: Events](https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Building_blocks/Test_your_skills:_Events)”

I have tried out all the three problems and I wanted to check the solution:  
Here are the CodePen links for my solutions:  
Events 1: [https://codepen.io/sindhu\_ja/pen/NWxmMPb](https://codepen.io/sindhu_ja/pen/NWxmMPb)  
Events 2: [https://codepen.io/sindhu\_ja/pen/BajExNK](https://codepen.io/sindhu_ja/pen/BajExNK)  
Events 3: [https://codepen.io/sindhu\_ja/pen/rNxbvVd](https://codepen.io/sindhu_ja/pen/rNxbvVd)

Please check the solutions and let me know if I need to improve anything.

Thanks,  
Sindhuja

---

<div class="post-metadata">

**Author:** ![chrisdavidmills](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/chrisdavidmills/32/21688_2.png) [@chrisdavidmills](https://discourse.mozilla.org/u/chrisdavidmills)\
**Post date:** [July 27, 2020, 8:37am UTC](https://discourse.mozilla.org/t/assessment-wanted-for-events-skill-test/64612/2 "2020-07-27T08:37:09Z")

</div>

Hi there @Sindhuja_G, and welcome to our community!

I’ve looked over your code, and the solutions you’ve provided all work perfectly — well done!

The only thing I noticed is that in events 2, you don’t need to write out the `drawCircle()` invocation 4 times; you could just call it once, after the if/else structure, like this:

```auto
canvas.onkeyup = function (ev) {
  if (ev.key == "w" || ev.key == "W") {
    y = y - 5;
  } else if (ev.key == "a" || ev.key == "A") {
    x = x - 5;
  } else if (ev.key == "d" || ev.key == "D") {
    x = x + 5;
  } else if (ev.key == "s" || ev.key == "S") {
    y = y + 5;
  }
  
  drawCircle(x, y, size);
};

```
