ucfopen / Materia

Engage students with easily embedded apps for online courses. Supercharge your course with compelling experiences and game mechanics.
https://ucfopen.github.io/Materia-Docs/
GNU Affero General Public License v3.0
36 stars 33 forks source link

[Reach Branch] Support users should be able to view standalone score screens associated with a specific play/context ID #1457

Closed clpetersonucf closed 1 month ago

clpetersonucf commented 1 year ago

Right now, you can review a user's instance play history as a support user, and even have the option to view the score screen in question by selecting the score value in the user admin panel:

Screenshot 2023-03-08 at 1 50 23 PM

However, doing so leads to the score screen in an error state. It appears to be due to the fact that the score manager's get_instance_score_history method is searching for instance scores implicitly associated with the current user:

$query = \DB::select('id','created_at','percent')
            ->from('log_play')
            ->where('is_complete', '1')
            ->where('user_id', \Model_User::find_current_id())
            ->where('inst_id', $inst_id)
            ->order_by('created_at', 'DESC');

We may want to consider changing this behavior slightly to allow either one of the following cases:

  1. Get instance score history for a particular instance for the current user and optionally, a given context ID
  2. Get instance score history for a a particular instance if the user is a support user and a context ID is provided

At least right now, the user admin and instance admin panels don't display the full score history of an instance, so it's up for debate whether option 2 should even require a context ID if the user is a support user.

clpetersonucf commented 11 months ago

I'm leaving this open pending further investigation and its potential association with #1494, however it should be noted that this behavior is no longer occurring - the score screen loads fine for me when viewing a score for a play, even if it's an instance I don't have explicit permissions to.

clpetersonucf commented 1 month ago

Implemented via #1581 as part of 10.2.0.