Example #1
0
def e1bab_bungee_xixb1():
    correct = (
        'From their highest point, the velocity of the bungee jumper increases until they reach the point of equilibrium',
        'From the lowest point in their jump, they velocity of the  bungee jumper increases until they reach the point of equilibrium',
        'After passing through the point of equilibrium, the bungee jumper will always slow down',
        'The bungee jumper will briefly experience zero velocity at two points in their jump',
        'An entire oscillation is completed when the jumper reaches their highest point in the jump',
        'The jumper will experience maximum velocity at the point of equilibrium'
    )
    incorrect = (
        'From their highest point, the velocity of the bungee jumper increases until they reach the lowest point',
        'From their highest point, the velocity of the bungee jumper increases until they are half way through their oscillation',
        'An entire oscillation is completed when the jumper reaches their lowest point in the jump',
        'The bungee jumper will briefly experience zero velocity at one point in their jump',
        'After passing through the point of equilibrium, the bungee jumper will always speed up',
    )
    fact = "true"
    if randint(0, 1) == 0:
        fact = "false"
        correct, incorrect = incorrect, correct
    q = ucf.SelectMcDrag('multi', correct, incorrect, None, (), 1, 1, 4)
    q.questionBase = [
        f"Which of the following statements about bungee jumpers are {fact}?"
    ]
    q.questionNumber = 1
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = ucf.previousNext(
        list_callable_functions(), ucf.currentFuncName(), module_path(),
        ucf.currentFuncName()[0:2], 0, 2)

    return q.returnAll()
Example #2
0
def e1bab_free_vibrations_pxax3():
    q = ucf.Question(ucf.currentFuncName())
    q.questionNumber = 1
    q.questionBase = "The following questions are about free vibrations."
    ruler = q.item(vl.rulers)
    thing = q.item(vl.objects)

    sub2 = [
        f"A {randint(1,50)/10} metre {ruler} is clamped to a table so that part of its length projects at right angles from the edge of the table.",
        f"{q.item(vl.comments)}. A {randint(10, 200)}g {thing} is attached to the free end of the {ruler}. When the free end of the {ruler} is depressed downwards then released, the {thing} oscillates.",
        f"Describe how you would find out if the oscillations of the {thing} are free oscillations."
    ]
    q.questionPartList = [
        {
            'sub_number': 1,
            'sub_question': ['Define free vibrations (oscillations)'],
            'sub_answer':
            'Free vibrations are where the maximum displacement of an oscilating object from the point of equilibrium (amplitude) is contstant, and no frictional forces are present',
            'sub_mark': 2
        },
        {
            'sub_number': 2,
            'sub_question': sub2,
            'sub_answer':
            'Measure the amplitude of each oscilation. If the amplitude decreases, frictional forces are present and the oscillation is not a free vibration',
            'sub_mark': 2
        },
    ]
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = ucf.previousNext(
        list_callable_functions(), ucf.currentFuncName(), module_path(),
        ucf.currentFuncName()[0:2], 0, 2)
    return q.returnAll()
Example #3
0
def db_cd_changing_current_effect_on_resistor_pxax5():
    q = ucf.Question(ucf.currentFuncName())
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = ucf.previousNext(
        list_callable_functions(), ucf.currentFuncName(), module_path(),
        ucf.currentFuncName()[0:2], 0, 2)
    emf, intRes, resistor, totalRes, current, terminalPd, wastedPd, powerSupplied, powerDelivered, powerWasted, current2, terminalPd2, resistor2 = emfIntResSetup(
    )
    q.questionBase = [
        f"A battery of unknown emf and internal resistance is connected in series with an ammeter and a resistance box. The current was {current} A when the box was set at {resistor} \u03A9 and {current2} A at {resistor2} \u03A9.",
        "Calculate:"
    ]
    question1 = ["the cell's emf"]
    question2 = ["the cell's internal resistance"]
    marks1, marks2 = 2, 3
    answer1 = f"{emf} v"
    answer2 = f"{intRes} \u03A9"
    q.questionPartList = [
        {
            'sub_number': 1,
            'sub_question': question1,
            'sub_answer': answer1,
            'sub_mark': marks1
        },
        {
            'sub_number': 2,
            'sub_question': question2,
            'sub_answer': answer2,
            'sub_mark': marks2
        },
    ]
    return q.returnAll()
Example #4
0
def e1bca_frequency_and_acceleration_pxax4():
    time_period = randint(2, 6)
    amplitude = randint(45, 70)
    frequency = round(1 / time_period, 2)
    angular_frequency = round(2 * 3.14159265358 / (1 / frequency), 2)
    maximum_acceleration = round((-angular_frequency**2) * amplitude / 1000, 2)
    q = ucf.Question(ucf.currentFuncName())
    q.questionBase = [
        f"A {q.item(vl.objects)} attached to a thread oscillates in simple harmonic motion with a time period of {time_period}s and an amplitude of {amplitude}mm.",
        "Calculate:"
    ]
    q.questionPartList = [
        {
            'sub_number': 1,
            'sub_question': ["its frequency"],
            'sub_answer': f'{frequency}Hz',
            'sub_mark': 2
        },
        {
            'sub_number': 2,
            'sub_question': ["its maximum acceleration"],
            'sub_answer': f'{maximum_acceleration}m/s\u00b2',
            'sub_mark': 2
        },
    ]
    q.piclink = q.item(vl.pendulum_links)
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = ucf.previousNext(
        list_callable_functions(), ucf.currentFuncName(), module_path(),
        ucf.currentFuncName()[0:2], 0, 2)
    return q.returnAll()
Example #5
0
def da_aa_charge_current_time_piax2():
    q = ucf.Question(ucf.currentFuncName())
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = ucf.previousNext(
        list_callable_functions(), ucf.currentFuncName(), module_path(),
        ucf.currentFuncName()[0:2], 0, 2)
    option, current, minSecs, statedTime, time, charge = setup()
    q.constant = None
    if option == 1:
        q.questionBase = [
            f"The current in a certain wire is {current}A.",
            f"Calculate the charge passing a point in the wire during {statedTime} {minSecs}."
        ]
        q.answerBase = f"{charge}"
        q.answerUnits = 'C'
    if option == 2:
        q.questionBase = [
            f"{charge} coulombs pass a point in a wire in {statedTime} {minSecs}.",
            f"What is the average current at this point during this time?"
        ]
        q.answerBase = f"{current}"
        q.answerUnits = 'A'
    if option == 3:
        q.questionBase = [
            f"{charge} coulombs pass a point in a wire at a current of {current} Amps.",
            f"How long does this take?"
        ]
        q.answerBase = f"{time}"
        q.answerUnits = 's'
    q.qtype = 'type'
    return q.returnAll()
Example #6
0
def db_cc_changing_current_impact_on_emf_pxax5():
    q = ucf.Question(ucf.currentFuncName())
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = ucf.previousNext(
        list_callable_functions(), ucf.currentFuncName(), module_path(),
        ucf.currentFuncName()[0:2], 0, 2)
    emf, intRes, resistor, totalRes, current, terminalPd, wastedPd, powerSupplied, powerDelivered, powerWasted, current2, terminalPd2, resistor2 = emfIntResSetup(
    )
    q.questionBase = [
        f"The pd acrpss the terminals of a cell was {terminalPd} v when the current from the cell was {current} A, and {terminalPd2} v when the current was {current2} A.",
        "Calculate:"
    ]
    question1 = ["the internal resistance of the cell"]

    question2 = ["the cell's emf"]
    marks1, marks2 = 2, 3
    answer1 = f"{intRes} \u03A9"
    answer2 = f"{emf} v"
    q.questionPartList = [
        {
            'sub_number': 1,
            'sub_question': question1,
            'sub_answer': answer1,
            'sub_mark': marks1
        },
        {
            'sub_number': 2,
            'sub_question': question2,
            'sub_answer': answer2,
            'sub_mark': marks2
        },
    ]
    return q.returnAll()
def da_cb_resistivity_uniform_wire_piax2():
    q = ucf.Question(ucf.currentFuncName())
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = ucf.previousNext(
        list_callable_functions(), ucf.currentFuncName(), module_path(),
        ucf.currentFuncName()[0:2], 0, 2)
    q.diagram = None
    component, option, pd, current, resistance, length, material, resistivityConstant, area = resistancePdCurrentSetup(
    )
    q.constant = None
    resistivityConstant = ("{:.2e}".format(resistivityConstant))
    if option == 1:
        q.questionBase = [
            f"Calculate the resistance of a uniform {material} cable of a diameter {round(area/3.15159, 2)} and length {length} m.",
            f"The resistivity of the material is {resistivityConstant} Ohm metres."
        ]
        q.answerBase = f"{resistance}"
        q.answerUnits = ' \u03A9'
    if option == 2:
        q.questionBase = [
            f"What is the area of a uniform {material} wire of length {length} m and resistance of {resistance} \u03A9 if the resistivity of the material is {resistivityConstant} Ohm metres?"
        ]
        q.answerBase = f"{area}"
        q.answerUnits = ' m\u00b2'
    if option == 3:
        q.questionBase = [
            f"What is the length of a uniform {material} wire with resistance of {resistance} \u03A9 and radius of {round((area/3.15159)/2,2)} if the resistivity of the material is {resistivityConstant} Ohm metres?"
        ]
        q.answerBase = f"{length}"
        q.answerUnits = ' m'
    q.qtype = 'type'
    return q.returnAll()
Example #8
0
def da_bb_power_pd_current_4pxax():
    q = ucf.Question(ucf.currentFuncName())
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = ucf.previousNext(
        list_callable_functions(), ucf.currentFuncName(), module_path(),
        ucf.currentFuncName()[0:2], 0, 2)
    component, option, time, current, pd, work, power, q.constant = pdPowerSetup(
    )
    q.questionBase = [
        f"A {pd} V, {round(power,2)} W {component} is connected to a {pd} V battery.",
        "Work out:"
    ]
    question1 = [f"the current through the {component}"]
    answer1 = f"{current} A"
    question2 = [f"the energy transfered to the {component} in {time} s."]
    answer2 = f"{work} J"
    q.questionPartList = [
        {
            'sub_number': 1,
            'sub_question': question1,
            'sub_answer': answer1,
            'sub_mark': 2
        },
        {
            'sub_number': 2,
            'sub_question': question2,
            'sub_answer': answer2,
            'sub_mark': 2
        },
    ]
    return q.returnAll()
def da_cd_two_part_resistivity_pxax4():
    q = ucf.Question(ucf.currentFuncName())
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = ucf.previousNext(
        list_callable_functions(), ucf.currentFuncName(), module_path(),
        ucf.currentFuncName()[0:2], 0, 2)
    component, option, pd, current, resistance, length, material, resistivityConstant, area = resistancePdCurrentSetup(
    )
    q.constant = None
    resistivityConstant = ("{:.2e}".format(resistivityConstant))
    q.questionBase = [
        f'A {material} wire of uniform diameter {round(area/3.15159, 2)} m  and length {length} m has a resistance of {resistance} \u03A9.'
    ]
    question1 = [f"What is its resistivity?"]
    answer1 = f"{resistivityConstant} \u03A9 metres"
    randOhm = randint(1, 3)
    question2 = [
        f"How long would a length of this wire with {randOhm} \u03A9 be?"
    ]
    answer2 = f"{(randOhm*area)/float(resistivityConstant)} m"
    q.questionPartList = [
        {
            'sub_number': 1,
            'sub_question': question1,
            'sub_answer': answer1,
            'sub_mark': 2
        },
        {
            'sub_number': 2,
            'sub_question': question2,
            'sub_answer': answer2,
            'sub_mark': 2
        },
    ]
    return q.returnAll()
def da_ca_resistance_pd_current_piax2():
    q = ucf.Question(ucf.currentFuncName())
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = ucf.previousNext(
        list_callable_functions(), ucf.currentFuncName(), module_path(),
        ucf.currentFuncName()[0:2], 0, 2)
    component, option, pd, current, resistance, length, material, resistivityConstant, area = resistancePdCurrentSetup(
    )
    q.constant = None
    if option == 1:
        q.questionBase = [
            f"The current through a {component} is {current} A when the pd across it is {pd} V.",
            f"Calculate the resistance at this current."
        ]
        q.answerBase = f"{resistance}"
        q.answerUnits = ' \u03A9'
    if option == 2:
        q.questionBase = [
            f"The current through a {component} is {current} A and the resistance is {resistance} \u03A9",
            "What is the pd accross this component?"
        ]
        q.answerBase = f"{pd}"
        q.answerUnits = ' V'
    if option == 3:
        q.questionBase = [
            f"The pd across a {component} is {pd} V when the resistance is {resistance} \u03A9.",
            f"Calculate the current through this component."
        ]
        q.answerBase = f"{current}"
        q.answerUnits = ' A'
    q.qtype = 'type'
    return q.returnAll()
def da_cc_resistivity_rectangular_wire_piax2():
    q = ucf.Question(ucf.currentFuncName())
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = ucf.previousNext(
        list_callable_functions(), ucf.currentFuncName(), module_path(),
        ucf.currentFuncName()[0:2], 0, 2)
    component, option, pd, current, resistance, length, material, resistivityConstant, area = resistancePdCurrentSetup(
    )
    q.constant = None
    thickness = randint(1, 20) / 1000
    resistivityConstant = ("{:.2e}".format(resistivityConstant))
    radius = ("{:.2e}".format(area / 3.14159265 * 2))
    width = ("{:.2e}".format(area / thickness))
    if option == 1:
        q.questionBase = [
            f"Calculate the resistance of a piece of rectangular {material} of thickness {thickness}m, width of {width} m and length {length} m. The resistivity of the material is {resistivityConstant} Ohm metres."
        ]
        q.answerBase = f"{resistance}"
        q.answerUnits = ' \u03A9'
    if option == 2:
        q.questionBase = [
            f"What is the cross-sectional area of a rectangular piece of {material} of length {length}m and resistance of {resistance} \u03A9 if the resistivity of the material is {resistivityConstant} Ohm metres?"
        ]
        q.answerBase = f"{area}"
        q.answerUnits = ' m\u00b2'
    if option == 3:
        q.questionBase = [
            f"What is the length of a rectangular piece of {material} with resistance of {resistance} \u03A9 and radius of {radius} m if the resistivity of the material is {resistivityConstant} Ohm metres?"
        ]
        q.answerBase = f"{length}"
        q.answerUnits = ' m'
    q.qtype = 'qtype'
    return q.returnAll()
Example #12
0
def da_dc_variable_temperature_resistance_pxax4():
    q = ucf.Question(ucf.currentFuncName())
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = ucf.previousNext(list_callable_functions(), ucf.currentFuncName(), module_path(), ucf.currentFuncName()[0:2], 0, 2)
    q.diagram = None
    component, option, pd, current, power, resistance, length= temp_res_setup()
    q.constant = None
    temp1 = randint(1,20)
    temp2 = randint(21,100)
    tempDiff = temp2-temp1
    temp3 = randint(temp1, temp2)
    tempChange = temp2-temp3
    tempco = tempChange/tempDiff

    res1 = randint(5,25)
    res2 = randint(30,55)
    resDiff = res2-res1
    res3 = randint(res1, res2)
    resChange = res2 - res3
    resco = resChange/resDiff
    answer1 = round(res2 - (resDiff*tempco), 2)
    answer2 = round(temp2 - (tempDiff*resco), 2)

    q.questionBase = [f"The resistance of a wire increased from {res1} to {res2} \u03A9 as the temperature increased from {temp1} to {temp2} \u00B0 C.","Assuming that resistance varies linearly with temperature over this range, calculate:"]
    question1 = [f"The resistance when temperature is {temp3} \u00B0 C"]
    answer1 = f"{answer1} \u03A9"
    question2 = [f"The temperature at which resistance will be {res3} \u03A9"]
    answer2 = f'{answer2} \u00B0 C'
    q.questionPartList = [
       {'sub_number': 1, 'sub_question': question1, 'sub_answer': answer1, 'sub_mark': 2}, 
       {'sub_number': 2, 'sub_question': question2, 'sub_answer': answer2, 'sub_mark': 2}, 
    ]
    return q.returnAll()
Example #13
0
def da_db_temperature_of_a_thermistor_pxax4():
    q = ucf.Question(ucf.currentFuncName())
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = ucf.previousNext(list_callable_functions(), ucf.currentFuncName(), module_path(), ucf.currentFuncName()[0:2], 0, 2)
    q.diagram = '/diagrams/physics/circuit_ab_series.jpg'
    component, option, pd, current, power, resistance, length= temp_res_setup()
    cell = [["alkaline AA", 1.5],["of those square", 9],["Li-Mn", 3.7],["NiMh", 1.2],["lead acid car", 12],["Nuclear power cell belonging to an advanced robot assassin sent from the future", 15,000]]
    selection = randint(0,len(cell)-1)
    cell_type = cell[selection][0]
    cell_pd = cell[selection][1]
    temp1 = randint(0, 100)
    temp2 = randint(0, 100)
    res1 = randint(400, 5000)
    res2 = randint(400, 5000)
    number_of_cells = randint(2,6)
    current1 = round((number_of_cells*cell_pd)/res1, 4)
    current2 = round((number_of_cells*cell_pd)/res2, 4)
    q.constant = None

    q.questionBase = [f"The circuit above is from a {component}.",f"The thermistor at point a in the circuit has a resistance of {res1} \u03A9 at {temp1} \u00B0C and {res2} \u03A9 at {temp2} \u00B0C.",f"It is connected in series with an ammeter at point b and {number_of_cells} {cell_type} batteries each delivering {cell_pd} V as shown above."]
    question1 = [f"Calculate the ammeter reading when the thermistor is at {temp1} \u00B0C"]
    answer1 = f"{current1}A"
    question2 = [f"Calculate the ammeter reading when the thermistor is at {temp2} \u00B0C"]
    answer2 = f'{current2}A'
    q.questionPartList = [
       {'sub_number': 1, 'sub_question': question1, 'sub_answer': answer1, 'sub_mark': 2}, 
       {'sub_number': 2, 'sub_question': question2, 'sub_answer': answer2, 'sub_mark': 2}, 
    ]
    return q.returnAll()
def aa_ab_Naming_parts_of_the_atom_piab1():
    q = cf.Question(cf.currentFuncName())
    q.qtype = 'type'
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = cf.previousNext(
        list_callable_functions(), cf.currentFuncName(), module_path(),
        cf.currentFuncName()[0:2], 0, 2)
    answers = [[
        "neutron",
        [
            "have zero charge", "have the largest mass",
            "when removed create a different isotope"
        ]
    ],
               [
                   "proton",
                   [
                       "have positive charge", "have second to largest mass",
                       " have the second to largest specific charge",
                       "dictate what element an atom is"
                   ]
               ],
               [
                   "electron",
                   [
                       "have negative charge",
                       "have the highest specific charge",
                       "dictate whether the atom is an ion"
                   ]
               ]]
    nuclide = randint(0, len(answers) - 1)
    qu = randint(0, len(answers[nuclide][1]) - 1)
    q.questionBase = f'Name the sub-atomic particle in the atom which {answers[nuclide][1][qu]}.'
    q.answerBase = f'{answers[nuclide][0]}'
    q.constant = None
    return q.returnAll()
Example #15
0
def e1bac_calculate_period_frequency_pxax2():
    cycles = randint(5, 30)
    time_for_cycles = randint(5, 20)
    frequency = round(cycles / time_for_cycles, 2)
    time_period = round(1 / frequency, 2)
    q = ucf.Question(ucf.currentFuncName())
    q.questionBase = [
        f"A {q.item(vl.objects)} is suspended from the lower end of a vertical spring, which is dsiplaced downwards from equilibrium. It takes {time_for_cycles} seconds for {cycles} complete cycles to be completed.",
        "Giving your answer to two decimal places, calculate:"
    ]
    q.questionPartList = [
        {
            'sub_number': 1,
            'sub_question': ["Its time period"],
            'sub_answer': f'{time_period} seconds',
            'sub_mark': 1
        },
        {
            'sub_number': 1,
            'sub_question': ["The frequency of the oscillations"],
            'sub_answer': f'{frequency}Hz',
            'sub_mark': 1
        },
    ]
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = ucf.previousNext(
        list_callable_functions(), ucf.currentFuncName(), module_path(),
        ucf.currentFuncName()[0:2], 0, 2)
    return q.returnAll()
Example #16
0
def da_ba_work_pd_current_piax2():
    q = ucf.Question(ucf.currentFuncName())
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = ucf.previousNext(
        list_callable_functions(), ucf.currentFuncName(), module_path(),
        ucf.currentFuncName()[0:2], 0, 2)
    component, option, time, current, pd, work, power, q.constant = pdPowerSetup(
    )
    if option == 1:
        q.questionBase = [
            f"Calculate the energy transfered in {time} s in a {component} where the the potential difference is {pd} v and current is {current} A."
        ]
        q.answerBase = f"{work}"
        q.answerUnits = 'J'
    if option == 2:
        q.questionBase = [
            f"Calculate the time taken to transfer {work} J of energy where the the potential difference accross a {component} is {pd} v and the current is {current} A."
        ]
        q.answerBase = f"{time}"
        q.answerUnits = 's'
    if option == 3:
        q.questionBase = [
            f"Calculate the average potential difference accross a {component} where a current of {current} A does {work} J of work over {time} s."
        ]
        q.answerBase = f"{pd}"
        q.answerUnits = 'v'
    if option == 4:
        q.questionBase = [
            f"Calculate the average current drawn by a {component} where the average potential difference accross the component is {pd} v over {time} seconds and {work} J of work is done."
        ]
        q.answerBase = f"{current} A"
        q.answerUnits = 'A'
    qtype = 'type'
    return q.returnAll()
def gx_ac_radioactive_nucleus_alpha_decay_pxax3():
    name = ucf.currentFuncName()
    q = ucf.Question(name)
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = ucf.previousNext(
        list_callable_functions(), ucf.currentFuncName(), module_path(),
        ucf.currentFuncName()[0:2], 0, 2)
    q.questionBase = [
        "A radioactive nucleus decays with the emission of an alpha partcile and a gamma-ray photon."
    ]
    sub_q1: [
        'Describe the changes that occur in the proton number and nucleon number of the nucleus.'
    ]
    sub_a1: 'The proton number will decrease by two, and the nucleon number will decrease by four'
    sub_q2: [
        'Comment on the relative penetrating powers of the two types of ionising radiation'
    ]
    sub_a2: 'Alpha particles are relatively large and slow, and have less penetrating power than faster gamma-ray protons  because gamma protons are less likely to interact with atomic structures'
    q.questionPartList = [
        {
            'sub_number': 1,
            'sub_question': sub_q1,
            'sub_answer': sub_a1,
            'sub_mark': 1
        },
        {
            'sub_number': 2,
            'sub_question': sub_q2,
            'sub_answer': sub_a2,
            'sub_mark': 2
        },
    ]
    return q.returnAll()
Example #18
0
def da_ac_electron_beam_experiment_piax2():
    q = ucf.Question(ucf.currentFuncName())
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = ucf.previousNext(
        list_callable_functions(), ucf.currentFuncName(), module_path(),
        ucf.currentFuncName()[0:2], 0, 2)
    option, current, minSecs, statedTime, time, charge = setup()
    option = randint(1, 2)
    eCharge = electronCharge()
    charge = (current * time)
    numElectrons = charge / eCharge
    numElectrons = ("{:.2e}".format(numElectrons))
    q.constant = f"e = {eCharge} c"
    if option == 1:
        q.questionBase = [
            f"In an electron beam experiment, the beam current is {current} A.",
            f"Calculate the charge which flows along the beam in {statedTime} {minSecs}."
        ]
        q.answerBase = f"{charge}"
        q.answerUnits = 'C'
    if option == 2:
        q.questionBase = [
            f"In an electron beam experiment, the beam current is {current} A.",
            f"Calculate the number of electrons which flow along the beam in {statedTime} {minSecs}."
        ]
        q.answerBase = f"{numElectrons}"
        q.answerUnits = 'electrons'
    q.qtype = 'type'
    return q.returnAll()
Example #19
0
def e1bbc_frequency_and_initial_acceleration_pxax4():
    cycles = randrange(10, 30, 2)
    in_time = randrange(8, 24, 2)
    amplitude = randint(20, 30)
    #cycles, in_time, amplitude = 10, 20, 32
    frequency = round(cycles / in_time, 2)
    angular_frequency = round(2 * 3.14159265358 / (1 / frequency), 2)
    acceleration = round(
        -(2 * 3.14159265359 * frequency)**2 * amplitude / 1000, 2)
    q = ucf.Question(ucf.currentFuncName())
    q.questionBase = [
        f"A simple pendulum consists of a small {q.item(vl.objects)} attached to the end of a thread. {q.item(vl.comments)}. The aforementioned object is displaced from equilibrium and released. It oscillates with an amplitude of {amplitude} mm, taking {in_time} s to execute {cycles} oscillations.",
        "Calculate:"
    ]
    q.questionPartList = [
        {
            'sub_number': 1,
            'sub_question': [f"its frequency"],
            'sub_answer': f'{frequency}Hz',
            'sub_mark': 1
        },
        {
            'sub_number': 2,
            'sub_question': [f"its initial acceleration"],
            'sub_answer': f'{acceleration} m/s\u00b2',
            'sub_mark': 2
        },
    ]
    q.piclink = q.item(vl.pendulum_links)
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = ucf.previousNext(
        list_callable_functions(), ucf.currentFuncName(), module_path(),
        ucf.currentFuncName()[0:2], 0, 2)
    return q.returnAll()
Example #20
0
def da_ab_electrons_current_time_piax2():
    q = ucf.Question(ucf.currentFuncName())
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = ucf.previousNext(
        list_callable_functions(), ucf.currentFuncName(), module_path(),
        ucf.currentFuncName()[0:2], 0, 2)
    option, current, minSecs, statedTime, time, charge = setup()
    eCharge = electronCharge()
    charge = (current * time) / eCharge
    charge = ("{:.2e}".format(charge))
    q.constant = f"e = {eCharge} c"
    if option == 1:
        q.questionBase = [
            f"The current in a certain wire is {current}A.",
            f"Calculate the number of electrons passing a point in the wire during {statedTime} {minSecs}."
        ]
        q.answerBase = f"{charge}"
        q.answerUnits = 'C'
    if option == 2:
        q.questionBase = [
            f"{charge} electrons pass a point in a wire in {statedTime} {minSecs}.",
            f"What is the average current at this point during this time?"
        ]
        q.answerBase = f"{current} A"
        q.answerUnits = 'A'
    if option == 3:
        q.questionBase = [
            f"{charge} electrons pass a point in a wire at a current of {current} Amps.",
            f"How long does this take?"
        ]
        q.answerBase = f"{time} s"
        q.answerUnits = 's'
    q.qtype = 'type'
    return q.returnAll()
