Pārlūkot izejas kodu

a gui now exists!

master
Fradl pirms 2 gadiem
vecāks
revīzija
be9037aac8
11 mainītis faili ar 849 papildinājumiem un 43 dzēšanām
  1. +102
    -0
      package-lock.json
  2. +1
    -0
      package.json
  3. +67
    -10
      src/App.css
  4. +9
    -6
      src/App.js
  5. +33
    -6
      src/Components/Inputs.js
  6. +56
    -20
      src/Components/Table.js
  7. +1
    -0
      src/python/case2.js
  8. +517
    -0
      src/python/case2.json
  9. +16
    -0
      src/python/case2parsed.json
  10. +47
    -0
      src/python/parse.py
  11. +0
    -1
      timetable/dcu-opentimetable

+ 102
- 0
package-lock.json Parādīt failu

@@ -5817,6 +5817,11 @@
"resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz",
"integrity": "sha1-8QdIy+dq+WS3yWyTxrzCivEgwIE="
},
"gud": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/gud/-/gud-1.0.0.tgz",
"integrity": "sha512-zGEOVKFM5sVPPrYs7J5/hYEw2Pof8KCyOwyhG8sAF26mCAeUFAcYPu1mwB7hhpIP29zOIBaDqwuHdLp0jvZXjw=="
},
"gzip-size": {
"version": "5.1.1",
"resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-5.1.1.tgz",
@@ -5965,6 +5970,19 @@
"resolved": "https://registry.npmjs.org/hex-color-regex/-/hex-color-regex-1.1.0.tgz",
"integrity": "sha512-l9sfDFsuqtOqKDsQdqrMRk0U85RZc0RtOR9yPI7mRVOa4FsR/BVnZ0shmQRM96Ji99kYZP/7hn1cedc1+ApsTQ=="
},
"history": {
"version": "4.10.1",
"resolved": "https://registry.npmjs.org/history/-/history-4.10.1.tgz",
"integrity": "sha512-36nwAD620w12kuzPAsyINPWJqlNbij+hpK1k9XRloDtym8mxzGYl2c17LnV6IAGB2Dmg4tEa7G7DlawS0+qjew==",
"requires": {
"@babel/runtime": "^7.1.2",
"loose-envify": "^1.2.0",
"resolve-pathname": "^3.0.0",
"tiny-invariant": "^1.0.2",
"tiny-warning": "^1.0.0",
"value-equal": "^1.0.1"
}
},
"hmac-drbg": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz",
@@ -5975,6 +5993,14 @@
"minimalistic-crypto-utils": "^1.0.1"
}
},
"hoist-non-react-statics": {
"version": "3.3.0",
"resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.0.tgz",
"integrity": "sha512-0XsbTXxgiaCDYDIWFcwkmerZPSwywfUqYmwT4jzewKTQSWoE6FCMoUVOeBJWK3E/CrWbxRG3m5GzY4lnIwGRBA==",
"requires": {
"react-is": "^16.7.0"
}
},
"hosted-git-info": {
"version": "2.8.5",
"resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.5.tgz",
@@ -8234,6 +8260,16 @@
"resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
"integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg=="
},
"mini-create-react-context": {
"version": "0.3.2",
"resolved": "https://registry.npmjs.org/mini-create-react-context/-/mini-create-react-context-0.3.2.tgz",
"integrity": "sha512-2v+OeetEyliMt5VHMXsBhABoJ0/M4RCe7fatd/fBy6SMiKazUSEt3gxxypfnk2SHMkdBYvorHRoQxuGoiwbzAw==",
"requires": {
"@babel/runtime": "^7.4.0",
"gud": "^1.0.0",
"tiny-warning": "^1.0.2"
}
},
"mini-css-extract-plugin": {
"version": "0.8.0",
"resolved": "https://registry.npmjs.org/mini-css-extract-plugin/-/mini-css-extract-plugin-0.8.0.tgz",
@@ -10460,6 +10496,52 @@
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.11.0.tgz",
"integrity": "sha512-gbBVYR2p8mnriqAwWx9LbuUrShnAuSCNnuPGyc7GJrMVQtPDAh8iLpv7FRuMPFb56KkaVZIYSz1PrjI9q0QPCw=="
},
"react-router": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/react-router/-/react-router-5.1.2.tgz",
"integrity": "sha512-yjEuMFy1ONK246B+rsa0cUam5OeAQ8pyclRDgpxuSCrAlJ1qN9uZ5IgyKC7gQg0w8OM50NXHEegPh/ks9YuR2A==",
"requires": {
"@babel/runtime": "^7.1.2",
"history": "^4.9.0",
"hoist-non-react-statics": "^3.1.0",
"loose-envify": "^1.3.1",
"mini-create-react-context": "^0.3.0",
"path-to-regexp": "^1.7.0",
"prop-types": "^15.6.2",
"react-is": "^16.6.0",
"tiny-invariant": "^1.0.2",
"tiny-warning": "^1.0.0"
},
"dependencies": {
"isarray": {
"version": "0.0.1",
"resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz",
"integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8="
},
"path-to-regexp": {
"version": "1.7.0",
"resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.7.0.tgz",
"integrity": "sha1-Wf3g9DW62suhA6hOnTvGTpa5k30=",
"requires": {
"isarray": "0.0.1"
}
}
}
},
"react-router-dom": {
"version": "5.1.2",
"resolved": "https://registry.npmjs.org/react-router-dom/-/react-router-dom-5.1.2.tgz",
"integrity": "sha512-7BPHAaIwWpZS074UKaw1FjVdZBSVWEk8IuDXdB+OkLb8vd/WRQIpA4ag9WQk61aEfQs47wHyjWUoUGGZxpQXew==",
"requires": {
"@babel/runtime": "^7.1.2",
"history": "^4.9.0",
"loose-envify": "^1.3.1",
"prop-types": "^15.6.2",
"react-router": "5.1.2",
"tiny-invariant": "^1.0.2",
"tiny-warning": "^1.0.0"
}
},
"react-scripts": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/react-scripts/-/react-scripts-3.2.0.tgz",
@@ -10850,6 +10932,11 @@
"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-3.0.0.tgz",
"integrity": "sha1-six699nWiBvItuZTM17rywoYh0g="
},
"resolve-pathname": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/resolve-pathname/-/resolve-pathname-3.0.0.tgz",
"integrity": "sha512-C7rARubxI8bXFNB/hqcp/4iUeIXJhJZvFPFPiSPRnhU5UPxzMFIl+2E6yY6c4k9giDJAhtV+enfA+G89N6Csng=="
},
"resolve-url": {
"version": "0.2.1",
"resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz",
@@ -12137,6 +12224,16 @@
"resolved": "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz",
"integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q="
},
"tiny-invariant": {
"version": "1.0.6",
"resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.0.6.tgz",
"integrity": "sha512-FOyLWWVjG+aC0UqG76V53yAWdXfH8bO6FNmyZOuUrzDzK8DI3/JRY25UD7+g49JWM1LXwymsKERB+DzI0dTEQA=="
},
"tiny-warning": {
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/tiny-warning/-/tiny-warning-1.0.3.tgz",
"integrity": "sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA=="
},
"tmp": {
"version": "0.0.33",
"resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz",
@@ -12543,6 +12640,11 @@
"spdx-expression-parse": "^3.0.0"
}
},
"value-equal": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/value-equal/-/value-equal-1.0.1.tgz",
"integrity": "sha512-NOJ6JZCAWr0zlxZt+xqCHNTEKOsrks2HQd4MqhP1qy4z1SkbEP467eNx6TgDKXMvUOb+OENfJCZwM+16n7fRfw=="
},
"vary": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",


+ 1
- 0
package.json Parādīt failu

@@ -5,6 +5,7 @@
"dependencies": {
"react": "^16.11.0",
"react-dom": "^16.11.0",
"react-router-dom": "^5.1.2",
"react-scripts": "3.2.0"
},
"scripts": {


+ 67
- 10
src/App.css Parādīt failu

@@ -1,3 +1,5 @@
@import url('https://fonts.googleapis.com/css?family=Roboto&display=swap');

.App {
text-align: center;
}
@@ -6,6 +8,13 @@
height: 40vmin;
}

html {
background: #314755; /* fallback for old browsers */
background: -webkit-linear-gradient(to right, #26a0da, #314755); /* Chrome 10-25, Safari 5.1-6 */
background: linear-gradient(to right, #26a0da, #314755); /* W3C, IE 10+/ Edge, Firefox 16+, Chrome 26+, Opera 12+, Safari 7+ */
font-family: 'Roboto', sans-serif;
}

.App-header {
background-color: #282c34;
min-height: 100vh;
@@ -33,22 +42,70 @@
}

.highlighted {
background-color: grey;
background-color: rgba(0,0,0,0.3);
color: white;
}

tbody th {
min-width: 100px;
}

table {
width: 500px;
border: 1px solid black;
height: 50vh;
justify-content: space-between;
width: 90vw;
margin-left: 5vw;
margin-top: 5vh;
}

table tbody tr {
min-height: 4em;
height: 4em;
}

table tbody th {
background-color: rgba(255,255,255,0.33)
}

caption {
font-size: 18px;
font-weight: 600;
}

tr {
justify-content: space-between;
border: 1px solid black;
.autoComplete {
display: flex;
justify-content: center;
align-content: center;
align-items: center;
flex-direction: column;
width: 100%;
text-align: center;
margin: 10% 0;
font-size: 48px;
}

td {
border: 1px solid black;
.results {
margin-left: 12%
}

input {
height: 50px;
padding-top: 10px;
border-radius: 15px;
border: 2px grey solid;
}

.autoInner {
margin: auto;
margin-top: auto;
}

button {
padding: 25px;
margin: 0;
font-size: 18px;
border-radius: 25px;
border: 5px goldenrod solid;;
background-color: transparent;
color: white;
font-weight: 800;
}

+ 9
- 6
src/App.js Parādīt failu

@@ -2,22 +2,25 @@ import React from 'react';
import './App.css';
import Table from './Components/Table';
import Inputs from './Components/Inputs';
import {BrowserRouter, Switch, Route} from 'react-router-dom'
import {case2} from './python/case2.js'

class App extends React.Component{
constructor(){
super()

this.modules = ['CA1', 'CASE2', 'CASE3', 'CASE4', 'EC1','EC2','EC3','EC4']
this.case2 = case2
}

render(){
return(
<div>
<Inputs modules={this.modules} />
<hr />
<Table />
</div>
<BrowserRouter>
<Switch>
<Route exact path='/' render={(props) => <Inputs modules={this.modules} /> } />
<Route path='/Timetable/:for' render={(props) => <Table for={props.match.params.for} data={this.case2} /> } />
</Switch>
</BrowserRouter>
)
}
}


+ 33
- 6
src/Components/Inputs.js Parādīt failu

@@ -1,4 +1,5 @@
import React from 'react';
import {Redirect} from 'react-router-dom';
import '../App.css';

class Inputs extends React.Component{
@@ -7,11 +8,14 @@ class Inputs extends React.Component{
this.state = {
moduleCode: "",
selectedSuggestion: -1,
redirect: false,
error: '',
}

this.setSelected = this.setSelected.bind(this)
this.keyPressHandler = this.keyPressHandler.bind(this)
this.clickSuggestion = this.clickSuggestion.bind(this)
this.buttonClick = this.buttonClick.bind(this)
this.divElement = {}
}

@@ -83,8 +87,26 @@ class Inputs extends React.Component{
}
}

buttonClick = () => {
if(this.props.modules.indexOf(this.state.moduleCode) !== -1)
this.setState({redirect: true})
else
this.setState({
error: 'This is not a supported course code. :('
})
}

render(){


const buttonStyle = () => {
if(this.props.modules.indexOf(this.state.moduleCode) !== -1)
return {borderColor: 'green'}
if(this.state.error)
return {borderColor: 'red'}
return {}
}

const displaySearchSuggestions = () => {
if(this.state.moduleCode === "")
return ''
@@ -101,20 +123,25 @@ class Inputs extends React.Component{
}


if(this.state.redirect)
return(<Redirect to={"/timetable/"+this.state.moduleCode} />)
else
return(
<div>
<div id="searchFields">
<label htmlFor="moduleCode">Module Code:</label>
<input value={this.state.moduleCode} onChange={this.changeHandler} onKeyDown={this.keyPressHandler} type="text" autoComplete="off" role="combobox" aria-autocomplete="both" aria-activedescendant="suggestion-1" aria-owns="results" id="search" name="moduleCode"></input>
<div className="autoComplete">
<div id="searchFields" className="autoInner">
<div>{this.state.error}</div>
<label htmlFor="moduleCode">Course Code:</label>
<input value={this.state.moduleCode} onChange={this.changeHandler} onKeyDown={this.keyPressHandler} type="text" placeholder="e.g. CASE3" autoComplete="off" role="combobox" aria-autocomplete="both" aria-activedescendant="suggestion-1" aria-owns="results" id="search" name="moduleCode"></input>
</div>
<div className="autocomplete" id="search-autocomplete">
<div className="results" id="search-autocomplete">
<div id="results" role="listbox">
{displaySearchSuggestions()}
</div>
</div>
<div id='announce' className="hidden" aria-live="assertive">
{displaySearchSuggestions().length} suggestions found, use up and down arrows to review.
{this.state.error} {displaySearchSuggestions().length} suggestions found, use up and down arrows to review.
</div>
{this.state.moduleCode !== "" ? <button style={buttonStyle()} onClick={this.buttonClick} aria-pressed="false">View {this.state.moduleCode} Timetable</button> : ''}
</div>
)
}


+ 56
- 20
src/Components/Table.js Parādīt failu

@@ -7,12 +7,63 @@ class Table extends React.Component{
}

render(){

const noneFree = {
backgroundColor: 'rgba(0,0,255,0.5)'
}

const free = {
backgroundColor: 'rgba(0,255,0,0.3)'
}

const thead = {
backgroundColor: '#871F78',
color: "whitesmoke",
padding: 0,
margin: 0,
}

const trow = {
backgroundColor: 'rgba(255,255,255,0.75)',
color: "black",
padding: 0,
margin: 0,
}

const displayTable = () => {
let display = []
Object.keys(this.props.data).map((time) => {
let data = this.props.data[time]
let sTime = ""+time
let nTime = Number(time) + 1
nTime = ""+nTime
if (sTime.length != 2)
sTime = "0"+sTime
if (nTime.length != 2)
nTime = "0"+nTime
nTime += ":00"
sTime += ":00"
display.push(
<tr style={trow}>
<th scope="row" className="leftCol">{sTime + " - " + nTime} </th>
<td style={data[0] !== 'Free' ? noneFree : free}>{data[0]}</td>
<td style={data[1] !== 'Free' ? noneFree : free}>{data[1]}</td>
<td style={data[2] !== 'Free' ? noneFree : free}>{data[2]}</td>
<td style={data[3] !== 'Free' ? noneFree : free}>{data[3]}</td>
<td style={data[4] !== 'Free' ? noneFree : free}>{data[4]}</td>
</tr>
)
})
return display
}

return(
<table>
<caption>Timetable For: *User selected timetable would be here*</caption>
<thead>
<tr>
<td></td>
{console.log(this.props)}
<caption>Timetable For: {this.props.for.toUpperCase()}</caption>
<thead style={thead}>
<tr style={trow}>
<td style={{border: 'none'}} className="leftCol"></td>
<th scope="col">Monday</th>
<th scope="col">Tuesday</th>
<th scope="col">Wednesday</th>
@@ -21,22 +72,7 @@ class Table extends React.Component{
</tr>
</thead>
<tbody>
<tr>
<th scope="row">09:00 - 10:00</th>
<td>CA357 @ XG19<br /> Donal Fitzpatrick</td>
<td>CA357 @ XG19<br /> Donal Fitzpatrick</td>
<td>CA357 @ XG19<br /> Donal Fitzpatrick</td>
<td>CA357 @ XG19<br /> Donal Fitzpatrick</td>
<td>CA357 @ XG19<br /> Donal Fitzpatrick</td>
</tr>
<tr>
<th scope="row">10:00 - 11:00</th>
<td>CA357 @ XG19<br /> Donal Fitzpatrick</td>
<td>Free</td>
<td>CA357 @ XG19<br /> Donal Fitzpatrick</td>
<td>Free</td>
<td>CA357 @ XG19<br /> Donal Fitzpatrick</td>
</tr>
{displayTable()}
</tbody>
</table>
)


+ 1
- 0
src/python/case2.js Parādīt failu

@@ -0,0 +1 @@
export const case2 = {"8": ["Free", "Free", "Free", "Free", "Free"], "9": ["Free", "GLA.L125, GLA.LG25\nComputer Programming 3 (Data Structure and Algorithms)\nDaly C", "Free", "GLA.CG12\nComputer Programming 3 (Data Structure and Algorithms)\nDaly C", "Free"], "10": ["GLA.HG23\nLOGIC\nSinclair D", "Free", "GLA.XG14\nComputer Architecture & Assembly Level Programming\nFitzpatrick D", "GLA.CG12\nLOGIC\nSinclair D", "Free"], "11": ["GLA.L101, GLA.L125\nLOGIC\nSinclair D", "GLA.SA301\nSystems Analysis\nYilmaz M", "Free", "Free", "GLA.L101, GLA.L128, GLA.LG27\nComputer Architecture & Assembly Level Programming\nFitzpatrick D"], "12": ["GLA.HG23\nComputer Programming 3 (Data Structure and Algorithms)\nDaly C", "Free", "Free", "Free", "Free"], "13": ["Free", "GLA.CG12\nIntro to Databases\nRoantree M", "Free", "GLA.HG23\nSystems Analysis\nYilmaz M", "Free"], "14": ["Free", "Free", "Free", "Free", "Free"], "15": ["GLA.HG23\nComputer Architecture & Assembly Level Programming\nFitzpatrick D", "Free", "Free", "Free", "Free"], "16": ["GLA.HG23\nComputer Architecture & Assembly Level Programming\nFitzpatrick D", "GLA.CG12\nCA218[1] Intro to Databases, CA119[1] Intro to Databases\nRoantree M", "Free", "GLA.LG26, GLA.LG25\nIntro to databases\nRoantree M", "Free"], "17": ["Free", "Free", "Free", "Free", "Free"], "18": ["Free", "Free", "Free", "Free", "Free"]}

+ 517
- 0
src/python/case2.json Parādīt failu

@@ -0,0 +1,517 @@
[{
"CategoryTypeIdentity": "241e4d36-60e0-49f8-b27e-99416745d98d",
"CategoryTypeName": "Programmes of Study",
"CategoryEvents": [{
"EventIdentity": "464545de-8094-59b3-001d-d4d868b55922",
"HostKey": "1920#SPLUSB6C846",
"Description": null,
"EndDateTime": "2019-11-05T17:00:00+00:00",
"EventType": "Lecture",
"IsPublished": true,
"Location": "GLA.CG12",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-05T16:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-08-23T15:33:51.051166+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA218[1] Intro to Databases, CA119[1] Intro to Databases",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Roantree M",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "1-12",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA119/CA218[1]L1/01",
"Identity": "35563f75-befe-4efe-ab4a-155bd66f0b71"
}, {
"EventIdentity": "dac75556-6bac-438d-a2c9-3b8b5380d045",
"HostKey": "1920#SPLUSB6C85E",
"Description": "Intro to Databases",
"EndDateTime": "2019-11-05T14:00:00+00:00",
"EventType": "Lecture",
"IsPublished": true,
"Location": "GLA.CG12",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-05T13:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-08-23T15:22:52.7354192+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA218[1] Intro to Databases, CA119[1] Intro to Databases",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Roantree M",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "1-12",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA119/CA218[1]L2/01",
"Identity": "48170ef9-8652-4a86-a909-f3679310a8b8"
}, {
"EventIdentity": "f3993d03-524a-a5e2-6339-6138e4b17ca3",
"HostKey": "1920#SPLUSB6C86E",
"Description": "Intro to databases",
"EndDateTime": "2019-11-07T18:00:00+00:00",
"EventType": "Practical",
"IsPublished": true,
"Location": "GLA.LG26, GLA.LG25",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-07T16:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-09-11T16:04:23.8332451+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA218[1] Intro to Databases, CA119[1] Intro to Databases",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Roantree M",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "1-12",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA119/CA218[1]P1/01",
"Identity": "c778aece-12b9-433a-afc7-ee184511de94"
}, {
"EventIdentity": "ff540b51-2930-df3c-06a9-9413672e4412",
"HostKey": "1920#SEM1SE0C4FA",
"Description": "LOGIC",
"EndDateTime": "2019-11-04T11:00:00+00:00",
"EventType": "Lecture",
"IsPublished": true,
"Location": "GLA.HG23",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-04T10:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-08-23T15:20:01.7110262+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA208[1] LOGIC",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Sinclair D",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "1-12",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA208[1]L1",
"Identity": "20145c9a-3bf1-4226-952d-49e7ad238275"
}, {
"EventIdentity": "b03e33fc-f67f-aaa4-b250-7bfbd778bf7f",
"HostKey": "1920#SPLUSF0B774",
"Description": "LOGIC",
"EndDateTime": "2019-11-07T11:00:00+00:00",
"EventType": "Lecture",
"IsPublished": true,
"Location": "GLA.CG12",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-07T10:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-08-23T15:22:49.4384725+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA208[1] LOGIC",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Sinclair D",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "1-12",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA208[1]L2",
"Identity": "dfd19a20-387b-4115-a4fe-700e394fe706"
}, {
"EventIdentity": "b44d3aac-8cc1-bb10-5e81-b3b3010ca4a6",
"HostKey": "1920#SPLUS01B8B3",
"Description": "LOGIC",
"EndDateTime": "2019-11-04T12:00:00+00:00",
"EventType": "Practical",
"IsPublished": true,
"Location": "GLA.L101, GLA.L125",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-04T11:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-08-23T15:25:45.7884621+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA208[1] LOGIC",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Sinclair D",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "1-12",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA208[1]P1",
"Identity": "74869f0a-a9cb-4720-bb25-9c6783973376"
}, {
"EventIdentity": "d468d694-ff6a-bdfc-e126-01a56bf0a3fd",
"HostKey": "1920#SPLUS641D03",
"Description": "Systems Analysis",
"EndDateTime": "2019-11-07T14:00:00+00:00",
"EventType": "Lecture",
"IsPublished": true,
"Location": "GLA.HG23",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-07T13:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-08-23T15:23:22.3163286+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA214/228[1] Systems Analysis",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Yilmaz M",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "1-12",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA214/228[1]L1",
"Identity": "f0485217-535b-45be-a330-3b4a0e12d752"
}, {
"EventIdentity": "fcdb3766-02f3-19d2-e1dd-da95c71731ac",
"HostKey": "1920#SPLUS641D05",
"Description": "Systems Analysis",
"EndDateTime": "2019-11-05T12:00:00+00:00",
"EventType": "Lecture",
"IsPublished": true,
"Location": "GLA.SA301",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-05T11:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-08-23T15:28:37.5448021+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA214/228[1] Systems Analysis",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Yilmaz M",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "1-12",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA214/228[1]L2",
"Identity": "43dcc1c6-fc34-4981-adab-1914a221c8a8"
}, {
"EventIdentity": "0ff73494-d6ae-119c-8bee-be270e4b3018",
"HostKey": "1920#SPLUSF9ECA1",
"Description": "Computer Programming 3 (Data Structure and Algorithms)",
"EndDateTime": "2019-11-04T13:00:00+00:00",
"EventType": "Lecture",
"IsPublished": true,
"Location": "GLA.HG23",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-04T12:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-08-23T15:34:09.3682517+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA268[1] Computer Programming 3 (Data Structure and Algorithms)",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Daly C",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "1-12",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA268(1)L1",
"Identity": "e3037683-43c6-476a-bff3-7663815801fe"
}, {
"EventIdentity": "c921d938-c7b8-491d-84a8-51b23e5b93c1",
"HostKey": "1920#SPLUSF9ECA3",
"Description": "Computer Programming 3 (Data Structure and Algorithms)",
"EndDateTime": "2019-11-07T10:00:00+00:00",
"EventType": "Lecture",
"IsPublished": true,
"Location": "GLA.CG12",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-07T09:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-08-23T15:36:17.555BB8179+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA268[1] Computer Programming 3 (Data Structure and Algorithms)",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Daly C",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "1-12",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA268(1)L2",
"Identity": "9758a0a1-fac6-448b-a96b-cf6c57caa13c"
}, {
"EventIdentity": "0e1c94c7-e4bd-f25c-4cf5-8c5624cf595f",
"HostKey": "1920#SPLUSF9ECA5",
"Description": "Computer Programming 3 (Data Structure and Algorithms)",
"EndDateTime": "2019-11-05T11:00:00+00:00",
"EventType": "Practical",
"IsPublished": true,
"Location": "GLA.L125, GLA.LG25",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-05T09:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-09-26T15:38:26.0247305+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA268[1] Computer Programming 3 (Data Structure and Algorithms)",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Daly C",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "1-12",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA268(1)P1",
"Identity": "ed7aa179-9314-4589-8b66-ee06433cb85c"
}, {
"EventIdentity": "0e3b360f-f1d7-5c6d-fbbd-51ae73237be7",
"HostKey": "1920#SPLUSC0E34B 001",
"Description": "Computer Architecture & Assembly Level Programming",
"EndDateTime": "2019-11-04T16:00:00+00:00",
"EventType": "Lecture",
"IsPublished": true,
"Location": "GLA.HG23",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-04T15:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-09-17T13:20:37.6861585+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA296(1) Computer Architecture & Assembly Level Programming",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Fitzpatrick D",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "1-12",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA296[1]L1",
"Identity": "23ec4305-d9a3-4fa8-a49a-945326ce3918"
}, {
"EventIdentity": "0668b093-9d62-80c9-3128-9022a20cae2a",
"HostKey": "1920#SPLUSFC9EDD 001",
"Description": "Computer Architecture & Assembly Level Programming",
"EndDateTime": "2019-11-04T17:00:00+00:00",
"EventType": "Lecture",
"IsPublished": true,
"Location": "GLA.HG23",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-04T16:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-09-17T13:10:26.7122119+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA296(1) Computer Architecture & Assembly Level Programming",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Fitzpatrick D",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "1-12",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA296[1]L2",
"Identity": "3d23504d-235a-4d1f-811f-02db95f6a162"
}, {
"EventIdentity": "a7c58b79-69ec-f4d3-0a58-652e282686bb",
"HostKey": "1920#SPLUSAC20C8",
"Description": "Computer Architecture & Assembly Level Programming",
"EndDateTime": "2019-11-06T11:00:00+00:00",
"EventType": "Lecture",
"IsPublished": true,
"Location": "GLA.XG14",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-06T10:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-10-31T15:52:34.2723602+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA296(1) Computer Architecture & Assembly Level Programming",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Fitzpatrick D",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "7",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA296[1]L3z",
"Identity": "a517ca50-8ae0-41c6-bdea-f48063f0ef73"
}, {
"EventIdentity": "b627d7f4-98da-164f-c3e8-496f97c48f7e",
"HostKey": "1920#SPLUS57685A 002",
"Description": "Computer Architecture & Assembly Level Programming",
"EndDateTime": "2019-11-08T13:00:00+00:00",
"EventType": "Practical",
"IsPublished": true,
"Location": "GLA.L101, GLA.L128, GLA.LG27",
"Owner": "b8cf1f5a-9687-4440-86b8-13da2c69fa62",
"StartDateTime": "2019-11-08T11:00:00+00:00",
"IsDeleted": false,
"LastModified": "2019-10-31T14:52:33.8916952+00:00",
"ExtraProperties": [{
"Name": "Module Name",
"DisplayName": "Module Name",
"Value": "CA296(1) Computer Architecture & Assembly Level Programming",
"Rank": 1
}, {
"Name": "Staff Member",
"DisplayName": "Staff Member",
"Value": "Fitzpatrick D",
"Rank": 2
}, {
"Name": "Activity.TeachingWeekPattern_PatternAsArray",
"DisplayName": "Weeks",
"Value": "1-12",
"Rank": 3
}],
"UserManuallyAddedEvent": false,
"StatusIdentity": "b48c85d4-19aa-4b19-87a6-63a5c6d2e630",
"Status": null,
"StatusBackgroundColor": null,
"Name": "CA296[1]P1",
"Identity": "0be58a9c-0ae4-43c5-b898-5523e34882a7"
}],
"Name": "CASE2",
"Identity": "38b55ac0-a242-23d3-4a10-79f11bdd780c"
}]

+ 16
- 0
src/python/case2parsed.json Parādīt failu

@@ -0,0 +1,16 @@
1
1
3
0
3
0
3
1
0
3
1
0
0
2
4
{"8": ["Free", "Free", "Free", "Free", "Free"], "9": ["Free", "GLA.L125, GLA.LG25\nComputer Programming 3 (Data Structure and Algorithms)\nDaly C", "Free", "GLA.CG12\nComputer Programming 3 (Data Structure and Algorithms)\nDaly C", "Free"], "10": ["GLA.HG23\nLOGIC\nSinclair D", "Free", "GLA.XG14\nComputer Architecture & Assembly Level Programming\nFitzpatrick D", "GLA.CG12\nLOGIC\nSinclair D", "Free"], "11": ["GLA.L101, GLA.L125\nLOGIC\nSinclair D", "GLA.SA301\nSystems Analysis\nYilmaz M", "Free", "Free", "GLA.L101, GLA.L128, GLA.LG27\nComputer Architecture & Assembly Level Programming\nFitzpatrick D"], "12": ["GLA.HG23\nComputer Programming 3 (Data Structure and Algorithms)\nDaly C", "Free", "Free", "Free", "Free"], "13": ["Free", "GLA.CG12\nIntro to Databases\nRoantree M", "Free", "GLA.HG23\nSystems Analysis\nYilmaz M", "Free"], "14": ["Free", "Free", "Free", "Free", "Free"], "15": ["GLA.HG23\nComputer Architecture & Assembly Level Programming\nFitzpatrick D", "Free", "Free", "Free", "Free"], "16": ["GLA.HG23\nComputer Architecture & Assembly Level Programming\nFitzpatrick D", "GLA.CG12\nCA218[1] Intro to Databases, CA119[1] Intro to Databases\nRoantree M", "Free", "GLA.LG26, GLA.LG25\nIntro to databases\nRoantree M", "Free"], "17": ["Free", "Free", "Free", "Free", "Free"], "18": ["Free", "Free", "Free", "Free", "Free"]}

+ 47
- 0
src/python/parse.py Parādīt failu

@@ -0,0 +1,47 @@
import json
import sys


def main(fname):
with open(fname, 'r') as f:
d = json.loads(f.read())
d = d[0]

start = {
8: [None,None,None,None,None,],
9: [None,None,None,None,None,],
10: [None,None,None,None,None,],
11: [None,None,None,None,None,],
12: [None,None,None,None,None,],
13: [None,None,None,None,None,],
14: [None,None,None,None,None,],
15: [None,None,None,None,None,],
16: [None,None,None,None,None,],
17: [None,None,None,None,None,],
18: [None,None,None,None,None,],
}

for v in d['CategoryEvents']:
key = int(v['StartDateTime'].split("T")[1][:2])
day = int(v['StartDateTime'].split("T")[0][-2:]) - 4
print(day)
location = v['Location']
module = v['Description']
if not(module):
module = v['ExtraProperties'][0]['Value']
lecturer = v['ExtraProperties'][1]['Value']
s = location + "\n" + module + "\n" + lecturer
start[key][day] = s
for k in range(8,19):
for i in range(5):
if start[k][i] == None:
start[k][i] = "Free"
print(json.dumps(start))



if __name__ == "__main__":
main(sys.argv[1])

+ 0
- 1
timetable/dcu-opentimetable

@@ -1 +0,0 @@
Subproject commit 2e1b8a8966e7573118587e6d04a3a3dbfe98eae4

Notiek ielāde…
Atcelt
Saglabāt