prima : main plugin for Lino Prima¶
In Lino Prima this plugin defines the locale directory for all
translations.
A tested document¶
This is a tested document. The following instructions are used for initialization:
>>> import lino
>>> lino.startup('lino_prima.projects.prima1.settings')
>>> from lino.api.doctest import *
Window fields¶
The following snippet verifies whether all window fields are visible.
>>> print(analyzer.show_window_fields())
- about.About.insert_reference : content_type, primary_key
- about.About.reset_password : email, username, new1, new2
- about.About.show : about_html
- about.About.sign_in : username, password
- about.About.verify_user : email, verification_code
- cert.AllElementResponses.detail : section_response, section_response__certificate__enrolment, section_response__certificate__period, cert_element, cert_element__skill, max_score, computed_rating, score, rating_buttons, ratings_detail
- cert.AllSectionResponses.detail : certificate, section, rating_type, max_score, score, smiley, predicate, body, cert.ElementResponsesBySection1, cert.ExamResponsesBySection1, cert.ChallengeRatingsBySection1, cert.ChallengeRatingsBySection2, cert.ChallengeRatingsBySection3, cert.FinalRatingsBySection1, cert.FinalRatingsBySection2
- cert.CertSections.detail : cert_template, seqno, subject, heading, heading_de, icon_text, rating_type, max_score, id, body, cert.ElementsBySection1, cert.ElementsBySection2
- cert.CertTemplates.detail : designation, designation_de, with_final_exams, cert.SectionsByTemplate1, cert.SectionsByTemplate2, cert.SectionsByTemplate3
- cert.Certificates.detail : enrolment, period, state, id, SectionResponsesByCertificate1, SectionResponsesByCertificate2, social_skills_comment, SocialRatingsByCertificate1, absences_p, absences_m, absences_u, preview
- cert.ExamResponsesBySection.detail : exam, enrolment, remark, ratings.RatingsByResponse1, ratings.RatingsByResponse2, ratings.RatingsByResponse3
- cert.SectionResponsesByCertificate.detail : body, cert.ElementResponsesBySection2, cert.ExamResponsesBySection2
- cert.SectionResponsesByCourse.detail : body, cert.ElementResponsesBySection2, cert.ExamResponsesBySection2
- checkdata.Checkers.detail : value, text, checkdata.MessagesByChecker1, checkdata.MessagesByChecker2
- checkdata.Messages.detail : checker, owner, message, user, id
- gfks.ContentTypes.detail : id, app_label, model, base_classes, BrokenGFKsByModel1, BrokenGFKsByModel2
- linod.SystemTasks.detail : seqno, procedure, name, every, every_unit, log_level, disabled, status, requested_at, last_start_time, last_end_time, message
- linod.SystemTasks.insert : procedure, every, every_unit
- periods.StoredPeriods.merge_row : merge_to, reason
- periods.StoredYears.merge_row : merge_to, reason
- projects.ProjectSections.detail : seqno, designation, designation_de, project_template, id, ratings.ChallengesByProjectSection1, ratings.ChallengesByProjectSection2
- projects.ProjectTemplates.detail : designation, designation_de, short_header, display_color, id, main_skill, grade, SectionsByProject1
- projects.Projects.detail : enrolment, date_started, period, template__main_skill, body, gr_1, gr_2, gr_3, gr_4, template, template__main_skill__subject, id, build_method, build_time, ratings_done, total_score, total_max_score
- projects.ProjectsByEnrolment.insert : enrolment, template, body
- ratings.ChallengeRatings.detail : challenge, max_score, enrolment, score, rating_buttons, period, teacher, date_done
- ratings.ChallengeRatings.set_score_action : score
- ratings.ChallengeSummaries.detail : master, skill, challenge, score1, score2
- ratings.Challenges.detail : exam, project_section, id, seqno, skill, max_score, ratings.RatingsByChallenge1, ratings.RatingsByChallenge2, ratings.RatingsByChallenge3
- ratings.ChallengesByExam.insert : skill, max_score
- ratings.ChallengesByProjectSection.insert : skill, max_score
- ratings.ExamResponses.detail : exam, enrolment, remark, ratings.RatingsByResponse1, ratings.RatingsByResponse2, ratings.RatingsByResponse3
- ratings.ExamResponsesByEnrolment.insert : exam, remark
- ratings.Exams.detail : subject, group, date, seqno, heading, ratings.ResponsesByExam1, ratings.ResponsesByExam2, period, id, user, ratings.ChallengesByExam1, ratings.ChallengesByExam2
- ratings.ExamsByCourse.insert : heading, skill_1, max_score_1, skill_2, max_score_2, skill_3, max_score_3
- ratings.FinalChallenges.detail : designation, skill, max_score, grade, ratings.FinalExamsByChallenge1, ratings.FinalExamsByChallenge2
- ratings.FinalExams.detail : challenge, group, ratings.FinalRatingsByExam1, ratings.FinalRatingsByExam2
- ratings.FinalRatings.detail : challenge, enrolment, score, max_score, teacher, period, date_done
- ratings.PupilSummaries.detail : master, skill, enrolment, score1, score2, ratings.RatingsBySkillAndPupil1, ratings.RatingsBySkillAndPupil2, ratings.RatingsBySkillAndPupil3
- ratings.RatingsSummaries.detail : master, skill, score1, score2
- school.AllCourses.detail : ratings.ExamsByCourse1, ratings.ExamsByCourse2, ratings.SummariesByCourse1, ratings.SummariesByCourse2, ratings.FinalExamsByCourse1, ratings.FinalExamsByCourse2, cert.SectionResponsesByCourse1, cert.SectionResponsesByCourse2, group, subject, body
- school.AllCourses.insert : group, subject
- school.AllGroups.detail : CoursesByGroup1, pupils_and_projects, ratings.SummariesByGroup1, ratings.SummariesByGroup2, ratings.SummariesByGroup3, ratings.FinalExamsByGroup1, ratings.FinalExamsByGroup2, body, EnrolmentsByGroup1, EnrolmentsByGroup2, designation, designation_de, year, grade, id, CastsByGroup1, CastsByGroup2
- school.AllGroups.insert : designation, designation_de, grade, year
- school.CastsByGroup.insert : role, user
- school.CastsByRole.insert : group, user
- school.CastsByUser.insert : group, role
- school.Enrolments.detail : pupil, group, successful, projects.ProjectsByEnrolment1, projects.ProjectsByEnrolment2, cert.CertificatesByEnrolment1, ratings.ChallengeRatingsByEnrolment1, ratings.FinalRatingsByEnrolment1, ratings.FinalRatingsByEnrolment2
- school.EnrolmentsByGroup.insert : pupil
- school.EnrolmentsByPupil.insert : group
- school.Grades.detail : id, ref, cert_template, designation, designation_de, rating_conditions, rating_conditions_de, projects.ProjectTemplatesByGrade1, projects.ProjectTemplatesByGrade2, GroupsByGrade1, GroupsByGrade2, GroupsByGrade3, GroupsByGrade4
- school.Grades.merge_row : merge_to, reason
- school.Roles.detail : designation, designation_de, CastsByRole1, CastsByRole2
- school.Skills.detail : designation, designation_de, id, subject, with_final_exams, projects.ProjectTemplatesBySkill1, projects.ProjectTemplatesBySkill2, ratings.ChallengesBySkill1, ratings.ChallengesBySkill2, cert.RatingsBySkill1
- school.Subjects.detail : designation, designation_de, id, advanced, icon_text, image_file, rating_type, CoursesBySubject1
- system.SiteConfigs.detail : default_build_method, simulate_today
- uploads.UploadTypes.detail : id, upload_area, wanted, max_number, shortcut, name, name_de, uploads.UploadsByType1, uploads.UploadsByType2, uploads.UploadsByType3, uploads.UploadsByType4
- uploads.UploadTypes.insert : name, name_de, upload_area
- uploads.Uploads.camera_stream : type, description
- uploads.Uploads.detail : file, volume, library_file, user, owner, upload_area, type, description, memo.MentionsByTarget1, preview
- uploads.Uploads.insert : type, description, file, volume, library_file, user
- uploads.UploadsByController.insert : file, volume, library_file, type, description
- uploads.Volumes.detail : ref, root_dir, description, overview, UploadsByVolume1, UploadsByVolume2, UploadsByVolume3, UploadsByVolume4
- uploads.Volumes.insert : ref, root_dir, description
- uploads.Volumes.merge_row : merge_to, reason
- users.AllUsers.change_password : current, new1, new2
- users.AllUsers.detail : username, user_type, start_date, end_date, id, created, modified, school.EnrolmentsByPupil1, school.CastsByUser1, first_name, last_name, email, language, nickname, initials, users.AuthoritiesGiven1, users.AuthoritiesGiven2, users.AuthoritiesTaken1, users.AuthoritiesTaken2
- users.AllUsers.insert : username, email, first_name, last_name, language, user_type
- users.AllUsers.merge_row : merge_to, reason
- users.AllUsers.verify_me : verification_code
“Auswahl Kompetenz in Test darf nur Kompetenzen anzeigen, die in dieser Klasse im Zeugnis stehen.”
>>> rt.show(cert.CertTemplates)
==== ============= ================== ==================
ID Designation Designation (de) With final exams
---- ------------- ------------------ ------------------
1 Junior Junior No
2 Senior Senior No
==== ============= ================== ==================
>>> #show_fields(school.Grade, all=True)
>>> rt.show(school.Grades)
==== ============== ================== =========== ====================== =================== ========================
ID Designation Designation (de) Reference Certificate template Rating conditions Rating conditions (de)
---- -------------- ------------------ ----------- ---------------------- ------------------- ------------------------
1 First grade Erstes Jahr 1 Junior
2 Second grade Zweites Jahr 2 Junior
3 Third grade Drittes Jahr 3 Senior
4 Fourth grade Viertes Jahr 4 Senior
5 Fifth grade Fünftes Jahr 5 Senior
6 Sixth grade Sechstes Jahr 6 Senior
7 Alumni Alumni X
==== ============== ================== =========== ====================== =================== ========================
>>> #rt.show(cert.CertElements)
>>> def subjects_by_tpl(tpl):
... qs = cert.CertElement.objects.filter(cert_section__cert_template=tpl)
... return sorted(set([str(ce.skill.subject) for ce in qs]))
>>> for tpl in cert.CertTemplate.objects.all():
... print(tpl, subjects_by_tpl(tpl))
Junior ['Behaviour', 'French', 'German', 'Teamwork']
Senior ['Behaviour', 'Geography', 'History', 'Mathematics', 'Music', 'Natural science', 'Religion', 'Teamwork']
>>> exams = ratings.Exam.objects.filter(
... group__designation="2B", subject__designation="German")
>>> exam = exams.last()
>>> print(exam.subject)
German
List of all skills for German:
>>> qs = school.Skill.objects.filter(subject=exam.subject)
>>> all_skills = set([str(o) for o in qs])
>>> list(sorted(all_skills))
['Dealing with texts and media', 'Linguistical thinking', 'Listening',
'Reading', 'Reading comprehension', 'Speaking', 'Writing']
But we want to see only skills for which there is also a certificate element.
>>> tpl = exam.group.grade.cert_template
>>> qs = cert.CertElement.objects.filter(cert_section__cert_template=tpl)
>>> qs = qs.filter(cert_section__subject=exam.subject)
>>> cert_skills = set([str(ce.skill) for ce in qs])
>>> list(sorted(cert_skills))
['Linguistical thinking', 'Listening', 'Reading', 'Reading comprehension',
'Speaking', 'Writing']
Above list is the same as the one Lino provides as choices for the combobox:
>>> base = f"/choices/ratings/Challenge/skill?exam={exam.id}"
>>> show_choices("robin", base + '&query=')
Reading
Reading comprehension
Writing
Speaking
Listening
Linguistical thinking