FormulasQuestion / moodle-qtype_formulas

Formulas question type for Moodle
17 stars 30 forks source link

Feature request: new grading behaviour #155

Open PhilippImhof opened 2 weeks ago

PhilippImhof commented 2 weeks ago

_Originally posted by @alexanderlata in https://github.com/FormulasQuestion/moodle-qtype_formulas/issues/154#issuecomment-2396956750_

For example, I ask students to solve a system of linear equations using the Gauss method. I create two parts and, with the help of JavaScript and HTML, I add a dropdown menu using the select and option tags.

Depending on the choice made in the dropdown menu, I show one part and hide the other. In the first part, I ask for an answer, and in the second part, I ask another question.
The first part is fully correct, but I want to know whether the student answered the additional question in the second part correctly (depending on their choice). As a result, I evaluate them either on the first part or the second part, ensuring that the maximum grade doesn’t exceed that of the first part.

This behavior could also be useful for other types of questions, like proofs. In the second part, I could ask to calculate an example, while in the first part, the student would fill in the gaps of the proof.

Here is my example. I have not corrected the grading logic. Please disregard it.

Moodle XML export ``` xml Gaussian-method-05 (uncertain system) function showFields(option) { var additionalFirstField = document.getElementById('additionalFirst'); var additionalSecondField = document.getElementById('additionalSecond'); var additionalThirdField = document.getElementById('additionalThird'); if (option.value == "Option 1") { additionalFirstField.style.display = 'block'; } else { additionalFirstField.style.display = 'none'; } if (option.value == "Option 2") { additionalSecondField.style.display = 'block'; } else { additionalSecondField.style.display = 'none'; } if (option.value == "Option 3") { additionalThirdField.style.display = 'block'; } else { additionalThirdField.style.display = 'none'; } }

Solve a system of linear equations using the Gaussian method


\[ \begin{cases} {M11} x_1  {=d[nM12]} {M12} x_2  {=d[nM13]} {M13} x_3  {=d[nM14]} {M14} x_4  {=d[nM15]} {M15} x_5 ={M16} \\ {M21} x_1  {=d[nM22]}{M22} x_2  {=d[nM23]}{M23} x_3  {=d[nM24]}{M24} x_4  {=d[nM25]}{M25} x_5={M26} \\ {M31} x_1  {=d[nM32]} {M32} x_2  {=d[nM33]} {M33} x_3  {=d[nM34]} {M34} x_4  {=d[nM35]} {M35} x_5 ={M36} \end{cases} \]

This system of equations is

]]>
35 0 0 question_7 Ваш ответ верный. Ваш ответ частично правильный. Ваш ответ неправильный. a={-9:-1}; b={-9:-1}; c={-5:-1,1:4}; d={-5:-1,1:4}; e={-9:-1}; f={0:5}; s={-5:-1,1:4}; g={-5:-1,1:4}; h={-5:-1,1:4}; i={-5:-1,1:4}; j={-5:-1,1:4}; k={-5:-1,1:4}; m={-5:-1,1:4}; n={-5:-1,1:4}; x={-5:-1,1:4}; y={-5:-1,1:4}; z={-5:-1,1:4}; u={-5:-1,1:4}; v={-5:-1,1:4}; =0) ? abs(M16) : M16; M21 = h*j; M22 = a*h*j; M23 = g*h*j + g*k; M24 = e*g*k + h*j*(b + e*g); M25 = f*g*k + h*j*(c + f*g); M26 = g*k*s + h*j*(d + g*s); M26 = (M26>=0) ? abs(M26) : M26; M31 = h*m; M32 = a*h*m; M33 = g*h*m + g*n; M34 = e*g*n + h*m*(b + e*g); M35 = f*g*n + h*m*(c + f*g); M36 = g*n*s + h*m*(d + g*s); M36 = (M36>=0) ? abs(M36) : M36; x1 = -a*y - b*u - c*v + d; x2 = y; x3 = -e*u - f*v + s; x4 = u; x5 = v; d=["", "+"]; nM12 = (M12>=0) ? 1 : 0; nM13 = (M13>=0) ? 1 : 0; nM14 = (M14>=0) ? 1 : 0; nM15 = (M15>=0) ? 1 : 0; nM22 = (M22>=0) ? 1 : 0; nM23 = (M23>=0) ? 1 : 0; nM24 = (M24>=0) ? 1 : 0; nM25 = (M25>=0) ? 1 : 0; nM32 = (M32>=0) ? 1 : 0; nM33 = (M33>=0) ? 1 : 0; nM34 = (M34>=0) ? 1 : 0; nM35 = (M35>=0) ? 1 : 0; ]]> abc 0 #1 4 0 2 [rangA, rangAb] 0 grade_rangA = (_0 == rangA) ? 1 : 0; grade_rangAb = (_1 == rangAb) ? 1 : 0; grade_part1 = grade_rangA + grade_rangAb; grade_part1 1 0 Enter the solutions in the appropriate fields below
\[\text{rank}(\mathbf{A})\\] = {_0}  

\[\text{rank}(\mathbf{\widetilde{A}})\\] = {_1}


]]>
1 #2 6 0 5 [x1, x2, x3,x4,x5] 0 grade_x1 = (_0 == x1) ? 1 : 0; grade_x2 = (_1 == x2) ? 1 : 0; grade_x3 = (_2 == x3) ? 1 : 0; grade_x4 = (_3 == x4) ? 1 : 0; grade_x5 = (_4 == x5) ? 1 : 0; grade_part2 = grade_x1 + grade_x2 + grade_x3 + grade_x4 + grade_x5; grade_part2 1 0 Enter the solutions in the appropriate fields below
\[x_1\] = {_0}
\[x_2\] = {_1}
\[x_3\] = {_2}
\[x_4\] = {_3}
\[x_5\] = {_4}

]]>
2 #3 25 0 5 [x1, x2, x3, x4, x5] 0 grade_x1 = (_0 == x1) ? 1 : 0; grade_x2 = (_1 == x2) ? 1 : 0; grade_x3 = (_2 == x3) ? 1 : 0; grade_x4 = (_3 == x4) ? 1 : 0; grade_x5 = (_4 == x5) ? 1 : 0; grade_part3 = 5*(grade_x1 + grade_x2 + grade_x3 + grade_x4 + grade_x5); grade_part3 1 0 Find a general solution to the system of equations (write it down on a sheet of paper).

Assign values to the free variables {y}, {u}, and {v}, in their respective orders, and find a specific solution.

Enter the solutions in the appropriate fields below

\[x_1\] = {_0}
\[x_2\] = {_1}
\[x_3\] = {_2}
\[x_4\] = {_3}
\[x_5\] = {_4}

]]>
```
PhilippImhof commented 2 weeks ago

