Technology and society · GCSE · OCR J277 1.6.1, AQA 8525 3.8, Edexcel 1CP2 5.2.3 · about 15 min
Proprietary and open source software, common licences, and Creative Commons.
[1 mark]What does open source mean?
[1 mark]Give an advantage of proprietary software.
[1 mark]What does a GPL licence require if you distribute your changes?
[1 mark]What does CC BY mean for an image?
[1 mark]Which is a disadvantage of open source for a school?
Write allowed(licence, use) that returns True or False for a proposed use, given LICENCES where each entry is (may change, may sell, must share changes). A use of "change" needs may change; "sell" needs may sell; "use as is" is always allowed. For each (licence, use) in requests, print <licence> / <use>: yes or : no. If the licence is not in LICENCES, print <licence> / <use>: unknown licence. At the end print allowed: <n> of <total>.
# the two lines every program starts with: the commands, then the robot
from bugbot import *
connect()
# licence: (may change, may sell, must share changes)
LICENCES = {"MIT": (True, True, False), "GPL": (True, True, True), "All rights reserved": (False, False, False)}
requests = [
("MIT", "change"),
("MIT", "sell"),
("GPL", "change"),
("All rights reserved", "change"),
("All rights reserved", "use as is"),
("CC BY", "sell"),
]The hint students can ask for: If the licence is not in the table, say so. Otherwise look up what that licence allows and check it against the use asked for, remembering that using it unchanged is always allowed. Count the ones you allowed.
from bugbot import *
connect()
LICENCES = {"MIT": (True, True, False), "GPL": (True, True, True), "All rights reserved": (False, False, False)}
requests = [
("MIT", "change"),
("MIT", "sell"),
("GPL", "change"),
("All rights reserved", "change"),
("All rights reserved", "use as is"),
("CC BY", "sell"),
]
def allowed(licence, use):
change, sell, share = LICENCES[licence]
if use == "change":
return change
if use == "sell":
return sell
return True
yes = 0
for licence, use in requests:
if licence not in LICENCES:
print(f"{licence} / {use}: unknown licence")
elif allowed(licence, use):
yes = yes + 1
print(f"{licence} / {use}: yes")
else:
print(f"{licence} / {use}: no")
print(f"allowed: {yes} of {len(requests)}")
Any program that meets the task's checks is marked correct in the simulator; this is one way, not the only way.