Skip to content

Instantly share code, notes, and snippets.

@josephdicdican
Last active November 20, 2019 16:23
Show Gist options
  • Save josephdicdican/fade70d3e8798ff05657fa6b949f4d4b to your computer and use it in GitHub Desktop.
Save josephdicdican/fade70d3e8798ff05657fa6b949f4d4b to your computer and use it in GitHub Desktop.
Add English Report for Foreign Language - iassess

Add English Report on Foreign Language Testing

Target: To be able to download English version reports from the test results of a foreign language tests.

Involved Tables:

Current setup

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

Tryout

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

  1. order_candidate_test_scores <--- this is where test results from Test Complete computation be saved
  2. 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;

Updates

Feature: English Report for Foreign Language Tests - Actual Generating of Report

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment