2017年8月27日 星期日

postgresql import csv




COPY log
FROM '/root/5.csv'
DELIMITER ','
CSV HEADER;

GRANT SELECT ON log TO PUBLIC;

COPY log FROM '/tab/6.csv' CSV HEADER;

exo

https://community.exoplatform.com/portal/intranet/forum/topic/topic50443d707f00000100f10a7c909d19f9

http://docs.jboss.org/exojcr/1.12.6-GA/developer/en-US/html_single/#Core.LDAPConfiguration


opends directory server

gatein 3.0.0 final tomcat


https://docs.exoplatform.org/public/index.jsp?topic=%2FPLF40%2FPLFUserGuide.GettingStarted.TrialEdition.html

2017年8月23日 星期三

2017年8月20日 星期日

Learner report by Learner with grades

Which Learners in which course and what are the grades

SELECT u.firstname AS 'Name' , u.lastname AS 'Surname', c.fullname AS 'Course', cc.name AS 'Category',
CASE WHEN gi.itemtype = 'Course'   
THEN c.fullname + ' Course Total' 
ELSE gi.itemname
END AS 'Item Name', ROUND(gg.finalgrade,2) AS Score,ROUND(gg.rawgrademax,2) AS MAX, ROUND(gg.finalgrade / gg.rawgrademax * 100 ,2) AS Percentage,
IF (ROUND(gg.finalgrade / gg.rawgrademax * 100 ,2) > 79,'Yes' , 'No') AS Pass
FROM mdl_course AS c
JOIN mdl_context AS ctx ON c.id = ctx.instanceid
JOIN mdl_role_assignments AS ra ON ra.contextid = ctx.id
JOIN mdl_user AS u ON u.id = ra.userid
JOIN mdl_grade_grades AS gg ON gg.userid = u.id
JOIN mdl_grade_items AS gi ON gi.id = gg.itemid
JOIN mdl_course_categories AS cc ON cc.id = c.category
WHERE  gi.courseid = c.id AND gi.itemname != 'Attendance'
ORDER BY `Name` ASC

Grade and Course Completion Reports

Site-Wide Grade Report with All Items

Shows grades for all course items along with course totals for each student. Works with ad-hoc reports or Configurable Reports



SELECT u.firstname AS 'First' , u.lastname AS 'Last', u.firstname + ' ' + u.lastname AS 'Display Name',
c.fullname AS 'Course',
cc.name AS 'Category',
CASE
  WHEN gi.itemtype = 'course'
   THEN c.fullname + ' Course Total'
  ELSE gi.itemname
END AS 'Item Name',
ROUND(gg.finalgrade,2) AS Grade,DATE_ADD('1970-01-01', INTERVAL gi.timemodified SECOND) AS Time
FROM mdl_course AS c
JOIN mdl_context AS ctx ON c.id = ctx.instanceid
JOIN mdl_role_assignments AS ra ON ra.contextid = ctx.id
JOIN mdl_user AS u ON u.id = ra.userid
JOIN mdl_grade_grades AS gg ON gg.userid = u.id
JOIN mdl_grade_items AS gi ON gi.id = gg.itemid
JOIN mdl_course_categories AS cc ON cc.id = c.category
WHERE  gi.courseid = c.id
ORDER BY lastname

2017年8月18日 星期五

2017年8月15日 星期二

moodle - plugin

https://moodle.org/plugins/pluginversions.php?plugin=auth_uniquelogin

https://moodle.org/plugins/qformat_wordtable

https://moodle.org/plugins/mod_offlinequiz

2017年8月13日 星期日

mdl & time

select * from mdl_log,mdl_block_timestat where mdl_log.id = mdl_block_timestat.log_id

2017年8月10日 星期四

id

SELECT course, FROM_UNIXTIME( timemodified ) FROM mdl_assign

SELECT id, FROM_UNIXTIME( timemodified ) FROM mdl_course

select course,FROM_UNIXTIME( timemodified ) FROM  mdl_feedback

select course,FROM_UNIXTIME( timemodified ) FROM  mdl_folder

SELECT courseid, FROM_UNIXTIME( timemodified ) FROM  `mdl_event`

select course,,FROM_UNIXTIME( timemodified ) from mdl_quiz


SELECT course, FROM_UNIXTIME( TIME )
FROM mdl_log
WHERE ACTION =  'update'
AND module =  'course'


select course,,FROM_UNIXTIME( timemodified ) from mdl_quiz

SELECT *,FROM_UNIXTIME(timemodified) FROM `mdl_event`

2017年8月9日 星期三

score of assignment

SELECT u.id,u.picture,u.firstname,u.lastname,u.firstnamephonetic,u.lastnamephonetic,u.middlename,u.alternatename,u.imagealt,u.email, u.id as userid, s.status as status, s.id as submissionid, s.timecreated as firstsubmission, s.timemodified as timesubmitted, s.attemptnumber as attemptnumber, g.id as gradeid, g.grade as grade, g.timemodified as timemarked, g.timecreated as firstmarked, uf.mailed as mailed, uf.locked as locked, uf.extensionduedate as extensionduedate, uf.workflowstate as workflowstate, uf.allocatedmarker as allocatedmarker FROM mdl_user u LEFT JOIN mdl_assign_submission s ON u.id = s.userid AND  s.latest = 1 LEFT JOIN mdl_assign_grades g ON u.id = g.userid AND g.attemptnumber = s.attemptnumber LEFT JOIN mdl_assign_user_flags uf ON u.id = uf.userid

SELECT c.id, c.shortname, g.assignment, a.name, u.username, g.grade
FROM prefix_assign_grades AS g
JOIN prefix_user AS u ON g.userid = u.id
JOIN prefix_assign AS a ON g.assignment = a.id
JOIN prefix_course AS c ON a.course = c.id
WHERE c.id = ## AND u.id = ##
Showing rows 0 - 29 ( 16,818 total, Query took 0.0011 sec)
SELECT u.id, u.picture, u.firstname, u.lastname, u.firstnamephonetic, u.lastnamephonetic, u.middlename, u.alternatename, u.imagealt, u.email, u.id AS userid, s.status AS
STATUS , s.id AS submissionid, s.timecreated AS firstsubmission, s.timemodified AS timesubmitted, s.attemptnumber AS attemptnumber, g.id AS gradeid, g.grade ASgrade, g.timemodified AS timemarked, g.timecreated AS firstmarked, uf.mailed AS mailed, uf.locked AS locked, uf.extensionduedate AS extensionduedate,uf.workflowstate AS workflowstate, uf.allocatedmarker AS allocatedmarker
FROM mdl_user u
LEFT JOIN mdl_assign_submission s ON u.id = s.userid
AND s.latest =1
LEFT JOIN mdl_assign_grades g ON u.id = g.userid
AND g.attemptnumber = s.attemptnumber
LEFT JOIN mdl_assign_user_flags uf ON u.id = uf.userid
LIMIT 0 , 30