Higher – Javascript mouse events

The code bellow uses mouse events to run a javascript function.

On line 15  the onmouseover and onmouseout events are used to call the function on line 6.

Line 7 targets the swap id and uses the argument passed to replace the image source.


<!doctype html>
<html>
<head>

<script type="text/javascript">
function changeImage(img_src) {
document.getElementById("swap").src = img_src;

}
</script>

</head>
<body>
<h1>roll over</h1>
<img id="swap" src="redButton.jpg" onmouseover='changeImage("blueButton.jpg")' onmouseout='changeImage("redButton.jpg")'>

</body>
</html>

Higher – Database Learning Points

We have now finished Databases. Here is what you should know.

From Scholar

  • How to describe the structure of a database in terms of tables, records and fields.

  • The advantages of using relational databases.

  • The purpose of primary, surrogate, foreign and compound keys.

  • The differences between one-to-one, one-to-many and many-to-many relationships.

  • The purpose and uses of tables, forms and reports.

  • What is meant by a relationship in a database.

  • How to perform complex operations, such as performing a query, creating a form, creating a report.

  • A calculated field is one which is created using a query which calculates a result from one or more existing fields.

Work for Wednesday

Sign up for or login to Khan Academy, then undertake the course below.

N5

Use your jotter to take notes, I have created a class with the code <in email>

Higher

you might want pay special attention to the Relational Queries in SQL section. I have created a class with the code <in email>

https://www.khanacademy.org/computing/computer-programming/sql

Python – Thonny

I know that some of you have struggled to get Python working at home, so let me introduce you to Thonny.

Thonny is a Python IDE for beginners, it has Python built in so no need for a seperate install. It has a lot of cool features that you may find useful. I am going to demo a few features (the following text is from the Thonny homepage http://thonny.org/ )

No-hassle variables.

Once you’re done with hello-worlds, select View → Variables and see how your programs and shell commands affect Python variables.

Variables table

Simple debugger. Just press Ctrl+F5 instead of F5 and you can run your programs step-by-step, no breakpoints needed. Press F6 for a big step and F7 for a small step. Steps follow program structure, not just code lines.

Stepping through statements

Step through expression evaluation. If you use small steps, then you can even see how Python evaluates your expressions. You can think of this light-blue box as a piece of paper where Python replaces subexpressions with their values, piece-by-piece.

BGE – Powerpoint Triggers

We have been making quiz games and spooky castle walk throughes. Today we added some invisible triggers to our presentation to make zombies, etc. to appear.

You can try something similar at home by following this video.