Target: To be able to download English version reports from the test results of a foreign language tests.
Involved Tables:
order_candidate_test_scores
- group
- name
- banding
- mean_score
- result_desc
report_templates
- id
- test_type_id
report_template_formats
- test_type_id
- report_template_id
- result_type
question_codes
- id
- group
- name
scorings
- test_type_id
- question_code_id - question_codes -> group, name
- custom_id
- custom_id_type
- banding
- report_desc
- report_questions
- suggested_development_guide
Sample download Individual Report - IIR PDF
domain.com/strawberry/search/reports?
GET requests
download:candidate
candidate_id:1227
order_id:2242
test_report_id:167
content_type:report
test_id:100145
file_type:pdf-i
norms_id:0
test_type_id - get from test_id
switch test_type_id
case WEII EN
case WEII VN
case WEII CN
generateWEIIPDF - downloads PDF
case OPA EN
case OPA CN
generateOPAPDF - downloads PDF
API:
GET api/v1/tests/reports/templates/show-report-template-format/{report_template_id}?order_client_id=129
response [
file_type,
name,
report_template,
report_type,
report_template_format_id <--- NEW - should be included in response
];
- using
report_template_id
- get children report_templates - report_template_ids = [] <-- parent including children
- select * from report_template_formats where report_template_id in (report_template_ids)
Target Individual Report Download PDF
domain.com/strawberry/search/reports?
GET requests
download:candidate
candidate_id:1227
order_id:2242
test_report_id:167
content_type:report
test_id:100145
file_type:pdf-i
norms_id:0
report_template_format_id:{value} <-- NEW this will determine what is the language of the report to be used
Table Updates:
report_templates
- parent_id - nullable <-- NEW field to achieve parent-child setup
NEW Table: report_template_language_versions
- report_template_id
- test_type_id
- lang_id
- lang - computed basing on
languages.lang
Input: report_template_format_id
- report_template_id - get from report_template_formats.report_template_id
- get test_type_id in report_template_language_versions where report_template_id = report_template_id
test_type_id
is the identifier what language version is used
for scorings
select * from scorings where test_type_id = test_type_id
Test Results source can be either
- order_candidate_test_scores <--- this is where test results from Test Complete computation be saved
- report_test_scores <--- this is where test results during manual downloading of report be saved
Sample Query
select * from order_candidate_test_scores oct
left join question_codes qc on qc.`group` = oct.group and qc.name = oct.name and qc.test_type_id = 27
where oct.order_candidate_test_id = 16021;
Feature: English Report for Foreign Language Tests - Actual Generating of Report
- handled both Individual & Group Report Download using correct language version basing on report_template_format_id mapping
- migration added
- https://www.evernote.com/l/Ak9tH6Yy17JC-Iz_dI5kQt4qIdidMDL-Mqk/
using correct language version for both Individual and Group Admin site is only supported atm
admin\ReportsController@search admin\ReportsController@filter
Handle Individual Report Download Handle Group Report Download had hard time working on group report to pass report_template_format_id along with the download URL fixed and plugged onChange file_format select to also save report_template_format_id to pass to api for further usage
Group stores filters for downloading report on client_test_report_downloads need to save report_template_format_id used as well included upon storing filters on client_test_report_downloads use on generating report to use correct report_template_language_version basing on report_template_format_id