Conflicts: cms/djangoapps/contentstore/tests/test_contentstore.py cms/djangoapps/contentstore/views.py cms/templates/edit_subsection.html cms/templates/overview.html cms/templates/unit.html cms/templates/widgets/header.html common/djangoapps/course_groups/tests/tests.py common/lib/xmodule/setup.py common/lib/xmodule/xmodule/capa_module.py common/lib/xmodule/xmodule/combined_open_ended_module.py common/lib/xmodule/xmodule/course_module.py common/lib/xmodule/xmodule/js/src/.gitignore common/lib/xmodule/xmodule/mako_module.py common/lib/xmodule/xmodule/modulestore/mongo.py common/lib/xmodule/xmodule/modulestore/store_utilities.py common/lib/xmodule/xmodule/modulestore/xml_exporter.py common/lib/xmodule/xmodule/open_ended_grading_classes/combined_open_ended_modulev1.py common/lib/xmodule/xmodule/open_ended_grading_classes/controller_query_service.py common/lib/xmodule/xmodule/open_ended_grading_classes/open_ended_module.py common/lib/xmodule/xmodule/open_ended_grading_classes/openendedchild.py common/lib/xmodule/xmodule/open_ended_grading_classes/self_assessment_module.py common/lib/xmodule/xmodule/peer_grading_module.py common/lib/xmodule/xmodule/tests/__init__.py common/lib/xmodule/xmodule/tests/test_capa_module.py common/lib/xmodule/xmodule/tests/test_self_assessment.py common/lib/xmodule/xmodule/x_module.py lms/djangoapps/courseware/grades.py lms/djangoapps/courseware/models.py lms/djangoapps/courseware/views.py lms/djangoapps/open_ended_grading/tests.py
92 lines
2.7 KiB
HTML
92 lines
2.7 KiB
HTML
<script type="text/javascript" src="/static/js/vendor/jquery.leanModal.min.js"></script>
|
|
<script type="text/javascript">
|
|
|
|
function setup_debug(element_id, edit_link, staff_context){
|
|
$('#' + element_id + '_trig').leanModal();
|
|
$('#' + element_id + '_xqa_log').leanModal();
|
|
$('#' + element_id + '_xqa_form').submit(function () {sendlog(element_id, edit_link, staff_context);});
|
|
|
|
$("#" + element_id + "_history_trig").leanModal();
|
|
|
|
$('#' + element_id + '_history_form').submit(
|
|
function () {
|
|
var username = $("#" + element_id + "_history_student_username").val();
|
|
var location = $("#" + element_id + "_history_location").val();
|
|
|
|
// This is a ridiculous way to get the course_id, but I'm not sure
|
|
// how to do it sensibly from within the staff debug code.
|
|
// staff_problem_info.html is rendered through a wrapper to get_html
|
|
// that's injected by the code that adds the histogram -- it's all
|
|
// kinda bizarre, and it remains awkward to simply ask "what course
|
|
// is this problem being shown in the context of."
|
|
var path_parts = window.location.pathname.split('/');
|
|
var course_id = path_parts[2] + "/" + path_parts[3] + "/" + path_parts[4];
|
|
$("#" + element_id + "_history_text").load('/courses/' + course_id +
|
|
"/submission_history/" + username + "/" + location);
|
|
return false;
|
|
}
|
|
);
|
|
}
|
|
|
|
function sendlog(element_id, edit_link, staff_context){
|
|
|
|
var xqaLog = {
|
|
authkey: staff_context.xqa_key,
|
|
location: staff_context.location,
|
|
category : staff_context.category,
|
|
'username' : staff_context.user.username,
|
|
'return' : 'query',
|
|
format : 'html',
|
|
email : staff_context.user.email,
|
|
tag:$('#' + element_id + '_xqa_tag').val(),
|
|
entry: $('#' + element_id + '_xqa_entry').val()
|
|
};
|
|
|
|
$.ajax({
|
|
url: '${xqa_server}/log',
|
|
type: 'GET',
|
|
contentType: 'application/json',
|
|
data: JSON.stringify(xqaLog),
|
|
crossDomain: true,
|
|
dataType: 'jsonp',
|
|
beforeSend: function (xhr) {
|
|
xhr.setRequestHeader ("Authorization", "Basic eHFhOmFnYXJ3YWw="); },
|
|
timeout : 1000,
|
|
success: function(result) {
|
|
$('#' + element_id + '_xqa_log_data').html(result);
|
|
},
|
|
error: function() {
|
|
alert('Error: cannot connect to XQA server');
|
|
console.log('error!');
|
|
}
|
|
});
|
|
return false;
|
|
};
|
|
|
|
function getlog(element_id, staff_context){
|
|
|
|
var xqaQuery = {
|
|
authkey: staff_context.xqa_key,
|
|
location: staff_context.location,
|
|
format: 'html'
|
|
};
|
|
|
|
$.ajax({
|
|
url: '${xqa_server}/query',
|
|
type: 'GET',
|
|
contentType: 'application/json',
|
|
data: JSON.stringify(xqaQuery),
|
|
crossDomain: true,
|
|
dataType: 'jsonp',
|
|
timeout : 1000,
|
|
success: function(result) {
|
|
$('#' + element_id + '_xqa_log_data').html(result);
|
|
},
|
|
error: function() {
|
|
alert('Error: cannot connect to XQA server');
|
|
}
|
|
});
|
|
|
|
|
|
};
|
|
</script> |