Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lms/static/js/staff_debug_actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ var StaffDebug = (function() {
return string.replace(/[.*+?^:${}()|[\]\\]/g, '\\$&');
};

var sanitizeScore = function(string){
return string.replace(/[^0-9.]/g, '');
};

var getUser = function(locationName) {
var sanitizedLocationName = sanitizeString(locationName);
var uname = $('#sd_fu_' + sanitizedLocationName).val();
Expand All @@ -24,6 +28,7 @@ var StaffDebug = (function() {
if (score === '') {
score = $('#sd_fs_' + sanitizedLocationName).attr('placeholder');
}
score = sanitizeScore(score)
return score;
};

Expand Down
2 changes: 1 addition & 1 deletion lms/templates/staff_problem_info.html
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ <h3>${_('Actions')}</h3>
% if can_override_problem_score:
<div>
<label for="sd_fs_${location.block_id}">${_('Score (for override only)')}:</label>
<input type="text" tabindex="0" id="sd_fs_${location.block_id}" placeholder="0"/>
<input type="number" tabindex="0" id="sd_fs_${location.block_id}" placeholder="0"/>
<label for="sd_fs_${location.block_id}"> / ${max_problem_score}</label>
</div>
% endif
Expand Down