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
9e03280f
Commit
9e03280f
authored
May 07, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make peer grading fields stringy and fix js to avoid strange error
parent
258aebed
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
common/lib/xmodule/xmodule/js/src/peergrading/peer_grading.coffee
+4
-3
common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee
+0
-1
common/lib/xmodule/xmodule/peer_grading_module.py
+6
-6
No files found.
common/lib/xmodule/xmodule/js/src/peergrading/peer_grading.coffee
View file @
9e03280f
...
@@ -8,6 +8,10 @@ class @PeerGrading
...
@@ -8,6 +8,10 @@ class @PeerGrading
@
use_single_location
=
@
peer_grading_container
.
data
(
'use-single-location'
)
@
use_single_location
=
@
peer_grading_container
.
data
(
'use-single-location'
)
@
peer_grading_outer_container
=
$
(
'.peer-grading-container'
)
@
peer_grading_outer_container
=
$
(
'.peer-grading-container'
)
@
ajax_url
=
@
peer_grading_container
.
data
(
'ajax-url'
)
@
ajax_url
=
@
peer_grading_container
.
data
(
'ajax-url'
)
if
@
use_single_location
@
activate_problem
()
else
@
error_container
=
$
(
'.error-container'
)
@
error_container
=
$
(
'.error-container'
)
@
error_container
.
toggle
(
not
@
error_container
.
is
(
':empty'
))
@
error_container
.
toggle
(
not
@
error_container
.
is
(
':empty'
))
...
@@ -20,9 +24,6 @@ class @PeerGrading
...
@@ -20,9 +24,6 @@ class @PeerGrading
@
problem_list
=
$
(
'.problem-list'
)
@
problem_list
=
$
(
'.problem-list'
)
@
construct_progress_bar
()
@
construct_progress_bar
()
if
@
use_single_location
@
activate_problem
()
construct_progress_bar
:
()
=>
construct_progress_bar
:
()
=>
problems
=
@
problem_list
.
find
(
'tr'
).
next
()
problems
=
@
problem_list
.
find
(
'tr'
).
next
()
problems
.
each
(
(
index
,
element
)
=>
problems
.
each
(
(
index
,
element
)
=>
...
...
common/lib/xmodule/xmodule/js/src/peergrading/peer_grading_problem.coffee
View file @
9e03280f
...
@@ -27,7 +27,6 @@ class @PeerGradingProblemBackend
...
@@ -27,7 +27,6 @@ class @PeerGradingProblemBackend
else
else
# if this post request fails, the error callback will catch it
# if this post request fails, the error callback will catch it
$
.
post
(
@
ajax_url
+
cmd
,
data
,
callback
)
$
.
post
(
@
ajax_url
+
cmd
,
data
,
callback
)
.
error
=>
callback
({
success
:
false
,
error
:
"Error occured while performing this operation"
})
mock
:
(
cmd
,
data
)
->
mock
:
(
cmd
,
data
)
->
if
cmd
==
'is_student_calibrated'
if
cmd
==
'is_student_calibrated'
...
...
common/lib/xmodule/xmodule/peer_grading_module.py
View file @
9e03280f
...
@@ -11,7 +11,7 @@ from xmodule.raw_module import RawDescriptor
...
@@ -11,7 +11,7 @@ from xmodule.raw_module import RawDescriptor
from
xmodule.modulestore.django
import
modulestore
from
xmodule.modulestore.django
import
modulestore
from
.timeinfo
import
TimeInfo
from
.timeinfo
import
TimeInfo
from
xblock.core
import
Object
,
Integer
,
Boolean
,
String
,
Scope
from
xblock.core
import
Object
,
Integer
,
Boolean
,
String
,
Scope
from
xmodule.fields
import
Date
,
StringyFloat
from
xmodule.fields
import
Date
,
StringyFloat
,
StringyInteger
,
StringyBoolean
from
xmodule.open_ended_grading_classes.peer_grading_service
import
PeerGradingService
,
GradingServiceError
,
MockPeerGradingService
from
xmodule.open_ended_grading_classes.peer_grading_service
import
PeerGradingService
,
GradingServiceError
,
MockPeerGradingService
from
open_ended_grading_classes
import
combined_open_ended_rubric
from
open_ended_grading_classes
import
combined_open_ended_rubric
...
@@ -28,14 +28,14 @@ EXTERNAL_GRADER_NO_CONTACT_ERROR = "Failed to contact external graders. Please
...
@@ -28,14 +28,14 @@ EXTERNAL_GRADER_NO_CONTACT_ERROR = "Failed to contact external graders. Please
class
PeerGradingFields
(
object
):
class
PeerGradingFields
(
object
):
use_for_single_location
=
Boolean
(
help
=
"Whether to use this for a single location or as a panel."
,
use_for_single_location
=
Stringy
Boolean
(
help
=
"Whether to use this for a single location or as a panel."
,
default
=
USE_FOR_SINGLE_LOCATION
,
scope
=
Scope
.
settings
)
default
=
USE_FOR_SINGLE_LOCATION
,
scope
=
Scope
.
settings
)
link_to_location
=
String
(
help
=
"The location this problem is linked to."
,
default
=
LINK_TO_LOCATION
,
link_to_location
=
String
(
help
=
"The location this problem is linked to."
,
default
=
LINK_TO_LOCATION
,
scope
=
Scope
.
settings
)
scope
=
Scope
.
settings
)
is_graded
=
Boolean
(
help
=
"Whether or not this module is scored."
,
default
=
IS_GRADED
,
scope
=
Scope
.
settings
)
is_graded
=
Stringy
Boolean
(
help
=
"Whether or not this module is scored."
,
default
=
IS_GRADED
,
scope
=
Scope
.
settings
)
due_date
=
Date
(
help
=
"Due date that should be displayed."
,
default
=
None
,
scope
=
Scope
.
settings
)
due_date
=
Date
(
help
=
"Due date that should be displayed."
,
default
=
None
,
scope
=
Scope
.
settings
)
grace_period_string
=
String
(
help
=
"Amount of grace to give on the due date."
,
default
=
None
,
scope
=
Scope
.
settings
)
grace_period_string
=
String
(
help
=
"Amount of grace to give on the due date."
,
default
=
None
,
scope
=
Scope
.
settings
)
max_grade
=
Integer
(
help
=
"The maximum grade that a student can receieve for this problem."
,
default
=
MAX_SCORE
,
max_grade
=
Stringy
Integer
(
help
=
"The maximum grade that a student can receieve for this problem."
,
default
=
MAX_SCORE
,
scope
=
Scope
.
settings
)
scope
=
Scope
.
settings
)
student_data_for_location
=
Object
(
help
=
"Student data for a given peer grading problem."
,
student_data_for_location
=
Object
(
help
=
"Student data for a given peer grading problem."
,
scope
=
Scope
.
user_state
)
scope
=
Scope
.
user_state
)
...
@@ -93,9 +93,9 @@ class PeerGradingModule(PeerGradingFields, XModule):
...
@@ -93,9 +93,9 @@ class PeerGradingModule(PeerGradingFields, XModule):
if
not
self
.
ajax_url
.
endswith
(
"/"
):
if
not
self
.
ajax_url
.
endswith
(
"/"
):
self
.
ajax_url
=
self
.
ajax_url
+
"/"
self
.
ajax_url
=
self
.
ajax_url
+
"/"
if
not
isinstance
(
self
.
max_grade
,
(
int
,
long
)
):
if
not
isinstance
(
self
.
max_grade
,
int
):
#This could result in an exception, but not wrapping in a try catch block so it moves up the stack
#This could result in an exception, but not wrapping in a try catch block so it moves up the stack
self
.
max_grade
=
int
(
self
.
max_grade
)
raise
TypeError
(
"max_grade needs to be an integer."
)
def
closed
(
self
):
def
closed
(
self
):
return
self
.
_closed
(
self
.
timeinfo
)
return
self
.
_closed
(
self
.
timeinfo
)
...
...
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