Project

General

Profile

Bug #6310

Reported by forum user - Hotspot not storing the first spot created

Added by Eric Petitdemange about 6 years ago. Updated over 5 years ago.

Status:
Bug resolved
Priority:
Normal
Assignee:
Category:
Exercises
Target version:
Start date:
28/06/2013
Due date:
01/07/2013
% Done:

100%

Estimated time:
1.00 h
Spent time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

Please refer to : http://www.chamilo.org/phpBB3/viewtopic.php?f=6&t=4545

To gain time : create an spot on image exercise.
On the image, select the first zone, then a second one.

Attempt the exercise as trainee.
You'll occur a final mark 50% as teh first spot is not taken into account, so marked as failed.


Related issues

Related to Chamilo LMS - Bug #6511: Hotspot fails - First area disappearsBug resolved04/08/2013

Actions

Associated revisions

Revision e678def7 (diff)
Added by Julio Montoya almost 6 years ago

Adding hotspot type and coordinates when updating answer see #6310

History

#1

Updated by Rory Fogerty about 6 years ago

The issue is that /main/exercice/answer.class.php does not update the c_quiz_answer table with the $hotspot_coordinates and $hotspot_type.

The solution that works for me is to update /main/exercice/answer.class.php as follows:

line 445 change the function [b]update Answers[/b] to read:

    function updateAnswers($answer,$comment,$weighting,$position,$hotspot_coordinates,$hotspot_type,$destination) {
        $TBL_REPONSES = Database :: get_course_table(TABLE_QUIZ_ANSWER);

        $questionId=$this->questionId;
        $sql = "UPDATE $TBL_REPONSES SET 
                answer = '".Database::escape_string($answer)."',
                comment = '".Database::escape_string($comment)."', 
                ponderation = '".Database::escape_string($weighting)."', 
                position = '".Database::escape_string($position)."', 
                destination = '".Database::escape_string($destination)."',
                hotspot_coordinates = '".Database::escape_string($hotspot_coordinates)."',
                hotspot_type = '".Database::escape_string($hotspot_type)."'
                WHERE c_id = {$this->course_id} AND id = '".Database::escape_string($position)."'
                AND question_id = '".Database::escape_string($questionId)."'";
        Database::query($sql);
    }

update line 491 from [i]$this->updateAnswers($answer, $comment, $weighting, $position, $destination);[/i]
to:
[code]$this->updateAnswers($answer, $comment, $weighting, $position,$hotspot_coordinates,$hotspot_type,$destination);[/code]

Not only does this store the first hotpsot but it also allows you to change hotspots already defined.

#2

Updated by Yannick Warnier about 6 years ago

  • Due date set to 01/07/2013
  • Category set to Exercises
  • Status changed from New to Assigned
  • Assignee set to Julio Montoya
  • Target version set to 1.9.8
  • Estimated time set to 1.00 h

Thanks Rory! Assigning to Julio for revision. Should be included soon if everything's fine.
Julio, don't forget to add Rory to documentation/credits.html (in "Thanks also go to...") as he has already contributed a few patches :-)
Rory, let us know if you want your e-mail to appear there (or not).

#3

Updated by Rory Fogerty about 6 years ago

There is a further error in updateAnswers - it does not store a Multiple Answers question correctly. To make this work see [[http://www.chamilo.org/phpBB3/viewtopic.php?f=6&t=4545&p=20555]]

Am happy for my email to appear.

#4

Updated by Yannick Warnier almost 6 years ago

  • Assignee changed from Julio Montoya to Yoselyn Castillo
#5

Updated by Yoselyn Castillo almost 6 years ago

  • % Done changed from 0 to 60
#6

Updated by Yoselyn Castillo almost 6 years ago

A commit for this and #6533 was sent to:
https://github.com/chamilo/chamilo-lms/pull/110.
Please try it and let me know if there is any other bug when editing questions in tests

#7

Updated by Julio Montoya almost 6 years ago

  • Assignee changed from Yoselyn Castillo to Julio Montoya

I'm taking this task

#8

Updated by Julio Montoya almost 6 years ago

  • Status changed from Assigned to Needs testing
  • Assignee deleted (Julio Montoya)
  • % Done changed from 60 to 80
#9

Updated by Eric Petitdemange almost 6 years ago

Hi guys,
I'm just back :)

I saw an answer on the forum, this may be the solution...
http://www.chamilo.org/phpBB3/viewtopic.php?f=6&t=4545

#10

Updated by Yannick Warnier over 5 years ago

  • Status changed from Needs testing to Bug resolved
  • Assignee set to Julio Montoya
  • % Done changed from 80 to 100

As far as I know, this is fixed (as well as its 2 duplicate tasks). At least I cannot reproduce it anymore.

#11

Updated by Yannick Warnier over 5 years ago

  • Assignee changed from Julio Montoya to Rory Fogerty

Please ignore this update - Attributing credit internally for the contribution

Also available in: Atom PDF