Open sivashankerN opened 6 years ago
For testing utils.html
file contains. For Production, need to change usgaeUrl and feedbackUrl
<html>
<head>
<script>
var usageUrl = "http://analytics.base1.vlabs.ac.in/";
var feedbackBaseUrl = "http://feedback.base1.vlabs.ac.in"
var key = "defaultkey";
var submitUsage = function(labId, expName, labName, userId, expId) {
var xhttp = new XMLHttpRequest();
var urlstr = usageUrl + userId + "," + labId + "," + labName + "," + expId + "," + expName;
xhttp.open("GeT", urlstr, true);
xhttp.send();
};
var submitFeedback = function(labId, labName, expId, expName, userId) {
if (expId == "" || expName == "")
{
feedback_url = feedbackBaseUrl + "/feedback?lab_name=" + labName + "&key=" + key + "&user_id=" + userId;
window.open(feedback_url, '_blank');
}
else {
///Experiment wise feedback
feedback_url = feedbackBaseUrl + "/feedback?lab_name=" + labName + "&exp_name=" + expName + "&key=" + key + "&user_id=" + userId;
window.open(feedback_url, '_blank');
}
};
</script>
</head>
</html>
To delete following lines in every experiment of every course
var server_url = "http://analytics-api.vlabs.ac.in/" var xhttp = new XMLHttpRequest(); var urlstr = server_url + user_id + "," + lab_id + "," + lab_name + "," + exp_id + "," + exp_name xhttp.open("GET", urlstr, true);
Used following shell script 'delete.sh' after cloning all repository from https://github.com/vlabs-on-openedx using GitHub API
DEST="edx_repos/*/html/*.html"
sed -i '/var server_url/d;/var xhttp/d;/var urlstr/d;/xhttp.open/d' $DEST
sed -i 's/xhttp.send\(\).*/submitUsage\(lab_id\, exp_name\, lab_name\, user_id\, exp_id\)\;/g' $DEST
sed -i 's/submit_feedback/submitFeedback/g' $DEST
sed -i '/vlabs.ac.in:5959\/feedback_utils.js/d' $DEST
Above shell script also does other tasks(2 to 4) mentioned in the first comment of this issue.
Tagged every repository with version v1.1.0 before committing the changes
and then committed the latest changes( that are made with the above shell script delete.sh).
utils.html
file content should be added in /edx/var/nginx/server-static/utils.html
Add the following line
add_after_body /server/utils.html;
to /edx/app/nginx/sites-available/lms
at location @proxy_to_lms_app
location in lms file.
restart nginx service.
You may have to restart edx services too.
sudo /edx/bin/supervisorctl restart all
Set vlabs-utils( feedback and usage analytics) for OpenedX platform.
For this
Replace the line
xhttp.send()
withsubmitUsage(lab_id, exp_name, lab_name, user_id, exp_id);
in every experiment of the course.Replace the string
submit_feedback
withsubmitFeedback
in every course.Delete the line
<p><!-- <script src="https://vlabs.ac.in:5959/feedback_utils.js"></script> -->
in every course.So that later, add the
utils.html
in OpenedX platform.