Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- my %results_for_question =
- map {
- (
- my $feedback = $_->test_registration_result_feedback;
- $_->question_id => {
- question_id => $_->question_id,
- answer => $_->answer,
- score => $_->score,
- test_registration_id => $_->test_registration_id,
- question_response_description_id => \@{ $student_response_descriptions{ $_->question_id } },
- feedback => $feedback ? $feedback->feedback : undef,
- }
- )
- } $self->school_schema->resultset('TestRegistrationResult')->search(
- {
- 'me.question_id' => { IN => $options->{selected_questions} },
- 'me.test_registration_id' => {
- IN => $self->school_schema->resultset('TestRegistration')->search(
- {
- 'test_administration_id' => $options->{test_administration}->id,,
- 'sid' => $student->sid
- },
- { select => ['id'] },
- )->as_query
- },
- },
- { prefetch => 'test_registration_result_feedback'}
- )->all;
Add Comment
Please, Sign In to add comment