Project

General

Profile

Bug #8027

Hotspot question creation dont display image

Added by Hubert Borderiou almost 4 years ago. Updated almost 4 years ago.

Status:
Bug resolved
Priority:
Urgent
Assignee:
Category:
Exercises
Target version:
Start date:
05/01/2016
Due date:
% Done:

100%

Estimated time:
Complexity:
Normal
SCRUM pts - complexity:
?

Description

The hotspot question creation stop displaying page before the <select> that allow to choice beetwen circle, rectable, polygon.

In file
main/inc/lib/javascript/hotspot/js/hotspot.js
line 1128
we've got

        switch (config.for) {
            case 'admin':
                xhrQuestion = $.getJSON('/main/exercice/hotspot_actionscript_admin.as.php', {
                    modifyAnswers: parseInt(config.questionId)
                });
                break;

            case 'user':
                xhrQuestion = $.getJSON('/main/exercice/hotspot_actionscript.as.php', {
                    modifyAnswers: parseInt(config.questionId),
                    exe_id: parseInt(config.exerciseId)
                });
                break;

            case 'solution':
                //no break
            case 'preview':
                xhrQuestion = $.getJSON('/main/exercice/hotspot_answers.as.php', {
                    modifyAnswers: parseInt(config.questionId),
                    exe_id: parseInt(config.exerciseId)
                });
                break;
        }

with path '/main/exercice/hotspot_actionscript_admin.as.php'
It works with chamilo install directly in your pathroot.
But my installations are in a subfolder of the pathroot, eg, http://mychamilo.plop.org/chamilo1/index.php
as a result, the path must be

xhrQuestion = $.getJSON('/chamilo1/main/exercice/hotspot_actionscript_admin.as.php', {

Associated revisions

Revision 79d6c3b7
Added by José Loguercio almost 4 years ago

Merge pull request #1031 from jloguercio/hotspot

Fix hotspot creation issue when relpath not empty - Refs #8027

Revision 7158520a
Added by José Loguercio almost 4 years ago

Merge pull request #1036 from jloguercio/8027-master

Fix hotspot creation issue when relpath not empty (master) - Refs #8027

History

#1

Updated by Hubert Borderiou almost 4 years ago

Solution :

FILE main/exercice/hotspot_admin.inc.php line 1024

    <?php
    $swf_loaded = $answerType == HOT_SPOT_DELINEATION ? 'hotspot_delineation_admin' : 'hotspot_admin';
    $height = 450;
    $relPath = api_get_path(REL_PATH);
    ?>
                <div id="hotspot-container" class="center-block">
                </div>
            </div>
        </div>
    </form>
    <script>
        $(document).on('ready', function () {
            <?php if ($answerType == HOT_SPOT_DELINEATION) { ?>
                new DelineationQuestion({
                    questionId: <?php echo $modifyAnswers ?>,
                    selector: '#hotspot-container',
                    for: 'admin',
                    relpath: '<?php echo $relPath ?>'
                });
            <?php } else { ?>
                new HotspotQuestion({
                    questionId: <?php echo $modifyAnswers ?>,
                    selector: '#hotspot-container',
                    for: 'admin',
                    relpath: '<?php echo $relPath ?>'
                });
            <?php } ?>
        });
    </script>

FILE main/inc/lib/javascript/hotspot/js/hotspot.js line 1128

       switch (config.for) {
            case 'admin':
                xhrQuestion = $.getJSON(config.relpath+'main/exercice/hotspot_actionscript_admin.as.php', {
                    modifyAnswers: parseInt(config.questionId)
                });
                break;

            case 'user':
                xhrQuestion = $.getJSON(config.relpath+'main/exercice/hotspot_actionscript.as.php', {
                    modifyAnswers: parseInt(config.questionId),
                    exe_id: parseInt(config.exerciseId)
                });
                break;

            case 'solution':
                //no break
            case 'preview':
                xhrQuestion = $.getJSON(config.relPath+'main/exercice/hotspot_answers.as.php', {
                    modifyAnswers: parseInt(config.questionId),
                    exe_id: parseInt(config.exerciseId)
                });
                break;
        }

#2

Updated by José Loguercio almost 4 years ago

Added here : https://github.com/chamilo/chamilo-lms/pull/1031
Fixed the conflicts and added a forgotten variable to change :

case 'solution':
//no break
case 'preview':
- xhrQuestion = $.getJSON(config.relpath + 'main/exercice/hotspot_answers.as.php', {
+ xhrQuestion = $.getJSON(config.relPath+'main/exercice/hotspot_answers.as.php', {
modifyAnswers: parseInt(config.questionId),
exe_id: parseInt(config.exerciseId)
});

#3

Updated by José Loguercio almost 4 years ago

  • Status changed from New to Needs testing
  • Assignee set to Yannick Warnier
  • % Done changed from 0 to 90
#4

Updated by Yannick Warnier almost 4 years ago

  • Assignee changed from Yannick Warnier to Hubert Borderiou
  • Priority changed from Normal to Urgent
  • % Done changed from 90 to 80

I cannot test that easily, because of the subfolder. Hubert, could you quickly check and approve this one please?

#5

Updated by Hubert Borderiou almost 4 years ago

Hi, i've install a fresh new chamilo 1.10.4 on a subfolder

and it works fine

(just dont forget to empty the cache folder before using the hotspot tool, otherwise got error
File does not exist: /var/www/official-chamilo110/web/assets/image-map-resizer, referer: http://chamilotest.test.com/official-chamilo110/main/exercice/exercise.php?cidReq=TESTSIMSU01&id_session=0&gidReq=0&gradebook=0&origin=&choice=delete&sec_token=b117fa8a3a60c28f464eaf6125cf822c&exerciseId=1
and JS function arent loaded)

#6

Updated by Yannick Warnier almost 4 years ago

  • Status changed from Needs testing to Bug resolved
  • Assignee changed from Hubert Borderiou to Angel Quiroz
  • % Done changed from 80 to 100

Thanks.

Also available in: Atom PDF