Class: Studium::Commandline

Inherits:
Base
  • Object
show all
Defined in:
lib/studium/commandline/commandline.rb

Overview

Studium::Commandline

Constant Summary

Constants inherited from Base

Base::COMMON_YEAR_DAYS_IN_MONTH, Base::LEFT_PADDING, Base::NAMESPACE, Base::N_CHARACTERS_PER_LINE

Constants included from Colours

Studium::Colours::COLOURS

Class Method Summary collapse

Instance Method Summary collapse

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, #be_silent, #be_verbose?, #beautiful_url, #change_directory, #cheering_person, #chmod, #cliner, #colour_for_ects_points, #colourize_percentage, #convert_this_array_of_lectures_into_the_full_dataset, #copy, #course_filter, #cpruby, #create_directory, #create_file, #csv_file?, #current_month?, #current_semester?, #dataset?, #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?, #does_this_line_include_an_english_weekday?, #does_this_line_start_with_a_german_weekday?, #e, #ecomment, #editor?, #ee, #egrey, #enable_colours, #enable_colours_globally, #enable_debug, #encoding?, #english_to_german_weekday, #ensure_that_a_base_directory_exists_for_this_file, #ensure_that_the_log_directory_exists, #eparse, #esystem, #etomato, #exit_program, #extract_dd_mm_yyyy, #fetch_this_curriculum, #file_important_exams?, #file_lecture_information?, #file_passed_exams_per_month, #file_read_with_proper_encoding, #filter_away_already_answered_questions, #filter_away_invalid_questions, #filter_for_all_passed_exams, #find_corresponding_exam_topic, #from_curriculum_id_to_university, #german_date_notation, #german_weekday?, #german_weekdays?, #german_weekend_for?, #german_yes_or_no, #has_a_bachelor_and_a_master_curriculum?, #has_a_bachelor_curriculum?, #has_a_master_curriculum?, #has_lva_dates_registered?, #has_this_exam_topic_been_solved?, #has_year_entry?, #hh_mm_ss_dd_mm_yyyy, #horizontal_bar?, #html_log_directory?, #infer_the_namespace, #initialize_the_internal_hash, #internal_hash?, #is_a_master_lecture?, #is_a_registered_curriculum?, #is_a_weekday?, #is_connected_to_the_www?, #is_german_weekday?, #is_on_roebe?, #is_prüfungsimmanent?, #is_this_a_registered_exam_topic?, #is_this_a_valid_html_colour?, #is_this_day_today?, #is_this_lecture_a_practical_course?, #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, #left_arrow?, #load_yaml_dataset, #map_input_to_this_curriculum_filename, #move_file, #n_days_difference_from_today_to_this_day, #n_seconds_to_n_days, #namespace?, #no_ext_name, #no_file_exists_at, #number_to_month, #obtain, #obtain_lectures_from_this_curriculum, #open_in_browser, #open_in_editor, #opne, #opnerev, #opnn, #padded_current_month?, #parse_dd_mm_yyyy, #parse_this_line_for_date_entry, #path_to_exam_topic?, #project_yaml_directory?, #rds, #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, #require_open_uri, #reset_the_internal_state, #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, #right_arrow?, #rinstall2, #roebe_exam_directory?, #roebe_path_to_file_lecture_information?, #ruby_src_dir_at_home?, #sanitize_this_topic, #sanitize_url, #select_for_prüfungsimmanente_LVs, #select_lectures_with_this_key, #set_be_verbose, #set_this_cd_alias_to, #set_xorg_buffer, #sfancy, #shall_we_make_use_of_unicode_symbols?, #show_todays_date, #silently_open_in_browser, #simp, #sort_these_lecture_names_by_time, #spacer, #studium_log_dir?, #this_month_has_n_days?, #total_ects_points_passed, #translate_dd_mm_yyyy_to_weekday, #try_to_require_html_templates, #try_to_require_the_open_gem, #try_to_require_the_rcfiles, #try_to_require_the_verbose_truth_gem, #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, #yaml_dir?, #yellowrev, #yes_or_no

Methods included from RunmodeModule

#commandline?, #runmode?, #set_commandline_mode, #set_runmode, #set_www_mode, #www_mode?

Methods included from CommandlineArgumentsModule

#commandline_arguments?, #commandline_arguments_joined, #commandline_arguments_with_hyphens?, #commandline_arguments_without_leading_hyphens?, #first_argument?, #first_non_hyphen_argument?, #reset_the_commandline_arguments, #set_commandline_arguments, #set_first_argument

Methods included from HtmlColoursModule

#aquamarine, #blanchedalmond, #brown, #cadetblue, #chocolate, #coral, #cornflowerblue, #crimson, #cyan, #darkblue, #darkcyan, #darkgoldenrod, #darkgreen, #darkkhaki, #darkolivegreen, #darkorange, #darkred, #darkseagreen, #darkslateblue, #darkslategray, #darkturquoise, #deepskyblue, #firebrick, #forestgreen, #gold, #goldenrod, #green, #grey, #indianred, #khaki, #lavender, #lawngreen, #lightblue, #lightcoral, #lightgreen, #lightred, #lightseagreen, #lightskyblue, #lightslategray, #lightslategrey, #lime, #limegreen, #mediumaquamarine, #mediumblue, #mediumpurple, #mediumseagreen, #mediumslateblue, #mediumspringgreen, #mediumturquoise, #mediumvioletred, #mintcream, #moccasin, #oldlace, #olive, #olivedrab, #orange, #orangered, #orchid, #palegoldenrod, #palegreen, #paleturquoise, #palevioletred, #peru, #plum, #powderblue, #red, #rosybrown, #royalblue, #saddlebrown, #salmon, #sandybrown, #seagreen, #sienna, #silver, #skyblue, #slateblue, #slategray, #springgreen, #steelblue, #tan, #teal, #thistle, #tomato, #turquoise, #violet, #whitesmoke, #yellow, #yellowgreen

Methods included from Colours

#bold_blue, #bold_red, #bold_yellow, cadetblue, #cadetblue, #chartreuse, #coral, coral, #cornflowerblue, cornflowerblue, crimson, #cyan, cyan, darkgoldenrod, #darkgoldenrod, #darkgray, darkgreen, darkolivegreen, darkseagreen, #darkslateblue, darkslateblue, #darkslategray, darkslategray, #darkturquoise, darkturquoise, #deepskyblue, deepskyblue, default_colour, #dimgray, disable_colours, #dodgerblue, e, #efancy, enable_colours, #erev, #ewarn, #forestgreen, forestgreen, gold, #goldenrod, goldenrod, #grey, grey, indianred, #indianred, khaki, #khaki, lawngreen, #lawngreen, lightblue, lightgreen, lightsalmon, #lightseagreen, lightseagreen, lightskyblue, #lightskyblue, #lightslategray, lightslategray, #lightsteelblue, lime, #lime, limegreen, #limegreen, #mediumaquamarine, mediumaquamarine, #mediumorchid, #mediumpurple, mediumpurple, #mediumseagreen, mediumseagreen, #mediumslateblue, mediumslateblue, #mediumspringgreen, mediumspringgreen, #mediumturquoise, mediumturquoise, #oldlace, olive, #olive, olivedrab, #olivedrab, orange, orangered, #orchid, orchid, palegreen, #palegreen, paleturquoise, #paleturquoise, palevioletred, #papayawhip, peru, #peru, plum, #plum, #powderblue, powderblue, rev, #rev?, royalblue, saddlebrown, #saddlebrown, #sandybrown, sandybrown, sdir, #sdir, seagreen, #seagreen, sfancy, #sfancy, sfile, #sfile, #simp, simp, #skyblue, skyblue, slateblue, #slategray, slategray, springgreen, #springgreen, #steelblue, steelblue, #swarn, swarn, #tan, tan, teal, #teal, #tomato, tomato, turquoise, use_colours?, use_this_colour_for_exam_answers, use_this_colour_for_exam_questions, #yellow, yellowgreen, #yellowgreen

Constructor Details

#initialize(i = ARGV, run_already = true) ⇒ Commandline

#

initialize

#


29
30
31
32
33
34
35
36
37
# File 'lib/studium/commandline/commandline.rb', line 29

def initialize(
    i           = ARGV,
    run_already = true
  )
  reset
  set_commandline_arguments(i)
  parse_commandline_arguments_as_a_full_string
  run if run_already
end

Class Method Details

.[](i = ARGV) ⇒ Object

#

Studium::Commandline[]

#


1831
1832
1833
# File 'lib/studium/commandline/commandline.rb', line 1831

def self.[](i = ARGV)
  new(i)
end

Instance Method Details

#add_new_exam_questionObject

#

add_new_exam_question

#


1303
1304
1305
1306
# File 'lib/studium/commandline/commandline.rb', line 1303

def add_new_exam_question
  require 'studium/exams/add_exam_question.rb'
  Studium::Exams::AddExamQuestion.new
end

#check_the_lecture_information_fileObject

#

check_the_lecture_information_file

#


1687
1688
1689
1690
# File 'lib/studium/commandline/commandline.rb', line 1687

def check_the_lecture_information_file
  require 'studium/check_and_sanitize/check_the_lecture_information_file.rb'
  Studium.check_the_lecture_information_file
end

#copy_lecture_information_file_to_default_locationObject

#

copy_lecture_information_file_to_default_location

#


1248
1249
1250
# File 'lib/studium/commandline/commandline.rb', line 1248

def copy_lecture_information_file_to_default_location
  Studium.copy_lecture_information_file_to_default_location
end

#create_an_archive_of_the_exam_questionsObject

#

create_an_archive_of_the_exam_questions

#


1272
1273
1274
# File 'lib/studium/commandline/commandline.rb', line 1272

def create_an_archive_of_the_exam_questions
  Studium.create_an_archive_of_the_exam_questions
end

#create_an_executable_on_windows(on_this_file = '/home/x/programming/ruby/src/studium/lib/studium/gui/libui/ask_exam_question.rb', name_of_the_output_exe = 'ask_exam_question.exe') ⇒ Object

#

create_an_executable_on_windows

To invoke this method do:

studium --create-executable
#


1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
# File 'lib/studium/commandline/commandline.rb', line 1153

def create_an_executable_on_windows(
    on_this_file = 
      '/home/x/programming/ruby/src/studium/lib/studium/gui/libui/ask_exam_question.rb',
    name_of_the_output_exe = 'ask_exam_question.exe'
  )
  _ = 'ocra '+on_this_file+' '\
      '--dll ruby_builtin_dlls/libssp-0.dll '\
      '--dll ruby_builtin_dlls/libgmp-10.dll '\
      '--dll ruby_builtin_dlls/libffi-7.dll '\
      '--gem-all=fiddle '\
      '--output '+name_of_the_output_exe
  esystem _
end

#curriculum_comparerObject

#

curriculum_comparer

#


1178
1179
1180
# File 'lib/studium/commandline/commandline.rb', line 1178

def curriculum_comparer
  Studium::CurriculumComparer.new
end

#do_show_the_average_grade_of_all_passed_examsObject

#

do_show_the_average_grade_of_all_passed_exams

#


1389
1390
1391
1392
1393
1394
1395
# File 'lib/studium/commandline/commandline.rb', line 1389

def do_show_the_average_grade_of_all_passed_exams
  require 'studium/exams/average_grade/average_grade.rb'
  e 'The average grade of all passed exams is '+
     sfancy(
       Studium.average_grade(:default, round_to: 2 )
     )+'.'
end

#do_show_the_inscription_dates_at_the_different_universitiesObject

#

do_show_the_inscription_dates_at_the_different_universities

#


1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
# File 'lib/studium/commandline/commandline.rb', line 1400

def do_show_the_inscription_dates_at_the_different_universities
  _ = YAML.load_file(Studium.project_yaml_dir?+'inscription_dates_of_universities.yml')
  e
  _.each_pair {|key, value|
    if value.is_a? Array
      value = value.first
    end
    university = key.ljust(40)
    e "  "\
      "#{royalblue(university)} "\
      "#{steelblue(value)}"
  }
  e
end

#lectures_without_exam_entryObject

#

lectures_without_exam_entry

#


1232
1233
1234
1235
# File 'lib/studium/commandline/commandline.rb', line 1232

def lectures_without_exam_entry
  require 'studium/exams/lectures_without_exam_entry.rb'
  ::Studium::Exams::LecturesWithoutExamEntry.new
end

#mark_all_exam_question_answers_as_undoneObject

#

mark_all_exam_question_answers_as_undone

#


1820
1821
1822
1823
1824
1825
1826
# File 'lib/studium/commandline/commandline.rb', line 1820

def mark_all_exam_question_answers_as_undone
  require 'studium/exams/unsolve_all_questions_from_this_topic.rb'
  opne 'Now marking all exam-question-answers as undone.'
  available_topics?.each {|this_topic|
    Studium.unsolve_all_questions_from_this_topic(this_topic)
  }
end
#

menu (menu tag)

#


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
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
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
# File 'lib/studium/commandline/commandline.rb', line 68

def menu(
    i = commandline_arguments?
  )
  if i.is_a? Array
    i.each {|entry| menu(entry) }
  else
    case i # case tag
    # ===================================================================== #
    # === studium --mega-pdf
    #
    # This entry point will create one huge .pdf file, consisting of
    # ALL exam topics.
    # ===================================================================== #
    when /^-?-?mega(-|_| )?pdf$/i,
         /^-?-?monster(-|_| )?pdf$/i,
         /^-?-?monster(-|_| )$/i,
         /^-?-?fat(-|_| )?pdf$/i,
         /^-?-?big(-|_| )?pdf$/i
      ::Studium.create_pdf_file_for_this_exam_topic(:all_topics)
    # ===================================================================== #
    # === studium --jruby1
    #
    # Invocation example:
    #
    #   jruby studium --jruby1
    #   jruby studium --jruby
    #
    # ===================================================================== #
    when /^-?-?jruby1?$/
      require 'studium/gui/jruby/exam_trainer/exam_trainer.rb'
      Studium::GUI::Jruby::ExamTrainer.new(ARGV)
    # ===================================================================== #
    # === studium --max-ever
    # ===================================================================== #
    when /^-?-?max(-|_| )?ever\??$/,
         /^-?-?max(-|_| )?answers\??$/,
         /^-?-?max(-|_| )?stats\??$/,
         /^-?-?max(-|_| )?statistics\??$/,
         /^-?-?max(-|_| )?questions(-|_| )?answered\??$/, # studium --max-questions-answered
         /^-?-?daily$/i,
         /^-?-?daily(-|_| )?changes\??$/
      show_maximum_amount_of_questions_ever_answered
      exit
    # ===================================================================== #
    # === studium --all-undone
    #
    # This entry point will mark all exam question as "undone", aka
    # reset the whole exam-question dataset. Only invoke this if
    # you really need this.
    # ===================================================================== #
    when /-?-?all(_|-)?undone$/i
      mark_all_exam_question_answers_as_undone
      exit
    # ===================================================================== #
    # === studium --start-a-new-exam-day
    #
    # This entry point can be used to "reset" the file that keeps track
    # of which exams have been answered today.
    # ===================================================================== #
    when /-?-?start(_|-)?a(_|-)?new(_|-)?exam(_|-)?day$/i,
         /-?-?clear(_|-)?last(_|-)?questions$/i,
         /^-?-?clear(_|-)?old(_|-)?file$/i,
         /^-?-?clear(_|-)?file$/i,
         /^-?-?new(_|-)?day$/i
      start_a_new_exam_day
      exit
    # ===================================================================== #
    # === studium --ects-per-university
    # ===================================================================== #
    when /^-?-?ects(-|_| )?per(-|_| )?university$/i,
         /^-?-?overviews(-|_| )?at(-|_| )?universities$/i,
         /^-?-?per(-|_| )?university$/i,
         /^-?-?per(-|_| )?uni$/i,
         /^-?-?universities$/i, # === studium --universities
         /^-?-?show(_|-)?ects(_|-)?passed(_|-)?per(_|-)?university$/i
      show_ects_passed_per_university
      exit
    # ===================================================================== #
    # === studium --average-grade
    # ===================================================================== #
    when /^-?-?average(-|_| )?grade$/i
      do_show_the_average_grade_of_all_passed_exams
    # ===================================================================== #
    # === studium --update-max-ever
    #
    # This entry point can be used to update various things, but most
    # importantly, updating the "max-ever query".
    # ===================================================================== #
    when /^-?-?update(-|_| )?max(-|_| )?ever$/i,
         /^-?-?update$/i,
         /^-?-?update(-|_| )?statistics$/i,
         /^-?-?record$/i,
         /^-?-?save$/i,
         /^-?-?update(-|_| )?examstats$/i         # === studium --update-examstats
      verbose_update_max_ever
      exit
    # ===================================================================== #
    # === studium --max-per-topic?
    #
    # This entry point will show how many questions were answered
    # per given topic in a "maximum" manner, e. g. how many
    # questions were answered ever, overall.
    # ===================================================================== #
    when /^-?-?max(_|-)?per(_|-)?topics?\??$/i,
         /^-?-?max(_|-)?exams(_|-)?answered(_|-)?per(_|-)?topic\??$/i,
         /^-?-?max(_|-)?each$/i,
         /^-?-?max(_|-)?ever(_|-)?per(_|-)?topic$/i,
         /^-?-?max(_|-)?per(_|-)?question$/i # === studium --max-per-question
      show_max_exam_questions_answered_per_topic
    # ===================================================================== #
    # === studium --last-questions
    # ===================================================================== #
    when /^-?-?last(_|-)?questions?$/i
      require 'studium/logging/store_last_question_asked_into_file.rb'
      _ = Studium::Log::StoreLastQuestionAskedIntoFile.new {
        :do_not_run_yet
      }.return_path_to_the_file_all_exam_questions_asked
      e File.read(_)
      e
      e "The file that was used was: #{sfile(_)}"
      e
    # ===================================================================== #
    # === studium --examstats
    # ===================================================================== #
    when /-?-?exam(_|-)?stats$/,
         /-?-?exam(_|-)?statistics/,
         /^-?-?statistics\??$/i,
         /^-?-?statistik\??$/i,
         /^-?-?stats$/i
      require 'studium/statistics/show_exam_statistics.rb'
      Studium.show_exam_statistics
      if Studium.is_on_roebe?
        Studium::Exams.report_how_many_exam_questions_were_already_solved
      end
      exit
    # ===================================================================== #
    # === studium --generate-pdf-for=amg1
    # === studium --pdf-for=pharma
    # === studium --make-pdf-for=syszoo
    # ===================================================================== #
    when /^-?-?generate(-|_| )?pdf(-|_| )?for=(.+)$/i, # for $3
         /^-?-?make(-|_| )?pdf(-|_| )?for=(.+)$/i,     # for $3
         /^-?-?pdf(-|_| )?for-?=(.+)$/i,               # for $2
         /^-?-?pdf=(.+)$/i                             # for $1
      this_topic = $1.to_s.dup if $1
      this_topic = $2.to_s.dup if $2
      this_topic = $3.to_s.dup if $3
      ::Studium.create_pdf_file_for_this_exam_topic(this_topic)
    # ===================================================================== #
    # === studium --sinatra
    #
    # This entry point starts the sinatra-part of the Studium project.
    # ===================================================================== #
    when /^-?-?sinatra$/
      start_the_sinatra_interface
      exit
    # ===================================================================== #
    # === Show all courses that belong to a particular curriculum ID
    #
    # This entry point allows us to show all courses that belong to
    # a specific curriculum ID.
    #
    # Usage examples:
    #
    #   studium --all-courses-that-belong-to=255
    #   studium --all-courses-that-belong-to=033255
    #
    # ===================================================================== #
    when /^-?-?all(-|_| )?courses(-|_| )?that(-|_| )?belong(-|_| )?to=(.+)$/i
      curriculum_id = $5.to_s.dup
      require 'studium/curricula/show_lectures_of_this_curriculum_id/show_lectures_of_this_curriculum_id.rb'
      Studium::ShowLecturesOfThisCurriculumId.new(curriculum_id)
    # ===================================================================== #
    # === studium --show-mixed-courses
    #
    # This entry point allows the user to see only courses that are
    # part of a Bachelor as well as a Master curriculum.
    #
    # Usage example:
    #
    #   studium --show-mixed-courses
    #
    # ===================================================================== #
    when /^-?-?show(_|-)?mixed(_|-)?courses$/i
      require 'studium/utility_scripts/show_mixed_bachelor_master_courses/show_mixed_bachelor_master_courses.rb'
      Studium::ShowMixedBachelorMasterCourses.new
    # ===================================================================== #
    # === studium --available-themes
    #
    # This entry point can be used by the user to show which themes
    # are available (aka registered). For instance, it answers the
    # question such as "which courses contain the theme genetics?".
    #
    # Usage example:
    #
    #   studium --available-themes
    #
    # ===================================================================== #
    when /^-?-?available(_|-)?themes$/i,
         /^-?-?available(_|-)?topics$/i
      show_the_available_themes
    # ===================================================================== #
    # === studium --generate-spreadsheet-for=indi3
    #
    # Another example:
    #
    #   studium --xls-for=indi3
    #   xls3
    #
    # ===================================================================== #
    when /^-?-?generate(_|-)?spreadsheet(_|-)?for=(.+)$/i, # === $3
         /^-?-?xls(_|-)?for=(.+)$/i                        # === $2
      require 'studium/utility_scripts/generate_spreadsheet/generate_spreadsheet.rb'
      _ = $2.to_s.dup
      _ = $3.to_s.dup if $3
      Studium::GenerateSpreadsheet.new(_)
    # ===================================================================== #
    # === studium --passed-exams?
    # ===================================================================== #
    when /^-?-?passed(-|_| )?exams\??$/i,
         /^-?-?all(-|_| )?passed(-|_| )?exams\??$/i,
         /^-?-?return(-|_| )?passed(-|_| )?exams\??$/i,
         /^-?-?total(-|_| )?ECTS\??$/i
      show_passed_exams
    # ===================================================================== #
    # === studium --current-studyset?
    # ===================================================================== #
    when /^-?-?current(-|_| )?studyset\??$/i
      show_the_current_studyset
    # ===================================================================== #
    # === studium --create-database
    #
    # Create a new SQL database.
    # ===================================================================== #
    when /^-?-?create(_|-)?database$/i,
         /^-?-?database$/i,
         /^-?-?sql$/i
      Dir.chdir(Studium.log_directory?) if File.directory?(Studium.log_directory?)
      require 'studium/utility_scripts/create_database/create_database.rb'
      Studium::CreateDatabase.new
      # =================================================================== #
      # And then read it in:
      # =================================================================== #
      if File.exist? 'INSERT_INTO_STATEMENTS.sql'
        File.delete('exam_questions.db') if File.exist? 'exam_questions.db'
        esystem 'sqlite3 exam_questions.db < INSERT_INTO_STATEMENTS.sql'
      else
        e 'No file exists called '+sfile(INSERT_INTO_STATEMENTS.sql)+'.'
      end
    # ===================================================================== #
    # === studium --log-dir?
    # ===================================================================== #
    when /(_|-)?(_|-)?log(_|-)?dir\??/i
      e
      e "  #{sfile(Studium.log_directory?)}"
      e
    # ===================================================================== #
    # === studium --libui
    # ===================================================================== #
    when /-?-?libui$/i
      require 'studium/gui/libui/ask_exam_question/ask_exam_question.rb'
      Studium::GUI::Libui::AskExamQuestion.new
      exit
    # ===================================================================== #
    # === studium --gtk3
    # ===================================================================== #
    when /-?-?gtk3?$/i,
         /-?-?gui$/i
      require 'studium/gui/gtk3/exam_question_widget/exam_question_widget.rb'
      Studium::GUI::Gtk::ExamQuestionWidget.run(ARGV)
      exit
    # ===================================================================== #
    # === studium --create-executable
    # ===================================================================== #
    when /-?-?create(_|-)?executable$/i,
         /-?-?executable$/i
      create_an_executable_on_windows
      exit
    # ===================================================================== #
    # === studium --open-statistics
    #
    # This entry point allows the user to open the statistics file. It
    # is mostly catered to my use case, though - thus of limited use
    # to other users of this gem.
    # ===================================================================== #
    when /^-?-?open(-|_| )?the(-|_| )?statistics$/,
         /^-?-?open(-|_| )?the(-|_| )?statistics(-|_| )?file$/,
         /^-?-?open(-|_| )?statistics$/,
         /^-?-?open(-|_| )?stats$/
      open_the_statistics_file
      exit
    # ===================================================================== #
    # === studium --n-entries-in-the-file-lecture-information
    # === studium --n-lectures
    # ===================================================================== #
    when /^-?-?n(_|-)?entries(_|-)?in(_|-)?the(_|-)?file(_|-)?lecture(_|-)?information\??$/i,
         /^-?-?n(_|-)?entries\??$/i,
         /^-?-?n(_|-)?lectures\??$/i,
         /^-?-?n(_|-)?lectures(_|-)?registered$/i,
         /^-?-?n(_|-)?registered(_|-)?lectures$/i,
         /^-?-?n(_|-)?registered$/i,
         /^-?-?n(_|-)?courses$/i
      Studium.report_n_entries_in_the_file_lecture_information
    # ===================================================================== #
    # === studium --update-max-questions
    #
    # This will also update the max questions ever.
    # ===================================================================== #
    when /^-?-?update(-|_| )?max(-|_| )?questions$/
      require 'studium/statistics/report_how_many_exam_questions_were_answered.rb'
      Studium::Statistics::ReportHowManyExamQuestionsWereAnswered.new
      exit
    # ===================================================================== #
    # === studium --solved-topics?
    # ===================================================================== #
    when /^-?-?solved(_|-)?topics\??$/
      require 'studium/toplevel_methods/toplevel_methods.rb'
      e 'The solved exam-topics are as follows:'
      e
      ::Studium.available_topics_as_short_names.each {|this_topic|
        case ::Studium.return_n_percent_solved_from_this_topic(this_topic)
        when 100.0
          puts 'The topic '+this_topic+' has been solved.'
        end
      }
      e
      exit
    # ===================================================================== #
    # === studium --solved
    # ===================================================================== #
    when /^-?-?solved$/
      require_class_exams_solved.rb
      _ = Studium::Exams::Solved.new(ARGV, :dont_run_yet)
      _.set_commandline
      _.run
    # ===================================================================== #
    # === studium --nsolved
    # ===================================================================== #
    when /^-?-?nsolved$/
      report_how_many_exam_questions_were_already_solved
    # ===================================================================== #
    # === studium "--solved? 300143"
    # === studium "--already_solved_this_id 300143"
    # ===================================================================== #
    when /-?-?solved\?? (\d+)/,
         /-?-?already(_|-)?solved(_|-)?this(_|-)?id (\d+)/
      the_lva_number = $1.to_s.dup
      the_lva_number = $4.to_s.dup if $4
      yes_or_no = Studium.yes_or_no(
        Studium.already_solved_this_lva_number?(the_lva_number).to_s
      )
      e 'Did we solve this lecture (ID: '+simp(the_lva_number)+') yet? '+
        sfancy(yes_or_no)
    # ===================================================================== #
    # === studium --mandatory
    # ===================================================================== #
    when /^-?-?mandatory$/i
      show_upcoming_mandatory_presence_courses
      exit
    # ===================================================================== #
    # === studium --create_a_clean_lecture_information_file
    # ===================================================================== #
    when /^-?-?create(-|_| )?a(-|_| )?clean(-|_| )?lecture(-|_| )?information(-|_| )?file$/i
      Studium.create_a_clean_lecture_information_file
      exit
    # ===================================================================== #
    # === studium --upload-exam-questions
    # ===================================================================== #
    when /-?-?upload(_|-)?exam(_|-)?questions/,
         /-?-?upload(_|-)?exams/,
         /-?-?uexams/
      Studium.upload_exam_questions { :be_verbose }
    # ===================================================================== #
    # === studium --compare
    # ===================================================================== #
    when /^-?-?compare$/
      curriculum_comparer
    # ===================================================================== #
    # === studium --download-exam-dataset
    # ===================================================================== #
    when /^-?-?download(_|-)?exam(_|-)?dataset$/i,
         /^-?-?download(_|-)?dataset$/i
      ::Studium.download_exam_dataset
    # ===================================================================== #
    # === studium --use-this-colour-for-exam-answers=slateblue
    # ===================================================================== #
    when /^-?-?use(-|_| )?this(-|_| )?colour(-|_| )?for(-|_| )?exam(-|_| )?answers=(.+)/i,
         /^-?-?use(-|_| )?this(-|_| )?colour(-|_| )?for(-|_| )?answers=(.+)/i,
         /^-?-?colour(-|_| )?for(-|_| )?answers=(.+)/i
      _ = $3
      _ = $5 if $5
      _ = $6 if $6
      ::Studium::Colours.use_this_colour_for_exam_answers(_.to_s.dup)
    # ===================================================================== #
    # === studium --lectures-on-this-day=05.05.2018
    # ===================================================================== #
    when /^-?-?lectures(_|-)?on(_|-)?this(_|-)?day(_|-)?=(.+)$/,
         /^(\d{2}.\d{2}.\d{4})$/
      require 'studium/curricula/determine_curricula/determine_curricula.rb'
      first_match_to_the_regex = $1.to_s.dup
      i = $5.to_s.dup
      if first_match_to_the_regex =~ /^\d+/
        i = first_match_to_the_regex
      end
      Studium.show_lectures_on_this_day(i)
    # ===================================================================== #
    # === set_directory_to_the_exam_topics
    #
    # Usage example:
    #
    #   studium --set-directory-to-the-exam-topics=/Depot/j/EXAM_TOPICS/
    #
    # ===================================================================== #
    when /set(_|-)?directory(_|-)?to(_|-)?the(_|-)?exam(_|-)?topics=(.+)/
      match = $6.to_s.dup
      verbose_set_this_dir_to_exam_topics(match)
    # ===================================================================== #
    # === set_dir
    # ===================================================================== #
    when /set(_|-)?dir=(.+)/
      match = $2.to_s.dup
      verbose_set_this_dir_to_exam_topics(match)
    # ===================================================================== #
    # === studium --lectures_without_exam_entry
    # ===================================================================== #
    when /^-?-?lectures(_|-)?without(_|-)?exam(_|-)?entry$/i
      lectures_without_exam_entry
    # ===================================================================== #
    # === studium --use-this-colour-for-exam-questions=slateblue
    # ===================================================================== #
    when /^-?-?use(-|_| )?this(-|_| )?colour(-|_| )?for(-|_| )?exam(-|_| )?questions=(.+)/i,
         /^-?-?use(-|_| )?this(-|_| )?colour(-|_| )?for(-|_| )?questions=(.+)/i,
         /^-?-?colour(-|_| )?for(-|_| )?questions=(.+)/i
      _ = $3
      _ = $5 if $5
      _ = $6 if $6
      ::Studium::Colours.use_this_colour_for_exam_questions(_.to_s.dup)
    # ===================================================================== #
    # === studium --merge
    # ===================================================================== #
    when /^-?-?merge$/i
      copy_lecture_information_file_to_default_location
    # ===================================================================== #
    # === studium --open-upcoming-exams
    # ===================================================================== #
    when /^-?-?open(-|_| )?upcoming(-|_| )?exams$/i,
         /^-?-?open(-|_| )?important$/i
      open_relevant_files
    # ===================================================================== #
    # === studium --open-important-exams
    # ===================================================================== #
    when /^-?-?open(-|_| )?important(-|_| )?exams$/i,
         /^-?-?important(-|_| )?exams$/i,
         /^-?-?important$/i,
         /^-?-?priorities$/i,
         /^-?-?priority$/i,
         /^-?-?open(-|_| )?important(-|_| )?lectures$/i # === studium --open-important-lectures
      verbose_open_important_exams
    # ===================================================================== #
    # === studium --create-an-archive-of-the-exam-questions
    # ===================================================================== #
    when /^-?-?create(-|_| )?an(-|_| )?archive(-|_| )?of(-|_| )?the(-|_| )?exam(-|_| )?questions$/i,
         /^-?-?create(-|_| )?exam(-|_| )?topics(-|_| )?archive$/i
      create_an_archive_of_the_exam_questions
    # ===================================================================== #
    # === studium --upcoming-important-exams
    # ===================================================================== #
    when /-?-?upcoming(-|_| )?important(-|_| )?exams/,
         /-?-?upcoming(-|_| )?exams/
      upcoming_important_exams
    # ===================================================================== #
    # === studium --end
    # ===================================================================== #
    when /^-?-?end$/i,
         /^-?-?end(-|_| )?difference$/i
      report_the_difference_to_the_start_time
    # ===================================================================== #
    # === studium --upload_pdf
    # ===================================================================== #
    when /^-?-?upload(-|_| )?pdf$/i
      upload_pdf
    # ===================================================================== #
    # === studium --vim
    # ===================================================================== #
    when /^-?-?vim$/i
      permanently_set_this_editor(:vim)
    # ===================================================================== #
    # === studium --help
    #
    # Displaying help to the user must be a fast operation, so it is
    # stored in the file here.
    # ===================================================================== #
    when /help$/i,
         /-h$/i
      show_help
    # ===================================================================== #
    # === studium --show-lva-dates-of-this-lecture="Primatologie"
    # ===================================================================== #
    when /^-?-?show(_|-)?lva(_|-)?dates(_|-)?of(_|-)?this(_|-)?lecture=(.+)/i
      this_theme = $6.to_s.dup.delete('"')
      show_lva_dates_of_this_lecture(this_theme)
    # ===================================================================== #
    # === studium --colours?
    # ===================================================================== #
    when /-?-?colours\??/
      e ::Colours.rev+
        'Does the Studium project use colours, right now? '+
        sfancy(Studium.yes_or_no(Studium.use_colours?.to_s))
    # ===================================================================== #
    # === studium --add-a-new-question
    # ===================================================================== #
    when /^-?-?add(-|_| )?a(-|_| )?new(-|_| )?question$/i
      add_new_exam_question
    # ===================================================================== #
    # === studium set-delay=5
    # ===================================================================== #
    when /set(_|-)?delay=(.+)/ # studium set-delay=2.6
      ::Studium.save_this_delay_between_questions_and_answers($2.to_s.dup)
    # ===================================================================== #
    # === studium set_log_dir=/Depot/j/
    # ===================================================================== #
    when /-?-?set(_|-)?log(_|-)?dir=(.+)/
      match = $3.to_s.dup
      verbose_set_this_new_log_dir(match)
    # ===================================================================== #
    # === studium --last-question?
    # ===================================================================== #
    when /^-?-?last(_|-)?question\??$/i
      _ = Studium.file_last_question_asked?
      if File.exist? _
        e File.read(_)
      else
        no_file_exists_at(_)
      end
    # ===================================================================== #
    # === studium --expand-time-range="15.10. - 2.11.2018,"
    # === studium --expander="15.10. - 2.11.2018,"
    # === studium --expander="02.02.2020-02.05.2020"
    # ===================================================================== #
    when /^-?-?expand(-|_| )?time(-|_| )?range=(.+)$/,
         /^-?-?expander=(.+)$/
      _ = $1.to_s.dup
      _ = $3.to_s.dup if $3
      unless Studium.respond_to? :expand_time_range
        require 'studium/utility_scripts/expand_time_range/expand_time_range.rb'
      end
      Studium.expand_time_range(_)
    # ===================================================================== #
    # === studium --collage?
    # ===================================================================== #
    when /-?-?collage\??$/
      show_collage_of_current_exams
      exit
    # ===================================================================== #
    # === studium --master=vektorx
    # ===================================================================== #
    when /^-?-?master(=|-)(.+)$/
      require 'studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb'
      this_curriculum = "master-#{$2.to_s.dup}"
      Studium::ShowLecturesOnTheCommandline.new(this_curriculum)
    # ===================================================================== #
    # === studium --lectures-from-this-curriculum=geodäsie
    # ===================================================================== #
    when /^-?-?lectures(-|_| )?from(-|_| )?this(-|_| )?curriculum=(.+)$/i
      require 'studium/curricula/show_lectures_of_this_curriculum_id/show_lectures_of_this_curriculum_id.rb'
      Studium::ShowLecturesOfThisCurriculumId.new($4.to_s.dup)
    # ===================================================================== #
    # === studium --pristine
    # ===================================================================== #
    when /^-?-?pristine$/,
         /^-?-?new(_|-)?lecture(_|-)?information$/
      pristine
    # ===================================================================== #
    # === studium --passed-exams=chemistry
    # ===================================================================== #
    when /^-?-?passed(_|-)?exams=(.+)/i,
         /^-?-?report(_|-)?passed(_|-)?exams(_|-)?fitting(_|-)?to(_|-)?this(_|-)?theme=(.+)/i
      this_theme = $2.to_s.dup
      this_theme = $7.to_s.dup if $7
      report_passed_exams_fitting_to_this_theme(this_theme)
    # ===================================================================== #
    # === studium --outdated
    # ===================================================================== #
    when /^-?-?outdated$/
      show_outdated_lva_dates
    # ===================================================================== #
    # === studium --upload-archive-of-the-exam-questions
    # ===================================================================== #
    when /^-?-?upload(-|_| )?archive(-|_| )?of(-|_| )?the(-|_| )?exam(-|_| )?questions$/,
         /^-?-?upload(-|_| )?exam(-|_| )?archive$/,
         /^-?-?upload(-|_| )?exam(-|_| )?topics$/
      upload_archive_of_the_exam_questions
    # ===================================================================== #
    # === studium --encoding=utf
    # === studium --encoding=iso1
    # ===================================================================== #
    when /^-?-?encoding=(.+)$/i
      Studium.use_this_new_encoding($1.to_s.dup)
      exit
    # ===================================================================== #
    # === studium --use-this-curriculum=foo.md
    # ===================================================================== #
    when /^-?-?use(_|-)?this(_|-)?curriculum=(.+)$/i
      require 'studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb'
      _ = $3.to_s.dup
      if File.exist? _
        object = Studium::ShowLecturesOnTheCommandline.new { :do_not_run_yet }
        dataset = File.readlines(_).reject {|line|
          line.start_with?('#') or line.strip.empty?
        }.map {|entry|
          if entry.include?('#')
            entry = entry[0 .. (entry.index('#')-1)]
          end
          entry.strip.squeeze(' ')
        }
        object.clear_old_dataset
        object.add_to_the_dataset_without_any_further_checks(dataset)
        object.sanitize_the_dataset
        object.uniq_the_dataset
        object.is_not_an_individual_curriculum
        object.do_all_actions_after_the_main_dataset_was_read_in
      else
        e 'No file exists at '+sfile(_)+'.'
      end
    # ===================================================================== #
    # === studium important_exams.yml
    # ===================================================================== #
    when /important(_|-)?exams\.?yml$/
      target = ruby_src_dir_at_home?+'studium/lib/studium/yaml/important_exams.yml'
      e sfile(target)
      open_in_editor(target)
    # ===================================================================== #
    # === studium --version?
    # ===================================================================== #
    when /^-?-?version\??$/i
      require 'studium/version/version.rb'
      e sfancy(
          Studium.return_version_and_last_update
        )
    # ===================================================================== #
    # === studium --open-top
    # ===================================================================== #
    when /^-?-?open(-|_| )?top$/i,
         /^-?-?open(-|_| )?last$/i
      require 'studium/exams/show_backlog_of_exams.rb'
      Studium::ShowBacklogOfExams.open_the_main_file
    # ===================================================================== #
    # === studium --show-english-lectures
    # === studium --show-german-lectures
    # ===================================================================== #
    when /^-?-?show(_|-)?(english)(_|-)?lectures$/,
         /^-?-?show(_|-)?(german)(_|-)?lectures$/
      require 'studium/utility_scripts/show_lectures_fitting_to_this_language.rb'
      seek_lectures_for_this_language = $2.to_s.dup
      ShowLecturesFittingToThisLanguage.new(seek_lectures_for_this_language)
    # ===================================================================== #
    # === studium --files?
    # === studium --show-important-files
    # ===================================================================== #
    when /^-?-?files\??$/i,
         /^-?-?show(_|-)?important(_|-)?files\??$/i
      require 'studium/toplevel_methods/show_important_files.rb'
      ::Studium.show_important_files
    # ===================================================================== #
    # === studium --exam_topics?
    # ===================================================================== #
    when /-?-?exam(_|-)?topics\??/
      show_where_the_exam_topics_can_be_found
    # ===================================================================== #
    # === studium --statistics?
    # ===================================================================== #
    when /^-?-?statistics\??$/i,
         /^-?-?stats\??$/i
      require 'studium/curricula/determine_curricula/determine_curricula.rb'
      Studium.determine_curricula
    # ===================================================================== #
    # === studium --n-topics-available?
    # ===================================================================== #
    when /^-?-?n(_|-)?topics(_|-)?available\??/,
         /^-?-?n-?topics\??/
      show_how_many_exam_topics_are_available
    # ===================================================================== #
    # === studium --topics?
    # ===================================================================== #
    when /^-?-?topics\??$/i
      show_available_topics
    # ===================================================================== #
    # === studium --path-to-file-lecture-information
    # ===================================================================== #
    when /^-?-?path(-|_| )?to(-|_| )?file(-|_| )?lecture(-|_| )?information$/i
      show_path_to_the_file_lecture_information
    # ===================================================================== #
    # === studium --open-timetable
    # ===================================================================== #
    when /-?-?open(-|_| )?timetable$/i
      open_timetable
      exit
    # ===================================================================== #
    # === studium --upcoming_exams_at_the_boku
    # ===================================================================== #
    when /upcoming_?exams_?at_?the_?boku/
      show_upcoming_exams_at_the_boku
    # ===================================================================== #
    # === studium --show_collage_of_current_exams
    # ===================================================================== #
    when /^-?-?show(_|-)?collage(_|-)?of(_|-)?current(_|-)?exams$/i
      show_collage_of_current_exams
    # ===================================================================== #
    # === studium --open
    # ===================================================================== #
    when /^-?-?open$/i
      open_useful_files_via_the_default_editor
      exit
    # ===================================================================== #
    # === studium --base-dir?
    # ===================================================================== #
    when /^-?-?base(_|-)?dir\??/,
         /^-?-?dir\??$/
      show_the_base_dir
    # ===================================================================== #
    # === studium --ects-bachelor-master
    # ===================================================================== #
    when /^-?-?ects(_|-)?bachelor(_|-)?master$/,
         /^-?-?bachelor(_|-)?master$/,
         /^-?-?bm$/ # studium --bm
      show_passed_ects_in_the_individual_bachelor_and_master_curricula
    # ===================================================================== #
    # === studium --check-the-lecture-information-file
    # ===================================================================== #
    when /-?-?check(-|_| )?the(-|_| )?lecture(-|_| )?information(-|_| )?file$/,
         /-?-?check(-|_| )?file(-|_| )?information$/
      check_the_lecture_information_file
    # ===================================================================== #
    # === studium --exams-at-the-meduni
    # ===================================================================== #
    when /(-|_| )?(-|_| )?exams(-|_| )?at(-|_| )?the(-|_| )?(.+)$/
      this_university = $6.to_s.dup.downcase
      show_all_exams_at_this_university(this_university)
    # ===================================================================== #
    # === studium --best-month
    # ===================================================================== #
    when /^-?-?best-month$/,
         /^-?-?best(_|-)?month(_|-)?stats$/,
         /^-?-?show(_|-)?best(_|-)?months?$/,
         /^-?-?best(_|-)?months?$/
      show_best_month
      exit
    # ===================================================================== #
    # === studium --max?
    # ===================================================================== #
    when /-?-?max\??$/,
         /-?-?show(_|-)?how(_|-)?many(_|-)?exams(_|-)?were(_|-)?passed$/,
         /^-?-?top$/i # ← This should always be on top of this file here.
      show_how_many_exams_were_passed
      exit
    # ===================================================================== #
    # === studium --n-ects-from-this-file=ECTS.md
    # ===================================================================== #
    when /^-?-?n(-|_| )?ects(-|_| )?from(-|_| )?this(-|_| )?file=(.+)$/i, # === $5
         /^-?-?ects(-|_| )?from=(.+)$/i # === $2
      _ = $2.to_s.dup if $2
      _ = $5.to_s.dup if $5
      show_n_ects_from_this_file(_)
    # ===================================================================== #
    # === studium --audio-stats
    # ===================================================================== #
    when /^-?-?audio/
      require 'studium/utility_scripts/audio_stats.rb'
      Studium.audio_stats?
    # ===================================================================== #
    # === studium --backlog-of-exams
    # ===================================================================== #
    when /^-?-?backlog(-|_| )?of(-|_| )?exams$/i
      show_backlog_of_exams
    # ===================================================================== #
    # === studium --bachelor_curricula
    # ===================================================================== #
    when /^-?-?bachelor(-|_| )?curricula$/i,
         /^-?-?bachelor$/i
      show_passed_lectures_in_a_bachelor_curriculum
      exit
    # ===================================================================== #
    # === studium --disable-colours
    # ===================================================================== #
    when /^-?-?disable(_|-)?colours$/i,
         /^-?-?permanently(_|-)?disable(_|-)?colours$/i
      permanently_disable_colours
    # ===================================================================== #
    # === studium --passed-ects-per-year
    # ===================================================================== #
    when /^-?-?passed(-|_| )?ects(-|_| )?per(-|_| )?year$/i
      show_passed_ects_per_year
    # ===================================================================== #
    # === studium --inskriptionsfrist
    # ===================================================================== #
    when /^-?-?inskriptionsfrist$/i
      do_show_the_inscription_dates_at_the_different_universities
    # ===================================================================== #
    # === studium --master_curricula
    # ===================================================================== #
    when /^-?-?master(-|_| )?curricula$/i,
         /^-?-?master$/i
      show_passed_lectures_in_a_master_curriculum
      exit
    # ===================================================================== #
    # === studium --timetable
    # ===================================================================== #
    when /^-?-?timetable$/
      show_timetable
      exit
    # ===================================================================== #
    # === studium --set-editor=vim
    # ===================================================================== #
    when /^-?-?set(-|_| )?editor=(.+)$/i
      permanently_set_this_editor($2.to_s.dup)
    # ===================================================================== #
    # === studium --start
    # ===================================================================== #
    when /^-?-?start$/i
      note_down_the_start_time_and_how_many_exams_have_been_already_solved
    # ===================================================================== #
    # === studium --curricula
    # === studium --show-curricula
    # ===================================================================== #
    when /^-?-?curricula$/i,
         /^-?-?show(-|_| )?curricula$/i
      show_curricula
    # ===================================================================== #
    # === studium --bachelor=vektorx
    # ===================================================================== #
    when /^-?-?bachelor(=|-)(.+)$/
      require 'studium/utility_scripts/show_lectures_on_the_commandline/show_lectures_on_the_commandline.rb'
      this_curriculum = "bachelor-#{$2.to_s.dup}"
      Studium::ShowLecturesOnTheCommandline.new(this_curriculum)
    # ===================================================================== #
    # === studium --questions-per-year
    # ===================================================================== #
    when /^-?-?questions(_|-)?per(_|-)?year$/
      show_questions_per_year
    # ===================================================================== #
    # === studium --passed-ects
    # ===================================================================== #
    when /^-?-?passed(_|-)?ects\??$/i,
         /^-?-?overview$/i,
         /^-?-?performance$/i # studium --performance
      show_passed_credits_per_curriculum
    # ===================================================================== #
    # === studium --yearly-average-grades
    # ===================================================================== #
    when /^-?-?yearly(_|-)?average(_|-)?grades$/,
         /^-?-?grades$/i
      show_yearly_average_grades
      exit
    # ===================================================================== #
    # === studium --editor?
    # ===================================================================== #
    when /^-?-?editor\??$/i
      e sfancy(Studium.editor?) 
    # ===================================================================== #
    # === studium --delay?
    # ===================================================================== #
    when /^-?-?delay\?/ # Query the delay in use.
      require 'studium/toplevel_methods/read_delay_between_questions_from_file.rb'
      e rev+
        'The delay is '+lightgreen(
          Studium::Exams.read_delay_from_file.to_s
        )+
        ' seconds between individual question-answer sessions.'
    else # else tag
      # =================================================================== #
      # === Handle Pseudo-Regexes                               (regex tag)
      #
      # Handle pseudo-regexes next. These are strings that start
      # and end with a '/' character.
      # =================================================================== #
      if i.start_with?('/') and i.end_with?('/')
        e "A pseudo-regex was discovered (#{sfancy(i)}). We "\
          "will next query for any"
        e 'exam matching to that regex.'
        e
        use_this_regexp = Regexp.new(i.delete('/'), Regexp::IGNORECASE) # <- is case-insensitive.
        Studium.try_to_report_exams_that_match_to_this_regexp(use_this_regexp) { :also_show_the_grade }
      # =================================================================== #
      # === Handle lecture types
      #
      # This entry point will handle input such as the following:
      #
      #   studium --VO
      #   studium VO+SE
      #
      # =================================================================== #
      elsif ARRAY_LECTURE_TYPES_THAT_ARE_MANDATORY_CONTINUOUS_ASSESSMENT.include?(i.delete('-')) or
            (i.delete('-') == 'VO')
        Studium.report_all_lectures_matching_this_lecture_type(i.delete('-'))
      # =================================================================== #
      # === Handle --flags next
      # =================================================================== #
      elsif i.include?('--')
        e "#{rev}Unrecognized commandline instruction: "+
          steelblue(i)
      end
    end
  end
end

#note_down_the_start_time_and_how_many_exams_have_been_already_solvedObject

#

note_down_the_start_time_and_how_many_exams_have_been_already_solved

#


1776
1777
1778
1779
# File 'lib/studium/commandline/commandline.rb', line 1776

def note_down_the_start_time_and_how_many_exams_have_been_already_solved
  require 'studium/toplevel_methods/note_down_the_start_time_and_how_many_exams_have_been_already_solved.rb'
  Studium.note_down_the_start_time_and_how_many_exams_have_been_already_solved
end

#open_relevant_filesObject

#

open_relevant_files

#


1255
1256
1257
# File 'lib/studium/commandline/commandline.rb', line 1255

def open_relevant_files
  Studium::Exams::UpcomingImportantExams.open_relevant_files
end

#open_the_statistics_fileObject

#

open_the_statistics_file

#


1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
# File 'lib/studium/commandline/commandline.rb', line 1358

def open_the_statistics_file
  e
  cmd = "bluefish #{Studium.file_statistics} &"
  if Studium.is_on_roebe?
    cmd = "bluefish $RUBY_SRC/studium/lib/studium/yaml/statistics.yml &"
  end
  e cmd
  e
  system cmd
end

#open_timetableObject

#

open_timetable

To invoke this method, do:

studium --open-timetable
#


1629
1630
1631
1632
# File 'lib/studium/commandline/commandline.rb', line 1629

def open_timetable
  _ = FILE_EXAMS_AT_NON_BOKU_UNIVERSITIES
  Open.in_editor(_) if File.exist? _
end

#open_useful_files_via_the_default_editorObject

#

open_useful_files_via_the_default_editor

Invoke this method like so:

studium --open
#


1671
1672
1673
1674
# File 'lib/studium/commandline/commandline.rb', line 1671

def open_useful_files_via_the_default_editor
  require 'studium/exams/exams_per_month/open.rb'
  Studium::ExamsPerMonth.open_main_files_in_the_editor
end

#parse_commandline_arguments_as_a_full_stringObject

#

parse_commandline_arguments_as_a_full_string

This method will act on the whole ARGV, as a String rather than an Array.

#


1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
# File 'lib/studium/commandline/commandline.rb', line 1428

def parse_commandline_arguments_as_a_full_string
  _ = return_commandline_arguments_as_string
  case _
  # ======================================================================= #
  # === studium lastexams 10
  # ======================================================================= #
  when /-?-?last-?exams (\d+)/
    _ = $1.to_s.dup.to_i
    require 'studium/exams/last_exams/last_exams.rb'
    Studium.show_n_last_exams(_) # Show the last n exams that were passed.
    exit
  end
end

#permanently_disable_coloursObject

#

permanently_disable_colours

To invoke this method, try:

studium --permanently-disable-colours
#


1538
1539
1540
1541
1542
1543
1544
1545
1546
# File 'lib/studium/commandline/commandline.rb', line 1538

def permanently_disable_colours
  opne 'The colours in the Studium namespace will be '\
       'permanently disabled.'
  into = "#{Studium.yaml_directory?}use_colours.yml"
  if File.exist? into
    opne "Storing into the file #{sfile(into)} next."
    write_what_into(YAML.dump(false), into)
  end
end

#permanently_set_this_editor(i = :vim) ⇒ Object

#

permanently_set_this_editor

#


1279
1280
1281
# File 'lib/studium/commandline/commandline.rb', line 1279

def permanently_set_this_editor(i = :vim)
  Studium.permanently_set_this_editor(i)
end

#pristineObject

#

pristine

#


1185
1186
1187
# File 'lib/studium/commandline/commandline.rb', line 1185

def pristine
  Studium.pristine
end

#report_how_many_exam_questions_were_already_solvedObject

#

report_how_many_exam_questions_were_already_solved

#


1240
1241
1242
1243
# File 'lib/studium/commandline/commandline.rb', line 1240

def report_how_many_exam_questions_were_already_solved
  require 'studium/toplevel_methods/toplevel_methods.rb'
  Studium::Exams.report_how_many_exam_questions_were_already_solved
end

#report_passed_exams_fitting_to_this_theme(this_theme) ⇒ Object

#

report_passed_exams_fitting_to_this_theme

#


1192
1193
1194
1195
# File 'lib/studium/commandline/commandline.rb', line 1192

def report_passed_exams_fitting_to_this_theme(this_theme)
  require 'studium/exams/show_themes/misc.rb'
  Studium.report_passed_exams_fitting_to_this_theme(this_theme)
end

#report_the_difference_to_the_start_timeObject

#

report_the_difference_to_the_start_time

#


1295
1296
1297
# File 'lib/studium/commandline/commandline.rb', line 1295

def report_the_difference_to_the_start_time
  Studium.report_the_difference_to_the_start_time
end

#resetObject

#

reset (reset tag)

#


59
60
61
62
63
# File 'lib/studium/commandline/commandline.rb', line 59

def reset
  super()
  infer_the_namespace
  try_to_require_the_open_gem
end

#runObject

#

run (run tag)

#


1813
1814
1815
# File 'lib/studium/commandline/commandline.rb', line 1813

def run
  menu
end

#show_all_exams_at_this_university(this_university) ⇒ Object

#

show_all_exams_at_this_university

To invoke this method, try:

studium --exams-at-the-meduni
#


1700
1701
1702
1703
# File 'lib/studium/commandline/commandline.rb', line 1700

def show_all_exams_at_this_university(this_university)
  require 'studium/utility_scripts/finished_exams_at_this_university.rb'
  Studium::FinishedExamsAtThisUniversity.new(this_university)
end

#show_available_topicsObject

#

show_available_topics

Invocation example:

studium --topics?
#


1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
# File 'lib/studium/commandline/commandline.rb', line 1601

def show_available_topics
  require 'studium/toplevel_methods/toplevel_methods.rb'
  e
  Studium.available_topics?.sort.each_with_index {|entry, index| index += 1
    padded_index = ('  '+index.to_s+')').ljust(7)
    e royalblue(padded_index)+
      steelblue(entry)
  }
  e
end

#show_backlog_of_examsObject

#

show_backlog_of_exams

#


1738
1739
1740
1741
# File 'lib/studium/commandline/commandline.rb', line 1738

def show_backlog_of_exams
  require 'studium/exams/show_backlog_of_exams.rb'
  Studium::ShowBacklogOfExams.new
end

#show_best_month(i = 10) ⇒ Object

#

show_best_month

To invoke this, try:

studium --show-best-month
#


1713
1714
1715
1716
1717
1718
# File 'lib/studium/commandline/commandline.rb', line 1713

def show_best_month(i = 10)
  require 'studium/exams/exams_per_month/exams_per_month.rb'
  _ = Studium::ExamsPerMonth.new(:do_not_run_yet)
  _.sanitize_dataset
  _.show_best_months(i)
end

#show_collage_of_current_examsObject

#

show_collage_of_current_exams

Invoke this method via:

studium --collage?
#


1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
# File 'lib/studium/commandline/commandline.rb', line 1650

def show_collage_of_current_exams
  require 'studium/exams/cycle.rb'
  file = Studium::Exams::Cycle.main_file?
  array = YAML.load_file(file) 
  opne 'These entries are currently being tested by class'
  opne "#{slateblue('Studium::Exams::Cycle')}:"
  e
  array.each {|this_exam_topic|
    e "  #{sfancy(this_exam_topic)}"
  }
  e
end

#show_curricula(use_this_file = Studium.file_curricula) ⇒ Object

#

show_curricula

#


1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
# File 'lib/studium/commandline/commandline.rb', line 1445

def show_curricula(
    use_this_file = Studium.file_curricula
  )
  e
  e 'The available curricula are:'
  e
  YAML.load_file(use_this_file).each_pair {|id_of_the_curriculum, inner_array|
    name_of_the_curriculum = inner_array.first
    e '  '+
      orange(id_of_the_curriculum.ljust(8))+''+
      slateblue(name_of_the_curriculum)
  }
  e
end

#show_ects_passed_per_universityObject

#

show_ects_passed_per_university

#


1559
1560
1561
1562
# File 'lib/studium/commandline/commandline.rb', line 1559

def show_ects_passed_per_university
  require 'studium/ects/ects_per_university/ects_per_university.rb'
  Studium::EctsPerUniversity.new
end

#show_exam_statisticsObject

#

show_exam_statistics

This method will show some exam-statistics, if the file specified at FILE_STATISTICS can be found. If it is found, the content will be displayed, but we will also colourize a bit, to make the display easier to read.

To invoke this method, do:

studium --examstats
#


1350
1351
1352
1353
# File 'lib/studium/commandline/commandline.rb', line 1350

def show_exam_statistics
  require 'studium/statistics/show_exam_statistics.rb'
  Studium.show_exam_statistics
end

#show_helpObject

#

show_help (help tag)

We will first build up an Array, then sort it, then display it. That way we can just add to that Array without having to worry about whether it is sorted or not.

Invocation example:

studium --show-help
#


985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
# File 'lib/studium/commandline/commandline.rb', line 985

def show_help
  array = []
  array << '  --exam-topics?                                           # feedback '\
           'the location to the exam-topics in use'
  array << '  --log-dir?                                               # feedback '\
           'the log directory in use'
  array << '  --n-topics?                                              # feedback '\
           'how many topics are available'
  array << '  --show_how_many_exams_were_passed                        # feedback '\
           'how many exams were already passed'
  array << '  --set-directory-to-the-exam-topics=/Depot/j/EXAM_TOPICS/ # set a '\
           'specific directory target'
  array << '  --best-months                                            # show '\
           'the best month, that is, most ECTS points solved in any given month'
  array << '  --set-dir=/dir                                           # shorter '\
           'variant of the above; an alias'
  array << '  --lectures-from-this-curriculum=217                      # use '\
           'a specific curriculum number (as ID)'
  array << '  --set-editor=vim                                         # set '\
           'to use the editor called vim (or any other one of your choice)'
  array << '  --show-curricula                                         # show '\
           'all registered curricula'
  array << '  --master-curricula                                       # show '\
           'all lectures passed in a given master curriculum'
  array << '  --upload-exam-questions                                  # uploads '\
           'the exam questions'
  array << '  --expand="15.10-22.10.2018"                              # expand '\
           'the time range for this range'
  array << '  --encoding=utf                                           # use '\
           'this encoding for the Studium namespace'
  array << '  --outdated                                               # show '\
           'outdated lva- and exam-dates of registered lectures'
  array << '  --show-mixed-courses                                     # show '\
           'only courses that are part of a Bachelor as well as '\
           'a Master curriculum'
  array << '  --collage?                                               # show '\
           'which exams we are currently training'
  array << '  --n-ects-from-this-file=ECTS.md                          # display '\
           'how many ECTS points are in that file'
  array << '  --ects-bachelor-master?                                  # show '\
           'how many bachelor/master ECTS points were passed so far'
  array << '  --passed-exams?                                          # show '\
           'which exams were already completed successfully'
  array << '  --start                                                  # note '\
           'down the start time + how many exams were solved at this point'
  array << '  --pristine                                               # this '\
           'will create a new file called '+
           'lecture_information.yml'+
           ', without any already solved exams'
  array << '  --colours?                                               # show '\
           'whether we will use colours or whether we will not'
  array << '  --passed-ects                                            # show '\
           'how many ECTS were passed in the registered curricula'
  array << '  --passed-exams=chemistry                                 # show '\
           'passed exams belonging to the given theme (in this '\
           'case, lectures related to chemistry)'
  array << '  --available-themes                                       # show '\
           'all registered (and thus available) themes of different lectures'
  array << '  --statistics                                             # show '\
           'some general statistics of this project'
  array << '  --check-the-lecture-information-file                     # check '\
           'whether all entries are correct, in the file called '+
           sfile('lecture_information.yml')
  array << '  --lectures-on-this-day=05.05.2018                        # show '\
           'which lectures are on the given day'
  array << '  --disable-colours                                        # this '\
           'entry point allows you to permanently disable colours'
  array << '  --solved?                                                # show '\
           'whether whether that particular lecture ID was already solved or '\
           'whether it was not'
  array << '  --set-log-dir=/foo/bar/                                  # specify '\
           'another log directory'
  array << '  --exams-at-the-meduni                                    # show '\
           'all exams at the meduni'
  array << '  --n-entries-in-the-file-lecture-information?             # report '\
           'how many courses are registered in the file '+
           sfile('lecture_information.yml')
  array << '  --max?                                                   # show '\
           'how many exams were already passed'
  array << '  --download-exam-dataset                                  # download '\
           'the exam dataset from a remote website'
  array << '  --gui                                                    # start '\
           'the GUI component of the Studium project'
  array << '  --timetable                                              # show '\
           'upcoming possible exams, via a timetable'
  array << '  --max-ever                                               # show '\
           'the maximum amount of exam-questions ever answered'
  array << '  --audio-stats                                            # show '\
           'all locally available audio files in the study-directory'
  array << '  --yearly-average-grades                                  # show '\
           'the yearly average grades'
  array << '  --percentage-achieved                                    # show '\
           'how much percent of a given curriculum we have already passed'
  array << '  --questions-per-year                                     # show '\
           'how many questions were added per year'
  array << '  --exams-at-the-uniwien                                   # show '\
           'all exams at the uniwien (university of vienna)'
  array << '  --open                                                   # open '\
           'relevant study-specific files in the (default) editor'
  array << '  /name_of_exams/                                          # regex '\
           'search for an exam with that name'
  array << '  --upcoming_exams_at_the_boku                             # show '\
           'all upcoming exams at the BOKU. (This will also generate a .html page.)'
  array << '  --upcoming-important-exams                               # show '\
           'all upcoming exams in general. (This will also generate a .html page.)'
  array << '  --examstats                                              # show '\
           'the exam statistics, that is, how many exams you passed'
  array << '  --use-this-colour-for-exam-questions=slateblue           # set '\
           'to use this colour for exam-questions'
  array << '  --use-this-colour-for-exam-answers=slateblue             # set '\
           'to use this colour for exam-answers'
  array << '  --set-delay=5                                            # set '\
           'the delay between answering a question to n seconds, in this case 5'
  array << '  --delay?                                                 # query '\
           'the current delay in use'
  array << '  --files?                                                 # show '\
           'where some of the important files may be kept'
  array << '  last-exams 15                                            # show '\
           'the last 15 passed exams'
  array << '  --update-max-questions                                   # update '\
           'how many questions were asked'
  array << '  --mandatory                                              # show '\
           'upcoming mandatory courses in the next some days (40 days usually)'
  e
  e "#{rev}The following #{steelblue(array.size.to_s)} options "\
    "are available and documented for #{royalblue('bin/studium')}:"
  e
  e
  # ======================================================================= #
  # The above ^^^ can be added in any random order; the next line will
  # sort this anyway.
  # ======================================================================= #
  array.sort.each {|entry| eparse entry }
  e
end

#show_how_many_exam_topics_are_availableObject

#

show_how_many_exam_topics_are_available

#


1372
1373
1374
1375
1376
# File 'lib/studium/commandline/commandline.rb', line 1372

def show_how_many_exam_topics_are_available
  require 'studium/toplevel_methods/n_topics_available.rb'
  e rev+'There are '+simp(Studium::Exams.n_topics_available?.to_s)+' '\
    'topics available.'
end

#show_how_many_exams_were_passedObject

#

show_how_many_exams_were_passed

This method will tell us how many exams were passed.

Commandline invocation example:

studium --show_how_many_exams_were_passed
#


1730
1731
1732
1733
# File 'lib/studium/commandline/commandline.rb', line 1730

def show_how_many_exams_were_passed
  require 'studium/toplevel_methods/toplevel_methods.rb'
  Studium::Exams.report_how_many_exam_questions_were_already_solved
end

#show_lva_dates_of_this_lecture(this_theme) ⇒ Object

#

show_lva_dates_of_this_lecture

#


1418
1419
1420
# File 'lib/studium/commandline/commandline.rb', line 1418

def show_lva_dates_of_this_lecture(this_theme)
  Studium.show_lva_dates_of_this_lecture(this_theme)
end

#show_max_exam_questions_answered_per_topic(file_max_stats = Studium.file_max_stats) ⇒ Object

#

show_max_exam_questions_answered_per_topic

#


1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
# File 'lib/studium/commandline/commandline.rb', line 1580

def show_max_exam_questions_answered_per_topic(
    file_max_stats = Studium.file_max_stats
  )
  dataset = YAML.load_file(file_max_stats)
  e
  dataset.each_pair {|key, value|
    value = value.to_s.rjust(5)
    e "  #{lightgreen(key+':').ljust(80)} "\
      "#{steelblue(value)}"
  }
  e
end

#show_maximum_amount_of_questions_ever_answeredObject

#

show_maximum_amount_of_questions_ever_answered

#


42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/studium/commandline/commandline.rb', line 42

def show_maximum_amount_of_questions_ever_answered
  require 'studium/exams/questions_solved_from_day_to_day/questions_solved_from_day_to_day.rb'
  _ = Studium::Exams::QuestionsSolvedFromDayToDay.return_maximum_amount_of_questions_ever_answered
  opne "#{rev}The maximum amount of exam-questions ever answered was `"\
       "#{sfancy(_)}#{rev}`."
  if Studium.is_on_roebe?
    # ===================================================================== #
    # Next show the "We already solved xyz questions" line:
    # ===================================================================== #
    require 'studium/toplevel_methods/toplevel_methods.rb'
    Studium::Exams.report_how_many_exam_questions_were_already_solved
  end
end

#show_n_ects_from_this_file(i) ⇒ Object

#

show_n_ects_from_this_file

#


1747
1748
1749
1750
1751
1752
1753
1754
1755
# File 'lib/studium/commandline/commandline.rb', line 1747

def show_n_ects_from_this_file(i)
  if File.exist? i
    e royalblue(
        Studium.return_n_ects_from_this_file(i).to_s+' ECTS points'
      )
  else
    no_file_exists_at(i)
  end
end

#show_outdated_lva_datesObject

#

show_outdated_lva_dates

#


1200
1201
1202
1203
# File 'lib/studium/commandline/commandline.rb', line 1200

def show_outdated_lva_dates
  require 'studium/utility_scripts/show_outdated_lva_dates.rb'
  Studium.show_outdated_lva_dates
end

#show_passed_credits_per_curriculumObject

#

show_passed_credits_per_curriculum

Invocation example:

studium --passed-ects
#


1484
1485
1486
1487
# File 'lib/studium/commandline/commandline.rb', line 1484

def show_passed_credits_per_curriculum
  require 'studium/ects/show_passed_credits_per_curriculum.rb'
  Studium.show_passed_credits_per_curriculum
end

#show_passed_ects_in_the_individual_bachelor_and_master_curriculaObject

#

show_passed_ects_in_the_individual_bachelor_and_master_curricula

#


1679
1680
1681
1682
# File 'lib/studium/commandline/commandline.rb', line 1679

def show_passed_ects_in_the_individual_bachelor_and_master_curricula
  require 'studium/toplevel_methods/show_passed_ects_in_the_individual_bachelor_and_master_curricula.rb'
  Studium.show_passed_ects_in_the_individual_bachelor_and_master_curricula
end

#show_passed_ects_per_yearObject

#

show_passed_ects_per_year

#


1381
1382
1383
1384
# File 'lib/studium/commandline/commandline.rb', line 1381

def show_passed_ects_per_year
  require 'studium/utility_scripts/passed_ects_per_year.rb'
  Studium.passed_ects_per_year
end

#show_passed_examsObject

#

show_passed_exams

#


1519
1520
1521
# File 'lib/studium/commandline/commandline.rb', line 1519

def show_passed_exams
  ::Studium.show_passed_exams
end

#show_passed_lectures_in_a_bachelor_curriculumObject

#

show_passed_lectures_in_a_bachelor_curriculum

#


1768
1769
1770
1771
# File 'lib/studium/commandline/commandline.rb', line 1768

def show_passed_lectures_in_a_bachelor_curriculum
  require 'studium/exams/exams_per_month/exams_per_month.rb'
  Studium::ExamsPerMonth.show_passed_bachelor_lectures
end

#show_passed_lectures_in_a_master_curriculumObject

#

show_passed_lectures_in_a_master_curriculum

Use this method if you want to see which lectures have been passed in a master curriculum.

To invoke this method from the commandline, try:

studium --master_curricula
#


1792
1793
1794
1795
# File 'lib/studium/commandline/commandline.rb', line 1792

def show_passed_lectures_in_a_master_curriculum
  require 'studium/exams/exams_per_month/exams_per_month.rb'
  Studium::ExamsPerMonth.show_passed_master_lectures
end

#show_path_to_the_file_lecture_informationObject

#

show_path_to_the_file_lecture_information

#


1615
1616
1617
1618
1619
# File 'lib/studium/commandline/commandline.rb', line 1615

def show_path_to_the_file_lecture_information
  e
  e sfancy("  #{Studium.file_lecture_information}")
  e
end

#show_questions_per_yearObject

#

show_questions_per_year

#


1551
1552
1553
1554
# File 'lib/studium/commandline/commandline.rb', line 1551

def show_questions_per_year
  require 'studium/exams/new_questions_per_year.rb'
  Studium.show_questions_per_year
end

#show_the_available_themesObject

#

show_the_available_themes

Invoke this method from the commandline via:

studium --available-themes
#


1129
1130
1131
1132
1133
1134
1135
# File 'lib/studium/commandline/commandline.rb', line 1129

def show_the_available_themes
  file = ::Studium.file_allowed_themes_for_courses
  if File.exist? file
    dataset = YAML.load_file(file)
    dataset.each {|entry| e steelblue(entry) }
  end
end

#show_the_base_dirObject

#

show_the_base_dir

#


1567
1568
1569
1570
1571
1572
1573
1574
1575
# File 'lib/studium/commandline/commandline.rb', line 1567

def show_the_base_dir
  e
  e '  '+sfile(
    File.expand_path(
      File.read(Studium.file_log_directory).chomp
    )
  )
  e
end

#show_the_current_studysetObject

#

show_the_current_studyset

#


1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
# File 'lib/studium/commandline/commandline.rb', line 1504

def show_the_current_studyset
  _ = FILE_FOR_EXAM_QUESTIONS
  if File.exist? _
    this_exam_topic = YAML.load_file(_).strip
    e 'The current exam-topic, taken from the file '
    e sfile(_)
    e 'is `'+sfile(File.basename(this_exam_topic))+'`.'
  else
    e 'No file exists at `'+sfile(_)+'`.'
  end
end

#show_timetableObject

#

show_timetable

Invocation example:

studium --timetable
#


1805
1806
1807
1808
# File 'lib/studium/commandline/commandline.rb', line 1805

def show_timetable
  require 'studium/requires/require_upcoming_exams.rb'
  Studium::Exams::UpcomingExams.new
end

#show_upcoming_exams_at_the_bokuObject

#

show_upcoming_exams_at_the_boku

#


1637
1638
1639
1640
# File 'lib/studium/commandline/commandline.rb', line 1637

def show_upcoming_exams_at_the_boku
  require 'studium/exams/upcoming_exams_at_the_boku/upcoming_exams_at_the_boku.rb'
  Studium.show_upcoming_exams_at_the_boku
end

#show_upcoming_mandatory_presence_coursesObject

#

show_upcoming_mandatory_presence_courses

#


1170
1171
1172
1173
# File 'lib/studium/commandline/commandline.rb', line 1170

def show_upcoming_mandatory_presence_courses
  require 'studium/utility_scripts/upcoming_mandatory_presence_courses/upcoming_mandatory_presence_courses.rb'
  Studium::UpcomingMandatoryPresenceCourses.new(ARGV)
end

#show_where_the_exam_topics_can_be_foundObject

#

show_where_the_exam_topics_can_be_found

#


1329
1330
1331
1332
1333
1334
1335
# File 'lib/studium/commandline/commandline.rb', line 1329

def show_where_the_exam_topics_can_be_found
  e
  e 'The exam topics can be found here:'
  e
  e  "  #{sdir(Studium.exam_topics?)}"
  e
end

#show_yearly_average_gradesObject

#

show_yearly_average_grades

Invocation example:

studium --yearly-average-grades
#


1468
1469
1470
1471
1472
1473
1474
# File 'lib/studium/commandline/commandline.rb', line 1468

def show_yearly_average_grades
  # ======================================================================= #
  # Must delegate towards Studium::ExamsPerMonth in this case.
  # ======================================================================= #
  require 'studium/exams/exams_per_month/exams_per_month.rb'
  Studium::ExamsPerMonth.new(:dont_run_yet) { '--yearly-average-grades' }
end

#start_a_new_exam_dayObject

#

start_a_new_exam_day

#


1140
1141
1142
1143
# File 'lib/studium/commandline/commandline.rb', line 1140

def start_a_new_exam_day
  require 'studium/logging/store_last_question_asked_into_file.rb'
  Studium::Log::StoreLastQuestionAskedIntoFile.reset_file
end

#start_gui_componentObject

#

start_gui_component

Use this method to start the gui/gtk component of the Studium project.

Invocation example:

studium --gui
#


1215
1216
1217
1218
1219
1220
# File 'lib/studium/commandline/commandline.rb', line 1215

def start_gui_component
  unless ::Studium.const_defined? :GUI
    require 'studium/gui/gtk2/simple_widget_question_answer.rb'
  end
  Studium::GUI::Gtk::SimpleWidgetQuestionAnswer.run_as_standalone_gtk_window
end

#start_the_sinatra_interfaceObject

#

start_the_sinatra_interface

#


1760
1761
1762
1763
# File 'lib/studium/commandline/commandline.rb', line 1760

def start_the_sinatra_interface
  require 'studium/www/sinatra/app.rb'
  Studium.start_sinatra_interface
end

#upcoming_important_examsObject

#

upcoming_important_exams

This class seems to no longer exist as of October 2020.

#


1288
1289
1290
# File 'lib/studium/commandline/commandline.rb', line 1288

def upcoming_important_exams
  Studium::Exams::UpcomingImportantExams.new
end

#upload_archive_of_the_exam_questionsObject

#

upload_archive_of_the_exam_questions

#


1225
1226
1227
# File 'lib/studium/commandline/commandline.rb', line 1225

def upload_archive_of_the_exam_questions
  Studium.upload_archive_of_the_exam_questions
end

#upload_pdfObject

#

upload_pdf

#


1526
1527
1528
# File 'lib/studium/commandline/commandline.rb', line 1526

def upload_pdf
  Studium.upload_pdf
end

#verbose_open_important_examsObject

#

verbose_open_important_exams

#


1262
1263
1264
1265
1266
1267
# File 'lib/studium/commandline/commandline.rb', line 1262

def verbose_open_important_exams
  require 'studium/exams/upcoming_exams/upcoming_exams.rb'
  opne "Now opening the #{slateblue('important-exams')} #{rev}"\
       "file in the editor." 
  ::Studium.open_important_exams
end

#verbose_set_this_dir_to_exam_topics(match) ⇒ Object

#

verbose_set_this_dir_to_exam_topics

#


1311
1312
1313
1314
1315
# File 'lib/studium/commandline/commandline.rb', line 1311

def verbose_set_this_dir_to_exam_topics(match)
  e 'Now setting to a new directory for the exam topics, at:'
  e "  #{sdir(match)}"
  Studium.permanenty_set_directory_to_the_exam_topics(match)
end

#verbose_set_this_new_log_dir(match) ⇒ Object

#

verbose_set_this_new_log_dir

#


1320
1321
1322
1323
1324
# File 'lib/studium/commandline/commandline.rb', line 1320

def verbose_set_this_new_log_dir(match)
  e 'Now setting to a new log-directory for the Studium project, at:'
  e "  #{sdir(match)}"
  Studium.permanenty_set_log_directory_to_this_entry(match)
end

#verbose_update_max_everObject

#

verbose_update_max_ever

#


1492
1493
1494
1495
1496
1497
1498
1499
# File 'lib/studium/commandline/commandline.rb', line 1492

def verbose_update_max_ever
  require 'studium/exams/questions_solved_from_day_to_day/questions_solved_from_day_to_day.rb'
  e "#{rev}Now updating the max-ever entry of all exam-questions "\
    "that were answered."
  e 'This will be stored in the file at '+
    sfile(Studium.file_daily_questions_solved?)
  Studium.update_max_ever_exam_questions_answered
end