Welcome to our inclusive community of web designers, developers and makers.
Creating an account takes less than 30 seconds, start participating right away!
Create account

Entries Open [Code/Programming, Beginner Concepts] 🎃 Spooky Coding Quiz

Adam

Mr. Webwide
Administrator
Joined
Sep 24, 2019
Messages
500
Reaction score
473
Points
485
Location
United Kingdom
Local Time
Today, 20:49
Pronouns
he/him
Happy Halloween! Here's a quick coding quiz for you all. You will be awarded points in the challenge cup for each correct answer and a funky pumpkin trophy 🎃 for your profile if you can get them all right. Entries should be direct messaged to me. I'll reply in this thread with how many right, but not which ones. You are free to have another go. 🤭

Closing Date: November 3rd 7pm UTC

Question 1
(HTML, 2 points)
Adam is making a secret website for his top pumpkin carving tips to share with his friends. Which HTML meta tag could he use to make sure it does not show up in search engines such as Google?

Question 2 (Apache, 3 points)
Oh no! Hiding the website from search engines wasn't enough. The enemy pumpkin making team have found the URL. In less than 5 lines, how can he password protect his website using an Apache .htaccess file?

Question 3 (CSS, 2 points)
Adam's got an unordered list (<ul>) with his tips. He wants each bullet point to be a cute pumpkin face that he made (pumpkin.gif). What CSS would he put inside his ul { } selector to achieve this?

Question 4 (JavaScript, 3 points)
Adam's got some filtering on his tips using jQuery $('.tipCard').hasClass('candleTips');. One of his friends asks why he is using jQuery just for that? He could use vanilla JavaScript instead. But how?

Question 5 (PHP, 2 points)
Adam can't wait until the pumpkin carving competition, so using PHP he has put a countdown of the days left until the competition. For some reason, it is telling him there is over 600 days left when really it is happening on 21:00 on 31st October 2019! Why is it wrong? (Negative numbers expected when date has passed).
Code:
<?php
$today = time();
$event = mktime(21,0,0,31,10,2019);
$countdown = round(($event - $today)/86400);
echo "$countdown days until the competition!";

Question 6 (SQL, 2 points)
Adam has started to collect so many tips he decides a MySQL database would be better. What 1 line SQL query should he use to get all pumpkin carving tips with a status of published?
Code:
'pumpkinTips' table structure:

FIELD       TYPE
id          number
category    varchar
content     text
published   boolean
Question 7 (Optimisation, 3 points)
Adam's friends in Australia are complaining that the huge JPEGs of his latest pumpkin creations are downloading very slowly from his server in the UK. What are three ways he could speed this up?

Question 8 (Python, 3 points)
Adam's happy with his pumpkin website but now needs to start practicing for the competition. He spends a long time trying to decide what style to carve each time so he decides to make a quick Python script to help him decide. When executed, it should display a random pumpkin style from his array pumpkinStyles = ["Scary", "Funny", "Happy", "Cute", "Abstract"]. How could he do this in the fewest lines of code?

🎃
 
Last edited:

Adam

Mr. Webwide
Administrator
Joined
Sep 24, 2019
Messages
500
Reaction score
473
Points
485
Location
United Kingdom
Local Time
Today, 20:49
Pronouns
he/him
Nice job @tom with a spooktastic 8/8!

This is a great way for you to fix my website issues for free thanks. 😂🎃 (jk hope it’s fun! sorry for you pros, some trickier stuff coming soon 😄)
 
Last edited:
  • Haha
Reactions: Gummibeer and tom

Adam

Mr. Webwide
Administrator
Joined
Sep 24, 2019
Messages
500
Reaction score
473
Points
485
Location
United Kingdom
Local Time
Today, 20:49
Pronouns
he/him
Why are the frontend questions worth less than backend questions? :C
Nevertheless determined to get that pumpkin! PMing soon :)
Great point! Not really intended and just based on how difficult I personally perceived them as a generalist. Tbh I just wanted them to equal 20 so it was nice and round. 😅

I chose the questions to try and be that even if you have never really written Python like I haven't, it would be fairly simple to go and find out the answer to hopefully maybe learn something new.

Edit: Tweaked the weighting a bit. 😄
 
Last edited:
  • Love
Reactions: ek1