Class: Studium::ShowLecturesOnTheCommandline
- Inherits:
-
Base
- Object
- Base
- Studium::ShowLecturesOnTheCommandline
show all
- Defined in:
- lib/studium/utility_scripts/show_lectures_on_the_commandline/html.rb,
lib/studium/utility_scripts/show_lectures_on_the_commandline/run.rb,
lib/studium/utility_scripts/show_lectures_on_the_commandline/help.rb,
lib/studium/utility_scripts/show_lectures_on_the_commandline/menu.rb,
lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb,
lib/studium/utility_scripts/show_lectures_on_the_commandline/show.rb,
lib/studium/utility_scripts/show_lectures_on_the_commandline/reset.rb,
lib/studium/utility_scripts/show_lectures_on_the_commandline/konsole.rb,
lib/studium/utility_scripts/show_lectures_on_the_commandline/constants.rb,
lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb,
lib/studium/utility_scripts/show_lectures_on_the_commandline/initialize.rb,
lib/studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb
Overview
Studium::ShowLecturesOnTheCommandline
Constant Summary
collapse
- IMAGE_FOR_THE_COMPLETED_MODULE =
#
Studium::ShowLecturesOnTheCommandline::IMAGE_FOR_THE_COMPLETED_MODULE
This constant resides here because it is only used by this .rb file.
#
'<img src="/home/x/data/images/studium/COMPLETED_MODULE.png" '\
'style="margin-left: 1em; border: 3px solid black">'.dup
- NAMESPACE =
inspect
- ALSO_SHOW_URL =
#
ALSO_SHOW_URL
If this constant is set to true then this class will also show the URL to the target course.
#
true
Constants inherited
from Base
Base::ARRAY_HTML_COLOURS_IN_USE, Base::CHECK_FOR_INCORRECT_ENTRIES_IN_THE_QUESTION_ANSWER_FILE_THAT_SHOULD_BE_COMMENTS, Base::COLOURS, Base::COMMON_YEAR_DAYS_IN_MONTH, Base::GRAY, Base::LEFT_PADDING, Base::N_CHARACTERS_PER_LINE, Base::UNICODE_RIGHT_ARROW
Constants included
from Colours
Colours::COLOURS
Class Method Summary
collapse
Instance Method Summary
collapse
-
#add_to_the_dataset_without_any_further_checks(i) ⇒ Object
# === add_to_the_dataset_without_any_further_checks ========================================================================= #.
-
#check_for_title_entry_in_the_file(this_file = dataset? ) ⇒ Object
# === check_for_title_entry_in_the_file.
-
#clear_old_dataset ⇒ Object
# === clear_old_dataset ========================================================================= #.
-
#consider_generating_a_graphviz_image_displaying_the_modules(use_this_dataset) ⇒ Object
# === consider_generating_a_graphviz_image_displaying_the_modules ========================================================================= #.
-
#consider_generating_a_html_file(i = @generate_html_file) ⇒ Object
# === consider_generating_a_html_file (html tag).
-
#consider_generating_a_spreadsheet(i = @title) ⇒ Object
# === consider_generating_a_spreadsheet ========================================================================= #.
-
#consider_showing_to_which_universities_the_lectures_belong_to ⇒ Object
# === consider_showing_to_which_universities_the_lectures_belong_to.
-
#dataset? ⇒ Boolean
(also: #all_lectures?, #dataset_holding_all_lectures, #lectures?)
# === dataset? ========================================================================= #.
-
#determine_from_which_files_to_read(i = FILE_MASTER_VEKTORX, type_of_the_curriculum = :bachelor) ⇒ Object
(also: #determine_from_which_file_to_read)
# === determine_from_which_files_to_read.
-
#determine_the_type_of_the_curriculum(i = :bachelor) ⇒ Object
# === determine_the_type_of_the_curriculum (type tag).
-
#do_all_actions_after_the_main_dataset_was_read_in ⇒ Object
# === do_all_actions_after_the_main_dataset_was_read_in ========================================================================= #.
-
#do_generate_a_html_file ⇒ Object
# === do_generate_a_html_file.
-
#do_not_read_in_from_a_file ⇒ Object
# === do_not_read_in_from_a_file ========================================================================= #.
-
#do_not_report_anything ⇒ Object
(also: #do_not_report)
# === do_not_report_anything ========================================================================= #.
-
#do_not_show_loaded_from_which_file ⇒ Object
# === do_not_show_loaded_from_which_file ========================================================================= #.
-
#do_not_show_the_next_exams ⇒ Object
# === do_not_show_the_next_exams.
-
#do_show_all_URLs ⇒ Object
# === do_show_all_URLs ========================================================================= #.
-
#do_show_lecture_attribution_to_universities ⇒ Object
# === do_show_lecture_attribution_to_universities ========================================================================= #.
-
#exclude_title_entries_from_the_main_dataset ⇒ Object
# === exclude_title_entries_from_the_main_dataset ========================================================================= #.
-
#html_string? ⇒ Boolean
# === html_string? ========================================================================= #.
-
#individual_curriculum? ⇒ Boolean
(also: #is_it_an_individual_curriculum?)
# === individual_curriculum? ========================================================================= #.
-
#initialize(commandline_arguments = [], run_already = true) ⇒ ShowLecturesOnTheCommandline
constructor
# === initialize ========================================================================= #.
-
#is_an_individual_curriculum ⇒ Object
# === is_an_individual_curriculum ========================================================================= #.
-
#is_bachelor_curriculum ⇒ Object
# === is_bachelor_curriculum ========================================================================= #.
-
#is_bachelor_master_curriculum ⇒ Object
# === is_bachelor_master_curriculum ========================================================================= #.
-
#is_master_curriculum ⇒ Object
# === is_master_curriculum.
-
#is_not_an_individual_curriculum ⇒ Object
# === is_not_an_individual_curriculum ========================================================================= #.
-
#is_this_a_registered_lecture?(i) ⇒ Boolean
# === is_this_a_registered_lecture? ========================================================================= #.
-
#is_this_lecture_a_practical_course?(lecture_type) ⇒ Boolean
# === is_this_lecture_a_practical_course? ========================================================================= #.
-
#iterate_over_the_lectures(i = @dataset) ⇒ Object
(also: #do_the_main_iteration)
# === iterate_over_the_lectures (iterate tag) ========================================================================= #.
-
#ja_oder_nein(i = 'nein') ⇒ Object
# === ja_oder_nein.
-
#lecture_dataset? ⇒ Boolean
(also: #main_dataset?)
# === lecture_dataset? ========================================================================= #.
-
#menu(i = commandline_arguments? ) ⇒ Object
(also: #use_this_curriculum=)
-
#n_ects_points_in_total? ⇒ Boolean
(also: #total_ects_points?)
# === n_ects_points_in_total? ========================================================================= #.
-
#n_ects_were_passed_in_this_curriculum? ⇒ Boolean
(also: #n_ects_were_passed_in_this_curriculum, #n_ects_were_passed_so_far)
# === n_ects_were_passed_in_this_curriculum? ========================================================================= #.
-
#n_lectures_are_already_solved? ⇒ Boolean
(also: #n_lectures_completed?)
# === n_lectures_are_already_solved? ========================================================================= #.
-
#n_lectures_in_this_curriculum? ⇒ Boolean
# === n_lectures_in_this_curriculum? ========================================================================= #.
-
#n_total_lectures? ⇒ Boolean
# === n_total_lectures? ========================================================================= #.
-
#no_html_and_do_not_report_anything ⇒ Object
# === no_html_and_do_not_report_anything ========================================================================= #.
-
#no_html_page ⇒ Object
(also: #no_html)
# === no_html_page7 ========================================================================= #.
-
#obtain_sanitized_dataset_from(i) ⇒ Object
# === obtain_sanitized_dataset_from.
-
#opnn(i = NAMESPACE) ⇒ Object
# === opnn ========================================================================= #.
-
#prepend_this_to_dataset(i = :bachelor_biologie_basisblock_curriculum) ⇒ Object
# === prepend_this_to_dataset.
-
#read_from_these_files? ⇒ Boolean
(also: #loaded_from_which_file?, #curriculum_file?, #curriculum_file_location?, #curriculum_file_location, #curriculum?)
# === read_from_these_files? ========================================================================= #.
-
#read_in_dataset_from_this_file(i) ⇒ Object
# === read_in_dataset_from_this_file.
-
#read_in_main_dataset_from_the_existing_files(i = @read_from_these_files) ⇒ Object
# === read_in_main_dataset_from_the_existing_files.
-
#report_how_many_ects_points_are_in_this_curriculum ⇒ Object
# === report_how_many_ects_points_are_in_this_curriculum ========================================================================= #.
-
#report_how_many_ects_points_have_been_passed_already ⇒ Object
# === report_how_many_ects_points_have_been_passed_already ========================================================================= #.
-
#report_how_many_exams_have_been_passed_already ⇒ Object
# === report_how_many_exams_have_been_passed_already.
-
#report_how_many_lectures_are_in_this_curriculum_and_how_many_of_them_are_already_solved ⇒ Object
# === report_how_many_lectures_are_in_this_curriculum_and_how_many_of_them_are_already_solved ========================================================================= #.
-
#report_the_average_grade ⇒ Object
# === report_the_average_grade ========================================================================= #.
-
#report_the_university_attribution ⇒ Object
# === report_the_university_attribution.
-
#report_title(this_title = @title) ⇒ Object
(also: #display_the_name_of_the_curriculum)
# === report_title.
-
#reset ⇒ Object
# === reset ========================================================================= #.
-
#return_and_check_file_for_this_curriculum(i) ⇒ Object
# === return_and_check_file_for_this_curriculum.
-
#return_arrow_pointing_to_the_right_side(optional_margin_left = nil) ⇒ Object
# === return_arrow_pointing_to_the_right_side ========================================================================= #.
-
#return_bachelor_or_master_logo(this_lecture = nil) ⇒ Object
# === return_bachelor_or_master_logo.
-
#return_how_many_ects_points_have_been_passed_already(use_for = @mode) ⇒ Object
# === return_how_many_ects_points_have_been_passed_already ========================================================================= #.
-
#return_how_many_ects_points_this_curriculum_has_in_total(use_colours = true) ⇒ Object
# === return_how_many_ects_points_this_curriculum_has_in_total ========================================================================= #.
-
#return_how_many_lectures_are_in_this_curriculum_and_how_many_of_them_are_already_solved(optional_use_colours = true) ⇒ Object
# === return_how_many_lectures_are_in_this_curriculum_and_how_many_of_them_are_already_solved.
-
#return_proper_logo_for_this_university(i) ⇒ Object
# === return_proper_logo_for_this_university ========================================================================= #.
-
#return_the_average_grade ⇒ Object
# === return_the_average_grade.
-
#return_timetable_of_upcoming_exams ⇒ Object
-
#run ⇒ Object
# === run (run tag).
-
#sanitize_the_dataset ⇒ Object
# === sanitize_the_dataset ========================================================================= #.
-
#set_commandline_arguments(i) ⇒ Object
# === set_commandline_arguments ========================================================================= #.
-
#set_dataset(i) ⇒ Object
(also: #set_all_lectures)
# === set_dataset ========================================================================= #.
-
#set_html_string(i) ⇒ Object
# === set_html_string ========================================================================= #.
-
#set_title(i) ⇒ Object
(also: #set_title_of_the_curriculum)
# === set_title.
-
#show_available_curricula ⇒ Object
# === show_available_curricula.
-
#show_help ⇒ Object
# === show_help (help tag).
-
#show_important_files(use_this_file = FILE_LECTURE_INFORMATION) ⇒ Object
# === show_important_files.
-
#show_loaded_from_which_file? ⇒ Boolean
# === show_loaded_from_which_file? ========================================================================= #.
-
#sort_dataset(i = @dataset) ⇒ Object
# === sort_dataset.
-
#starts_with_a_lecture_id_entry?(i) ⇒ Boolean
# === starts_with_a_lecture_id_entry? ========================================================================= #.
-
#title? ⇒ Boolean
(also: #return_name_of_the_curriculum, #name_of_the_curriculum, #name_of_the_curriculum?)
# === title? ========================================================================= #.
-
#try_to_rename_kde_konsole_tab(use_this_title = return_name_of_the_curriculum) ⇒ Object
# === try_to_rename_kde_konsole_tab.
-
#type_of_the_curriculum? ⇒ Boolean
(also: #curriculum_type?)
# === type_of_the_curriculum? ========================================================================= #.
-
#uniq_the_dataset ⇒ Object
# === uniq_the_dataset.
-
#use_bachelor_agrarwissenschaften_curriculum ⇒ Object
# === use_bachelor_agrarwissenschaften_curriculum ========================================================================= #.
-
#use_bachelor_bioinformatik_und_molekulare_biotechnologie ⇒ Object
-
#use_bachelor_biologie_basisblock_curriculum ⇒ Object
# === use_bachelor_biologie_basisblock_curriculum ========================================================================= #.
-
#use_bachelor_biologische_informatik ⇒ Object
-
#use_bachelor_botanik_curriculum ⇒ Object
# === use_bachelor_botanik_curriculum ========================================================================= #.
-
#use_bachelor_chemie_curriculum ⇒ Object
# === use_bachelor_chemie_curriculum ========================================================================= #.
-
#use_bachelor_dummy_curriculum ⇒ Object
# === use_bachelor_dummy_curriculum ========================================================================= #.
-
#use_bachelor_ernährung_curriculum ⇒ Object
# === use_bachelor_ernährung_curriculum ========================================================================= #.
-
#use_bachelor_forstwirtschaft ⇒ Object
# === use_bachelor_forstwirtschaft ========================================================================= #.
-
#use_bachelor_genetik_curriculum ⇒ Object
# === use_bachelor_genetik_curriculum ========================================================================= #.
-
#use_bachelor_informatik_curriculum ⇒ Object
-
#use_bachelor_ktww_curriculum ⇒ Object
# === use_bachelor_ktww_curriculum ========================================================================= #.
-
#use_bachelor_lmbt_curriculum ⇒ Object
# === use_bachelor_lmbt_curriculum ========================================================================= #.
-
#use_bachelor_master_tu_wien_curriculum ⇒ Object
# === use_bachelor_master_tu_wien_curriculum ========================================================================= #.
-
#use_bachelor_medizinische_informatik_curriculum ⇒ Object
-
#use_bachelor_molbio_curriculum ⇒ Object
# === use_bachelor_molbio_curriculum ========================================================================= #.
-
#use_bachelor_molekularbiologie_curriculum ⇒ Object
(also: #use_bachelor_molekularbiologie_graz_curriculum)
# === use_bachelor_molekularbiologie_curriculum ========================================================================= #.
-
#use_bachelor_pharmazie_curriculum ⇒ Object
# === use_bachelor_pharmazie_curriculum ========================================================================= #.
-
#use_bachelor_technical_chemistry_curriculum ⇒ Object
# === use_bachelor_technical_chemistry_curriculum ========================================================================= #.
-
#use_bachelor_ubrm_curriculum ⇒ Object
# === use_bachelor_ubrm_curriculum ========================================================================= #.
-
#use_bachelor_vektor_curriculum ⇒ Object
# === use_bachelor_vektor_curriculum.
-
#use_bachelor_verfahrenstechnik_curriculum ⇒ Object
# === use_bachelor_verfahrenstechnik_curriculum ========================================================================= #.
-
#use_bachelor_ökologie_curriculum ⇒ Object
# === use_bachelor_ökologie_curriculum ========================================================================= #.
-
#use_master_bioinformatics_and_molecular_biotechnology ⇒ Object
-
#use_master_biologische_chemie_curriculum ⇒ Object
# === use_master_biologische_chemie_curriculum ========================================================================= #.
-
#use_master_dummy_curriculum ⇒ Object
# === use_master_dummy_curriculum ========================================================================= #.
-
#use_master_immunobiology_curriculum ⇒ Object
# === use_master_immunobiology_curriculum ========================================================================= #.
-
#use_master_lmbt_curriculum ⇒ Object
# === use_master_lmbt_curriculum ========================================================================= #.
-
#use_master_molbio_curriculum ⇒ Object
# === use_master_molbio_curriculum ========================================================================= #.
-
#use_master_pharmazie_curriculum ⇒ Object
# === use_master_pharmazie_curriculum ========================================================================= #.
-
#use_master_vektoren_curriculum ⇒ Object
# === use_master_vektoren_curriculum ========================================================================= #.
-
#use_mikrobiologie_individuelles_curriculum ⇒ Object
(also: #use_mikrobiologie_curriculum)
# === use_mikrobiologie_individuelles_curriculum ========================================================================= #.
-
#use_priority_points ⇒ Object
# === use_priority_points.
-
#use_tu_master_biotechnology_curriculum ⇒ Object
# === use_tu_master_biotechnology_curriculum ========================================================================= #.
-
#use_uni_vienna_master_bioinformatics_curriculum ⇒ Object
-
#use_uni_vienna_master_genetik_und_entwicklungsbiologie_curriculum ⇒ Object
# === use_uni_vienna_master_genetik_und_entwicklungsbiologie_curriculum ========================================================================= #.
Methods inherited from Base
#add_proper_year_entry_to_this_line, #already_solved_this_lva_number?, #append_what_into, #available_topics_as_short_name, #average_grade, #bachelor_master_or_diploma, #base_dir?, #be_silent, #be_verbose?, #beautiful_url, #change_directory, #cheering_person, #cliner, #colour_for_ects_points, #colourize_percentage, #commandline_arguments?, #commandline_arguments_joined, #commandline_arguments_with_hyphens?, #convert_this_array_of_lectures_into_the_full_dataset, #copy, #cpruby, #create_directory, #create_file, #csv_file?, #current_month?, #datum?, #day_month_year, #debug?, #delete_file, #directory_of_the_exam_topics?, #directory_to_my_exam_topics, #directory_to_the_exam_topics?, #disable_colours, #disable_colours_globally, #do_not_be_verbose, #do_not_use_opn, #do_these_curricula_include_both_a_bachelor_and_a_master_curriculum?, #does_this_line_include_a_german_weekday?, #does_this_line_include_a_html_colour?, #e, #ecomment, #editor?, #ee, #enable_colours, #enable_colours_globally, #enable_debug, #encoding?, #english_to_german_weekday, #ensure_main_encoding, #ensure_that_the_log_directory_exists, #eparse, #erev, #esystem, #etomato, #exit_program, #expand_topic, #extract_dd_mm_yyyy, #file_lecture_information?, #file_read_with_proper_encoding, #filter_away_invalid_questions, #find_corresponding_exam_topic, #first_argument?, #first_non_hyphen_argument?, #from_curriculum_id_to_university, #german_date_notation, #german_weekday?, #german_weekdays?, #has_a_bachelor_curriculum?, #has_a_master_curriculum?, #has_this_exam_topic_been_solved?, #has_year_entry?, #hh_mm_ss_dd_mm_yyyy, #horizontal_bar?, #html_log_directory?, #is_a_master_lecture?, #is_a_weekday?, #is_connected_to_the_www?, #is_on_roebe?, #is_prüfungsimmanent?, #is_this_a_valid_html_colour?, #is_this_day_today?, #konsole_support?, #last_file?, #lectures_from_indi1, #lectures_from_indi2, #lectures_from_indi3, #lectures_from_indi4, #lectures_from_the_bachelor_genetik_curriculum, #lectures_from_the_individual_vektor_curricula, #load_yaml_dataset, #move_file, #n_days_difference_from_today_to_this_day, #no_ext_name, #no_file_at, #number_to_month, #obtain, #obtain_lectures_from_this_curriculum, #open_in_editor, #path_to_exam_topic?, #read_dataset_from_a_curriculum_file, #read_in_exam_dataset_from_this_file, #read_this_file_with_default_encoding, #readlines_from_this_input_file, #register_sigint, #remove_empty_strings, #remove_escape_sequences, #remove_internal_comments, #remove_leading_comments, #remove_leading_weekday_names_from, #remove_newlines, #remove_tags_from_this_input, #rename_kde_konsole_tab, #rename_konsole_tab?, #replace_all_html_colours_in_this, #replace_bold_token_with_default_colour, #replace_italic_token_with_default_colour, #replace_italic_token_with_this_colour, #replace_regular_numbers_with_unicode_numbers, #replace_underline_token_with_default_colour, #replace_underline_token_with_this_colour, #return_all_bachelor_lectures, #return_all_exams_on_this_day, #return_all_numbers_from, #return_all_registered_curricula, #return_all_steop_lectures, #return_current_year, #return_dataset_for_this_topic, #return_dataset_from_this_curriculum_file, #return_dd_mm_yy_and_time_from, #return_directory_for, #return_ects_points_from_these_lectures, #return_either_grey_or_the_custom_colour_for_answers, #return_either_grey_or_the_custom_colour_for_questions, #return_file_for_this_curriculum, #return_german_name_for_this_english_month, #return_german_weekday_of?, #return_hh_mm_ss_from, #return_hour_from_this, #return_lectures_from_bachelor_vektor_curriculum, #return_lectures_with_at_the_least_one_upcoming_exam, #return_local_path_of_this_pwdstud, #return_lva_number_of_this_lecture, #return_month_fitting_to_this_input, #return_n_days_until_monday, #return_n_days_until_sunday, #return_n_exam_questions_in, #return_n_questions_were_answered_for_this_topic, #return_name_of_the_weekday, #return_name_of_this_curriculum, #return_name_of_this_curriculum_based_on_its_id_number, #return_opnn, #return_passed_courses, #return_pwd, #return_random_curriculum, #return_sanitized_dataset_from_the_file_lecture_information, #return_solved_lectures, #return_steop_lectures, #return_the_remote_homepage_url, #return_this_line_has_n_characters_as_html_colour_tags, #return_title_from_this_curriculum_file, #rev, #right_arrow?, #rinstall2, #roebe_exam_directory?, #ruby_src_dir_at_home?, #runmode?, #sanitize_this_topic, #sanitize_url, #select_lectures_with_this_key, #set_be_quiet, #set_be_verbose, #set_commandline_mode, #set_runmode, #set_this_cd_alias_to, #set_www_mode, #sfancy, #shall_we_make_use_of_unicode_symbols?, #show_todays_date, #simp, #sort_these_lecture_names_by_time, #spacer, #swarn, #this_month_has_n_days?, #total_ects_points_passed, #translate_dd_mm_yyyy_to_weekday, #try_to_require_the_rcfiles, #turn_this_array_into_the_full_dataset, #unicode_blocks_line, #use_colours?, #use_opn?, #vertical_bar?, #web_liner, #weekday?, #weekdays?, #word_wrap, #write_what_into, #www_connection_is_unavailable, #www_mode?, #yaml_dir?
Methods included from Colours
#bold_blue, #bold_red, #bold_yellow, #cadetblue, #chartreuse, crimson, #darkgray, darkgreen, darkseagreen, deepskyblue, #deepskyblue, default_colour, #dimgray, disable_colours, #dodgerblue, e, #efancy, enable_colours, #ewarn, #forestgreen, gold, #grey, lightblue, lightgreen, #lightslategray, #lightsteelblue, #mediumorchid, #mediumseagreen, #oldlace, #olivedrab, orange, orangered, #orchid, palevioletred, #papayawhip, rev, royalblue, sdir, #sdir, sfancy, #sfancy, sfile, #sfile, simp, #simp, slateblue, steelblue, #steelblue, #swarn, swarn, #teal, turquoise, use_colours?, use_this_colour_for_exam_answers, use_this_colour_for_exam_questions, #yellow
Constructor Details
#initialize(commandline_arguments = [], run_already = true) ⇒ ShowLecturesOnTheCommandline
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/initialize.rb', line 12
def initialize(
commandline_arguments = [],
run_already = true
)
reset
case commandline_arguments
when :do_not_run_yet
commandline_arguments = nil
run_already = false
end
set_commandline_arguments(
commandline_arguments
)
case run_already
when :do_not_run_yet
run_already = false
end
if block_given?
yielded = yield
case yielded
when :do_not_run_yet
run_already = false
when :www
set_www_mode
end
end
run if run_already
end
|
Class Method Details
.[](commandline_arguments = ARGV, run_already = true) ⇒ Object
#
Studium::ShowLecturesOnTheCommandline[]
#
396
397
398
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb', line 396
def self.[](commandline_arguments = ARGV, run_already = true)
new(commandline_arguments, run_already)
end
|
Instance Method Details
#add_to_the_dataset_without_any_further_checks(i) ⇒ Object
#
add_to_the_dataset_without_any_further_checks
#
311
312
313
314
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 311
def add_to_the_dataset_without_any_further_checks(i)
@dataset << i
@dataset.flatten!
end
|
#check_for_title_entry_in_the_file(this_file = dataset?
) ⇒ Object
#
check_for_title_entry_in_the_file
You can put a line within a curriculum such as:
@title Biologie Basisblock
The method will check for this. However had, you can also avoid using such a title, by having a header section, as a comment, where the second line should contain the title of the lecture.
The latter is the default (and recommended) mode.
#
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 131
def check_for_title_entry_in_the_file(
this_file = dataset?
)
temporary_dataset = Studium.read_dataset_from_a_curriculum_file(
this_file,
:retain_comments
)
if temporary_dataset[1].start_with?('# === ')
use_this_title = temporary_dataset[1]
set_title(use_this_title)
elsif this_file.any? {|line|
line.start_with? '@title'
}
set_title(
dataset.select {|line| line.start_with? '@title ' }
)
dataset.reject! {|line| line.start_with? '@title '}
dataset.compact!
set_dataset(dataset)
end
end
|
#clear_old_dataset ⇒ Object
359
360
361
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 359
def clear_old_dataset
@dataset = []
end
|
#consider_generating_a_graphviz_image_displaying_the_modules(use_this_dataset) ⇒ Object
#
consider_generating_a_graphviz_image_displaying_the_modules
#
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 438
def consider_generating_a_graphviz_image_displaying_the_modules(
use_this_dataset
)
require 'image_paradise/graphviz/generate_graphviz_image.rb'
copy = use_this_dataset.dup
copy.map! {|entry|
if entry.include? '#'
entry = entry[0 .. ( entry.index('#') - 1 )]
end
entry.strip
}
copy = turn_this_array_into_the_full_dataset(
copy.flatten, @lecture_dataset
)
hash_containing_the_module_dependencies = {}
copy.each_pair {|name_of_the_lecture, inner_hash|
if inner_hash
individual_curricula = inner_hash[:individual_curricula]
if individual_curricula
selection = individual_curricula.select {|most_inner_hash|
most_inner_hash[:name_of_the_curriculum].include? @title
}.first
if selection
individual_curriculum_module = selection[:individual_curriculum_module]
if individual_curriculum_module
individual_curriculum_module = individual_curriculum_module.first
end
individual_curriculum_depends_on_these_modules = selection[:individual_curriculum_depends_on_these_modules]
hash_containing_the_module_dependencies[individual_curriculum_module] =
individual_curriculum_depends_on_these_modules
end
end
end
}
ImageParadise::GenerateGraphvizImage.new(
hash_containing_the_module_dependencies
) { :use_bold_font_and_german }
end
|
#consider_generating_a_html_file(i = @generate_html_file) ⇒ Object
#
consider_generating_a_html_file (html tag)
This method can generate a .html file. As a consequence it is fairly long and messy.
#
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/html.rb', line 128
def consider_generating_a_html_file(
i = @generate_html_file
)
if i
if is_on_roebe?
Studium.install_the_project_on_the_given_hostsystem
end
html_file = "#{log_dir?}html/"\
"#{title?.to_s.tr(' ','_').delete('(),')}.html"
_ = ''.dup
if www_mode?
else
_ << '<meta charset="UTF-8">'
_ << "#{N}<html>#{N}"
_ << "<head>#{N}"
_ << "<title>#{title?.to_s}</title>#{N}"
end
_ << '<link rel="stylesheet" type="text/css" href="../../../home/x/DATA/CSS/balloon.css">'
if www_mode?
else
_ << "</head>#{N}"
_ << "<body style=\"font-size: 1.5em; "\
"font-family: monospace; "\
"padding: 1px; "\
"margin: 0px\">#{N}" end
_ << '<div style="border: 1px solid black; padding:2px;">'
_ << HtmlTags.h1(
title?.to_s, css_style: 'font-weight: bold; color: darkblue'
)+N
remote_url = ::Studium.return_homepage_of_this_lecture(title?.to_s)
_ << '<b style="margin-left:1em">
Link to the remote page:
</b>
<a style="font-weight: bold; color: darkblue" href="'+remote_url+'">'+title?.to_s+'</a>'
if show_loaded_from_which_file? and loaded_from_which_file?
loaded_from_which_file?.each {|this_file|
_ << '<h2 style="color:slateblue; margin-bottom:4px; margin-left: 0.75em;">
Loaded from the file:
</h2>'+N
_ << '<b style="margin-left:2.0em; font-size:larger; color:blue">'+
File.basename(this_file)+'</b>
( <span style="font-weight: bold; color:steelblue">'+this_file+'</span> )
<br><br><br>'+N
}
end
hash = {}
all_lectures?.each {|this_lecture|
if this_lecture.include? '#' raw_name_of_the_lecture = this_lecture[0 .. (this_lecture.index('#')-1)].strip
else
raw_name_of_the_lecture = this_lecture.dup
end
raw_name_of_the_lecture.squeeze!(' ') pointer_to_the_lecture_dataset = @lecture_dataset[raw_name_of_the_lecture]
if pointer_to_the_lecture_dataset.nil?
next
end
hash[raw_name_of_the_lecture] = pointer_to_the_lecture_dataset
}
if @this_curriculum_has_n_ects_points_in_total >= 270.0
@individual_curriculum = false
end
if @individual_curriculum
new_hash = ::Studium::SortedIndividualCurricula.new(hash, name_of_the_curriculum?)
hash.clear
(1 .. new_hash.max?).each {|module_number|
pointer = new_hash[module_number]
if pointer.nil?
e 'A nil-value was found for module number '+
steelblue(module_number)+'.'
e
e 'The hash was:'
e
pp new_hash
e
end
pointer.each {|name_of_the_lecture, inner_hash|
hash[name_of_the_lecture] = inner_hash
}
}
end
@name_of_the_individual_curriculum_module = ''.dup
index = 0
hash.each_pair {|this_lecture, pointer_to_the_lecture_dataset| index += 1
splitted = this_lecture.split(' ')
lva_id = splitted.first name_of_the_lecture = splitted[1..-1].join(' ').strip
n_ects_points = obtain(:ects, pointer_to_the_lecture_dataset)
university = obtain(:university, pointer_to_the_lecture_dataset)
lecture_type = obtain(:type, pointer_to_the_lecture_dataset)
bereits_absolviert = obtain(:already_solved, pointer_to_the_lecture_dataset)
curricula = obtain(:curricula, pointer_to_the_lecture_dataset)
is_a_steop_lecture = obtain(:is_a_steop_lecture, pointer_to_the_lecture_dataset)
semester = obtain(:semester, pointer_to_the_lecture_dataset).to_s if pointer_to_the_lecture_dataset.has_key? :homepage
else
e crimson('The lecture `')+
sfancy(this_lecture)+
crimson('` does not have a registered')
e crimson('remote homepage entry.')
open_this_in_the_browser = false
if open_this_in_the_browser and
is_on_roebe? and
commandline_mode?
e crimson('Opening the URL to this lecture in the editor now, so that')
e crimson('this erroneous entry can be corrected.')
this_url = Studium.return_remote_homepage_of_this_lecture(this_lecture)
if this_url != this_lecture Studium.open_this_remote_url(this_url)
sleep(0.75)
end
end
end
use_this_as_remote_url = ::Studium.return_homepage_of_this_lecture(this_lecture)
case semester
when 'both'
semester = 'Sommer / Winter'
when 'winter'
semester = 'Winter'
when 'summer'
semester = 'Sommer'
end
@hash_containing_the_lectures_for_this_curriculum[name_of_the_lecture] =
pointer_to_the_lecture_dataset
@hash_containing_the_lectures_for_this_curriculum[name_of_the_lecture].update(
remote_url: use_this_as_remote_url
)
bereits_absolviert = ja_oder_nein(bereits_absolviert)
case bereits_absolviert
when 'Ja'
colourized_bereits_absolviert = '<b style="color:green">'+bereits_absolviert
on_which_date = @hash_containing_the_lectures_for_this_curriculum[name_of_the_lecture][:already_solved_at].to_s
colourized_bereits_absolviert <<
", absolviert am</b> <b style=\"color:darkgreen\">#{on_which_date}</b>"
else
colourized_bereits_absolviert = '<b style="color:red">'+bereits_absolviert+'</b>'
end
if individual_curriculum? and
pointer_to_the_lecture_dataset.has_key?(:individual_curricula) and
pointer_to_the_lecture_dataset[:individual_curricula].has_key?(:individual_curriculum_module)
individual_curriculum_module = pointer_to_the_lecture_dataset[:individual_curricula][:individual_curriculum_module]
name_of_the_curriculum_module = pointer_to_the_lecture_dataset[:individual_curricula][:name_of_the_curriculum_module]
if individual_curriculum_module.is_a? Array
individual_curriculum_module = individual_curriculum_module.first
end
if @name_of_the_individual_curriculum_module != individual_curriculum_module
@name_of_the_individual_curriculum_module = individual_curriculum_module
_ << '<h1><b style="color:midnightblue">Module</b> '\
'<span style="color:#510042">'+
@name_of_the_individual_curriculum_module+
'</span> '+
'<b style="color:midnightblue">'+
name_of_the_curriculum_module.strip+
'</b>'
n_ects_in_that_module = ::Studium.return_n_ects_in_that_module(
title?,
@name_of_the_individual_curriculum_module,
@lecture_dataset
)
_ << " <span style=\"font-size:0.8em\">[#{n_ects_in_that_module} ECTS in this module]</span>"
if ::Studium.query_based_on_curriculum_title_whether_this_module_been_completed(
title?,
@name_of_the_individual_curriculum_module,
@lecture_dataset
)
_ << IMAGE_FOR_THE_COMPLETED_MODULE.dup
end
_ << '</h1>' end
end
clickable_logo = return_proper_logo_for_this_university(university)
clickable_logo = '<a href="'+use_this_as_remote_url+'">'+clickable_logo+'</a>'
_ << '<span style="margin-left:2.0em">'+
clickable_logo
if is_a_steop_lecture
_ << return_proper_logo_for_this_university(:steop_picture)
end
if bereits_absolviert == 'Nein'
bold_name_of_the_lecture = '<b style="font-size:larger; color: navy">'+
this_lecture+
'</b>'
else bold_name_of_the_lecture = '<b style="font-size:larger">'+
this_lecture+
'</b>'
end
_ << " Lehrveranstaltung <b>##{index}</b>:</span> "+
bold_name_of_the_lecture+
', Bereits <b>absolviert</b>? <span style="font-size:larger">'+
colourized_bereits_absolviert+'</span>'\
' (LVA Nummer: <b>'+lva_id.to_s+'</b>; '\
'ECTS: <b>'+n_ects_points.to_s+'</b>; '\
'Lecture Type: <b>'+lecture_type+'</b>; '\
'Semester: <b>'+semester+'</b>; '
_ << "University: <b>#{university}</b>) "
if bereits_absolviert == 'Nein'
_ << return_bachelor_or_master_logo(curricula)
end
if is_this_lecture_a_practical_course?(lecture_type) and
(bereits_absolviert == 'Nein')
_ << PRACTICAL_COURSE_IMAGE
end
_ << BR+N
shall_we_show_the_url = false
if @show_all_URLs or (bereits_absolviert == 'Nein')
shall_we_show_the_url = true
end
if shall_we_show_the_url
this_url = ::Studium.return_homepage_of_this_lecture(this_lecture)
_ << return_arrow_pointing_to_the_right_side('3em')
_ << '<a style="margin-left: 5em; font-size: larger; font-weight:bold" href="'+this_url+'">'+
this_url+
'</a>'+BR+N
url_to_moodle = ::Studium.return_remote_moodle_link_of_this_lecture(this_lecture)
_ << return_arrow_pointing_to_the_right_side('3em')
if (url_to_moodle == this_lecture) and !url_to_moodle.include?('http')
url_to_moodle = '[No remote URL for Moodle is known for this course.]'
_ << '<span style="margin-left: 5em; font-size: larger; font-weight:bold; color: darkblue" href="'+url_to_moodle+'">'+
url_to_moodle+
'</span>'+BR+N
else
_ << '<a style="margin-left: 5em; font-size: larger; font-weight:bold" href="'+url_to_moodle+'">'+
url_to_moodle+
'</a>'+BR+N
end
if @show_next_exams
if pointer_to_the_lecture_dataset.has_key? 'exams'
array_upcoming_exams = pointer_to_the_lecture_dataset['exams']
first_entry = array_upcoming_exams.first
first_entry = remove_weekdays(first_entry)
weekday = first_entry
if weekday.include? ','
weekday = weekday.split(',').first
end
weekday = english_to_german_weekday(
translate_dd_mm_yyyy_to_weekday(weekday)
)
_ << '<span style="font-weight:bold; font-size: larger;margin-left:9em"> ^^^ '+
'<b style="color: teal">Next exam:</b> '+
weekday+' '+
first_entry+'</span>'+BR+N
end
end
end
}
_ << BR+
return_how_many_lectures_are_in_this_curriculum_and_how_many_of_them_are_already_solved(:use_for_html).join(' ')+N
_ << BR+BR+
return_how_many_ects_points_this_curriculum_has_in_total(:no_colours)+'<br>'+N
_ << BR+
return_how_many_ects_points_have_been_passed_already(:use_for_html).join(' ')+N
n_missing_lectures = n_total_lectures?.to_i - n_lectures_completed?
_ << "#{BR}#{BR}There are still <b>#{n_missing_lectures.to_s}</b> lectures missing "\
"before this curriculum has been completed successfully."
if @do_report
average_grade = return_the_average_grade
_ << "\n<br><br>The <span style=\"font-weight:800;padding-left:2px; padding-right:2px;background-color: black; color:gold\">average grade</span> "\
"is: <b style=\"color:darkgreen\">#{average_grade}</b>\n\n<br><br>"
end
if @show_next_exams
_ << "#{return_timetable_of_upcoming_exams}#{N}"
end
_ << "#{N}</div>"
_ << @append_this_string_onto_the_html_string
set_html_string(_)
_ << "</html>#{N}"
if cmdline?
result = "Next storing into\n".dup
result << " `#{sfile(html_file)}`\n"
also_open_in_the_browser = true
if also_open_in_the_browser
result << "\nThat page will be opened via the browser as well."
opnn; e result
write_what_into(_, html_file)
Open.in_browser(html_file) { :be_silent } end
end
end
end
|
#consider_generating_a_spreadsheet(i = @title) ⇒ Object
#
consider_generating_a_spreadsheet
#
100
101
102
103
104
105
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 100
def consider_generating_a_spreadsheet(
i = @title
)
require 'studium/utility_scripts/generate_spreadsheet.rb'
Studium::GenerateSpreadsheet.new(i)
end
|
#consider_showing_to_which_universities_the_lectures_belong_to ⇒ Object
#
consider_showing_to_which_universities_the_lectures_belong_to
We should only show as to which university a particular lecture belongs to if it is an individual curriculum. Other curricula all belong to one particular university, so showing the “table” on the commandline is useless.
#
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/show.rb', line 72
def consider_showing_to_which_universities_the_lectures_belong_to
if @show_to_which_universities_the_lectures_belong_to
first_argument = @commandline_arguments
if first_argument.is_a? Array
first_argument = first_argument.first
end
first_argument = first_argument.to_s.delete('-')
if cmdline?
e
e 'The percentage-value of lectures attributed to '\
'the different'
e 'universities will be shown next:'
end
_ = Studium::LecturesAttributedToUniversities.new(first_argument) {
:do_not_show_the_title_and_do_not_report
}
splitted_html_string = _.html_string.split("\n")
@append_this_string_onto_the_html_string <<
'<div style="padding: 0.70em; background-color: black; '\
'font-size: 1.0em; font-family: monospace;">'
splitted_html_string.each {|line|
@append_this_string_onto_the_html_string << "<b>#{line.strip}</b><br>#{N}"
}
@append_this_string_onto_the_html_string << '</div>'
_.report if cmdline?
end
end
|
#dataset? ⇒ Boolean
Also known as:
all_lectures?, dataset_holding_all_lectures, lectures?
274
275
276
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb', line 274
def dataset?
@dataset
end
|
#determine_from_which_files_to_read(i = FILE_MASTER_VEKTORX, type_of_the_curriculum = :bachelor) ⇒ Object
Also known as:
determine_from_which_file_to_read
#
determine_from_which_files_to_read
This method will also assign towards the instance variables The available curricula are stored within file_constants.rb in the studium/constants/ subdirectory.
#
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 72
def determine_from_which_files_to_read(
i = FILE_MASTER_VEKTORX, type_of_the_curriculum = :bachelor
)
case i when :bachelor_forstwirtschaft
i = return_and_check_file_for_this_curriculum(i)
is_bachelor_curriculum
do_show_lecture_attribution_to_universities
when :bachelor_informatik_und_molekulare_biologie,
:bachelor_biologische_informatik,
:indi3
i = return_and_check_file_for_this_curriculum(i)
is_bachelor_curriculum
is_an_individual_curriculum
do_show_lecture_attribution_to_universities
when :master_bioinformatics_and_molecular_biotechnology,
:indi4
i = return_and_check_file_for_this_curriculum(i)
is_master_curriculum
is_an_individual_curriculum
do_show_lecture_attribution_to_universities
when :master_dummy_curriculum
i = return_and_check_file_for_this_curriculum(i)
is_master_curriculum
do_show_lecture_attribution_to_universities
when :bachelor_dummy_curriculum,
:dummy
i = return_and_check_file_for_this_curriculum(i)
is_bachelor_curriculum
do_show_lecture_attribution_to_universities
when :bachelor_vektor_curriculum,
:bachelor_vektorx_curriculum,
:indi1
i = return_and_check_file_for_this_curriculum(i)
is_bachelor_curriculum
is_an_individual_curriculum
do_show_lecture_attribution_to_universities
when :master_vektoren_curriculum
i = return_and_check_file_for_this_curriculum(i)
is_master_curriculum
is_an_individual_curriculum
do_show_lecture_attribution_to_universities
when :bachelor_bioinformatik_und_biotechnologie
i = return_and_check_file_for_this_curriculum(i)
is_bachelor_curriculum
is_an_individual_curriculum
do_show_lecture_attribution_to_universities
when :bachelor_molekularbiologie_graz,
:bachelor_molekularbiologie_graz_curriculum,
:bachelor_molekularbiologie,
:bachelor_molekularbiologie_curriculum
i = return_and_check_file_for_this_curriculum(i)
is_bachelor_curriculum
when :bachelor_ernährung_curriculum
i = return_and_check_file_for_this_curriculum(i)
is_bachelor_curriculum
when :bachelor_verfahrenstechnik_curriculum,
:verfahrenstechnik_curriculum,
:verfahrenstechnik
i = return_and_check_file_for_this_curriculum(i)
is_bachelor_curriculum
when :bachelor_genetik_curriculum,
:genetik_curriculum
i = return_and_check_file_for_this_curriculum(i)
is_bachelor_curriculum
when :master_genetik_und_entwicklungsbiologie_curriculum
i = return_and_check_file_for_this_curriculum(i)
is_master_curriculum
when :master_pharmazie_curriculum,
:master_pharmazie
i = return_and_check_file_for_this_curriculum(i)
is_master_curriculum
when :bachelor_pharmazie_curriculum
i = return_and_check_file_for_this_curriculum(i)
is_bachelor_curriculum
when :master_biologische_chemie_curriculum,
:master_biologische_chemie
i = return_and_check_file_for_this_curriculum(i)
is_master_curriculum
when :master_lmbt_curriculum
i = return_and_check_file_for_this_curriculum(i)
is_master_curriculum
when :bachelor_boku_lmbt_curriculum
i = return_and_check_file_for_this_curriculum(i)
is_bachelor_curriculum
when :bachelor_technical_chemistry_curriculum,
:technical_chemistry_curriculum
i = return_and_check_file_for_this_curriculum(i)
is_bachelor_curriculum
do_show_lecture_attribution_to_universities
when :bachelor_informatik_curriculum,
:bachelor_informatik,
:binformatik
i = return_and_check_file_for_this_curriculum(i)
is_bachelor_curriculum
when :bachelor_ktww_curriculum,
:bachelor_boku_ktww_curriculum
i = return_and_check_file_for_this_curriculum(i)
is_bachelor_curriculum
when :bachelor_agrarwissenschaften_curriculum
i = return_and_check_file_for_this_curriculum(i)
is_bachelor_curriculum
when :bachelor_medizinische_informatik_curriculum
i = return_and_check_file_for_this_curriculum(i)
is_bachelor_curriculum
when :bachelor_botanik_curriculum,
:bachelor_botanik
i = return_and_check_file_for_this_curriculum(i)
is_bachelor_curriculum
when :master_bioinformatik_curriculum
i = return_and_check_file_for_this_curriculum(i)
is_master_curriculum
when :bachelor_ökologie_curriculum
i = return_and_check_file_for_this_curriculum(i)
is_bachelor_curriculum
when :bachelor_master_tu_wien
i = return_and_check_file_for_this_curriculum(i)
is_bachelor_master_curriculum
when :master_molbio_curriculum
i = return_and_check_file_for_this_curriculum(i)
is_master_curriculum
when :master_immunobiology_curriculum
i = return_and_check_file_for_this_curriculum(i)
is_master_curriculum
when :bachelor_chemie_curriculum
i = return_and_check_file_for_this_curriculum(i)
is_bachelor_curriculum
when :bachelor_boku_ubrm_curriculum
i = return_and_check_file_for_this_curriculum(i)
is_bachelor_curriculum
when :master_tu_vienna_biotechnology_curriculum
i = return_and_check_file_for_this_curriculum(i)
is_master_curriculum
when :bachelor_molekulare_biologie_curriculum
i = return_and_check_file_for_this_curriculum(i)
is_bachelor_curriculum
when :bachelor_basisblock_biologie
i = return_and_check_file_for_this_curriculum(i)
is_bachelor_curriculum
end
if i.include? 'master_individuelles_' type_of_the_curriculum = :master
end if i.is_a? String
unless i.is_a? Array
i = [i]
end
i.flatten! @read_from_these_files = i
end
|
#determine_the_type_of_the_curriculum(i = :bachelor) ⇒ Object
#
determine_the_type_of_the_curriculum (type tag)
The allowed types are currently:
:bachelor
:master
:bachelor_and_master
The default will be towards :bachelor.
#
387
388
389
390
391
392
393
394
395
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 387
def determine_the_type_of_the_curriculum(
i = :bachelor
)
case i
when :bachelor_master
i = :bachelor_and_master end
@type_of_the_curriculum = i
end
|
#do_all_actions_after_the_main_dataset_was_read_in ⇒ Object
#
do_all_actions_after_the_main_dataset_was_read_in
#
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/run.rb', line 12
def do_all_actions_after_the_main_dataset_was_read_in
iterate_over_the_lectures
consider_showing_to_which_universities_the_lectures_belong_to
if commandline?
report_how_many_lectures_are_in_this_curriculum_and_how_many_of_them_are_already_solved
report_how_many_ects_points_have_been_passed_already
report_how_many_ects_points_are_in_this_curriculum
report_the_average_grade
report_the_university_attribution
end
consider_generating_a_html_file
end
|
#do_generate_a_html_file ⇒ Object
#
do_generate_a_html_file
This method can be used to generate a .html file no matter what.
The other method, consider_generating_a_html_file, will instead honour a certain instance variable.
#
62
63
64
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/html.rb', line 62
def do_generate_a_html_file
consider_generating_a_html_file(true)
end
|
#do_not_read_in_from_a_file ⇒ Object
#
do_not_read_in_from_a_file
#
444
445
446
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 444
def do_not_read_in_from_a_file
@read_from_these_files = false
end
|
#do_not_report_anything ⇒ Object
Also known as:
do_not_report
#
do_not_report_anything
#
75
76
77
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 75
def do_not_report_anything
@do_report = false
end
|
#do_not_show_loaded_from_which_file ⇒ Object
#
do_not_show_loaded_from_which_file
#
375
376
377
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 375
def do_not_show_loaded_from_which_file
@show_loaded_from_which_file = false
end
|
#do_not_show_the_next_exams ⇒ Object
#
do_not_show_the_next_exams
Use this method if you do NOT want to show the next exams.
#
368
369
370
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 368
def do_not_show_the_next_exams
@show_next_exams = false
end
|
#do_show_all_URLs ⇒ Object
192
193
194
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 192
def do_show_all_URLs
@show_all_URLs = true
end
|
#do_show_lecture_attribution_to_universities ⇒ Object
#
do_show_lecture_attribution_to_universities
#
60
61
62
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/show.rb', line 60
def do_show_lecture_attribution_to_universities
@show_to_which_universities_the_lectures_belong_to = true
end
|
#exclude_title_entries_from_the_main_dataset ⇒ Object
#
exclude_title_entries_from_the_main_dataset
#
247
248
249
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 247
def exclude_title_entries_from_the_main_dataset
@dataset.reject! {|line| line.start_with? '@title ' }
end
|
#html_string? ⇒ Boolean
118
119
120
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/html.rb', line 118
def html_string?
@html_string
end
|
#individual_curriculum? ⇒ Boolean
Also known as:
is_it_an_individual_curriculum?
#
individual_curriculum?
#
486
487
488
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 486
def individual_curriculum?
@individual_curriculum
end
|
#is_an_individual_curriculum ⇒ Object
#
is_an_individual_curriculum
#
500
501
502
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 500
def is_an_individual_curriculum
@individual_curriculum = true
end
|
#is_bachelor_curriculum ⇒ Object
#
is_bachelor_curriculum
#
458
459
460
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 458
def is_bachelor_curriculum
determine_the_type_of_the_curriculum(:bachelor)
end
|
#is_bachelor_master_curriculum ⇒ Object
#
is_bachelor_master_curriculum
#
465
466
467
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 465
def is_bachelor_master_curriculum
determine_the_type_of_the_curriculum(:bachelor_master)
end
|
#is_master_curriculum ⇒ Object
#
is_master_curriculum
Denote that our curriculum at hand is a master-curriculum.
#
437
438
439
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 437
def is_master_curriculum
determine_the_type_of_the_curriculum(:master)
end
|
#is_not_an_individual_curriculum ⇒ Object
#
is_not_an_individual_curriculum
#
493
494
495
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 493
def is_not_an_individual_curriculum
@individual_curriculum = false
end
|
#is_this_a_registered_lecture?(i) ⇒ Boolean
#
is_this_a_registered_lecture?
#
431
432
433
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 431
def is_this_a_registered_lecture?(i)
@lecture_dataset.has_key?(i.strip)
end
|
#is_this_lecture_a_practical_course?(lecture_type) ⇒ Boolean
#
is_this_lecture_a_practical_course?
#
233
234
235
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 233
def is_this_lecture_a_practical_course?(lecture_type)
ARRAY_LECTURE_TYPES_THAT_ARE_MANDATORY_CONTINUOUS_ASSESSMENT.include? lecture_type
end
|
#iterate_over_the_lectures(i = @dataset) ⇒ Object
Also known as:
do_the_main_iteration
#
iterate_over_the_lectures (iterate tag)
#
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb', line 42
def iterate_over_the_lectures(
i = @dataset
)
i.each_with_index {|line, index| index += 1
result = ''.dup if line and line.include?('#')
raw_line = line[0 .. (line.index('#') - 1)] else
raw_line = line.dup
end
raw_line.strip! raw_line.squeeze!(' ') remote_url = Studium.return_remote_url_of_this_lecture(raw_line)
if remote_url == raw_line
e crimson("No registered remote homepage for #{raw_line}.")
end
splitted = raw_line.split(' ')
lecture_id = splitted.first name_of_the_lecture = splitted[1..-1].join(' ')
padded_index = ('('+index.to_s+')').rjust(5)
colourized_index = slategray(padded_index)
colourized_remote_url = N+dodgerblue(' → ')+
dodgerblue(remote_url)+
dodgerblue(' ☚')
pointer_to_the_lecture = @lecture_dataset[raw_line]
if pointer_to_the_lecture and
pointer_to_the_lecture.has_key?(:already_solved)
already_solved = pointer_to_the_lecture[:already_solved]
else
opnn; e "#{swarn('Problem with `')}#{sfancy(raw_line)}#{swarn('`:')}"
opnn; e swarn('no registered key called :already_solved was found')
unless main_dataset?.has_key? raw_line
opnn; e swarn('The lecture ')+sfancy(raw_line)+swarn(' has not yet been')
opnn; e swarn('registered in the file `')+
sfancy('lecture_information.yml')+
swarn('`.')
end
pp pointer_to_the_lecture
already_solved = false
end
if pointer_to_the_lecture.nil?
opnn; e "Skipping this lecture (#{sfancy(raw_line)})"
opnn; e 'as it is not registered or otherwise missing.'
next
end
n_ects_points = pointer_to_the_lecture[:ects]
@this_curriculum_has_n_ects_points_in_total += n_ects_points
padded_name_of_the_lecture = name_of_the_lecture.ljust(76)
padded_n_ects_points = n_ects_points.to_s.rjust(5)
colourized_n_ects_points = steelblue(padded_n_ects_points)
expanded_ja_oder_nein = ja_oder_nein(already_solved)
case expanded_ja_oder_nein
when 'Ja'
colourized_ja_oder_nein = lightgreen(expanded_ja_oder_nein.rjust(4))
when 'Nein' colourized_ja_oder_nein = crimson(expanded_ja_oder_nein.rjust(4))
end
fancified_already_solved = 'Bereits absolviert? '+colourized_ja_oder_nein+'. '
result << colourized_index+' '+
sfancy(padded_name_of_the_lecture)+' '+
fancified_already_solved+
'('+mediumseagreen('LVA Nummer: ')+
sfancy(lecture_id.rjust(7))
grade = nil
if already_solved
if pointer_to_the_lecture.has_key? :grade
grade = pointer_to_the_lecture[:grade]
@array_storing_the_grades << grade
end
@n_lectures_are_already_solved += 1
@n_ects_were_passed_so_far += n_ects_points
colourized_remote_url = ''
end
result << ', '+mediumseagreen('n ECTS: ')+colourized_n_ects_points
if grade
result << ', '+mediumseagreen('Grade: '+grade.to_s)
end
unless ALSO_SHOW_URL
colourized_remote_url = ''
end
if @do_report and cmdline? result << ') '+colourized_remote_url
e result
end
}
if @this_curriculum_has_n_ects_points_in_total >= 270.0
else
if is_it_an_individual_curriculum? and is_on_roebe?
consider_generating_a_graphviz_image_displaying_the_modules(
i
)
consider_generating_a_spreadsheet
end
end
end
|
#ja_oder_nein(i = 'nein') ⇒ Object
#
ja_oder_nein
Input “true” will become “Ja” and input “false” will become “Nein”.
#
654
655
656
657
658
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 654
def ja_oder_nein(
i = 'nein'
)
Studium.ja_oder_nein(i)
end
|
#lecture_dataset? ⇒ Boolean
Also known as:
main_dataset?
212
213
214
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 212
def lecture_dataset?
@lecture_dataset
end
|
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/menu.rb', line 14
def (
i = commandline_arguments?
)
if i.is_a? Array
i.each {|entry| (entry) }
else
case i.to_s when /^-?-?bachelor(-|_| )?vektorx?$/i,
/^-?-?bachelor(-|_| )?vektore?n?$/,
/^-?-?bachelor(-|_| )?vector$/,
/^-?-?bachelor(-|_| )?vector(-|_| )?curriculum$/,
/^-?-?molekularsimulatorisch(-|_| )?therapeutische(-|_| )?vektoren$/i,
/^-?-?bachelor(-|_| )?molekularsimulatorisch(-|_| )?therapeutische(-|_| )?vektoren$/i,
/^-?-?bachelor(-|_| )?individuelles(-|_| )?curriculum(-|_| )?molekularsimulatorische(-|_| )?vektoren(-|_| )?in(-|_| )?der(-|_| )?biotechnologie$/i,
/^-?-?bachelor(-|_| )?individuelles(-|_| )?curriculum(-|_| )?molekularsimulatorische(-|_| )?vektoren(-|_| )?in(-|_| )?biotechnologie(-|_| )?und(-|_| )?bioinformatik$/i,
/^-?-?bvektor$/i,
/^-?-?individuelles(-|_| )?bachelor(-|_| )?studium/i,
/^-?-?indi1$/i,
/^-?-?indi$/i,
'vektoren'
use_bachelor_vektor_curriculum
when /^-?-?aggregate$/i
use_master_vektoren_curriculum is_not_an_individual_curriculum
prepend_this_to_dataset(
%i(
bachelor_vektorx_curriculum
master_vektorx_curriculum
bachelor_informatik_und_molekulare_biologie
bachelor_lbt
bachelor_bioinformatik_an_der_boku
master_lbt
master_bioinformatik_an_der_boku
) )
prepend_this_to_dataset(
['892100 Physik (KTWW+HNT)']
)
sanitize_the_dataset
uniq_the_dataset
when /^-?-?biologische(-|_| )?informatik$/i,
/^-?-?bachelor(-|_| )?biologische(-|_| )?informatik$/i,
/^-?-?indi3$/i
use_bachelor_biologische_informatik
when /^-?-?master(-|_| )?bioinformatics(-|_| )?and(-|_| )?molecular(-|_| )?biotechnology$/i,
/^-?-?indi4$/i
use_master_bioinformatics_and_molecular_biotechnology
when /^-?-?bioinf2$/i,
/^-?-?bachelor(-|_| )?bioinformatik(-|_| )?und(-|_| )?molekulare(-|_| )?biotechnologie$/i,
/^-?-?bachelor(-|_| )?bioinformatik(-|_| )?und(-|_| )?biotechnologie$/i,
/^-?-?bachelor(-|_| )?bioinformatik(-|_| )?an(-|_| )?der(-|_| )?boku$/i,
/^-?-?indi2$/i
use_bachelor_bioinformatik_und_molekulare_biotechnologie
when /^-?-?master(-|_| )?dummy(-|_| )?curriculum$/i,
/^-?-?mdummy$/i
use_master_dummy_curriculum
when /^-?-?bachelor(-|_| )?dummy(-|_| )?curriculum$/i,
/^-?-?bdummy$/i,
/^-?-?dummy$/i
use_bachelor_dummy_curriculum
when /^-?-?aggregate(-|_| )?only(-|_| )?individual(-|_| )?curricula$/i
use_master_vektoren_curriculum prepend_this_to_dataset(
%i(
bachelor_vektorx_curriculum
bachelor_informatik_und_molekulare_biologie
bachelor_bioinformatik_an_der_boku
)
)
sanitize_the_dataset
uniq_the_dataset
when /^-?-?bachelor(-|_| )?lm?bt$/i,
/^-?-?bachelor(-|_| )?lm?bt$(-|_| )?curriculum/i,
/^-?-?lm?bt$(-|_| )?curriculum/i,
'lmbt',
/lbt/i
use_bachelor_lmbt_curriculum
when /^-?-?bachelor(-|_| )?master(-|_| )?vektorx?$/i,
/^-?-?bachelor(-|_| )?master(-|_| )?vektoren$/i,
/^-?-?bachelor(-|_| )?master(-|_| )?vector$/i,
/^-?-?bmvec$/i,
/^-?-?bmvek$/i
use_master_vektoren_curriculum prepend_this_to_dataset(:bachelor_vektorx_curriculum) when /^-?-?master(-|_| )?ve(c|k)torx$/,
/^-?-?master(_|-)?molekularsimulatorisch(_|-)?therapeutische(_|-)?vektoren$/i,
/^-?-?master(_|-)?individuelles(_|-)?curriculum(_|-)?molekularsimulatorische(_|-)?vektoren/i, /^-?-?master(_|-)?vektoren$/i,
/^-?-?master(-|_| )?ve(c|k)tors?$/,
/^-?-?master(-|_| )?individuell/,
'mastervect',
'mastersim'
use_master_vektoren_curriculum
when /^-?-?forstwirtschaft$/i,
/^-?-?bachelor(-|_| )?forstwirtschaft$/i
use_bachelor_forstwirtschaft
when /^-?-?bachelor(-|_| )?ernährung?$/,
/^-?-?bachelor(-|_| )?ern$/,
/^-?-?bachelor(-|_| )?ernährung(_|-)?uni(_|-)?wien$/,
/^-?-?bachelor(-|_| )?ernährungswissenschaften$/,
/^-?-?bachelor(-|_| )?nutrition(_|-)?science$/i,
/-?-?ernährung/,
'ernährungswissenschaften',
'ern'
use_bachelor_ernährung_curriculum
when /^-?-?bachelor(-|_| )?molekularbiologie(-|_| )?graz$/i,
/^-?-?bachelor(-|_| )?molekularbiologie(-|_| )?graz(-|_| )?curriculum$/i,
/^-?-?bachelor(-|_| )?molbio(-|_| )?graz$/i,
/^-?-?bachelor(-|_| )?molekularbiologie$/i,
/^-?-?graz$/i
use_bachelor_molekularbiologie_curriculum
when /^-?-?bachelor(-|_| )?pharmazie$/i,
/^-?-?pharmazie$/i,
/^-?-?pharm$/i,
/^-?-?bachelor(-|_| )?pharm$/i
use_bachelor_pharmazie_curriculum
when /^-?-?bachelor(-|_| )?verfahrenstechnik$/i,
/^-?-?verfahrenstechnik$/i
use_bachelor_verfahrenstechnik_curriculum
when /^-?-?bachelor(-|_| )?technical(-|_| )?chemistry?$/i
use_bachelor_technical_chemistry_curriculum
when /^-?-?(-|_| )?lm?bt$/i,
/^-?-?master(-|_| )?lm?bt(-|_| )?curriculum$/i,
/^-?-?master(-|_| )?biotech$/i,
/^-?-?master(-|_| )?lmbt$/i,
/LBT2/i,
'biotechnology',
'masterbiotech'
use_master_lmbt_curriculum
when /^-?-?master(-|_| )?pharmazie$/i,
/^-?-?master(-|_| )?pharmazie(-|_| )?curriculum$/i,
'mpharmacy',
'mpharma'
use_master_pharmazie_curriculum
when /^-?-?master(-|_| )?biologische(-|_| )?chemie$/i,
/^-?-?master(-|_| )?biologische(-|_| )?chemie(-|_| )?curriculum$/i,
/^-?-?biologische(-|_| )?chemie$/i,
'mbiochem'
use_master_biologische_chemie_curriculum
when /^-?-?master(_|-)?tu(_|-)?biotechnology$/i,
/^-?-?tu(_|-)?master(_|-)?biotech$/i,
/^-?-?master(_|-)?tu(_|-)?wien(_|-)?biotechnologie$/i,
/^-?-?tu(_|-)?vienna(_|-)?biotech(_|-)?master$/i,
/^-?-?master(_|-)?tuwienbiotech$/i,
/^-?-?tu(_|-)?wien(_|-)?biotech$/i
use_tu_master_biotechnology_curriculum
when /^-?-?bachelor(-|_| )?mikrobiologie$/i,
/^-?-?mikrobiologie$/i,
/^-?-?microbiology$/i
use_mikrobiologie_individuelles_curriculum
when /^-?-?priority(-|_| )?points$/i
use_priority_points
when /^-?-?informatik(_|-)?curriculum$/i,
/^-?-?informatik$/i,
/^-?-?bachelor(_|-)?informatik$/i,
/^-?-?bachelor(_|-)?informatik(_|-)?curriculum$/i,
'informatik'
use_bachelor_informatik_curriculum
when /^-?-?ktww(_|-)?curriculum$/i,
/^-?-?boku(_|-)?ktww$/i,
/^-?-?ktww$/i,
/^-?-?bachelor(_|-)?ktww$/i,
/^-?-?bachelor(_|-)?boku(_|-)?ktww(_|-)?curriculum$/i
use_bachelor_ktww_curriculum
when /^-?-?no(-|_| )?html(-|_| )?page$/,
/^-?-?no(-|_| )?html$/
no_html_page
when /^-?-?aw(_|-)?curriculum$/i,
/^-?-?boku(_|-)?aw$/i,
/^-?-?AW$/i,
/^-?-?agrarwissenschaften$/i,
/^-?-?bachelor(_|-)?agrarwissenschaften$/i,
'bachelorAW'
use_bachelor_agrarwissenschaften_curriculum
when /^-?-?master(-|_| )?genetik(-|_| )?und(-|_| )?entwicklungsbiologie$/i,
/^-?-?master(-|_| )?genetik(-|_| )?und(-|_| )?entwicklungsbiologie(-|_| )?curriculum$/i
use_uni_vienna_master_genetik_und_entwicklungsbiologie_curriculum
when /^-?-?master(_|-)?bioinformatik$/i,
/^-?-?master(_|-)?bioinformatics$/i
use_uni_vienna_master_bioinformatics_curriculum
when /^-?-?bachelor(-|_| )?medizinische(-|_| )?informatik$/i
use_bachelor_medizinische_informatik_curriculum
when /^-?-?bachelor(-|_| )?molekularbiologie$/,
/^-?-?bachelor(-|_| )?molekulare(-|_| )?biologie$/, /^-?-?bachelor(-|_| )?molbio$/,
/^-?-?molbio$/,
/^-?-?mbio$/,
'molekularebiologie'
use_bachelor_molbio_curriculum
when /^-?-?bachelor(-|_| )?chemie?$/,
/^-?-?bachelor(-|_| )?chemie?uni(_|-)?wien$/,
/^-?-?bachelor(-|_| )?chemie(-|_| )?uni(-|_| )?wien$/,
/^-?-?uni(-|_| )?wien(-|_| )?chemie$/,
/^-?-?uniwien(-|_| )?bachelor(-|_| )?chemie$/,
/^-?-?chem(-|_| )?bach$/i, 'chemie'
use_bachelor_chemie_curriculum
when /^-?-?show(_|-)?all(_|-)?URLs$/i
do_show_all_URLs
when /^-?-?bachelor(_|-)?ökologie(_|-)?curriculum$/i,
/^-?-?bachelor(_|-)?ecology(_|-)?curriculum/i,
'ökologie'
use_bachelor_ökologie_curriculum
when /^-?-?master(-|_| )?molekularbiologie$/,
/^-?-?master(-|_| )?molekulare(-|_| )?biologie/i,
/^-?-?master(-|_| )?molbio$/,
/^-?-?molbio2$/,
/^-?-?mbio2$/,
'mmolbio'
use_master_molbio_curriculum
when /^-?-?master(-|_| )?immunobiologie$/i,
/^-?-?master(-|_| )?immunobiology$/i,
/^-?-?master(-|_| )?immunobio$/i,
/^-?-?master(-|_| )?immunbiology$/i,
/^-?-?master(-|_| )?immuno$/i,
/^-?-?immunbio$/i
use_master_immunobiology_curriculum
when /^-?-?uniwien(_|-)?biologie(_|-)?basisblock$/i,
/^-?-?bachelor(_|-)?biologie(_|-)?basisblock$/i,
/^-?-?bachelor(_|-)?biologe(_|-)?basisblock$/i,
/^-?-?biologie(_|-)?basisblock$/i,
/^-?-?bachelor(_|-)?biologie/i,
/^-?-?biologie(_|-)?base$/i,
/^-?-?biologie(_|-)?1$/i,
'biologiebasisblock',
'biologie',
'uniwienbiologie'
use_bachelor_biologie_basisblock_curriculum
when /^-?-?bachelor(-|_| )?genetik$/,
/^-?-?bachelor(-|_| )?genetics$/,
/^-?-?bachelor(-|_| )?mikrobiologie(-|_| )?und(-|_| )?genetik$/,
/^-?-?geneti(c|k)$/,
/^-?-?genetics$/,
'mikrobiologie'
use_bachelor_genetik_curriculum
when /^-?-?lmbt(-|_| )?complete/i,
/^-?-?bachelor(-|_| )?master(-|_| )?lmbt(-|_| )?curriculum$/i
use_master_lmbt_curriculum
prepend_this_to_dataset(:bachelor_lmbt_curriculum)
when /^-?-?bachelor(-|_| )?master(-|_| )?tu(-|_| )?wien$/i,
/bachelor(-|_| )?master(-|_| )?individuelles(-|_| )?studium(-|_| )?an(-|_| )?der(-|_| )?tu(-|_| )?wien$/i
use_bachelor_master_tu_wien_curriculum
when /^-?-?bachelor(-|_| )?botanik(-|_| )?curriculum$/i,
/^-?-?bachelor(-|_| )?botanik$/i,
/^botanik$/,
'botany'
use_bachelor_botanik_curriculum
when /^-?-?bachelor(-|_| )?boku(-|_| )?ubrm$/i,
/^-?-?boku(-|_| )?ubrm$/i,
/^-?-?ubrm$/i
use_bachelor_ubrm_curriculum
when /-?-?do-?not-?show-?upcoming-?exams/,
/-?-?do-?not-?show-?next-?exams/,
/-?-?no-?next-?exams/
do_not_show_the_next_exams
when /-?-?files?\??/,
/-?-?fshow(_|-)?important(_|-)?files/
show_important_files
exit
when /^-?-?help$/
show_help
exit
when /-?-?available-?curricula/,
/-?-?show-?available/
show_available_curricula
exit
else opnn; e "Unknown input `#{sfancy(i)}` "\
"(in the method #{__method__}())"
exit end
end
end
|
#n_ects_points_in_total? ⇒ Boolean
Also known as:
total_ects_points?
#
n_ects_points_in_total?
#
262
263
264
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 262
def n_ects_points_in_total?
@this_curriculum_has_n_ects_points_in_total
end
|
#n_ects_were_passed_in_this_curriculum? ⇒ Boolean
Also known as:
n_ects_were_passed_in_this_curriculum, n_ects_were_passed_so_far
#
n_ects_were_passed_in_this_curriculum?
#
254
255
256
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 254
def n_ects_were_passed_in_this_curriculum?
@n_ects_were_passed_so_far
end
|
#n_lectures_are_already_solved? ⇒ Boolean
Also known as:
n_lectures_completed?
#
n_lectures_are_already_solved?
#
219
220
221
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 219
def n_lectures_are_already_solved?
@n_lectures_are_already_solved
end
|
#n_lectures_in_this_curriculum? ⇒ Boolean
#
n_lectures_in_this_curriculum?
#
82
83
84
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 82
def n_lectures_in_this_curriculum?
@dataset.size
end
|
#n_total_lectures? ⇒ Boolean
226
227
228
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 226
def n_total_lectures?
@dataset.size
end
|
#no_html_and_do_not_report_anything ⇒ Object
#
no_html_and_do_not_report_anything
#
644
645
646
647
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 644
def no_html_and_do_not_report_anything
no_html
do_not_report_anything
end
|
#no_html_page ⇒ Object
Also known as:
no_html
168
169
170
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 168
def no_html_page
@generate_html_file = false
end
|
#obtain_sanitized_dataset_from(i) ⇒ Object
#
obtain_sanitized_dataset_from
This method combines two other methods - loading the dataset that belongs to a Curriculum; and sorting that dataset.
#
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 322
def obtain_sanitized_dataset_from(i)
dataset = Studium.read_dataset_from_a_curriculum_file(i).map(&:chomp)
unless dataset == dataset.uniq
e 'We have found at the least one duplicate entry. This will be '\
'shown next:'
e
these_are_the_duplicates = {}
these_are_the_duplicates.default = 0
dataset.each {|this_entry|
these_are_the_duplicates[this_entry] += 1
}
these_are_the_duplicates.select {|key, value| value > 1 }.each {|duplicate, n_times|
e sfancy(" #{duplicate}")
}
e
e 'Please correct these entries before we can continue.'
exit
end
sort_dataset(dataset) if @shall_we_sort_the_dataset
end
|
#opnn(i = NAMESPACE) ⇒ Object
663
664
665
666
667
668
669
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 663
def opnn(i = NAMESPACE)
if block_given?
super(i) { yield }
else
super(i)
end
end
|
#prepend_this_to_dataset(i = :bachelor_biologie_basisblock_curriculum) ⇒ Object
#
prepend_this_to_dataset
An Array can be given to this method. If a symbol is given, such as :bachelor_lbt, then that symbol will be treated in a special way as far as this method is concerned.
#
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 273
def prepend_this_to_dataset(
i = :bachelor_biologie_basisblock_curriculum
)
original_input = i.dup
if i.is_a? Symbol
i = return_curriculum_file_based_on_this_input(i)
end
if i.is_a? Array
i.flatten.each {|entry| prepend_this_to_dataset(entry) }
else
if i.nil?
e 'A nil value was encountered, onto the method called '+
steelblue('prepend_this_dataset()')+'.'
e 'The original input was: '+
royalblue(original_input.to_s)
elsif File.exist? i array = obtain_sanitized_dataset_from(i)
@dataset = array+@dataset
@dataset.flatten!
exclude_title_entries_from_the_main_dataset
elsif is_this_a_registered_lecture? i
@dataset << i
else
opnn; e "No file exists at #{sfile(i)}."
end
end
end
|
#read_from_these_files? ⇒ Boolean
Also known as:
loaded_from_which_file?, curriculum_file?, curriculum_file_location?, curriculum_file_location, curriculum?
#
read_from_these_files?
#
348
349
350
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb', line 348
def read_from_these_files?
@read_from_these_files end
|
#read_in_dataset_from_this_file(i) ⇒ Object
#
read_in_dataset_from_this_file
Input to this method should be a String, not an Array.
#
91
92
93
94
95
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 91
def read_in_dataset_from_this_file(i)
@dataset << obtain_sanitized_dataset_from(i)
@dataset.flatten!
check_for_title_entry_in_the_file(i)
end
|
#read_in_main_dataset_from_the_existing_files(i = @read_from_these_files) ⇒ Object
#
read_in_main_dataset_from_the_existing_files
This method will read in from an Array, which is usually stored in the instance variables @read_from_these_files.
Input to this method can be like this:
["/Programs/Ruby/2.5.1/lib/ruby/site_ruby/2.5.0/studium/yaml/curricula/master_bioinformatik_066875.yml"]
#
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb', line 367
def read_in_main_dataset_from_the_existing_files(
i = @read_from_these_files
)
if i
i.each {|this_file|
if File.exist? this_file.to_s
read_in_dataset_from_this_file(this_file) else
opnn; e "Can not read from non-existing file "\
"`#{sfile(this_file)}`."
opnn; e 'The original input to the method '+
sfancy(__method__.to_s)+' was '+
sfancy(i)+' (class '+i.to_s+')'
opnn; e 'The '+orange('caller-stack')+' will be shown next:'
e
pp caller()
e
exit
end
}
end
end
|
#report_how_many_ects_points_are_in_this_curriculum ⇒ Object
#
report_how_many_ects_points_are_in_this_curriculum
#
182
183
184
185
186
187
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 182
def report_how_many_ects_points_are_in_this_curriculum
if @do_report
e return_how_many_ects_points_this_curriculum_has_in_total
e
end
end
|
#report_how_many_ects_points_have_been_passed_already ⇒ Object
#
report_how_many_ects_points_have_been_passed_already
#
47
48
49
50
51
52
53
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 47
def report_how_many_ects_points_have_been_passed_already
array = return_how_many_ects_points_have_been_passed_already
e array.first
e
e array.last
e
end
|
#report_how_many_exams_have_been_passed_already ⇒ Object
#
report_how_many_exams_have_been_passed_already
To invoke this method try:
emo --agrarwissenschaften
#
63
64
65
66
67
68
69
70
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 63
def report_how_many_exams_have_been_passed_already
n_lectures_are_in_this_curriculum = n_lectures_in_this_curriculum?
opnn; e sfancy(@n_lectures_are_already_solved.to_s)+' lectures have '\
'already been passed out'
opnn; e 'of a total '+
slateblue(n_lectures_are_in_this_curriculum.to_s)+', in '\
'the curriculum '+simp(title?.to_s)+'.'
end
|
#report_how_many_lectures_are_in_this_curriculum_and_how_many_of_them_are_already_solved ⇒ Object
#
report_how_many_lectures_are_in_this_curriculum_and_how_many_of_them_are_already_solved
#
199
200
201
202
203
204
205
206
207
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 199
def report_how_many_lectures_are_in_this_curriculum_and_how_many_of_them_are_already_solved
array = return_how_many_lectures_are_in_this_curriculum_and_how_many_of_them_are_already_solved
if @do_report
e
e array[0]
e array[1]
e
end
end
|
#report_the_average_grade ⇒ Object
#
report_the_average_grade
#
110
111
112
113
114
115
116
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 110
def report_the_average_grade
if @do_report
average_grade = return_the_average_grade
e "The #{gold('average grade')} is: #{sfancy(average_grade)}"
e
end
end
|
#report_the_university_attribution ⇒ Object
#
report_the_university_attribution
This method will report the university-attribution of that curriculum.
#
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 384
def report_the_university_attribution
require 'studium/toplevel_methods/report_n_ects_per_university.rb'
sanitize_the_dataset
hash = {}
@dataset.each {|entry|
pointer = @lecture_dataset[entry]
if pointer
n_ects = pointer[:ects]
this_university = pointer[:university]
if hash.has_key? this_university
hash[this_university] += n_ects
else
hash[this_university] = n_ects
end
else
e steelblue('No entry found for ')+
royalblue(entry.to_s)
end
}
Studium.report_n_ects_per_university(hash, n_ects_points_in_total?)
end
|
#report_title(this_title = @title) ⇒ Object
Also known as:
display_the_name_of_the_curriculum
#
report_title
Use this method to report the title of the Curriculum at hand.
#
611
612
613
614
615
616
617
618
619
620
621
622
623
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 611
def report_title(
this_title = @title
)
if this_title
e; e springgreen(this_title); e
else
opnn; e 'No title was set via @title. This is '\
'currently disallowed, so we exit now.'
opnn; e "The file to read from was `"\
"#{sfancy(@read_from_this_file)}`."
exit
end
end
|
#reset ⇒ Object
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/reset.rb', line 12
def reset
super()
is_bachelor_curriculum @lecture_dataset = return_dataset_from_the_file_lecture_information
@this_curriculum_has_n_ects_points_in_total = 0
@n_ects_were_passed_so_far = 0
@shall_we_sort_the_dataset = true @dataset = []
@title = nil
@hash_containing_the_lectures_for_this_curriculum = {}
@individual_curriculum = false
@show_next_exams = true
@n_lectures_are_already_solved = 0
determine_from_which_files_to_read
@array_storing_the_grades = []
@generate_html_file = true
@mode = :commandline
@show_loaded_from_which_file = true
@do_report = true
@show_all_URLs = false
@html_string = nil
@show_to_which_universities_the_lectures_belong_to = false
@append_this_string_onto_the_html_string = ''.dup
end
|
#return_and_check_file_for_this_curriculum(i) ⇒ Object
#
return_and_check_file_for_this_curriculum
The reason we have this method here is so that we can intercept individual curricula. If it is an individual curriculum then we will also show the university-attribution in the generated .html file.
#
17
18
19
20
21
22
23
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 17
def return_and_check_file_for_this_curriculum(i)
if i.to_s.include?('individuelles_curriculum') or
i.to_s.include?('vector') do_show_lecture_attribution_to_universities
end
return_file_for_this_curriculum(i) end
|
#return_arrow_pointing_to_the_right_side(optional_margin_left = nil) ⇒ Object
#
return_arrow_pointing_to_the_right_side
#
42
43
44
45
46
47
48
49
50
51
52
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/html.rb', line 42
def return_arrow_pointing_to_the_right_side(
optional_margin_left = nil
)
if optional_margin_left
'<img src="/home/x/DATA/images/STD/PFEIL6_red.png" style="margin-left:'+
optional_margin_left.to_s+
'">'.dup
else
'<img src="/home/x/DATA/images/STD/PFEIL6_red.png">'.dup
end
end
|
#return_bachelor_or_master_logo(this_lecture = nil) ⇒ Object
#
return_bachelor_or_master_logo
Here we differ between bachelor-logo and the master-logo.
By default, we will operate on @type_of_the_curriculum, but this can be wrong in a mixed bachelor-master curriculum.
#
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 584
def return_bachelor_or_master_logo(
this_lecture = nil
)
if this_lecture.nil?
case @type_of_the_curriculum
when :bachelor
BACHELOR_IMAGE
when :master
MASTER_IMAGE
end
else
if this_lecture.any? {|entry| entry.start_with?('033') }
BACHELOR_IMAGE
else
MASTER_IMAGE
end
end
end
|
#return_how_many_ects_points_have_been_passed_already(use_for = @mode) ⇒ Object
#
return_how_many_ects_points_have_been_passed_already
#
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 16
def return_how_many_ects_points_have_been_passed_already(
use_for = @mode
)
n_percent = (
(@n_ects_were_passed_so_far.to_f * 100) / n_ects_points_in_total?
).round(2)
colourized_n_ECTS_points_were_passed = @n_ects_were_passed_so_far.to_s
second_part = " <b>#{@title}</b>."
case use_for
when :use_for_html first_part = "In total we have passed <b>#{colourized_n_ECTS_points_were_passed} ECTS "\
"points</b> (<b>#{n_percent.to_s+'%'}</b>) so far in the"
when :commandline, :default colourized_n_ECTS_points_were_passed = plum(
colourized_n_ECTS_points_were_passed
)
first_part = "In total we have passed #{colourized_n_ECTS_points_were_passed} ECTS "\
"points (#{orangered(n_percent.to_s+'%')}) so far in the"
second_part = " #{sfancy(@title)}."
end
[ first_part, second_part ]
end
|
#return_how_many_ects_points_this_curriculum_has_in_total(use_colours = true) ⇒ Object
#
return_how_many_ects_points_this_curriculum_has_in_total
#
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb', line 283
def return_how_many_ects_points_this_curriculum_has_in_total(
use_colours = true
)
case use_colours
when :no_colours
use_colours = false
end
n_ects_points = @this_curriculum_has_n_ects_points_in_total
if use_colours
n_ects_points = tomato(n_ects_points)
else
n_ects_points = "<b>#{n_ects_points}</b>" end
n_ects_prüfungsimmanent = 0
@dataset.each {|line|
name = line.dup
if name.include? '#'
name = name[0 .. (name.index('#') - 1)]
name.strip!
name.squeeze!(' ')
if @lecture_dataset.has_key? name
pointer = @lecture_dataset[name]
n_ects = pointer[:ects].to_f
type = pointer[:type]
if is_prüfungsimmanent?(type)
n_ects_prüfungsimmanent += n_ects
end
end
end
}
n_percent_prüfungsimmanent = ((
n_ects_prüfungsimmanent.to_f * 100.0
) / @this_curriculum_has_n_ects_points_in_total.to_f).round(1)
colourized_n_ects_prüfungsimmanent =
skyblue(n_percent_prüfungsimmanent.to_s.dup)
"This curriculum has #{n_ects_points} ECTS points "\
"in total, of which "\
"#{colourized_n_ects_prüfungsimmanent} ECTS "\
"("+n_percent_prüfungsimmanent.to_s+"%)\n"\
"require continuous mandatory assessment "\
"(#{orangered('prüfungsimmanent')})."
end
|
#return_how_many_lectures_are_in_this_curriculum_and_how_many_of_them_are_already_solved(optional_use_colours = true) ⇒ Object
#
return_how_many_lectures_are_in_this_curriculum_and_how_many_of_them_are_already_solved
This method will return an Array with two members. The reason for this is that it is easier on the commandline to output two Arrays; and to also use this when we autogenerate a .html file.
#
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb', line 199
def return_how_many_lectures_are_in_this_curriculum_and_how_many_of_them_are_already_solved(
optional_use_colours = true
)
n_percent = (
(@n_lectures_are_already_solved.to_i * 100) / @dataset.size.to_f
).round(1)
case optional_use_colours when :use_for_html colourized_n_percent_finished = ' (<b>'+n_percent.to_s+'% finished'+'</b>)'
first_part = "A total of <b>#{@dataset.size.to_s}</b> lectures are part of this Curriculum."
second_part = "<b>#{@n_lectures_are_already_solved.to_s}</b> of these "\
"are already solved.#{colourized_n_percent_finished}"
when :no_colours, false
colourized_n_percent_finished = ' ('+n_percent.to_s+'% finished'+')'
first_part = "A total of #{@dataset.size.to_s} lectures are part of this Curriculum."
second_part = "#{@n_lectures_are_already_solved.to_s} of these "\
"are already solved.#{colourized_n_percent_finished}"
else colourized_n_percent_finished = ' ('+orangered(n_percent.to_s+'% finished')+')'
first_part = "A total of #{springgreen(@dataset.size.to_s)} "\
"lectures are part of this Curriculum."
second_part = "#{springgreen(@n_lectures_are_already_solved.to_s)} of these "\
"are already solved.#{colourized_n_percent_finished}"
end
[ first_part, second_part ]
end
|
#return_proper_logo_for_this_university(i) ⇒ Object
#
return_proper_logo_for_this_university
#
422
423
424
425
426
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 422
def return_proper_logo_for_this_university(
i
)
Studium.return_proper_university_image(i)
end
|
#return_the_average_grade ⇒ Object
#
return_the_average_grade
This method will return the average grade. So for example, if we have passed three exams, with a grade of 2, 3 and 4, respectively, then the average grade will be 2 + 3 + 4 = 9 / 3 → 3.
#
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb', line 254
def return_the_average_grade
array_storing_the_grades = @array_storing_the_grades.dup
array_storing_the_grades.reject! {|grade|
grade == '+' or grade == 'E' }
average_grade = (
array_storing_the_grades.sum.to_f / array_storing_the_grades.size
).round(2)
return average_grade
end
|
#
This method is for the display of a HTML timetable <div> element.
It will be near the bottom part of the auto-generated .html file, if we actually wish to generate a .html file.
#
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/html.rb', line 74
def return_timetable_of_upcoming_exams
new_hash = {}
dataset = @hash_containing_the_lectures_for_this_curriculum
dataset = dataset.sort_by {|name_of_the_lecture, inner_hash|
if inner_hash.has_key? 'exams'
exams = inner_hash['exams']
if exams.is_a? Array
exams = exams.first
if exams.include? ', '
exams = exams.split(', ').first.strip
end
end
else
exams = '01.01.2500' end
if exams.empty?
exams = '01.01.2500' end
Time.parse(exams)
}
dataset.each {|inner_array|
key = inner_array.first
value = inner_array.last
new_hash[key] = value
}
Studium.return_div_timetable_of_upcoming_exams(dataset)
end
|
#run ⇒ Object
#
run (run tag)
The menu() method has to come before any other methods here.
#
34
35
36
37
38
39
40
41
42
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/run.rb', line 34
def run
read_in_main_dataset_from_the_existing_files
if commandline?
try_to_rename_kde_konsole_tab
report_title
end
do_all_actions_after_the_main_dataset_was_read_in end
|
#sanitize_the_dataset ⇒ Object
527
528
529
530
531
532
533
534
535
536
537
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 527
def sanitize_the_dataset
@dataset.map! {|entry|
entry = entry.dup if entry.frozen?
entry.squeeze!(' ')
if entry.include? '#'
entry = entry[0 .. (entry.index('#')-1)]
end
entry.strip!
entry
}
end
|
#set_commandline_arguments(i) ⇒ Object
#
set_commandline_arguments
#
229
230
231
232
233
234
235
236
237
238
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb', line 229
def set_commandline_arguments(i)
if i.is_a?(Array) and i.empty?
i << :bachelor_vektorx end
@commandline_arguments = i
end
|
#set_dataset(i) ⇒ Object
Also known as:
set_all_lectures
243
244
245
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb', line 243
def set_dataset(i)
@dataset = i
end
|
#set_html_string(i) ⇒ Object
111
112
113
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/html.rb', line 111
def set_html_string(i)
@html_string = i.to_s.dup
end
|
#set_title(i) ⇒ Object
Also known as:
set_title_of_the_curriculum
#
set_title
The title of the Curriculum in question. Should be hardcoded in the file.
#
631
632
633
634
635
636
637
638
639
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 631
def set_title(i)
i = i.first if i.is_a? Array
i = i.dup.delete(N) if i.start_with? '# ==='
i.sub!(/^# === /,'')
end
i.sub!(/^@title /,'') if i.include? '@title '
@title = i.strip.chomp
end
|
#show_available_curricula ⇒ Object
#
show_available_curricula
This method will show the available Curricula.
Invocation example:
studium_solved --show-available
#
43
44
45
46
47
48
49
50
51
52
53
54
55
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/show.rb', line 43
def show_available_curricula
e 'These curricula are available:'
e
Studium.return_array_location_of_all_registered_curricula.each {|entry|
if entry.is_a? Array
entry.each {|inner_entry|
e " #{sfancy(File.basename(inner_entry).sub(/\.yml$/,''))}"
}
else
e " #{sfancy(File.basename(entry).sub(/\.yml$/,'').strip)}"
end
}; e
end
|
#show_help ⇒ Object
#
show_help (help tag)
The help options for class Studium::ShowLecturesOnTheCommandline are stored in this method here.
To invoke this method, do:
show_lectures_on_the_commandline --help
#
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/help.rb', line 22
def show_help
e
opnn { :no_trailing_colon }
help_string = <<-EOF
The following help-options are available and documented:
EOF
e help_string
" #{slateblue('--available-curricula?')} # show "\
"which curricula are available"
" #{slateblue('--do-not-show-upcoming-exams')} # Do not show upcoming exams"
" #{slateblue('--show-all-URLs')} # Also "\
"show remote URLs of already solved lectures"
" #{slateblue('--priority-points')} # Display "\
"a curriculum based on priority points"
" #{slateblue('--use-this-curriculum=foo.md')} # use "\
"this curriculum as specified in the file"
e
end
|
#show_important_files(use_this_file = FILE_LECTURE_INFORMATION) ⇒ Object
#
show_important_files
This method will show the file that has all lectures registered.
Usage example:
curriculum --files?
#
24
25
26
27
28
29
30
31
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/show.rb', line 24
def show_important_files(
use_this_file = FILE_LECTURE_INFORMATION
)
e "The following file is the most important file by far:"
e
e " #{sfile(use_this_file)}"
e
end
|
#show_loaded_from_which_file? ⇒ Boolean
#
show_loaded_from_which_file?
#
175
176
177
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 175
def show_loaded_from_which_file?
@show_loaded_from_which_file
end
|
#sort_dataset(i = @dataset) ⇒ Object
#
sort_dataset
This method will sort the dataset, according to the name of the lecture rather than the leading ID number.
#
545
546
547
548
549
550
551
552
553
554
555
556
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 545
def sort_dataset(
i = @dataset
)
i.sort_by! {|line|
line.split(' ')[1 .. -1].join(' ').strip
}
end
|
#starts_with_a_lecture_id_entry?(i) ⇒ Boolean
#
starts_with_a_lecture_id_entry?
#
561
562
563
564
565
566
567
568
569
570
571
572
573
574
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 561
def starts_with_a_lecture_id_entry?(i)
result = false
if i.include? ' '
splitted = i.split(' ')
first_entry = splitted.first
if first_entry =~ /^\d+\.?[A-Z]*\d{1,4}$/
result = true
end
end
result
end
|
#title? ⇒ Boolean
Also known as:
return_name_of_the_curriculum, name_of_the_curriculum, name_of_the_curriculum?
507
508
509
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 507
def title?
@title
end
|
#try_to_rename_kde_konsole_tab(use_this_title = return_name_of_the_curriculum) ⇒ Object
#
try_to_rename_kde_konsole_tab
This method can be used to rename the KDE Konsole tab.
#
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/konsole.rb', line 16
def try_to_rename_kde_konsole_tab(
use_this_title = return_name_of_the_curriculum
)
if rename_konsole_tab?
begin
require 'roebe/requires/require_kde_konsole.rb'
Roebe::KdeKonsole.new(use_this_title) { :be_quiet }
rescue LoadError
if is_on_roebe?
e "The #{steelblue('class Roebe::KdeKonsole')} is not "\
"available. Install the roebe-gem."
end
end
end
end
|
#type_of_the_curriculum? ⇒ Boolean
Also known as:
curriculum_type?
#
type_of_the_curriculum?
#
240
241
242
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 240
def type_of_the_curriculum?
@type_of_the_curriculum
end
|
#uniq_the_dataset ⇒ Object
#
uniq_the_dataset
This ad-hoc method will simply eliminate all the duplicates that may exist in the main dataset at hand. It is only called from within menu() right now (December 2019).
#
520
521
522
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/misc.rb', line 520
def uniq_the_dataset
@dataset.uniq!
end
|
#use_bachelor_agrarwissenschaften_curriculum ⇒ Object
#
use_bachelor_agrarwissenschaften_curriculum
#
500
501
502
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 500
def use_bachelor_agrarwissenschaften_curriculum
determine_from_which_file_to_read(:bachelor_agrarwissenschaften_curriculum)
end
|
619
620
621
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 619
def use_bachelor_bioinformatik_und_molekulare_biotechnologie
determine_from_which_file_to_read(:bachelor_bioinformatik_und_biotechnologie)
end
|
#use_bachelor_biologie_basisblock_curriculum ⇒ Object
#
use_bachelor_biologie_basisblock_curriculum
#
563
564
565
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 563
def use_bachelor_biologie_basisblock_curriculum
determine_from_which_file_to_read(:bachelor_basisblock_biologie)
end
|
42
43
44
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 42
def use_bachelor_biologische_informatik
determine_from_which_file_to_read(:bachelor_biologische_informatik)
end
|
#use_bachelor_botanik_curriculum ⇒ Object
#
use_bachelor_botanik_curriculum
#
514
515
516
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 514
def use_bachelor_botanik_curriculum
determine_from_which_file_to_read(:bachelor_botanik_curriculum)
end
|
#use_bachelor_chemie_curriculum ⇒ Object
#
use_bachelor_chemie_curriculum
#
542
543
544
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 542
def use_bachelor_chemie_curriculum
determine_from_which_file_to_read(:bachelor_chemie_curriculum)
end
|
#use_bachelor_dummy_curriculum ⇒ Object
#
use_bachelor_dummy_curriculum
#
35
36
37
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 35
def use_bachelor_dummy_curriculum
determine_from_which_file_to_read(:bachelor_dummy_curriculum)
end
|
#use_bachelor_ernährung_curriculum ⇒ Object
#
use_bachelor_ernährung_curriculum
#
400
401
402
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 400
def use_bachelor_ernährung_curriculum
determine_from_which_file_to_read(:bachelor_ernährung_curriculum)
end
|
#use_bachelor_forstwirtschaft ⇒ Object
#
use_bachelor_forstwirtschaft
#
626
627
628
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 626
def use_bachelor_forstwirtschaft
determine_from_which_file_to_read(:bachelor_forstwirtschaft)
end
|
#use_bachelor_genetik_curriculum ⇒ Object
#
use_bachelor_genetik_curriculum
#
521
522
523
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 521
def use_bachelor_genetik_curriculum
determine_from_which_file_to_read(:bachelor_genetik_curriculum)
end
|
486
487
488
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 486
def use_bachelor_informatik_curriculum
determine_from_which_file_to_read(:bachelor_informatik_curriculum)
end
|
#use_bachelor_ktww_curriculum ⇒ Object
#
use_bachelor_ktww_curriculum
#
605
606
607
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 605
def use_bachelor_ktww_curriculum
determine_from_which_file_to_read(:bachelor_boku_ktww_curriculum)
end
|
#use_bachelor_lmbt_curriculum ⇒ Object
#
use_bachelor_lmbt_curriculum
#
493
494
495
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 493
def use_bachelor_lmbt_curriculum
determine_from_which_file_to_read(:bachelor_boku_lmbt_curriculum)
end
|
#use_bachelor_master_tu_wien_curriculum ⇒ Object
#
use_bachelor_master_tu_wien_curriculum
#
507
508
509
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 507
def use_bachelor_master_tu_wien_curriculum
determine_from_which_file_to_read(:bachelor_master_tu_wien)
end
|
472
473
474
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 472
def use_bachelor_medizinische_informatik_curriculum
determine_from_which_file_to_read(:bachelor_medizinische_informatik_curriculum)
end
|
#use_bachelor_molbio_curriculum ⇒ Object
#
use_bachelor_molbio_curriculum
#
577
578
579
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 577
def use_bachelor_molbio_curriculum
determine_from_which_file_to_read(:bachelor_molekulare_biologie_curriculum)
end
|
#use_bachelor_molekularbiologie_curriculum ⇒ Object
Also known as:
use_bachelor_molekularbiologie_graz_curriculum
#
use_bachelor_molekularbiologie_curriculum
#
414
415
416
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 414
def use_bachelor_molekularbiologie_curriculum
determine_from_which_file_to_read(:bachelor_molekularbiologie_graz_curriculum)
end
|
#use_bachelor_pharmazie_curriculum ⇒ Object
#
use_bachelor_pharmazie_curriculum
#
407
408
409
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 407
def use_bachelor_pharmazie_curriculum
determine_from_which_file_to_read(:bachelor_pharmazie_curriculum)
end
|
#use_bachelor_technical_chemistry_curriculum ⇒ Object
#
use_bachelor_technical_chemistry_curriculum
#
584
585
586
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 584
def use_bachelor_technical_chemistry_curriculum
determine_from_which_file_to_read(:technical_chemistry_curriculum)
end
|
#use_bachelor_ubrm_curriculum ⇒ Object
#
use_bachelor_ubrm_curriculum
#
598
599
600
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 598
def use_bachelor_ubrm_curriculum
determine_from_which_file_to_read(:bachelor_boku_ubrm_curriculum)
end
|
#use_bachelor_vektor_curriculum ⇒ Object
#
use_bachelor_vektor_curriculum
This method is to be used to read from the bachelor-vektorx curriculum.
#
59
60
61
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 59
def use_bachelor_vektor_curriculum
determine_from_which_file_to_read(:bachelor_vektor_curriculum)
end
|
#use_bachelor_verfahrenstechnik_curriculum ⇒ Object
#
use_bachelor_verfahrenstechnik_curriculum
#
591
592
593
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 591
def use_bachelor_verfahrenstechnik_curriculum
determine_from_which_file_to_read(:bachelor_verfahrenstechnik_curriculum)
end
|
#use_bachelor_ökologie_curriculum ⇒ Object
#
use_bachelor_ökologie_curriculum
#
479
480
481
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 479
def use_bachelor_ökologie_curriculum
determine_from_which_file_to_read(:bachelor_ökologie_curriculum)
end
|
49
50
51
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 49
def use_master_bioinformatics_and_molecular_biotechnology
determine_from_which_file_to_read(:master_bioinformatics_and_molecular_biotechnology)
end
|
#use_master_biologische_chemie_curriculum ⇒ Object
#
use_master_biologische_chemie_curriculum
#
421
422
423
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 421
def use_master_biologische_chemie_curriculum
determine_from_which_file_to_read(:master_biologische_chemie_curriculum)
end
|
#use_master_dummy_curriculum ⇒ Object
#
use_master_dummy_curriculum
#
28
29
30
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 28
def use_master_dummy_curriculum
determine_from_which_file_to_read(:master_dummy_curriculum)
end
|
#use_master_immunobiology_curriculum ⇒ Object
#
use_master_immunobiology_curriculum
#
556
557
558
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 556
def use_master_immunobiology_curriculum
determine_from_which_file_to_read(:master_immunobiology_curriculum)
end
|
#use_master_lmbt_curriculum ⇒ Object
#
use_master_lmbt_curriculum
#
428
429
430
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 428
def use_master_lmbt_curriculum
determine_from_which_file_to_read(:master_lmbt_curriculum)
end
|
#use_master_molbio_curriculum ⇒ Object
#
use_master_molbio_curriculum
#
528
529
530
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 528
def use_master_molbio_curriculum
determine_from_which_file_to_read(:master_molbio_curriculum)
end
|
#use_master_pharmazie_curriculum ⇒ Object
#
use_master_pharmazie_curriculum
#
549
550
551
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 549
def use_master_pharmazie_curriculum
determine_from_which_file_to_read(:master_pharmazie_curriculum)
end
|
#use_master_vektoren_curriculum ⇒ Object
#
use_master_vektoren_curriculum
#
633
634
635
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 633
def use_master_vektoren_curriculum
determine_from_which_file_to_read(:master_vektoren_curriculum)
end
|
#use_mikrobiologie_individuelles_curriculum ⇒ Object
Also known as:
use_mikrobiologie_curriculum
#
use_mikrobiologie_individuelles_curriculum
#
612
613
614
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 612
def use_mikrobiologie_individuelles_curriculum
determine_from_which_file_to_read(:bachelor_mikrobiologie_individuelles_curriculum)
end
|
#use_priority_points ⇒ Object
361
362
363
364
365
366
367
368
369
370
371
372
373
374
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 361
def use_priority_points
_ = main_dataset?
_.select! {|a,b|
b.has_key? :priority_points
}
is_master_curriculum do_not_read_in_from_a_file
set_title 'Custom individual curriculum based on priority points'
set_all_lectures(_.keys)
end
|
#use_tu_master_biotechnology_curriculum ⇒ Object
#
use_tu_master_biotechnology_curriculum
#
570
571
572
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 570
def use_tu_master_biotechnology_curriculum
determine_from_which_file_to_read(:master_tu_vienna_biotechnology_curriculum)
end
|
535
536
537
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 535
def use_uni_vienna_master_bioinformatics_curriculum
determine_from_which_file_to_read(:master_bioinformatik_curriculum)
end
|
#use_uni_vienna_master_genetik_und_entwicklungsbiologie_curriculum ⇒ Object
#
use_uni_vienna_master_genetik_und_entwicklungsbiologie_curriculum
#
451
452
453
|
# File 'lib/studium/utility_scripts/show_lectures_on_the_commandline/determine.rb', line 451
def use_uni_vienna_master_genetik_und_entwicklungsbiologie_curriculum
determine_from_which_file_to_read(:master_genetik_und_entwicklungsbiologie_curriculum)
end
|