Guest User

Untitled

a guest
Aug 6th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 1.43 KB | None | 0 0
  1.         my %results_for_question =
  2.           map {
  3.             (
  4.         my $feedback = $_->test_registration_result_feedback;
  5.                 $_->question_id => {
  6.                     question_id                      => $_->question_id,
  7.                     answer                           => $_->answer,
  8.                     score                            => $_->score,
  9.                     test_registration_id             => $_->test_registration_id,
  10.                     question_response_description_id => \@{ $student_response_descriptions{ $_->question_id } },
  11.                     feedback                         => $feedback ? $feedback->feedback : undef,
  12.                 }
  13.               )
  14.           } $self->school_schema->resultset('TestRegistrationResult')->search(
  15.             {
  16.  
  17.                 'me.question_id'          => { IN => $options->{selected_questions} },
  18.                 'me.test_registration_id' => {
  19.                     IN => $self->school_schema->resultset('TestRegistration')->search(
  20.                         {
  21.                             'test_administration_id' => $options->{test_administration}->id,,
  22.                             'sid'                    => $student->sid
  23.                         },
  24.                         { select => ['id'] },
  25.                       )->as_query
  26.                 },
  27.                
  28.             },
  29.             { prefetch => 'test_registration_result_feedback'}
  30.           )->all;
Add Comment
Please, Sign In to add comment