Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make view mode available on mobile #134

Open
dasistwas opened this issue Jun 26, 2020 · 12 comments
Open

Make view mode available on mobile #134

dasistwas opened this issue Jun 26, 2020 · 12 comments
Assignees

Comments

@dasistwas
Copy link
Member

Implement the external API (Webservice) so that views can be shown on Moodle Mobile. Next step is to add support for editing entries on Moodle mobile.

@dasistwas
Copy link
Member Author

Should be done next.

michaelpollak added a commit to michaelpollak/moodle-mod_datalynx that referenced this issue Jul 7, 2020
@michaelpollak
Copy link
Collaborator

michaelpollak commented Jul 13, 2020

I have been working on a native implementation and ionic is rather complex esp. if the goal is to support all possible fieldtypes.
Depending on the goal I noticed h5p has a different approach. Instead of native support they use an embed.php within an iframe to display content. This seems pretty smart as it removes most of the rewriting of display code. Security is handled by a token.

To get this to work I need to extend the already existing embed.php and display as well as editing entries should be working.
Let me know what you think :)

Link to h5p implementation: https://github.com/h5p/h5p-moodle-plugin/blob/stable/templates/mobile_view_page.mustache
Ionic apo documentation: https://ionicframework.com/docs/api

@dasistwas
Copy link
Member Author

Not sure, if that is necessary. I just looked at the how the content is displayed on mobile: IMHO, the approach in michaelpollak@b42dcba creates several problems:

  1. You create a function different from the original function for getting entries.
  2. You should not duplicate functionality just for mobile

Instead there is already a function for displaying content inline:

public static function get_content_inline($datalynxid, $viewid = 0, $eids = null) {

@michaelpollak
Copy link
Collaborator

Thank you for your feedback David.
The new function is just temporary to understand how we can interact with mobile. We use ionic templates for the app and it wants a very specific form if we use it natively. I tried to just push html code into the app (e.g. with get_content_inline()) but that does not work reliably imho. Instead ionic wants a very well formated array and information about how to display the content. The template can only determine empty or not empty arrays but is not able to use any logic. Which means the formats we usually work with are not compatible.

I tried to learn from data and other complex plugins but most just don't work. h5p is explicitly commended for its compatibility despite just using an iframe, that's why i brought it up.

Ultimately I don't think we can use our current forms and need to either establish a simple translation that the app can handle or use our forms within an iframe and ignore the problem with offline users.

@dasistwas
Copy link
Member Author

OK, using forms is the next step. For that we need to have a web service or several web services in order to work with forms....

@dasistwas
Copy link
Member Author

How does the data activity do that? That would an activity very similar to datalynx.

@michaelpollak
Copy link
Collaborator

Good morning,
I've worked through the data plugin last week but it is not comparable as it uses core code that we can't utilise and is not documented. A better representation that actually follows documentation is Churchwards questionaire plugin (https://github.com/PoetOS/moodle-mod_questionnaire), it has different templates for different types. Basing my implementation on that code for now.

Today is pretty much reserved for datalynx, so if you have any feedback or ideas I'll be happy to hear them :) Have a nice day David.

michaelpollak added a commit to michaelpollak/moodle-mod_datalynx that referenced this issue Jul 27, 2020
michaelpollak added a commit to michaelpollak/moodle-mod_datalynx that referenced this issue Aug 4, 2020
michaelpollak added a commit to michaelpollak/moodle-mod_datalynx that referenced this issue Aug 7, 2020
@dasistwas
Copy link
Member Author

Any updates on this?

@michaelpollak
Copy link
Collaborator

We can display but not functionally edit entries in the mobile view.

@michaelpollak
Copy link
Collaborator

Well I have been working on this yesterday and today and am still not able to make edit work.
I can call a specific function (delete) and pass arguments, but I don't know - without big re-writes of sections of our renderer code - how to make add or edit work for all field classes.
Maybe I have looked at this for too long by now, will build something else now, if you have some ideas or input I'd love to hear them. Thanks David, have a great day.

@michaelpollak
Copy link
Collaborator

Okay so as I need your input on edit mode and further development I will keep this open but push it in the review pipeline.
Datalynx is available on the app and entries can be viewed, looking forward to your feedback David. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants