quizzer
Version:
Quizzer is a webserver for collaborative writing lab support. Based on a _fail early, fail often? approach to written language, the tool is particularly suited to second-language learners. The workflow (essay - error - quiz - exam) treats mistakes as an o
18 lines (17 loc) • 790 B
JavaScript
(function () {
var cogClass = function () {};
cogClass.prototype.exec = function (params, request, response) {
var oops = this.utils.apiError;
var page = this.page;
var commenter = this.sys.validCommenter(params).name;
var commenterID = this.sys.validCommenter(params).id;
this.sys.db.get('SELECT name FROM classes WHERE classID=?',[params.classid],function(err,row){
if (err||!row) {return oops(response,err,'class')};
var myPage = page.toString().replace(/@@CLASS@@/g, row.name);
myPage = myPage.toString().replace(/@@COMMENTER@@/g, commenter);
response.writeHead(200, {'Content-Type': 'text/html'});
response.end(myPage);
});
}
exports.cogClass = cogClass;
})();