1. Nick Freear
  2. trackoer-core

Commits

Nick Freear  committed 8920cb3

Adding test/ offline XML-RDF data - Controller plus assets

  • Participants
  • Parent commits ef73e3e
  • Branches master

Comments (0)

Files changed (3)

File application/assets/test_data/Learning_to_Learn_1.0.xml

View file
  • Ignore whitespace
+<rdf:RDF xmlns="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+    <Work rdf:about="">
+          <dc:title>Learning to Learn</dc:title>
+          <dc:subject>B2S</dc:subject>
+          <dc:description>Welcome to Learning to Learn! By accessing this course you have just taken a major         step toward helping you develop your study skills. Congratulations! Your first task is to         read the course overview and complete the self-reflection questionnaire. This will help you         to think about how Learning to Learn can help you achieve your goals and   aims.</dc:description>
+          <dc:publisher>The Open University</dc:publisher>
+          <dc:contributor>Andrew Studnicky</dc:contributor>
+          <dc:type>Course</dc:type>
+          <dc:format>text/html</dc:format>
+          <dc:identifier>Learning_to_Learn_1.0</dc:identifier>
+          <dc:source>Exploring Learning - Learning_to_Learn</dc:source>
+          <dc:rights>Except for third party materials and otherwise stated (see http://www.open.ac.uk/conditions terms and conditions), this content is made available under a http://creativecommons.org/licenses/by-nc-sa/2.0/uk/ Creative Commons Attribution-NonCommercial-ShareAlike 2.0 Licence</dc:rights>
+    </Work>
+</rdf:RDF>
+<!--
+ http://labspace.open.ac.uk/Learning_to_Learn_1.0?format=rdf
+ http://labspace.open.ac.uk/course/view.php?id=7442&amp;format=rdf
+-->

File application/assets/test_data/Succeed_with_Math_1.0.xml

View file
  • Ignore whitespace
+<rdf:RDF xmlns="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+    <Work rdf:about="">
+          <dc:title>Succeed with Math</dc:title>
+          <dc:subject>B2S</dc:subject>
+          <dc:subject>aacc</dc:subject>
+          <dc:subject>anne</dc:subject>
+          <dc:subject>arundel</dc:subject>
+          <dc:subject>bridge</dc:subject>
+          <dc:subject>college</dc:subject>
+          <dc:subject>community</dc:subject>
+          <dc:subject>math</dc:subject>
+          <dc:subject>succeed</dc:subject>
+          <dc:subject>success</dc:subject>
+          <dc:description>Succeed with Math will help you review key math concepts, and then apply these         concepts to real world applications. Units available include: Math and You, Getting Down to         the Basics, Numbers Everywhere, Parts of the Whole, Relationships Among Numbers, Exploring         Patterns and Formulas, Investigating Geometric Shapes and Sizes, and Communicating with         Data, Charts and Graphs.</dc:description>
+          <dc:publisher>The Open University</dc:publisher>
+          <dc:type>Course</dc:type>
+          <dc:format>text/html</dc:format>
+          <dc:identifier>Succeed_with_Math_1.0</dc:identifier>
+          <dc:source/>
+          <dc:rights>Except for third party materials and otherwise stated (see http://www.open.ac.uk/conditions terms and conditions), this content is made available under a http://creativecommons.org/licenses/by-nc-sa/2.0/uk/ Creative Commons Attribution-NonCommercial-ShareAlike 2.0 Licence</dc:rights>
+    </Work>
+</rdf:RDF>
+<!--
+ http://labspace.open.ac.uk/Succeed_with_Math_1.0?format=rdf
+ http://labspace.open.ac.uk/course/view.php?id=7654&amp;format=rdf
+-->

File application/controllers/test_data.php

View file
  • Ignore whitespace
+<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
+/**
+ * Track OER
+ *
+ * A web application to facilitate analytics for Open Educational Resources.
+ *
+ * @package		trackoer-core
+ * @copyright	Copyright 2012 The Open University.
+ * @author		N.D.Freear, 28 August 2012 (10:05)
+ * @filesource
+ */
+
+
+/**
+ * Controller to output test/ offline data.
+ */
+class Test_data extends MY_Controller {
+
+  public function rdf($file) {
+    $path = dirname(__FILE__) .'/../assets/test_data/'. $file .'.xml';
+
+    $xml = @file_get_contents($path);
+    if (! $xml) {
+      $this->_error("File not found, test_data/$file.xml", 404);
+    }
+
+    @header('X-content-type: application/rdf+xml');
+    @header('Content-Type: text/xml; charset=utf-8');
+    @header('Content-Disposition: inline; filename='. $file .'-rdf.xml');
+
+    echo $xml;
+  }
+}
+