Creating Course progress view

major
Hi once again, I'm trying to create view, which would show the student how many lessons he has completed from specific course. I was able to find the Quiz Results: Lesson State-field which gives me the information that I'm looking for. (example picture http://i.imgur.com/PqJqFHC.png) After this I tried to use the aggregation to COUNT value of that field for the progress, but I received error message: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'og_membership.target_id' in 'field list' SQLSTATE[42S22]: Column not found: 1054 Unknown column 'quiz_node_results.quiz_state' in 'field list' Is there something wrong with the files or am I missing something obvious (probably this one)? Any tips you can give? Thanks!
Profile picture for user James Aparicio
James Aparicio

Hi major,

Hi major, To do what you are looking for i guess it is best for you to clone the view "Opigno Quiz Teacher Views" and alter it. Remove the access permission, group by lesson and add a contextual filter for the user = logged in user. Best regards
major

Hey,

Hey, thanks for the tips. I was finally able to create a progress graph by cloning and modifying the "Opigno Quiz Students Views". Users can now see their progress on the course. Progress is related to the "Lesson state"-field. Here is the new view: http://i.imgur.com/c6uTCpC.png and views settings here: http://i.imgur.com/lB9cltQ.png Now I just need to find out how to make it work as a block, inside another view, for example under "My Courses". If you have any ideas for that, let me know! :)
Profile picture for user James Aparicio
James Aparicio

Hi major,

Hi major, Inside the view you just cloned and edited, if you click on Display -> add and select block, it will create a block that will inheriting the view page details. Best regards
major

Hi,

Hi, I think the current relationships mess this up, the view is only related to certain course so i won't show correct information related to the course. My question might have also been a bit misleading. I'm trying to find a way to show this kind of progress graph as field inside "My courses"-view, not as a block. Maybe this picture clarifies my thoughts: http://i.imgur.com/I67paM5.png . Do you think there is a way to do this with Views or should I start to develop some kind of custom module for that?
Profile picture for user James Aparicio
James Aparicio

Hi major,

Hi major, It is certainly possible with views, if there is an option inside views that you dont have access to, maybe you could create a small module and implement hook_views_query_alter instead of creating your own handlers. It is probably more time efficient if you will not be reusing the handlers. Study the database structure and alter the query to your liking if you find impossible to do what you want using the views ui. By the way activating the sql debug on views really helps. You can activate it inside the views settings. "Show the SQL query" https://api.drupal.org/api/views/views.api.php/function/hook_views_query_alter/7 Best regards
yovwi

Hi James

hello James ,i am trying to create a table containing course,and course progress for individuals .But lesson result provides only 3 state.I want to be able to display the course progress in chart just the way its display on general statistics page.Any hint will be helpfull