# Factor transfer rules ## Purpose **Assessment & Grading → Journal to bulletin transfer → Factor transfer rules** (`/journal-transfer-rules`) defines formulas that convert journal grades into one bulletin destination factor. The current navigation has no separate mapping editor: the destination and formula are configured together. ## Creating a rule Open the table and click Add. | Field | Rule | | --- | --- | | Bulletin factor | One destination of type `all` or `bulletins` | | Academic year | A single year, not a range | | Educational degrees and learning formats | Multi-select, at least one of each | | Check types and courses | Multi-select; courses 1–12 | | Expression | Required formula, up to 2000 characters | | Active | Enables the rule, on by default | | Show in grade book | Shows the calculated result in grade book statistics; does not replace active status or transfer permissions | All academic criteria must match. Multiple values form combinations: for example bachelor's, full-time and part-time, exam, courses 1 and 2. The server rejects overlapping active rules on the same year, degrees, formats, check types and courses, **even with different destination factors**. Save an inactive rule for review if needed, and resolve overlaps before enabling it. No cohort-year conversion occurs here; select the activity year. ## Formula and sources After selecting the academic context, open the formula builder. Choose operands from its catalog. [Subject factors](/en/docs/factor-settings) of type `all` are journal sources; both types are eligible destinations. The academic selection does not filter the source factor catalog. | Operand | Result | | --- | --- | | `{journal_factor:ID}.avg` or no suffix | Average of non-null entries; zero marks count | | `.sum`, `.min`, `.max`, `.last`, `.count` | Sum, minimum, maximum, last mark, count of numeric entries | | `{absence_percent}` | Unexcused absences / planned hours × 100; falls back to lessons held if no hours, or zero if neither exists | | `{absent_count}`, `{absent_excused_count}` | All and excused absences | | `{late_count}`, `{late_excused_count}`, `{late_minutes}` | Lateness, excused lateness and minutes | | `{planned_hours}`, `{lessons_held}` | Planned hours and lessons held | | `{coeff:ID}` | Numeric coefficient for the program–subject pair | | `{const:ID}` | Bulletin constant | Suffixes apply to one factor. The builder offers avg, sum, min, max, count, round, floor, ceil and abs. The server explicitly supports these except standalone count(); use the .count accessor to count marks. Arithmetic operations and parentheses are supported. The first explicit journal factor in the main formula represents the row, unless a separate source already exists on an older rule. With no explicit factor, the destination represents the source. Even a constant or conditional formula is skipped when the representative factor has no journal mark. Additional missing aggregates, numeric coefficients or constants resolve to zero; that is not the same as a recorded zero mark. Check source completeness, especially when dividing. ### Conditions Open the conditions editor, add comparisons between expressions and choose operators (>, >=, <, <=, ==, !=, with and/or/not). A branch returns a numeric expression or a supported performance status. Nested conditions and one Otherwise branch per level are supported; maximum depth is 16. Ordinary branches are evaluated in order and the first true branch determines the result. If no branch or Otherwise yields a result, the main formula is used. A main formula remains required even when conditions exist. Example: under the institution's actual rules, 25% or more unexcused absences could return the selected non-admission status, otherwise return the average of Test. The 25% is an illustrative threshold, not an institutional policy. ### Rounding and the grade scale Numeric results are rounded according to calculation settings for the degree/year when enabled, otherwise according to the working [grading scale](/en/docs/grade-scale) precision. They are then clamped between zero and the scale maximum if one is found, and classified into a performance level. Clamping produces a note; correct an out-of-scale formula instead of relying on clamping. A status branch returns the status rather than a number. ## Example Choose Current Assessment as the destination and select the academic context. If Test has values 10, 15 and 20, `{journal_factor:ID}.avg` gives 15. If the subject coefficient is 0.5, `{journal_factor:ID}.avg * {coeff:ID}` gives 7.5 before rounding. In the builder select actual factors instead of the placeholder IDs. Coefficients are configured in [factor details](/en/docs/factors); a grading scale does not replace them. Save and preview one student in [journal transfer](/en/docs/journal-transfer). Compare with the journal and test each condition branch. ## Rights and scope | Operation | Permission | | --- | --- | | List, view and factor catalog | `journal-transfer-rules.index` (catalog bound to view) | | Create/edit | `journal-transfer-rules.store`, `journal-transfer-rules.update` | | Delete | `journal-transfer-rules.destroy` | | Trash/restore | `journal-transfer/config/rules.deleted-items`, `journal-transfer/config/rules.restore` | Rule configuration is global with no organizational permission scopes. Academic criteria control formula applicability rather than administrator access. Deletion is soft; check existing active rules before restoring or re-enabling a record. Configuring a rule does not grant execution permission. ## Troubleshooting Check matching year, degree, format, check type and course; active status, overlaps, journal source and target factor. Verify the actual target column and journal records, formula errors and [history](/en/docs/journal-transfer-logs). ## Implementation references - [Rule table](https://gitlab.kamoorj.com/development/frontend-edusystems/-/blob/b928b3290040bab5c888b195b813f6705170e309/src/admin/src/pages/AssessmentAndGrading/JournalTransfer/RulesPage.tsx) - [Rule form and permissions](https://gitlab.kamoorj.com/development/frontend-edusystems/-/blob/b928b3290040bab5c888b195b813f6705170e309/src/admin/src/pages/AssessmentAndGrading/JournalTransfer/JournalTransferRuleDescriptor.tsx) - [Formula and conditions editors](https://gitlab.kamoorj.com/development/frontend-edusystems/-/blob/b928b3290040bab5c888b195b813f6705170e309/src/admin/src/pages/AssessmentAndGrading/JournalTransfer/JournalTransferRuleFormulaField.tsx) - [Formula catalog adapter](https://gitlab.kamoorj.com/development/frontend-edusystems/-/blob/b928b3290040bab5c888b195b813f6705170e309/src/admin/src/pages/AssessmentAndGrading/JournalTransfer/formulaCatalogAdapter.ts) - [Rule routes](https://gitlab.kamoorj.com/development/backend-edusystems/-/blob/83e0edc8d75daf02ae011b433d0be83afe994212/app/Modules/JournalTransfer/routes/api.php) - [Overlap and validation](https://gitlab.kamoorj.com/development/backend-edusystems/-/blob/83e0edc8d75daf02ae011b433d0be83afe994212/app/Modules/JournalTransfer/Http/Requests/FactorTransferRuleRequest.php) - [Variable catalog](https://gitlab.kamoorj.com/development/backend-edusystems/-/blob/83e0edc8d75daf02ae011b433d0be83afe994212/app/Modules/JournalTransfer/Services/FactorCatalogService.php) - [Rule matching](https://gitlab.kamoorj.com/development/backend-edusystems/-/blob/83e0edc8d75daf02ae011b433d0be83afe994212/app/Modules/JournalTransfer/Services/FactorTransferRuleResolver.php) - [Aggregation](https://gitlab.kamoorj.com/development/backend-edusystems/-/blob/83e0edc8d75daf02ae011b433d0be83afe994212/app/Modules/JournalTransfer/Services/JournalFactorAggregator.php) - [Tokens and operators](https://gitlab.kamoorj.com/development/backend-edusystems/-/blob/83e0edc8d75daf02ae011b433d0be83afe994212/app/Modules/JournalTransfer/Services/JournalTransferEvaluator.php) - [Condition and scale calculation](https://gitlab.kamoorj.com/development/backend-edusystems/-/blob/83e0edc8d75daf02ae011b433d0be83afe994212/app/Modules/JournalTransfer/Services/JournalTransferCalculator.php) - [Rounding logic](https://gitlab.kamoorj.com/development/backend-edusystems/-/blob/83e0edc8d75daf02ae011b433d0be83afe994212/app/Modules/JournalTransfer/Services/JournalTransferRoundingResolver.php) - [Representative factor and destination resolution](https://gitlab.kamoorj.com/development/backend-edusystems/-/blob/83e0edc8d75daf02ae011b433d0be83afe994212/app/Modules/JournalTransfer/Services/JournalTransferService.php) - [Show in grade book behavior](https://gitlab.kamoorj.com/development/backend-edusystems/-/blob/83e0edc8d75daf02ae011b433d0be83afe994212/app/Modules/GradeBook/Services/GradeBookTransferStatsService.php)