htdocs/maths/forms.js
2024-12-24 22:44:26 +00:00

29 lines
3.1 KiB
JavaScript
Executable File

let selected_topic = document.getElementById("topic-selection")
let subtopic_selection_div = document.getElementById("subtopic-selection-div")
let subtopic_selection_div_text = subtopic_selection_div.innerHTML
let subtopics = [
["any"],
["any","basic_algebra","combine_like_terms","complex_quadratic","compound_interest","distance_two_points","expanding","factoring","intersection_of_two_lines","invert_matrix","linear_equations","line_equation_from_2_points","log","matrix_multiplication","midpoint_of_two_points","multiply_complex_numbers","quadratic_equation","simple_interest","system_of_equations","vector_cross","vector_dot","orthogonal_projection"],
["any","absolute_difference","addition","compare_fractions","cube_root","divide_fractions","division","exponentiation","factorial","fraction_multiplication","fraction_to_decimal","greatest_common_division","is_composite","is_prime","multiplication","percentage","percentage_difference","percentage_error","power_of_powers","square","square_root","simplify_square_root","subtraction"],
["any","definite_integral","power_rule_differentiation","power_rule_integration","stationary_points","trig_differentiation"],
["any","bcd_to_decimal","binary_2s_complement","binary_complement_1s","binary_to_decimal","binary_to_hex","decimal_to_bcd","decimal_to_binary","decimal_to_hexadeci","decimal_to_octal","fibonacci_series","modulo_division","nth_fibonacci_number"],
["any","angle_btw_vectors","angle_regular_polygon","arc_length","area_of_circle","area_of_circle_given_center_and_point","area_of_triangle","basic_trigonometry","circumfrence","complementary_and_supplementary_angle","curved_surface_area_of_cylinder","degree_to_rad","equation_of_line_from_two_point","forth_angle_of_quadrilateral","perimeter_of_polygons","pythagorean_theorem","radian_to_deg","sector_area","sum_of_polygon_angles","surface_area_cone","surface_area_cube","surface_area_cuboid","surface_area_cylinder","surface_area_pyramid","surface_area_cone_frustrum","surface_area_hemisphere","surface_area_sphere",],
["any","arithmatic_progression_sum","arithmatic_progression_term","base_conversion","binomial_distribution","celsius_to_fahrenheit","common_factors","complex_to_polar","decimal_to_roman_numerals","euclidian_norm","factors","geometric_mean","geometric_progression","harmonic_mean","is_leap_year","lcm","minutes_to_hours","prime_factors","product_of_scientific_notations","profit_loss_percent","quotient_of_power_same_base","quotient_of_power_same_power","set_operation","signum_function","surds_comparison"],
["any","combinations","conditional_probability","confidence_interval","data_summary","dice_sum_probability","mean_median","permutation"]]
function onChange() {
let value = selected_topic.value;
let text = selected_topic.options[selected_topic.selectedIndex].text;
value = Number(value)
console.log(value);
let selection_text = "<select name='subtopic' id='subtopic-selection'>"
for (let i = 0; i < subtopics[value].length; i++) {
selection_text += `<option value='${subtopics[value][i]}'>${subtopics[value][i]}</option>`
}
selection_text += "</select>"
subtopic_selection_div.innerHTML = selection_text;
}
selected_topic.onchange = onChange;
onChange();