Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
0d4b9d26
Commit
0d4b9d26
authored
Apr 16, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add in a test, rescale preview images
parent
9acc5922
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
2 deletions
+27
-2
common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee
+18
-1
lms/djangoapps/open_ended_grading/tests.py
+9
-1
No files found.
common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee
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
])
lms/djangoapps/open_ended_grading/tests.py
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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment