Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
0d4b9d26
Commit
0d4b9d26
authored
12 years ago
by
Vik Paruchuri
Browse files
Options
Downloads
Patches
Plain Diff
Add in a test, rescale preview images
parent
9acc5922
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee
+18
-1
18 additions, 1 deletion
...b/xmodule/xmodule/js/src/combinedopenended/display.coffee
lms/djangoapps/open_ended_grading/tests.py
+9
-1
9 additions, 1 deletion
lms/djangoapps/open_ended_grading/tests.py
with
27 additions
and
2 deletions
common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee
+
18
−
1
View file @
0d4b9d26
...
...
@@ -553,10 +553,27 @@ class @CombinedOpenEnded
target_selection
=
$
(
event
.
target
).
val
()
Logger
.
log
'oe_feedback_response_selected'
,
{
value
:
target_selection
}
remove_attribute
:
(
name
)
=>
if
$
(
'.file-upload-preview'
).
attr
(
name
)
$
(
'.file-upload-preview'
)[
0
].
removeAttribute
(
name
)
preview_image
:
()
=>
if
$
(
'.file-upload-box'
)[
0
].
files
&&
$
(
'.file-upload-box'
)[
0
].
files
[
0
]
reader
=
new
FileReader
()
reader
.
onload
=
(
e
)
=>
$
(
'.file-upload-preview'
).
attr
(
'src'
,
e
.
target
.
result
).
width
(
150
).
height
(
150
)
max_dim
=
150
@
remove_attribute
(
'src'
)
@
remove_attribute
(
'height'
)
@
remove_attribute
(
'width'
)
$
(
'.file-upload-preview'
).
attr
(
'src'
,
e
.
target
.
result
)
height_px
=
$
(
'.file-upload-preview'
)[
0
].
height
width_px
=
$
(
'.file-upload-preview'
)[
0
].
width
scale_factor
=
0
if
height_px
>
width_px
scale_factor
=
height_px
/
max_dim
else
scale_factor
=
width_px
/
max_dim
$
(
'.file-upload-preview'
)[
0
].
width
=
width_px
/
scale_factor
$
(
'.file-upload-preview'
)[
0
].
height
=
height_px
/
scale_factor
$
(
'.file-upload-preview'
).
show
()
reader
.
readAsDataURL
(
$
(
'.file-upload-box'
)[
0
].
files
[
0
])
This diff is collapsed.
Click to expand it.
lms/djangoapps/open_ended_grading/tests.py
+
9
−
1
View file @
0d4b9d26
...
...
@@ -97,7 +97,7 @@ class TestStaffGradingService(LoginEnrollmentTestCase):
self
.
assertIsNotNone
(
d
[
'
rubric
'
])
def
test_
save_grade
(
self
):
def
save_grade
_base
(
self
,
skip
=
False
):
self
.
login
(
self
.
instructor
,
self
.
password
)
url
=
reverse
(
'
staff_grading_save_grade
'
,
kwargs
=
{
'
course_id
'
:
self
.
course_id
})
...
...
@@ -108,12 +108,20 @@ class TestStaffGradingService(LoginEnrollmentTestCase):
'
location
'
:
self
.
location
,
'
submission_flagged
'
:
"
true
"
,
'
rubric_scores[]
'
:
[
'
1
'
,
'
2
'
]}
if
skip
:
data
.
update
({
'
skipped
'
:
True
})
r
=
self
.
check_for_post_code
(
200
,
url
,
data
)
d
=
json
.
loads
(
r
.
content
)
self
.
assertTrue
(
d
[
'
success
'
],
str
(
d
))
self
.
assertEquals
(
d
[
'
submission_id
'
],
self
.
mock_service
.
cnt
)
def
test_save_grade
(
self
):
self
.
save_grade_base
(
skip
=
False
)
def
test_save_grade_skip
(
self
):
self
.
save_grade_base
(
skip
=
True
)
def
test_get_problem_list
(
self
):
self
.
login
(
self
.
instructor
,
self
.
password
)
...
...
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