def aa_aa_Counting_protons_and_neutrons_pxax2():
    q = cf.Question(cf.currentFuncName())
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = cf.previousNext(
        list_callable_functions(), cf.currentFuncName(), module_path(),
        cf.currentFuncName()[0:2], 0, 2)
    atom, mass, element, proton = generateAtom()
    q.questionBase = f"{atom}"
    question1 = ["How many protons in the above nucleus?"]
    answer1 = f"{proton}"
    question2 = ["How many neutrons in the above nucleus?"]
    answer2 = f"{mass-proton}"
    q.questionPartList = [
        {
            'sub_number': 1,
            'sub_question': question1,
            'sub_answer': answer1,
            'sub_mark': 1
        },
        {
            'sub_number': 2,
            'sub_question': question2,
            'sub_answer': answer2,
            'sub_mark': 1
        },
    ]
    return q.returnAll()
Example #22
0
def fb_ad_charging_an_insulated_metal_conductor_pxax3():
    q = ucf.Question(ucf.currentFuncName())
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = ucf.previousNext(list_callable_functions(), ucf.currentFuncName(), module_path(), ucf.currentFuncName()[0:2], 0, 2)
    q.questionBase = [f"An insulated metal conductor is earthed before a negatively charged object is brought near to it:"]
    q.questionPartList = [
       {'sub_number': 1, 'sub_question': ['Explain why the free electrons in the conductor move as far away from the charged object as they can.'], 'sub_answer': 'The free electrons in the metal are repelled by negatively charged object because they are also negatively charged.', 'sub_mark': 1 }, 
       {'sub_number': 2, 'sub_question': ["The conductor is then briefly earthed. The charged object is then removed from the vicinity of the conductor.","Explain why the conductor is left with an overall positive charge."], 'sub_answer': "When the conductor is earthed, electrons are able to flow out of the conductor to earth, resulting in less electrons in the conductor and an overall positive charge.", 'sub_mark': 2 }, 
    ]
    return q.returnAll()
Example #23
0
def fb_ab_shuttling_ball_experiment_pxax4():
    q = ucf.Question(ucf.currentFuncName())
    q.questionBase = ["In the shuttling ball experiment, explain why the ball shuttles faster if:"]
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = ucf.previousNext(list_callable_functions(), ucf.currentFuncName(), module_path(), ucf.currentFuncName()[0:2], 0, 2)
    q.questionPartList = [
       {'sub_number': 1, 'sub_question': ['the potential difference between the plates is increased'], 'sub_answer': 'On contact, electrons flow from the insulated metal to the positively charged rod, resulting in a net positive charge on the metal', 'sub_mark': 2 }, 
       {'sub_number': 2, 'sub_question': ['the plates are brought closer together'], 'sub_answer': 'Electrons from the sphere are repelled by the negative charge on the ball and flow down the wire until the charge of the sphere is no longer negative', 'sub_mark': 2 }, 
    ]
    return q.returnAll()
Example #24
0
def fb_aa_electrical_field_observations_pxax4():
    q = ucf.Question(ucf.currentFuncName())
    q.questionBase = ["Explain each of the following observations in terms of transfer of electrons:"]
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = ucf.previousNext(list_callable_functions(), ucf.currentFuncName(), module_path(), ucf.currentFuncName()[0:2], 0, 2)
    q.questionPartList = [
       {'sub_number': 1, 'sub_question': ['An insulated metal can is given a positive charge by touching it with a positively charged rod'], 'sub_answer': 'On contact, electrons flow from the insulated metal to the positively charged rod, resulting in a net positive charge on the metal', 'sub_mark': 2 }, 
       {'sub_number': 2, 'sub_question': ['A negatively charged metal sphere suspended on a thread is discharged by connecting it to the ground using a wire'], 'sub_answer': 'Electrons from the sphere are repelled by the negative charge on the ball and flow down the wire until the charge of the sphere is no longer negative', 'sub_mark': 2 }, 
    ]
    return q.returnAll()
def gx_ab_investigating_atomic_structure_pxax8():
    name = ucf.currentFuncName()
    q = ucf.Question(name)
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = ucf.previousNext(
        list_callable_functions(), ucf.currentFuncName(), module_path(),
        ucf.currentFuncName()[0:2], 0, 2)
    q.questionBase = [
        f"Figure 1 above shows the apparatus in which {sc.alpha()} particles are directed at a metal foil in order to investigate the structure of the atom."
    ]
    sub_q1 = ['Give two reasons why the metal foil should be thin.']
    sub_a1 = 'The alpha particles must be able to penetrate and pass through the foil to be detected.'
    sub_q2 = [
        f'Explain why the incident beam of {sc.alpha()} particles should be narrow.'
    ]
    sub_a2 = ''
    sub_q3 = [
        f'Describe and explain one feature of the distribution of the scattered {sc.alpha()} particles that suggests the nucleus contains most of the mass of an atom.'
    ]
    sub_a3 = ''
    sub_q4 = [
        f"Figure 2 shows three {sc.alpha()} particles a,b and c, with the same constant velocity incident on an atom in the metal foil.",
        "They all approach the nucleus close enough to be deflected by at least 10°.",
        f"Draw the paths followed by the three {sc.alpha()} particles whose initial directions are shown by the arrows."
    ]
    sub_a4 = ''
    q.piclink = "https://lh3.googleusercontent.com/AKZ2Ew-8X9sGDhR2dGBEkYK1fA7Np6xDE5RTHWXzx5Ig7AQQBcK7ndx1OnE8Uts1jeMNbBgHpi1anWY0DjGc3KM7XhKLvvPaPxMFjov7X5Km7AFLvjh6bMmcyp6nED64lHSXoMxcr0NyPIWyTRWvFNJI72WvPeflGU0Y75-f58HjNtiV3buKYilJAo3byr2g-q3HGRy2g5AtwT28h9TRNz9Y1Ce1Fj3mrb19ADdIdA6rvFYVila5e4hDuGD1681fZoszSebpDsR469Twq_lTL2k1XGiFM0vaXMpjvyVpOhkGj6cepeRbY8nghAtIQcFvOmmQ6pX--CPpPgCWes9VtxzF25wmeN0OyrtIPAG4Ly6vZIGLt7MLdBrbbP0s2vB12rqA8R2FufFMYUOAXU3fNOeLPXUVqggzpWnGn6wRUihAwDGDXwzLNfERKde_YI--8oQU67gVNHHDd2Nh-kVizksokcqZ8y7SlNenHJcJIN52WtUVxSJvj6kKs8ETh0b0Wl9hL7PZDCIBPqssOKxnx5rJC6PQFD0RH__3IeMNNKFyLBH9uEfczSYHA2vRH_lkH-CritGSXAfAwIBxGav8z6c1mjH74_UiAZ-W2pATXM4rZ-R-yEZBdAgVwpl_mVoAQ4LEfrxHxdsBBDut82eeKAUoUIBxpZh2HKVWLVwCjKXY3QiPXeIdO9j5oAZ0eEknhTcsxubf-CA4ZZtImUajgwGI=w1045-h589-no?authuser=0"
    q.questionPartList = [
        {
            'sub_number': 1,
            'sub_question': sub_q1,
            'sub_answer': sub_a1,
            'sub_mark': 1
        },
        {
            'sub_number': 2,
            'sub_question': sub_q2,
            'sub_answer': sub_a2,
            'sub_mark': 2
        },
        {
            'sub_number': 3,
            'sub_question': sub_q3,
            'sub_answer': sub_a3,
            'sub_mark': 2
        },
        {
            'sub_number': 4,
            'sub_question': sub_q4,
            'sub_answer': sub_a4,
            'sub_mark': 3
        },
    ]
    return q.returnAll()
Example #26
0
def e1baa_bungee_pxax2():
    q = ucf.Question(ucf.currentFuncName())
    q.questionNumber = 1
    q.questionBase = [
        "Describe how the velocity of a bungee jumper changes during a jump from the moment he jumps off the starting platform to the next time he reaches the highest point of his jump."
    ]
    q.marksBase = 2
    q.answerBase = "The velocity of the bungee jumper increases until they reach the point of equilibrium, after which tension in the cord starts to decrease their velocity. Half way through the time period of one oscilation, the bungee jumper will briefly experience zero velocity before their rate of negative velocity in the opposite direction increases until they pass through their point of equilibrium, at which point velocity decreases as they are slowed by gravity until they reach the highest point in their rebound"
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = ucf.previousNext(
        list_callable_functions(), ucf.currentFuncName(), module_path(),
        ucf.currentFuncName()[0:2], 0, 2)
    return q.returnAll()
Example #27
0
def e1bba_displacement_and_direction_of_oscilating_object_pxax4():
    amplitude = randint(20, 30)
    time_period = randrange(14, 27, 2) / 10
    if randint(0, 1) == 0:
        direction = 'upwards'
        dis1, dis2, dis3, dis4 = amplitude, 0, -amplitude, 0
        dir1, dir2, dir3, dir4 = 'changing from up to down', 'downwards', 'changing from down to up', 'upwards'
    else:
        direction = 'downwards'
        dis1, dis2, dis3, dis4 = -amplitude, 0, amplitude, 0
        dir1, dir2, dir3, dir4 = 'changing from down to up', 'upwards', 'changing from up to down', 'downwards'
    q = ucf.Question(ucf.currentFuncName())
    q.questionBase = [
        f"A small {q.item(vl.objects)} attached to the end of a vertical spring oscillates with an amplitude of {amplitude}mm and a time period of {time_period}s. The object passes through equilibrium moving upwards at timer = 0.",
        "What is the displacement and direction of motion of the object:"
    ]
    q.questionPartList = [
        {
            'sub_number': 1,
            'sub_question': [f"1\u20444 cycle later"],
            'sub_answer': f'{dis1} mm, {dir1}',
            'sub_mark': 1
        },
        {
            'sub_number': 2,
            'sub_question': [f"1\u20442 cycle later"],
            'sub_answer': f'{dis2} mm, {dir2}',
            'sub_mark': 1
        },
        {
            'sub_number': 3,
            'sub_question': [f"3\u20444 cycle later"],
            'sub_answer': f'{dis3} mm, {dir3}',
            'sub_mark': 1
        },
        {
            'sub_number': 4,
            'sub_question': [f"1 cycle later"],
            'sub_answer': f'{dis4} mm, {dir4}',
            'sub_mark': 1
        },
    ]
    q.diagram = f'/diagrams/physics/{ucf.currentFuncName()}.jpg'
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = ucf.previousNext(
        list_callable_functions(), ucf.currentFuncName(), module_path(),
        ucf.currentFuncName()[0:2], 0, 2)
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = cf.previousNext(
        list_callable_functions(), cf.currentFuncName(), module_path(),
        cf.currentFuncName()[0:2], 0, 2)
    return q.returnAll()
Example #28
0
def da_bc_pd_charge_energy_power_time_pxax6():
    q = ucf.Question(ucf.currentFuncName())
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = ucf.previousNext(
        list_callable_functions(), ucf.currentFuncName(), module_path(),
        ucf.currentFuncName()[0:2], 0, 2)
    component, option, time, current, pd, work, power, q.constant = pdPowerSetup(
    )
    bat = [
        "large potato battery", "lithium-ion battery",
        "curiously powerful watch battery", "NiMh battery",
        "battery made of lemons"
    ]
    battery = bat[randint(0, len(bat) - 1)]
    charge = round(current * time, 2)
    q.questionBase = [
        f"A {battery} has an emf of {pd} V. It stores a total charge of {charge} C and has negligible internal resistance.",
        "Calculate:"
    ]
    question1 = [f"the maximum energy the {battery} could deliver"]
    answer1 = f"{work} J"
    question2 = [
        f"the power it would deliver to a {component} drawing {current} A"
    ]
    answer2 = f"{power} W"
    question3 = [
        f"how long the {battery} would last in seconds if it supplied power at the rate calculated above."
    ]
    answer3 = f"{time} s"
    q.questionPartList = [
        {
            'sub_number': 1,
            'sub_question': question1,
            'sub_answer': answer1,
            'sub_mark': 2
        },
        {
            'sub_number': 2,
            'sub_question': question2,
            'sub_answer': answer2,
            'sub_mark': 2
        },
        {
            'sub_number': 3,
            'sub_question': question3,
            'sub_answer': answer3,
            'sub_mark': 2
        },
    ]
    return q.returnAll()
Example #29
0
def fb_ac_shuttling_ball_experiment2_pxax3():
    frequency = randint(20, 30)/10
    charge = 30
    charge_nano = 30e-9
    current = round(frequency*charge)
    number_of_electrons = (charge_nano/1.6e-19)/1e11

    q = ucf.Question(ucf.currentFuncName())
    q.constant = electron()
    q.questionBase = [f"A ball shuttles between two oppositely charged metal plates at a frequency of {frequency} Hz.",f"The ball carries a charge of {charge} nC each time it shuttles from one plate to the other.","Calculate:"]
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = ucf.previousNext(list_callable_functions(), ucf.currentFuncName(), module_path(), ucf.currentFuncName()[0:2], 0, 2)
    q.questionPartList = [
       {'sub_number': 1, 'sub_question': ['the average current in the circuit'], 'sub_answer': f'{current} nA', 'sub_mark': 1 }, 
       {'sub_number': 2, 'sub_question': ['the number of electrons transferred each time the ball makes contact with a metal plate'], 'sub_answer': f'{number_of_electrons}x10\u00b9\u00b9', 'sub_mark': 2 }, 
    ]
    return q.returnAll()
Example #30
0
def dbca_resistance_current_lost_pxax8():
    q = ucf.Question(ucf.currentFuncName())
    q.previousQ, q.nextQ, q.currentQname, q.nextQname, q.previousQname = ucf.previousNext(
        list_callable_functions(), ucf.currentFuncName(), module_path(),
        ucf.currentFuncName()[0:2], 0, 2)
    emf, intRes, resistor, totalRes, current, terminalPd, wastedPd, powerSupplied, powerDelivered, powerWasted, current2, terminalPd2, resistor2 = emfIntResSetup(
    )
    q.questionBase = [
        f"A battery of emf {emf}v and internal resistance of {intRes} \u03A9 is connected to a {resistor} \u03A9 resistor.",
        "Calculate:"
    ]
    question1 = ["the total resistance of the circuit"]
    question2 = ["the current through the battery"]
    question3 = ["the lost pd"]
    question4 = ["the pd across the cell terminals."]
    marks1, marks2, marks3, marks4 = 2, 2, 2, 2
    answer1 = f"{totalRes} \u03A9"
    answer2 = f"{current} A"
    answer3 = f"{wastedPd} v"
    answer4 = f"{terminalPd} v"
    q.questionPartList = [
        {
            'sub_number': 1,
            'sub_question': question1,
            'sub_answer': answer1,
            'sub_mark': marks1
        },
        {
            'sub_number': 2,
            'sub_question': question2,
            'sub_answer': answer2,
            'sub_mark': marks2
        },
        {
            'sub_number': 3,
            'sub_question': question3,
            'sub_answer': answer3,
            'sub_mark': marks3
        },
        {
            'sub_number': 4,
            'sub_question': question4,
            'sub_answer': answer4,
            'sub_mark': marks4
        },
    ]
    return q.returnAll()