Skip to content

Wrong value for "correct_answer" in sample Poll application #71

@depaege

Description

@depaege

In the "Poll" sample application that is delivered with Apex, the following bug exists. If you create a new poll of type "Quiz", and you create a question of type "Pick many", and ensure that the first answer is not correct, the processing of your answers is wrong. It will mark your question as incorrect, while you may have given the correct response.
The reason is that, after creating your question, the value of "correct_answer" in table eba_qpoll_questions is wrong. It should not start with 2 comma's.

This issue is easily reproducable by doing:
select eba_qpoll_quiz.delim_answers('a','b','c',null,null,null,null,null,null,null,null,null) from dual; --OK -> ,a,b,c,
select eba_qpoll_quiz.delim_answers(null,'a','b','c',null,null,null,null,null,null,null,null) from dual; --NOK -> ,,a,b,c,

This can be fixed in package eba_qpoll_quiz.delim_answers by setting:

   if trim(p_answer_01) is not null then
      l_answers := l_answers || l_delim || trim(p_answer_01);
   end if;

and at the end:

l_answers := l_answers || l_delim;
Then the correct_answer will not start with 2 commas.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions