learningequality / ka-lite

KA Lite: lightweight web server for serving core Khan Academy content (videos and exercises) without needing internet connectivity
https://learningequality.org/ka-lite/
Other
458 stars 305 forks source link

"Click on the LEARN button above to get started" shown to coaches when viewing student report with no data #4088

Closed jamalex closed 9 years ago

jamalex commented 9 years ago

Branch: 0.14.x

Expected: This message should only be shown to the Learner, not to a Coach.

Observed: image

Debugging:

It seems the message is shown unconditionally, when the user whose data is being requested has no data to load, even if that's not the currently logged in user.

var StudentProgressContainerView = Backbone.View.extend({
    // The containing view
    template: HB.template('student_progress/student-progress-container'),

    initialize: function() {
        this.listenTo(this.collection, 'add', this.add_one);

        var self=this;

        this.render();

        this.collection.fetch({
                success: function() {
                     if (self.collection.length == 0) {       //if the student visits the my progress page before attempting any quizes/videos
                              show_message("info", gettext("Click on the LEARN button above to get started on your learning journey."));
                              self.$el.html("");             //this is done to remove the 'Progress Report' header 
                          }
                       }
                   });
    },
jamalex commented 9 years ago

Putting this on 0.14.x milestone, but thinking of it as a post-release bugfix.

rtibbles commented 9 years ago

Fixed in #4091