chamilo-lms icon indicating copy to clipboard operation
chamilo-lms copied to clipboard

Score Model only shows colors but not text

Open aelalfey opened this issue 5 years ago • 3 comments

Dears,

I enabled Score model from "configuration.php" and used it for one of my courses.

error 2

As you can see in the picture below it worked but the color doesn't have the text/name along with it.

Current behavior: it shows only colored boxes as in the picture below:

error

Expected behavior: it shows the colored box with the title/name inside of it as in the picture below:

error 3

aelalfey avatar Sep 20 '20 16:09 aelalfey

Funny you mention that: the implementation was made for a school that required us not to show a term but only to show colors, which explains why you don't see anything. I'm marking this as a feature request and I agree with the concept, but it will have to wait for the next major version because we're mostly focused on bug-fixing for now.

ywarnier avatar Nov 20 '20 22:11 ywarnier

@christianbeeznest This has to be an option somewhere at the level of 'name' => 'ThisIsMyModel'. Something like this:

$_configuration['score_grade_model'] = [
    'models' => [
        [
            'id' => 1,
            'name' => 'ThisIsMyModel', // Value will be translated using get_lang
            'display_score_name' => 0,
            'score_list' => [
                [
                    'name' => 'VeryBad', // Value will be translated using get_lang
                    'css_class' => 'btn-danger',
                    'min' => 0,
                    'max' => 20,
                    'score_to_qualify' => 0
                ],

Only if 'display_score_name' => 1, should we show the text for the score.

ywarnier avatar Sep 08 '25 22:09 ywarnier

It is checked and improved with this commit https://github.com/chamilo/chamilo-lms/pull/7024/commits/89153597d5b9fd8b12daa0a246d8ea066faadeec

Execute this migration php bin/console doctrine:migrations:execute Chamilo\CoreBundle\Migrations\Schema\V200\Version20250708115900

christianbeeznest avatar Nov 10 '25 00:11 christianbeeznest

Works well for me. @christianbeeznest please update the template for this setting to use terms that can be translated directly (not the 1.11.x syntax) in SettingsValueTemplateFixtures.php (this would require a migration also):

  • ThisIsMyModel -> My score grading model
  • VeryBad -> Very bad
  • VeryGood -> Very good

ywarnier avatar Dec 19 '25 15:12 ywarnier

Works well for me. @christianbeeznest please update the template for this setting to use terms that can be translated directly (not the 1.11.x syntax) in SettingsValueTemplateFixtures.php (this would require a migration also):

  • ThisIsMyModel -> My score grading model
  • VeryBad -> Very bad
  • VeryGood -> Very good

It is checked with this commit https://github.com/chamilo/chamilo-lms/pull/7199/commits/044248307f86a8ae4fd7b05a4b22ab6ef88b0b8a

Thanks for confirmation.

christianbeeznest avatar Dec 19 '25 19:12 christianbeeznest

Thanks. Works for me.

ywarnier avatar Dec 19 '25 22:12 ywarnier