From 5530f03faccbae955c9f6943eff0e1bf519af998 Mon Sep 17 00:00:00 2001
From: MrFry
Date: Thu, 23 Jan 2020 09:48:55 +0100
Subject: [PATCH] File rearrange
---
modules/main.js | 69 -----------
modules/old.js | 46 -------
modules/qmining.js | 238 -------------------------------------
modules/sio.js | 95 ---------------
modules/stuff.js | 208 --------------------------------
server.js | 10 +-
views/main/main.ejs | 41 -------
views/qmining/alldata.ejs | 146 -----------------------
views/qmining/allqr.ejs | 23 ----
views/qmining/aludni.ejs | 6 -
views/qmining/b.ejs | 35 ------
views/qmining/main.ejs | 112 -----------------
views/qmining/man.ejs | 232 ------------------------------------
views/qmining/qa.ejs | 35 ------
views/qmining/thanks.ejs | 114 ------------------
views/qmining/uploaded.ejs | 23 ----
views/shared/404.ejs | 25 ----
views/sio/uload.ejs | 39 ------
views/stuff/audio.ejs | 39 ------
views/stuff/folders.ejs | 130 --------------------
views/stuff/nofile.ejs | 94 ---------------
views/stuff/video.ejs | 34 ------
22 files changed, 5 insertions(+), 1789 deletions(-)
delete mode 100755 modules/main.js
delete mode 100755 modules/old.js
delete mode 100755 modules/qmining.js
delete mode 100755 modules/sio.js
delete mode 100755 modules/stuff.js
delete mode 100755 views/main/main.ejs
delete mode 100755 views/qmining/alldata.ejs
delete mode 100755 views/qmining/allqr.ejs
delete mode 100755 views/qmining/aludni.ejs
delete mode 100755 views/qmining/b.ejs
delete mode 100755 views/qmining/main.ejs
delete mode 100755 views/qmining/man.ejs
delete mode 100755 views/qmining/qa.ejs
delete mode 100644 views/qmining/thanks.ejs
delete mode 100755 views/qmining/uploaded.ejs
delete mode 100755 views/shared/404.ejs
delete mode 100755 views/sio/uload.ejs
delete mode 100755 views/stuff/audio.ejs
delete mode 100755 views/stuff/folders.ejs
delete mode 100755 views/stuff/nofile.ejs
delete mode 100755 views/stuff/video.ejs
diff --git a/modules/main.js b/modules/main.js
deleted file mode 100755
index 73fbcbd..0000000
--- a/modules/main.js
+++ /dev/null
@@ -1,69 +0,0 @@
-/* ----------------------------------------------------------------------------
-
- Question Server
- GitLab:
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-
- ------------------------------------------------------------------------- */
-
-let url = '' // http(s)//asd.basd
-
-const express = require('express')
-const bodyParser = require('body-parser')
-const busboy = require('connect-busboy')
-const app = express()
-
-const logger = require('../utils/logger.js')
-// const utils = require('../utils/utils.js')
-// const actions = require('../utils/actions.js')
-
-app.set('view engine', 'ejs')
-app.use(express.static('public'))
-app.use(busboy({
- limits: {
- fileSize: 10000 * 1024 * 1024
- }
-}))
-app.use(bodyParser.json())
-app.use(bodyParser.urlencoded({
- limit: '5mb',
- extended: true
-}))
-app.use(bodyParser.json({
- limit: '5mb'
-}))
-
-// --------------------------------------------------------------
-
-app.get('/', function (req, res) {
- res.render('main/main', {
- siteurl: url
- })
-})
-
-app.get('*', function (req, res) {
- res.status(404).render('shared/404')
-})
-
-app.post('*', function (req, res) {
- res.status(404).render('shared/404')
-})
-
-exports.app = app
-exports.setup = (x) => {
- url = x.url
-}
-
-logger.Log('Main module started', logger.GetColor('yellow'))
diff --git a/modules/old.js b/modules/old.js
deleted file mode 100755
index 01e273e..0000000
--- a/modules/old.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/* ----------------------------------------------------------------------------
-
- Question Server
- GitLab:
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-
- ------------------------------------------------------------------------- */
-
-let url = ''
-const express = require('express')
-const app = express()
-
-const logger = require('../utils/logger.js')
-
-// --------------------------------------------------------------
-
-app.get('/', function (req, res) {
- res.redirect(url + req.url)
-})
-
-app.get('*', function (req, res) {
- res.redirect(url + req.url)
-})
-
-app.post('*', function (req, res) {
- res.redirect(url + req.url)
-})
-
-exports.app = app
-exports.setup = (x) => {
- url = x.url
-}
-
-logger.Log('Old module started', logger.GetColor('yellow'))
diff --git a/modules/qmining.js b/modules/qmining.js
deleted file mode 100755
index 7e78968..0000000
--- a/modules/qmining.js
+++ /dev/null
@@ -1,238 +0,0 @@
-/* ----------------------------------------------------------------------------
-
- Question Server
- GitLab:
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-
- ------------------------------------------------------------------------- */
-
-let url = ''
-
-const express = require('express')
-const bodyParser = require('body-parser')
-const busboy = require('connect-busboy')
-const fs = require('fs')
-const app = express()
-// const http = require('http')
-// const https = require('https')
-
-const logger = require('../utils/logger.js')
-const utils = require('../utils/utils.js')
-const actions = require('../utils/actions.js')
-
-const recivedFiles = 'public/recivedfiles'
-const uloadFiles = 'public/f'
-const dataFile = 'public/data.json'
-const msgFile = 'stats/msgs'
-const motdFile = 'public/motd'
-let donateURL = ''
-try {
- donateURL = utils.ReadFile('./data/donateURL')
-} catch (e) {
- logger.Log('Couldnt read donate URL file!', logger.GetColor('red'))
-}
-
-app.set('view engine', 'ejs')
-app.use(express.static('public'))
-app.use(busboy({
- limits: {
- fileSize: 10000 * 1024 * 1024
- }
-}))
-app.use(bodyParser.json())
-app.use(bodyParser.urlencoded({
- limit: '5mb',
- extended: true
-}))
-app.use(bodyParser.json({
- limit: '5mb'
-}))
-
-// --------------------------------------------------------------
-
-app.get('/', function (req, res) {
- // req.hostname
-
- let motd = ''
- try {
- motd = utils.ReadFile(motdFile)
- } catch (e) {
-
- }
- res.render('qmining/main', {
- siteurl: url,
- qa: actions.ProcessQA(),
- motd: motd
- })
- res.end()
-})
-
-app.get('/manual', function (req, res) {
- res.render('qmining/man')
- res.end()
- logger.LogReq(req)
-})
-
-app.get('/legacy', function (req, res) {
- var f = utils.ReadFile(dataFile)
- var d = actions.LoadJSON(f)
- let qcount = 0
- for (let i = 0; i < d.length; i++) { qcount += d.Subjects[i].length }
- let scount = d.length
-
- res.render('qmining/alldata', {
- data: d,
- scount: scount,
- qcount: qcount,
- siteurl: url
- })
-
- logger.LogReq(req)
-})
-
-app.post('/postfeedback', function (req, res) {
- res.redirect('back')
- logger.Log('New feedback message', logger.GetColor('bluebg'), true)
- utils.AppendToFile('\n\n' + logger.GetDateString() + ': ' + req.body.message_field, msgFile)
-})
-
-app.get('/postfeedback', function (req, res) {
- res.redirect('/')
-})
-
-app.post('/isAdding', function (req, res) {
- res.end('OK')
- logger.LogReq(req)
- actions.ProcessIncomingRequest(req.body.datatoadd)
- utils.WriteBackup()
-})
-
-app.get('/lred', function (req, res) {
- res.redirect('/legacy')
- res.end()
- logger.LogReq(req)
-})
-
-app.get('/menuClick', function (req, res) {
- res.redirect('/')
- res.end()
- logger.LogReq(req)
-})
-
-// all questions readable
-app.get('/allqr', function (req, res) {
- var f = utils.ReadFile(dataFile)
- var d = actions.LoadJSON(f)
-
- res.render('qmining/allqr', {
- d: d.toString().split('\n')
- })
- logger.LogReq(req)
-})
-
-app.get('/greasy', function (req, res) {
- res.redirect('https://greasyfork.org/en/scripts/38999-moodle-elearning-kmooc-test-help')
- res.end()
- logger.LogReq(req)
-})
-
-app.get('/install', function (req, res) {
- res.redirect(url + '/moodle-test-userscript/stable.user.js?install')
- res.end()
- logger.LogReq(req)
-})
-
-app.get('/donate', function (req, res) {
- res.redirect(donateURL)
- res.end()
- logger.LogReq(req)
-})
-
-app.get('/thanks', function (req, res) {
- res.render('qmining/thanks', {
- siteurl: url
- })
- res.end()
- logger.LogReq(req)
-})
-
-app.get('/classesgit', function (req, res) {
- res.redirect('https://gitlab.com/MrFry/question-classes')
- res.end()
- logger.LogReq(req)
-})
-
-app.get('/scriptgit', function (req, res) {
- res.redirect('https://gitlab.com/MrFry/moodle-test-userscript')
- res.end()
- logger.LogReq(req)
-})
-
-app.get('/servergit', function (req, res) {
- res.redirect('https://gitlab.com/MrFry/mrfrys-node-server')
- res.end()
- logger.LogReq(req)
-})
-
-function UploadFile (req, res, path, next) {
- var fstream
- req.pipe(req.busboy)
- req.busboy.on('file', function (fieldname, file, filename) {
- logger.Log('Uploading: ' + filename, logger.GetColor('blue'))
-
- utils.CreatePath(path, true)
- let d = new Date()
- let fn = d.getHours() + '' + d.getMinutes() + '' + d.getSeconds() + '_' + filename
-
- fstream = fs.createWriteStream(path + '/' + fn)
- file.pipe(fstream)
- fstream.on('close', function () {
- logger.Log('Upload Finished of ' + path + '/' + fn, logger.GetColor('blue'))
- next(fn)
- })
- fstream.on('error', function (err) {
- console.log(err)
- res.end('something bad happened :s')
- })
- })
-}
-
-app.route('/fosuploader').post(function (req, res, next) {
- UploadFile(req, res, uloadFiles, (fn) => {
- res.redirect('/f/' + fn)
- })
-})
-
-app.route('/badtestsender').post(function (req, res, next) {
- UploadFile(req, res, recivedFiles, (fn) => {
- res.render('qmining/uploaded')
- })
- logger.LogReq(req)
-})
-
-app.get('*', function (req, res) {
- res.status(404).render('shared/404')
-})
-
-app.post('*', function (req, res) {
- res.status(404).render('shared/404')
-})
-
-exports.app = app
-exports.setup = (x) => {
- url = x.url
-}
-
-logger.Log('Qmining module started', logger.GetColor('yellow'))
diff --git a/modules/sio.js b/modules/sio.js
deleted file mode 100755
index e25fcdd..0000000
--- a/modules/sio.js
+++ /dev/null
@@ -1,95 +0,0 @@
-/* ----------------------------------------------------------------------------
-
- Question Server
- GitLab:
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-
- ------------------------------------------------------------------------- */
-
-const express = require('express')
-const bodyParser = require('body-parser')
-const busboy = require('connect-busboy')
-const fs = require('fs')
-const app = express()
-// const http = require('http')
-// const https = require('https')
-
-const logger = require('../utils/logger.js')
-const utils = require('../utils/utils.js')
-
-const uloadFiles = './public/f'
-
-app.set('view engine', 'ejs')
-app.use(express.static('public'))
-app.use(busboy({
- limits: {
- fileSize: 10000 * 1024 * 1024
- }
-}))
-app.use(bodyParser.json())
-app.use(bodyParser.urlencoded({
- limit: '5mb',
- extended: true
-}))
-app.use(bodyParser.json({
- limit: '5mb'
-}))
-
-// --------------------------------------------------------------
-
-app.get('/', function (req, res) {
- res.render('sio/uload')
- res.end()
-})
-
-function UploadFile (req, res, path, next) {
- var fstream
- req.pipe(req.busboy)
- req.busboy.on('file', function (fieldname, file, filename) {
- logger.Log('Uploading: ' + filename, logger.GetColor('blue'))
-
- utils.CreatePath(path, true)
- let d = new Date()
- let fn = d.getHours() + '' + d.getMinutes() + '' + d.getSeconds() + '_' + filename
-
- fstream = fs.createWriteStream(path + '/' + fn)
- file.pipe(fstream)
- fstream.on('close', function () {
- logger.Log('Upload Finished of ' + path + '/' + fn, logger.GetColor('blue'))
- next(fn)
- })
- fstream.on('error', function (err) {
- console.log(err)
- res.end('something bad happened :s')
- })
- })
-}
-
-app.route('/fosuploader').post(function (req, res, next) {
- UploadFile(req, res, uloadFiles, (fn) => {
- res.redirect('/f/' + fn)
- })
-})
-app.get('*', function (req, res) {
- res.status(404).render('shared/404')
-})
-
-app.post('*', function (req, res) {
- res.status(404).render('shared/404')
-})
-
-exports.app = app
-
-logger.Log('Sio module started', logger.GetColor('yellow'))
diff --git a/modules/stuff.js b/modules/stuff.js
deleted file mode 100755
index 383c251..0000000
--- a/modules/stuff.js
+++ /dev/null
@@ -1,208 +0,0 @@
-/* ----------------------------------------------------------------------------
-
- Question Server
- GitLab:
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see .
-
- ------------------------------------------------------------------------- */
-
-const express = require('express')
-const bodyParser = require('body-parser')
-const busboy = require('connect-busboy')
-const fs = require('fs')
-const app = express()
-let url = ''
-
-const logger = require('../utils/logger.js')
-// const utils = require('../utils/utils.js')
-// const actions = require('../utils/actions.js')
-
-const listedFiles = './public/files'
-
-app.set('view engine', 'ejs')
-app.use(express.static('public'))
-app.use(busboy({
- limits: {
- fileSize: 10000 * 1024 * 1024
- }
-}))
-app.use(bodyParser.json())
-app.use(bodyParser.urlencoded({
- limit: '5mb',
- extended: true
-}))
-app.use(bodyParser.json({
- limit: '5mb'
-}))
-
-// --------------------------------------------------------------
-
-// app, '/*.mp4', 'video/mp4', 'stuff/video'
-function appGetFileType (app, wildcard, contentType, pageToRender) {
- app.get(wildcard, function (req, res) {
- let p = decodeURI(req.url)
- let fp = p
- if (p.includes('?')) {
- fp = p.split('?')
- fp.pop()
- fp = fp.join('/')
- }
- const fpath = './public/files' + fp
- if (!fs.existsSync(fpath)) {
- res.render('stuff/nofile', {
- missingFile: fpath,
- url
- })
- return
- }
- if (req.query.stream || !pageToRender) {
- const stat = fs.statSync(fpath)
- const fileSize = stat.size
- const range = req.headers.range
- if (range) {
- const parts = range.replace(/bytes=/, '').split('-')
- const start = parseInt(parts[0], 10)
- const end = parts[1]
- ? parseInt(parts[1], 10)
- : fileSize - 1
- const chunksize = (end - start) + 1
- const file = fs.createReadStream(fpath, { start, end })
- const head = {
- 'Content-Range': `bytes ${start}-${end}/${fileSize}`,
- 'Accept-Ranges': 'bytes',
- 'Content-Length': chunksize,
- 'Content-Type': contentType
- }
- res.writeHead(206, head)
- file.pipe(res)
- } else {
- const head = {
- 'Content-Length': fileSize,
- 'Content-Type': contentType
- }
- res.writeHead(200, head)
- fs.createReadStream(fpath).pipe(res)
- }
- } else {
- logger.LogReq(req)
- let fname = fpath.split('/')
- fname = fname.pop()
- res.render(pageToRender, {
- path: fp,
- fname,
- url,
- contentType,
- albumArt: GetAlbumArt(p)
- })
- }
- })
-}
-
-const fileTypes = [
- ['/*.mp4', 'video/mp4', 'stuff/video'],
- ['/*.mkv', 'audio/x-matroska', 'stuff/video'],
- ['/*.mp3', 'audio/mpeg', 'stuff/audio'],
- ['/*.pdf', 'application/pdf'],
- ['/*.zip', 'application/zip']
-]
-
-function GetAlbumArt (path) {
- let tmp = path.split('.')
- tmp.pop()
- tmp = tmp.join('.').split('/')
- let last = tmp.pop()
-
- return tmp.join('/') + '/.' + last + '.png'
-}
-
-fileTypes.forEach((t) => {
- appGetFileType(app, t[0], t[1], t[2])
-})
-
-app.get('/*', function (req, res) {
- let parsedUrl = decodeURI(req.url)
- let curr = listedFiles + '/' + parsedUrl.substring('/'.length, parsedUrl.length).split('?')[0]
- let relPath = curr.substring('./public/files'.length, curr.length)
-
- if (relPath[relPath.length - 1] !== '/') { relPath += '/' }
-
- let t = relPath.split('/')
- let prevDir = ''
- for (let i = 0; i < t.length - 2; i++) { prevDir += t[i] + '/' }
-
- // curr = curr.replace(/\//g, "/");
- // relPath = relPath.replace(/\//g, "/");
-
- logger.LogReq(req)
-
- try {
- if (fs.lstatSync(curr).isDirectory()) {
- if (curr[curr.length - 1] !== '/') { curr += '/' }
-
- let f = []
-
- fs.readdirSync(curr).forEach((item) => {
- if (item[0] !== '.') {
- let res = { name: item }
- let stat = fs.statSync(curr + '/' + item)
-
- let fileSizeInBytes = stat['size']
- res.size = Math.round(fileSizeInBytes / 1000000)
-
- res.path = relPath
- if (res.path[res.path.length - 1] !== '/') { res.path += '/' }
- res.path += item
-
- res.mtime = stat['mtime'].toLocaleString()
- res.isDir = stat.isDirectory()
-
- f.push(res)
- }
- })
-
- res.render('stuff/folders', {
- folders: f,
- dirname: relPath,
- prevDir,
- url
- })
- } else {
- let fileStream = fs.createReadStream(curr)
- fileStream.pipe(res)
- }
- } catch (e) {
- res.render('stuff/nofile', {
- missingFile: curr,
- url
- })
- }
-})
-
-// -----------------------------------------------------------------------------------------------
-
-app.get('*', function (req, res) {
- res.status(404).render('shared/404')
-})
-
-app.post('*', function (req, res) {
- res.status(404).render('shared/404')
-})
-
-exports.app = app
-exports.setup = (x) => {
- url = x.url
-}
-
-logger.Log('Stuff module started', logger.GetColor('yellow'))
diff --git a/server.js b/server.js
index 9678a58..da68f36 100755
--- a/server.js
+++ b/server.js
@@ -36,27 +36,27 @@ const loggableKeywords = [
]
let modules = {
qmining: {
- path: './modules/qmining.js',
+ path: './modules/qmining/qmining.js',
name: 'qmining',
urls: [ 'qmining.frylabs.net', 'localhost' ]
},
main: {
- path: './modules/main.js',
+ path: './modules/main/main.js',
name: 'main',
urls: [ 'frylabs.net', 'www.frylabs.net' ]
},
sio: {
- path: './modules/sio.js',
+ path: './modules/sio/sio.js',
name: 'sio',
urls: [ 'sio.frylabs.net' ]
},
stuff: {
- path: './modules/stuff.js',
+ path: './modules/stuff/stuff.js',
name: 'stuff',
urls: [ 'stuff.frylabs.net' ]
},
old: {
- path: './modules/old.js',
+ path: './modules/old/old.js',
name: 'old',
urls: [ 'qmining.tk', 'www.qmining.tk' ]
}
diff --git a/views/main/main.ejs b/views/main/main.ejs
deleted file mode 100755
index 11d8f43..0000000
--- a/views/main/main.ejs
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
- FryLabs.net
-
-
-
-
-
-
-
-
-
-
-
diff --git a/views/qmining/alldata.ejs b/views/qmining/alldata.ejs
deleted file mode 100755
index 4a9f454..0000000
--- a/views/qmining/alldata.ejs
+++ /dev/null
@@ -1,146 +0,0 @@
-
-
-
-
-
- All questions
-
-
-
-
-
-
- Ennek az oldalnak a tartalma dinamikusan frissül minden beküldött kérdés után
-
- <%=scount%> tárgy és <%=qcount%> kérdés
-
-
- Letöltés
- Összes kinyitása
-
-
- <% include aludni.ejs %>
-
- <% for (var i = 0; i < data.Subjects.length; i++) { %>
-
-
- >
-
- <%=data.Subjects[i].Name %>
-
-
- <%=data.Subjects[i].length %>
-
-
-
-
-
- <% var a = data.Subjects[i].toString().split('\n')%>
- <% for (var j = 1; j < a.length; j++) { %>
- <% if (a[j][0] == '?') { %>
-
- <% } %>
- <%=a[j] %>
-
- <% } %>
-
- <% } %>
-
- <% include b.ejs %>
-
-
diff --git a/views/qmining/allqr.ejs b/views/qmining/allqr.ejs
deleted file mode 100755
index 6e6b48d..0000000
--- a/views/qmining/allqr.ejs
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
- All questions
-
-
-
-
-
- <% for (var i = 0; i < d.length; i++) { %>
- <%= d[i] %>
-
- <% } %>
-
-
-
diff --git a/views/qmining/aludni.ejs b/views/qmining/aludni.ejs
deleted file mode 100755
index b90d50c..0000000
--- a/views/qmining/aludni.ejs
+++ /dev/null
@@ -1,6 +0,0 @@
-<% var d = new Date().getHours();
-if (d < 6 || d > 22) { %>
-
-
-
-<% } %>
diff --git a/views/qmining/b.ejs b/views/qmining/b.ejs
deleted file mode 100755
index c0804d8..0000000
--- a/views/qmining/b.ejs
+++ /dev/null
@@ -1,35 +0,0 @@
-<% function GetRandom(min, max) {
- return Math.floor(Math.random() * (max - min + 1) + min);
-} %>
-
-
-<% if (GetRandom(0, 100) == 1) { %>
-
-
-
-
-
-<% } %>
-
-
diff --git a/views/qmining/main.ejs b/views/qmining/main.ejs
deleted file mode 100755
index 4a96f6d..0000000
--- a/views/qmining/main.ejs
+++ /dev/null
@@ -1,112 +0,0 @@
-
-
-
-
-
- Question mining
-
-
-
-
-
-
-
-
-
-
-
-
- MOTD:
- <%- motd %>
-
-
-
-
-
-
-
- Hibát kiváltó teszt feltöltése
-
-
-
-
-
-
-
-
- Ha egy kérdésre mindig helytelenül talál választ a userscript (vagy egyéb hibát észlelsz), akkor azon az oldalon nyomj egy ctrl-s -t. Ez lementi a weboldalt úgy ahogy van egy mappába, és egy html fájlba. Ezt a kettőt ha berakod egy .zip-be, és ide feltöltöd, akkor ránézek mi lehet a hiba, és kijavítom. Max 10 MB!
- Ha több, elég a .html. Bónusz ha mellékelsz egy readme-t, hogy mit csináljak.
-
- <% include aludni.ejs %>
-
-
-
-
-
- <% include qa.ejs %>
-
-
-
- ...
-
- <% include b.ejs %>
-
-
diff --git a/views/qmining/man.ejs b/views/qmining/man.ejs
deleted file mode 100755
index 8df7192..0000000
--- a/views/qmining/man.ejs
+++ /dev/null
@@ -1,232 +0,0 @@
-
-
-
-
-
-
- Moodle/Elearning/KMOOC manual
-
-
-
-
-
- Moodle/Elearnig/KMOOC manual
-
-
- Ez a userscript Moodle/Elearnig/KMOOC tesztek megoldása során segítséget jelenít meg.
-
-
- A válasz ablakban jobb felül lévő százalék jelzi, hogy mekkora eséllyel jó a megoldás. Ez
- sokszor jó viszonyítás, de semmi sem biztos! Bármikor előfordulhat, hogy nem jó a
- megjelenített válasz! Ezért csak saját felelősségedre használd! Sok kikerülhetetlen
- hibalehetőség van, amit egyszerű nem lehet scriptben lekezelni (Pl rosszul megadott kérdés
- tanár részéről). Kézzel is lehet keresni a elmentett kérdések között. Ezért mindig
- legyen egy letöltött verziód a kérdésekről, mert nem 100% hogy mindég elérhető a szerver!
- Továbbá ha a moodle oldalán a layout megváltozik, a script nem fog működni! Ez nem annyira
- gyakori, de bármikor megtörténhet! Érdemes nem kikapcsolni a tampermonkey-ban a userscript
- frissítést. Ez nem windows update, itt tényleg hibajavítások jönnek ki. Hiba, észrevétel
- esetén : Script Feedback (ezt
- gyakran még aznap megnézem.)
-
-
- Továbbá ez a userscript HTTP requestekket küldhet egy szerver felé, ahova az összes megoldott
- tesztjeid kérdéseit és (helyes)válaszait feltölti! Ezzel garantálja, hogy neked, és mindenki
- másnak a legfrissebb adatok állnak rendelkezésre.
-
-
- <% include aludni.ejs %>
-
- Tartalomjegyzék
-
-
-
-
- Használat - Ez szuper fontos, elsőnek olvasd el
-
-
- Eddigi teszt kérdések - Itt elérhető az eddigi összes ismert teszt
- kérdés-válaszai
-
-
- Gyakran előforduló kérdések - Ha itt nincs kérdésed, akkor itt tedd fel!
-
-
- Adat egyszerűsítés - Ha túl sok egyforma kérdésed van ;)
-
-
- Other stuff
-
-
-
- Használat
-
-
-
-
- Először is tölts le egy userscript futtató kiegészítőt a böngésződhöz. Én Tampermonkeyt használok, és ezzel van tesztelve a
- userscript is, ezért ez ajánlott. Más is működhet (violentmonkey, etc), de az nem garantált.
- Majd a weboldalról egy kattintással elvileg
- le tudod tölteni a scriptet, és elvileg kész is.
- Ha tesztet akarsz megoldani, akkor először nézd meg a menüben, hogy aktív-e a
- tárgyad. Teszt közben a script a megadott tárgy már lementett kérdéseiből próbál segíteni.
-
- Teszt közben még több dolog történhet:
-
-
- Nem jó kérdésre ad választ a script: Ilyenkor az van, hogy nincs meg a
- kérdés, vagy több hasonló kérdés/válasz van. Ilyenkor a jobbra/balra gombbal
- váltogathatsz azok a kérdés/válasz combók közül, amit talált a script
-
- Több teszt kérdés van egy oldalon: Fel le gombbal váltogathatsz a kérdések között.
- Ilyenkor is működik az előbb említett funkció. Az indexek, amit kiír a bal felső sarokban:
- aktuális kérdés száma / aktuális találat száma.
-
- Nem jelenik meg semmi, vagy nem működik a script: Megesik az ilyesmi. Ha
- a webszerver még elérhető akkor ott meg bírod nézni a kérdéseket, és ott lehet
- keresgélni Ctrl + F -el Ha az sincs, akkor lehet hogy jól jön ha van egy
- lementett kérdés gyűjteményed.
-
-
- Fontos hogy kijelöld a tárgyat amit szeretnél "tanulni" mielőtt nekikezdesz. Ha egy
- olyan tárgynak kezdesz neki, ami még nincs benne az adatbázisban, akkor az új tárgyként
- fog bekerülni (obviously). De azt neked kell utána aktívnak jelölnöd! Ha nem
- használsz egy tárgyat, akkor kapcsold ki, mert picit belassulhat!
-
- Egyéb funkciók:
-
-
- Ha esetleg videókat nézel, akkor spaceval lehet play/pausolni, és jobbra/balra
- gombbal ugrani a videóban.
-
-
- Menüben el lehet rejteni a kérdéseket a felugró ablakról, így az
- kisebb helyet foglal, de így nem bírod ellenőrizni, hogy tényleg jó kérdés/választ talált-e.
-
-
- Ugyanitt az üdvözlő üzenetet is el lehet rejteni. Ez frissítésnél vagy hibánál így is
- úgyis megjelenik, mert azok nagyjából fontosak.
-
-
- Ha bármikor nem kell a script, akkor a menü gomb alatt bekapcsolhatod a passzív
- módot, ami nem olvassa be a kérdéseket. Vagy kikapcsolhatod magát a scriptet
- tampermonkey-ban. Ha bármiért is el akarod tüntetni a következő oldalig az éppen
- megjelenő script ablakot, akkor középső egér gombbal kattintva rajta ezt
- megteheted.
-
-
-
- TL; DR:
-
- Olvasd csak el. Az összes bonyodalom abból adódik, hogy a tampermonkey API-je
- korlátozott, és néhány dolgot neked kell megcsinálni, megérteni. Nagy eséllyel semmi
- teendőd, de azért jó ha tudod hogy működik, ha esetleg valami elromlik teszt közben,
- tudd hogy lehet megcsinálni gyorsan. Legyen mindég nálad egy másolat az online
- kérdésekről, mert bármikor eltűnhet!
-
-
-
-
-
-
-
- Eddigi teszt kérdések:
-
-
- Eddigi összes kérdés
- Továbbá ez még arra jó, hogy ha valamiért bugos a script, akkor itt tudsz ctrl-f el nézegetni,
- vagy ha lemented az összes kérdést, akkor még akkor is biztonságban vagy, ha netán leáll a
- szerver, vagy elmegy a neted. Bár úgy nehezen moodlezel, de mind1
-
-
- Gyakran előforduló kérdések
-
-
-
-
- 1. Olyan helyeken fut le a script, ahol nem kellene, vagy zavar
- Tampermonkey bővitmény ikon -> click -> scriptet kapcsold ki. Csak ne felejtsd
- visszakapcsolni ;) Meg passzív módot is bekapcsolhatod a menü gomb alatt.
-
-
-
- 2. Túl nagy a kérdést és a választ megjelenítő ablak, nem tudok a válaszra kattintani
- Zommolj ki egy kicsit, vagy kapcsold ki addig a scriptet. Továbbá középső
- egérgombra kattintva rá el bírod tüntetni az ablakot, amíg újra nem töltöd az oldalt,
- vagy másikra ugrasz.
-
-
-
- 3. Online adatokat használok, de a script hibát jelez
- Ennek több oka is lehet:
-
- Nem engedélyezted az http requestek küldését a usercript menedzselő
- programodnál. Ez nélkül nem működik.
- Nem elérhető a szerver. Ezt ellenőrizheted: link
- Nincs kiválasztva a megoldani kívánt tárgy a menüben.
-
-
-
- 4. Mi ez a ... ?
-
-
-
-
- 5.
-
-
-
-
-
- Egyéb:
- észrevétel
-
-
- Jogosultságok:
- GM_openInTab: help megnyitása új lapon, GM_xmlhttpRequest: online adatbázishoz. GM_info: a
- scriptről információ, a verzióváltozás érzékeléséhez. GM_getValue/ GM_setValue: oldal
- bezárásakor megmaradó változók kezelése. Előző verzió tárolására, ugyanúgy verzióváltozás
- érzékeléséhez, néhány beállítás, illetve hogy melyik tárgyakból keressen kérdéseket. Ezek
- függvények, és a sciptben néhol meg vannak hívva, keresd meg.
- Elküldött adatok online módban: Minden teszt végén az összes kérdés, és rá a moodle szerint
- helyesnek vélt válaszok. Fogadott adatok: az összes eddig ismert moodle kérdés
-
-
-
-
-
-
- <% include b.ejs %>
-
-
diff --git a/views/qmining/qa.ejs b/views/qmining/qa.ejs
deleted file mode 100755
index f3315b3..0000000
--- a/views/qmining/qa.ejs
+++ /dev/null
@@ -1,35 +0,0 @@
- Q & A:
-<% for (var i = qa.length - 1; i >= 0 ; i--) { %>
-
-
-
-
- <%= i %>
-
-
-
-
-
-
- <%= qa[i].q %>
-
-
-
- <% if (qa[i].a) { %>
- <% for (var j = 0; j < qa[i].a.length; j++) { %>
-
- <% if (j != 0) { %>
-
- <% } %>
-
- <%= qa[i].a[j] %>
-
- <% } %>
-
- <% } else { %>
- Válasz folyamatban...
- <% } %>
-
-
-
-<% } %>
diff --git a/views/qmining/thanks.ejs b/views/qmining/thanks.ejs
deleted file mode 100644
index a83885f..0000000
--- a/views/qmining/thanks.ejs
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
-
-
-
-
- Thank you!
-
-
-
-
-
- Thanks for the gold, kind question miner! Return
-
-
-
-
-
diff --git a/views/qmining/uploaded.ejs b/views/qmining/uploaded.ejs
deleted file mode 100755
index 38c7812..0000000
--- a/views/qmining/uploaded.ejs
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
-
-
-
-
- fájl feltöltve!
- Vissza
-
-
-
diff --git a/views/shared/404.ejs b/views/shared/404.ejs
deleted file mode 100755
index e97a2cb..0000000
--- a/views/shared/404.ejs
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
-
-
-
-
-
-
- 404
-
-
-
-
-
-
diff --git a/views/sio/uload.ejs b/views/sio/uload.ejs
deleted file mode 100755
index 89a6f9a..0000000
--- a/views/sio/uload.ejs
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
- Shit uploader
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/views/stuff/audio.ejs b/views/stuff/audio.ejs
deleted file mode 100755
index 6d5e3ae..0000000
--- a/views/stuff/audio.ejs
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
-
-
- <%= fname %>
-
-
-
-
-
-
- <%= fname %>
-
-
-
- >
-
-
-
-
-
diff --git a/views/stuff/folders.ejs b/views/stuff/folders.ejs
deleted file mode 100755
index e6dd742..0000000
--- a/views/stuff/folders.ejs
+++ /dev/null
@@ -1,130 +0,0 @@
-
-
-
-
-
- <%=dirname%>
-
-
-
-
-
-
- <%=dirname%>
-
-
-
-
-
-
-
-
-
diff --git a/views/stuff/nofile.ejs b/views/stuff/nofile.ejs
deleted file mode 100755
index c2e81ae..0000000
--- a/views/stuff/nofile.ejs
+++ /dev/null
@@ -1,94 +0,0 @@
-
-
-
-
-
- No such file/folder
-
-
-
-
-
- No such file / folder:
-
- <%= missingFile %>
-
- Back to root
-
-
- Go back
-
-
-
-
-
-
diff --git a/views/stuff/video.ejs b/views/stuff/video.ejs
deleted file mode 100755
index 62db36a..0000000
--- a/views/stuff/video.ejs
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
- <%= fname %>
-
-
-
-
-
-
- <%= fname %>
-
-
-
-
-
-
-
-