I do not yet fully understand the idea:

The first part is fully correct, but I want to know whether the student answered the additional question in the second part correctly (depending on their choice). As a result, I evaluate them either on the first part or the second part, ensuring that the maximum grade doesn’t exceed that of the first part.

If the student gives a correct answer to part 1, they will also see part 2 and if they answer it, they will not get more points than they can get with part 1 alone?

Or do you mean you have two parts, one more difficult than the other, and the student can answer either of them?

alexanderlata commented 2 weeks ago

I do not yet fully understand the idea:

The first part is fully correct, but I want to know whether the student answered the additional question in the second part correctly (depending on their choice). As a result, I evaluate them either on the first part or the second part, ensuring that the maximum grade doesn’t exceed that of the first part.

If the student gives a correct answer to part 1, they will also see part 2 and if they answer it, they will not get more points than they can get with part 1 alone?

Or do you mean you have two parts, one more difficult than the other, and the student can answer either of them?

My idea includes the following points:  

  1. Non-linearly display the question parts on the screen based on the dropdown menu selection.
  2. Make the question more complex without explicitly stating the form of the correct answer.
  3. In case of an incorrect selection from the dropdown menu, allow the student to answer an additional question to make it easier to analyze their mistake.
  4. Functionality of the dropdown menu: when a selection is made, the student answers that part, and the remaining parts are locked. If the student changes their selection, the previously entered fields should be reset, and only the answer from the new part should be recorded.
  5. The ability to implement nested questions.
  6. The ability to use complex questions consisting of two parts, one more difficult than the other, where the student can answer either. The student will receive the corresponding grade, and the other part will be locked until they change their choice of which part to answer.   This way, we can organize different paths for solving problems containing simple elements.