Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
34fd4a65
Commit
34fd4a65
authored
6 years ago
by
Simon Chen
Browse files
Options
Downloads
Patches
Plain Diff
Remove auto grade column from override modal
parent
b14d9b48
No related branches found
Branches containing commit
Tags
release-2021-03-16-09.35
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/static/common/templates/gradebook/_gradebook_modal_table.underscore
+0
-3
0 additions, 3 deletions
...mon/templates/gradebook/_gradebook_modal_table.underscore
lms/static/js/writable_gradebook.js
+43
-63
43 additions, 63 deletions
lms/static/js/writable_gradebook.js
with
43 additions
and
66 deletions
common/static/common/templates/gradebook/_gradebook_modal_table.underscore
+
0
−
3
View file @
34fd4a65
...
...
@@ -19,15 +19,12 @@
<table id="grade-override-modal-table">
<thead>
<th><%- strLib.studentNameHeading %></th>
<th id="auto-grade-header"></th>
<th id="adjusted-grade-header"></th>
</thead>
<tbody>
<% _.each(studentsData, function(student){ %>
<tr data-user-id="<%- student.user_id %>" data-course-id="<%- student.course_id %>" data-username="<%- student.username %>">
<td class="user-student-name"><%- student.full_name || student.username %></td>
<td class="user-auto-grade" data-username="<%- student.username %>">
</td>
<td class="user-adjusted-grade" data-username="<%- student.username %>">
<input type=text>/<span></span>
</td>
...
...
This diff is collapsed.
Click to expand it.
lms/static/js/writable_gradebook.js
+
43
−
63
View file @
34fd4a65
...
...
@@ -98,7 +98,7 @@ $(document).ready(function() {
const
options
=
{
columnDefs
:
[{
orderable
:
false
,
targets
:
2
targets
:
1
}],
language
:
{
zeroRecords
:
''
...
...
@@ -299,7 +299,6 @@ $(document).ready(function() {
function
fillModalTemplate
()
{
var
$modal
=
$
(
'
.grade-override-modal
'
);
var
$adjustedGradeHeader
=
$modal
.
find
(
'
#adjusted-grade-header
'
);
var
$autoGradeHeader
=
$modal
.
find
(
'
#auto-grade-header
'
);
var
$manualGradeVisibilityWrapper
=
$modal
.
find
(
'
#manual-grade-visibility
'
);
var
$saveGradeOverrideButton
=
$modal
.
find
(
'
.grade-override-modal-save
'
);
var
$tableWrapper
=
$modal
.
find
(
'
.grade-override-table-wrapper
'
);
...
...
@@ -312,59 +311,46 @@ $(document).ready(function() {
$modal
.
find
(
'
.assignment-name-placeholder
'
).
text
(
assignmentName
);
$modal
.
find
(
'
.block-id-placeholder
'
).
text
(
blockID
);
$modal
.
find
(
'
.grade-override-info-container
'
).
hide
();
if
(
_
.
isEmpty
(
userAutoGrades
)
)
{
$tableWrapper
.
hide
();
$manualGradeVisibilityWrapper
.
toggle
(
false
);
$modal
.
find
(
'
.grade-override-message
'
).
text
(
gettext
(
'
There are no student grades to adjust.
'
));
$modal
.
find
(
'
.grade-override-message
'
).
show
();
$saveGradeOverrideButton
.
hide
();
}
else
{
$adjustedGradeHeader
.
text
(
isManualGrading
?
'
Manual grade
'
:
'
Adjusted grade
'
);
$autoGradeHeader
.
text
(
isManualGrading
?
'
Current grade
'
:
'
Auto grade
'
);
$manualGradeVisibilityWrapper
.
toggle
(
isManualGrading
);
$saveGradeOverrideButton
.
attr
(
'
data-manual-grading
'
,
isManualGrading
);
$manualGradeVisibilityWrapper
.
attr
(
'
data-visibility
'
,
gradesPublished
);
$
(
'
input[name=grades-published]
'
).
prop
(
'
checked
'
,
gradesPublished
);
$tableWrapper
.
attr
(
'
data-manual-grading
'
,
isManualGrading
);
$tableWrapper
.
show
();
$modal
.
find
(
'
#modal-table-empty-message
'
).
hide
();
$saveGradeOverrideButton
.
show
().
prop
(
'
disabled
'
,
true
);
modalDataTable
.
$
(
'
tr
'
).
each
(
function
(){
$
(
this
).
attr
(
'
data-block-id
'
,
blockID
);
var
$adjustedGradePlaceholder
=
$
(
this
).
find
(
'
td.user-adjusted-grade
'
);
var
$autoGradePlaceholder
=
$
(
this
).
find
(
'
td.user-auto-grade
'
);
var
username
=
$autoGradePlaceholder
.
attr
(
'
data-username
'
);
if
(
username
in
userAutoGrades
)
{
$autoGradePlaceholder
.
text
(
userAutoGrades
[
username
]);
var
autoEarnedGrade
=
userAutoGrades
[
username
].
split
(
'
/
'
)[
0
],
autoPossibleGrade
=
userAutoGrades
[
username
].
split
(
'
/
'
)[
1
];
$adjustedGradePlaceholder
.
attr
(
'
data-score-earned
'
,
autoEarnedGrade
);
$adjustedGradePlaceholder
.
attr
(
'
data-score-possible
'
,
autoPossibleGrade
);
$autoGradePlaceholder
.
attr
(
'
data-sort
'
,
autoEarnedGrade
);
if
(
username
in
userAdjustedGrades
)
{
var
adjustedGrade
=
userAdjustedGrades
[
username
].
split
(
'
/
'
)[
0
];
$adjustedGradePlaceholder
.
attr
(
'
data-score-earned
'
,
adjustedGrade
);
$adjustedGradePlaceholder
.
attr
(
'
data-sort
'
,
adjustedGrade
);
$adjustedGradePlaceholder
.
addClass
(
'
has-adjusted-score
'
);
}
else
if
(
isManualGrading
)
{
$adjustedGradePlaceholder
.
attr
(
'
data-sort
'
,
autoEarnedGrade
);
}
else
{
$adjustedGradePlaceholder
.
attr
(
'
data-sort
'
,
autoEarnedGrade
);
}
$adjustedGradePlaceholder
.
find
(
'
input
'
).
val
(
$adjustedGradePlaceholder
.
attr
(
'
data-score-earned
'
));
$adjustedGradePlaceholder
.
find
(
'
span
'
).
text
(
$adjustedGradePlaceholder
.
attr
(
'
data-score-possible
'
));
$adjustedGradeHeader
.
text
(
isManualGrading
?
'
Manual grade
'
:
'
Grade
'
);
$manualGradeVisibilityWrapper
.
toggle
(
isManualGrading
);
$saveGradeOverrideButton
.
attr
(
'
data-manual-grading
'
,
isManualGrading
);
$manualGradeVisibilityWrapper
.
attr
(
'
data-visibility
'
,
gradesPublished
);
$
(
'
input[name=grades-published]
'
).
prop
(
'
checked
'
,
gradesPublished
);
$tableWrapper
.
attr
(
'
data-manual-grading
'
,
isManualGrading
);
$tableWrapper
.
show
();
$modal
.
find
(
'
#modal-table-empty-message
'
).
hide
();
$saveGradeOverrideButton
.
show
().
prop
(
'
disabled
'
,
true
);
modalDataTable
.
$
(
'
tr
'
).
each
(
function
(){
$
(
this
).
attr
(
'
data-block-id
'
,
blockID
);
var
$adjustedGradePlaceholder
=
$
(
this
).
find
(
'
td.user-adjusted-grade
'
);
var
username
=
$adjustedGradePlaceholder
.
attr
(
'
data-username
'
);
if
(
username
in
userAutoGrades
)
{
var
autoEarnedGrade
=
userAutoGrades
[
username
].
split
(
'
/
'
)[
0
],
autoPossibleGrade
=
userAutoGrades
[
username
].
split
(
'
/
'
)[
1
];
$adjustedGradePlaceholder
.
attr
(
'
data-score-earned
'
,
autoEarnedGrade
);
$adjustedGradePlaceholder
.
attr
(
'
data-score-possible
'
,
autoPossibleGrade
);
if
(
username
in
userAdjustedGrades
)
{
var
adjustedGrade
=
userAdjustedGrades
[
username
].
split
(
'
/
'
)[
0
];
$adjustedGradePlaceholder
.
attr
(
'
data-score-earned
'
,
adjustedGrade
);
$adjustedGradePlaceholder
.
attr
(
'
data-sort
'
,
adjustedGrade
);
$adjustedGradePlaceholder
.
addClass
(
'
has-adjusted-score
'
);
}
else
$
(
this
).
hide
();
});
}
else
if
(
isManualGrading
)
{
$adjustedGradePlaceholder
.
attr
(
'
data-sort
'
,
autoEarnedGrade
);
}
else
{
$adjustedGradePlaceholder
.
attr
(
'
data-sort
'
,
autoEarnedGrade
);
}
$adjustedGradePlaceholder
.
find
(
'
input
'
).
val
(
$adjustedGradePlaceholder
.
attr
(
'
data-score-earned
'
));
$adjustedGradePlaceholder
.
find
(
'
span
'
).
text
(
$adjustedGradePlaceholder
.
attr
(
'
data-score-possible
'
));
}
else
$
(
this
).
hide
();
});
$modal
.
show
();
}
...
...
@@ -430,15 +416,13 @@ $(document).ready(function() {
}
$
(
document
).
on
(
'
keyup focus
'
,
'
.user-adjusted-grade input
'
,
function
(){
var
$row
=
$
(
this
).
parents
(
'
tr
'
),
$cell
=
$
(
this
).
parents
(
'
td
'
),
autoGrade
=
$row
.
find
(
'
.user-auto-grade
'
).
html
().
split
(
'
/
'
)[
0
],
var
$cell
=
$
(
this
).
parents
(
'
td
'
),
previousGrade
=
$cell
.
attr
(
'
data-score-earned
'
);
adjustedGrade
=
$
(
this
).
val
();
$cell
.
attr
(
'
data-sort
'
,
adjustedGrade
);
if
(
autoGrade
!=
adjustedGrade
||
previousGrade
!=
adjustedGrade
)
if
(
previousGrade
!=
adjustedGrade
)
$
(
this
).
addClass
(
'
score-visited
'
);
else
$
(
this
).
removeClass
(
'
score-visited
'
);
...
...
@@ -460,9 +444,7 @@ $(document).ready(function() {
var
$gradeCell
=
$row
.
find
(
'
.user-adjusted-grade
'
);
var
$grade
=
$gradeCell
.
find
(
'
input
'
);
var
username
=
$gradeCell
.
attr
(
'
data-username
'
);
var
autoGrade
;
var
grade
;
var
removeAdjustedGrade
;
if
(
$grade
.
hasClass
(
'
score-visited
'
))
adjustedGradesData
[
username
]
=
{
...
...
@@ -473,12 +455,10 @@ $(document).ready(function() {
};
if
(
username
in
adjustedGradesData
)
{
autoGrade
=
$row
.
find
(
'
.user-auto-grade
'
).
text
().
split
(
'
/
'
)[
0
];
grade
=
$grade
.
val
().
trim
();
removeAdjustedGrade
=
isManualGrading
||
autoGrade
===
grade
;
adjustedGradesData
[
username
].
grade
=
grade
;
adjustedGradesData
[
username
].
remove_adjusted_grade
=
removeAdjustedGrad
e
;
adjustedGradesData
[
username
].
remove_adjusted_grade
=
tru
e
;
adjustedGradesData
[
username
].
section_block_id
=
sectionBlockId
;
}
});
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment