Stuck on Idea Silver badge Maker Activation

Watch this thread
Diamonddolphin26
Badges: 7
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#1
Report Thread starter 2 years ago
#1
I'm stuck on the Idea Silver badge on the first functions. This is what I typed down:
initiate();
function lifeSupportCheck() {
initiate();
}

Where have I gone wrong?
0
reply
Igotanidea
Badges: 5
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#2
Report 2 years ago
#2
It's ridiculous how unhelpful the course is... I emailed them and their response it is supposed to be harder than bronze...... Shame they can't do their jobs and make a constructive piece of kit. I'll post the answer when i guess it right
0
reply
Igotanidea
Badges: 5
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#3
Report 2 years ago
#3
initiate();
function lifeSupportCheck () {
//
}
1
reply
Hannah_ lawler
Badges: 2
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#4
Report 2 years ago
#4
Do you know the answer to the one which says:Call the function you just wrote, in the same way you called initiate,then press ‘run code’
0
reply
Hannah_ lawler
Badges: 2
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#5
Report 2 years ago
#5
(Original post by Igotanidea)
initiate();
function lifeSupportCheck () {
//
}
Do you know the answer too this one :
Attached files
0
reply
winterscoming
Badges: 19
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#6
Report 2 years ago
#6
(Original post by Hannah_ lawler)
Do you know the answer to the one which says:Call the function you just wrote, in the same way you called initiate,then press ‘run code’
(Original post by Hannah_ lawler)
Do you know the answer too this one :
Firstly, a function in programming is basically a named block of instructions - the task gives you one of those called lifeSupportCheck.

The block of instructions is everything in-between those { curly } brackets, although of course the { and } in your lifeSupportCheck is basically empty aside from the // comment. Therefore it's a function which actually wouldn't do anything if it were used, but that doesn't matter. The function can still exist and do-nothing when the program actually uses it

However, the code in your task only creates ('defines') the function (that's what the curly brackets are doing - i.e. linking the block of instructions with the name) - the code doesn't actually use that function. So even if it did contain any instructions, the program would never run those. The phrase 'call the function'. is just a programmer's way of saying "use this function as if it were a single instruction in your program to run it".

'calling' a function is a matter of using its name and the (rounded brackets), and ending with a semicolon. Your task mentions "the same way you called initiate" as a clue that you already have an example line in your program which calls the initiate function by doing this:
Code:
initiate();
One last point on where to put the line - Programming languages' instructions flow downwards in-sequence, just like Written English, so the position in your program where you call the function is important. It needs to happen after the closing-curly-bracket } because the code needs to have finished the sequence of actually creating/defining the whole function before it's possible to actually call it

(Just remember the order that you do things matters, like when making a cup of tea, you can't pour hot water before the kettle has finished boiling)
2
reply
Hannah_ lawler
Badges: 2
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#7
Report 2 years ago
#7
Not trying to be rude, but could you shorten that please ?
0
reply
Hannah_ lawler
Badges: 2
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#8
Report 2 years ago
#8
(Original post by winterscoming)
Firstly, a function in programming is basically a named block of instructions - the task gives you one of those called lifeSupportCheck.

The block of instructions is everything in-between those { curly } brackets, although of course the { and } in your lifeSupportCheck is basically empty aside from the // comment. Therefore it's a function which actually wouldn't do anything if it were used, but that doesn't matter. The function can still exist and do-nothing when the program actually uses it

However, the code in your task only creates ('defines') the function (that's what the curly brackets are doing - i.e. linking the block of instructions with the name) - the code doesn't actually use that function. So even if it did contain any instructions, the program would never run those. The phrase 'call the function'. is just a programmer's way of saying "use this function as if it were a single instruction in your program to run it".

'calling' a function is a matter of using its name and the (rounded brackets), and ending with a semicolon. Your task mentions "the same way you called initiate" as a clue that you already have an example line in your program which calls the initiate function by doing this:
Code:
initiate();
One last point on where to put the line - Programming languages' instructions flow downwards in-sequence, just like Written English, so the position in your program where you call the function is important. It needs to happen after the closing-curly-bracket } because the code needs to have finished the sequence of actually creating/defining the whole function before it's possible to actually call it

(Just remember the order that you do things matters, like when making a cup of tea, you can't pour hot water before the kettle has finished boiling)
Not trying to be rude, but could you shorten that ?
0
reply
winterscoming
Badges: 19
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#9
Report 2 years ago
#9
(Original post by Hannah_ lawler)
Not trying to be rude, but could you shorten that ?
Sorry for the long answer! It's useful to know what the code means anyway


And an example of calling a function which is this (including the name, brackets and semicolon at the end) :
Code:
initiate();
so it's just asking you to 'call' your function, which is lifeSupportCheck();
1
reply
Hannah_ lawler
Badges: 2
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#10
Report 2 years ago
#10
(Original post by winterscoming)
Sorry for the long answer! It's useful to know what the code means anyway


And an example of calling a function which is this (including the name, brackets and semicolon at the end) :
Code:
initiate();
so it's just asking you to 'call' your function, which is lifeSupportCheck();
Thank you xx
1
reply
toepeach1997
Badges: 6
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#11
Report 2 years ago
#11
does anyone know the answer for

$review = $_POST['review'];

insertIntoDatabase($review);
0
reply
MiniFestSam
Badges: 1
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#12
Report 2 years ago
#12
(Original post by toepeach1997)
does anyone know the answer for

$review = $_POST['review'];

insertIntoDatabase($review);
i was stuck on this forever. in your notepad theres a code with escape tags. you just gotta follow that. can't remember exactly but i think the answer is something like

$review = escape_tags($review);
and just put that in the blank line between the two you already have.
its not much but play around with it and you'll get it
0
reply
toepeach1997
Badges: 6
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#13
Report 2 years ago
#13
(Original post by MiniFestSam)
i was stuck on this forever. in your notepad theres a code with escape tags. you just gotta follow that. can't remember exactly but i think the answer is something like

$review = escape_tags($review);
and just put that in the blank line between the two you already have.
its not much but play around with it and you'll get it
It worked thank you!!!
0
reply
toepeach1997
Badges: 6
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#14
Report 2 years ago
#14
$myFormData = $_POST['comments'];

insertIntoDatabase($myFormData);


Does anyone know how to sanitise
0
reply
RobTheGoblin
Badges: 5
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#15
Report 2 years ago
#15
(Original post by Diamonddolphin26)
I'm stuck on the Idea Silver badge on the first functions. This is what I typed down:
initiate();
function lifeSupportCheck() {
initiate();
}

Where have I gone wrong?
here is the correct answer for anyone who needs it

initiate();

function lifeSupportCheck() {

//initiate(lifeSupportCheck);

}
1
reply
BonnieBunBuns
Badges: 0
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#16
Report 2 years ago
#16
I'm stuck on the loop part, can someone help me with that?
0
reply
BonnieBunBuns
Badges: 0
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#17
Report 2 years ago
#17
Nevermind, I completed it, i don't need help with it ;-;
Last edited by BonnieBunBuns; 2 years ago
0
reply
tinyminy13
Badges: 11
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#18
Report 2 years ago
#18
(Original post by toepeach1997)
$myFormData = $_POST['comments'];

insertIntoDatabase($myFormData);


Does anyone know how to sanitise
The answer to sanitise the variable before it gets inserted into the database
should be:

$myFormData = escape_tags($myFormData);
insertIntoDatabase($myFormData)

You only need to replace the first line with the escape_tags variable and replace $message to $myFormData.
Hope this helps!
0
reply
Mehrin_09
Badges: 0
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#19
Report 1 year ago
#19
Has anyone done level 6 on the maker badge (sliver activation). The part with the sound blocks. I really need help!! T-T
0
reply
SIRE_boi
Badges: 0
Rep:
? You'll earn badges for being active around the site. Rep gems come when your posts are rated by other community members.
#20
Report 1 month ago
#20
(Original post by BonnieBunBuns)
Nevermind, I completed it, i don't need help with it ;-;
im stuck o dat
0
reply
X

Quick Reply

Attached files
Write a reply...
Reply
new posts
Back
to top
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise

Year 12s - where are you at with making decisions about university?

I’ve chosen my course and my university (19)
32.2%
I’ve chosen my course and shortlisted some universities (22)
37.29%
I’ve chosen my course, but not any universities (2)
3.39%
I’ve chosen my university, but not my course (3)
5.08%
I’ve shortlisted some universities, but not my course (4)
6.78%
I’m starting to consider my university options (7)
11.86%
I haven’t started thinking about university yet (1)
1.69%
I’m not planning on going to university (1)
1.69%

Watched Threads

View All
Latest
My Feed

See more of what you like on
The Student Room

You can personalise what you see on TSR. Tell us a little about yourself to get started.

Personalise