Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding a general description in a questionnaire with the pick_randomly option generates an empty question #109

Open
jaguarfi opened this issue Dec 9, 2020 · 4 comments
Labels
area: questionnaire Related to the questionnaire directive effort: days Solving this issue could take days. Starting with the creation of a new branch to the merging experience: moderate required knowledge estimate priority: low type: bug This is a bug which is critical for the correct operation of the system

Comments

@jaguarfi
Copy link
Contributor

jaguarfi commented Dec 9, 2020

The following code will generate an empty question

.. questionnaire:: pick_randomly_1
  :title: Pick question randomly from a pool of questions
  :submissions: 4
  :points-to-pass: 10
  :pick_randomly: 1
  :category: Pool

  This is a questionnaire with the key `1` that grants at maximum 70 points of difficulty A. 
  Students can make at most 4 submissions.
  This exercise is marked passed when 0 points are reached (the default).

  .. include:: pool_of_questions.rst

The yaml file will have something like this

...
- fields:
  - more: '<p>This is a questionnaire with the key <cite>1</cite> that grants at maximum
      70 points

      of difficulty A. Students can make at most 4 submissions.

      This exercise is marked passed when 0 points are reached (the default).</p>

      <blockquote>

      <div>'
...
    - more: '</div></blockquote>

      '
    title: ''
    type: static
...

The UI looks like this

image

The text in the questionnaire description is not accurate, this is just an example.

@jaguarfi jaguarfi added type: bug This is a bug which is critical for the correct operation of the system priority: medium effort: weeks The issues is a bit bigger and is likely to take one to few weeks area: questionnaire Related to the questionnaire directive experience: moderate required knowledge estimate labels Dec 9, 2020
@jaguarfi
Copy link
Contributor Author

jaguarfi commented Dec 9, 2020

The pool_of_questions.rst looks like this:

.. freetext:: 10 regexp

  This question accepts either "red" or "blue" as the correct answer.
  The model solution is a regular expression.

  red|blue

.. pick-one:: 10
  :required:
  :dropdown:

  What is 1+2?

  +0. 0
  1. 1
  2. 2
  *3. 3

.. freetext:: 10 string-ignorews-ignorequotes-requirecase
  :length: 10

  A textual input can be compared with the model solution as integer, float or string.
  Here the correct answer is "test". Surrounding quotes are ignored in the solution
  as well as whitespace everywhere (modifiers ignorequotes and ignorews).

  test
  !test § Follow the instruction.
  regexp:Test|TEST § Use the lower case!

@markkuriekkinen
Copy link
Contributor

markkuriekkinen commented Dec 9, 2020

The actual problem here could be that pick_randomly does not understand the difference of static text and real questions. The static text block is treated as one of the questions and if you select only one question randomly, that one question may be a text block. If you log in with a different user or increase the parameter of pick_randomly from just one, then do you see real questions? (The static text block could disappear completely while another question is shown.) At any rate, I remember that pick_randomly does not work with the static text blocks (since it thinks they are part of the question pool), so at the moment we would instruct users that they can't use static text blocks inside the questionnaire with pick_randomly. Of course, it is possible to fix that bug/"feature".

Another thing to test: use the include directive, but remove all static text blocks. Does pick_randomly work correctly when the include directive and all other questionnaire content only consist of question directives?

Note that questions may still have their own descriptions (text). By static text block, I mean text that is outside any question directive, but inside the questionnaire directive. In the config.yaml, you can see that the text blocks are their own items in the fields list and they have type static.

@markkuriekkinen markkuriekkinen added effort: days Solving this issue could take days. Starting with the creation of a new branch to the merging and removed effort: weeks The issues is a bit bigger and is likely to take one to few weeks labels Dec 9, 2020
@jaguarfi
Copy link
Contributor Author

jaguarfi commented Dec 9, 2020

Yes, you are right, the static text causes this problem. I removed the static text

This is a questionnaire with the key `1` that grants at maximum 70 points
of difficulty A. Students can make at most 4 submissions.
This exercise is marked passed when 0 points are reached (the default).

and that solved the problem.

@jaguarfi jaguarfi changed the title Using the include directive in a questionnaire with the pick_randomly option generates an empty question Adding a general description in a questionnaire with the pick_randomly option generates an empty question Dec 10, 2020
@markkuriekkinen
Copy link
Contributor

Then this issue can be about fixing the random choice of questions in the MOOC-Grader graded form code so that static text blocks would not be part of the question pool.

Code around here and elsewhere in the file:
https://github.com/apluslms/mooc-grader/blob/42f1a810c0c19b07ebefe73cce73ef182a99cf47/access/types/forms.py#L80

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: questionnaire Related to the questionnaire directive effort: days Solving this issue could take days. Starting with the creation of a new branch to the merging experience: moderate required knowledge estimate priority: low type: bug This is a bug which is critical for the correct operation of the system
Projects
None yet
Development

No branches or pull requests

2 participants